@reqvire-org/ads 0.4.7 → 0.5.1
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/README.md +268 -420
- package/dist/accessibility-declarations.mjs +43 -0
- package/dist/active-clock.d.mts +30 -0
- package/dist/active-clock.mjs +26 -17
- package/dist/ads-errors.mjs +3684 -0
- package/dist/ads-view-choices.mjs +17 -0
- package/dist/ads-views.mjs +12 -0
- package/dist/analysis/captured-content.mjs +16 -0
- package/dist/analysis/compiler-options.mjs +3 -7
- package/dist/analysis/context.mjs +14 -20
- package/dist/analysis/controller-gates.mjs +119 -0
- package/dist/analysis/design-usage.mjs +142 -0
- package/dist/analysis/file-tree.mjs +44 -29
- package/dist/analysis/framework-imports.mjs +62 -0
- package/dist/analysis/glyph-macros.mjs +103 -0
- package/dist/analysis/helpers.mjs +119 -91
- package/dist/analysis/impact.mjs +25 -12
- package/dist/analysis/inputs.mjs +19 -13
- package/dist/analysis/mock-check.mjs +99 -0
- package/dist/analysis/module-graph.mjs +156 -0
- package/dist/analysis/module-resolvers.mjs +30 -28
- package/dist/analysis/native-adapter.mjs +139 -146
- package/dist/analysis/native-boundary.mjs +52 -0
- package/dist/analysis/native-project.mjs +331 -231
- package/dist/analysis/native-session.mjs +20 -0
- package/dist/analysis/owner-accessibility.mjs +74 -0
- package/dist/analysis/owner-analysis-cache.mjs +125 -0
- package/dist/analysis/owner-analysis-key.mjs +114 -0
- package/dist/analysis/owner-choices.mjs +896 -0
- package/dist/analysis/owner-composition.mjs +636 -0
- package/dist/analysis/owner-controls.mjs +27 -0
- package/dist/analysis/owner-discovery.mjs +164 -0
- package/dist/analysis/owner-failures.mjs +19 -0
- package/dist/analysis/owner-outcomes.mjs +42 -0
- package/dist/analysis/owner-reuse.mjs +100 -0
- package/dist/analysis/owner-source.mjs +1555 -0
- package/dist/analysis/prose-owners.mjs +57 -0
- package/dist/analysis/public-imports.mjs +31 -0
- package/dist/analysis/queries.mjs +72 -54
- package/dist/analysis/runtime-setters.mjs +114 -0
- package/dist/analysis/scenario-keys.mjs +151 -0
- package/dist/analysis/service.mjs +111 -70
- package/dist/analysis/standalone.mjs +40 -37
- package/dist/analysis/styling-ownership.mjs +298 -0
- package/dist/analysis/svg-attributes.mjs +199 -0
- package/dist/analysis/syntax.mjs +82 -78
- package/dist/analysis/visual-bindings.mjs +68 -0
- package/dist/analysis/worker-protocol.mjs +302 -0
- package/dist/analysis/worker.mjs +234 -166
- package/dist/api-signature.mjs +53 -0
- package/dist/app-icon-checks.mjs +298 -0
- package/dist/app-icon-declaration.d.mts +53 -0
- package/dist/app-icon-declaration.mjs +66 -0
- package/dist/asset-binding.mjs +35 -0
- package/dist/asset-catalog.mjs +83 -0
- package/dist/asset-declaration.d.mts +42 -0
- package/dist/asset-declaration.mjs +108 -0
- package/dist/asset-macro.d.mts +63 -0
- package/dist/asset-macro.mjs +22 -0
- package/dist/asset-model.mjs +74 -0
- package/dist/asset-usage.mjs +14 -0
- package/dist/asset-view-facts.mjs +41 -0
- package/dist/authoring-macro.d.mts +11 -0
- package/dist/authoring-macro.mjs +21 -0
- package/dist/autocomplete-hints.mjs +31 -0
- package/dist/availability.mjs +9 -0
- package/dist/behavior-macro.d.mts +31 -0
- package/dist/behavior-macro.mjs +3 -0
- package/dist/behavior-registry.mjs +358 -0
- package/dist/boundaries.mjs +50 -212
- package/dist/browser-runtime.mjs +73 -0
- package/dist/browser-test.d.mts +3 -0
- package/dist/browser-test.mjs +2 -0
- package/dist/bun-bundler.mjs +10 -0
- package/dist/bun-compiler.mjs +30 -18
- package/dist/bun-runtime.mjs +4 -0
- package/dist/bun-worker.mjs +10 -4
- package/dist/capture/request.mjs +81 -0
- package/dist/capture/worker.mjs +69 -40
- package/dist/capture/worker.page.mjs +6 -0
- package/dist/capture-store.mjs +159 -75
- package/dist/capture.mjs +232 -95
- package/dist/check-service.mjs +27 -33
- package/dist/check.mjs +206 -904
- package/dist/cli-arguments.mjs +278 -0
- package/dist/cli.mjs +374 -304
- package/dist/color-values.mjs +294 -242
- package/dist/composed-contrast.mjs +648 -0
- package/dist/composed-keyline.mjs +107 -0
- package/dist/config.mjs +162 -468
- package/dist/construction-output.mjs +345 -0
- package/dist/construction-spec.d.mts +915 -0
- package/dist/construction-spec.mjs +1178 -0
- package/dist/corner-overpaint.mjs +53 -0
- package/dist/css-length.mjs +80 -0
- package/dist/css-quantity.mjs +173 -0
- package/dist/deletion-model.mjs +56 -0
- package/dist/deletion-plan.mjs +364 -0
- package/dist/dependency-manifest.mjs +56 -0
- package/dist/design-context-model.d.mts +61 -0
- package/dist/design-context-model.mjs +79 -0
- package/dist/design-contexts.mjs +105 -0
- package/dist/design-foundation.mjs +532 -0
- package/dist/design-inputs.mjs +156 -0
- package/dist/design-modules.mjs +27 -0
- package/dist/design-rejection.d.mts +23 -0
- package/dist/design-rejection.mjs +29 -0
- package/dist/design-system-closure.mjs +108 -0
- package/dist/design-usage.mjs +54 -0
- package/dist/development-modules.mjs +2 -0
- package/dist/development-runtime.mjs +0 -7
- package/dist/digest.mjs +2 -0
- package/dist/draft-boundary.mjs +1 -27
- package/dist/draft-workspace.mjs +11 -5
- package/dist/emit/accept.mjs +33 -0
- package/dist/emit/app-icon-emission.mjs +124 -0
- package/dist/emit/app-icon-render.mjs +126 -0
- package/dist/emit/asset-imports.mjs +18 -0
- package/dist/emit/cli-report.mjs +97 -0
- package/dist/emit/contract.mjs +136 -0
- package/dist/emit/emission.mjs +182 -0
- package/dist/emit/font-emission.mjs +111 -0
- package/dist/emit/foundation-sheet.mjs +56 -0
- package/dist/emit/icon-containers.mjs +46 -0
- package/dist/emit/integrity.mjs +61 -0
- package/dist/emit/lock.mjs +66 -0
- package/dist/emit/namespace.mjs +79 -0
- package/dist/emit/operation-reply.mjs +3 -0
- package/dist/emit/operation.mjs +36 -0
- package/dist/emit/output-location.mjs +20 -0
- package/dist/emit/output-package.mjs +7 -0
- package/dist/emit/owner-emission-cache.mjs +52 -0
- package/dist/emit/palette-module.mjs +19 -0
- package/dist/emit/palette-refresh.mjs +77 -0
- package/dist/emit/preview-emitter.mjs +110 -0
- package/dist/emit/preview-tree.mjs +174 -0
- package/dist/emit/scheduler.mjs +75 -0
- package/dist/emit/service.mjs +249 -0
- package/dist/emit/sync.mjs +38 -0
- package/dist/emit/watch.mjs +74 -0
- package/dist/emit/writer.mjs +102 -0
- package/dist/evidence.mjs +6 -8
- package/dist/example-babel.mjs +7 -0
- package/dist/example-literals.mjs +88 -0
- package/dist/finding-rules.mjs +78 -77
- package/dist/focus-checks.mjs +93 -0
- package/dist/font-checks.mjs +185 -0
- package/dist/font-declaration.d.mts +64 -0
- package/dist/font-declaration.mjs +99 -0
- package/dist/font-fallback.d.mts +37 -0
- package/dist/font-fallback.mjs +25 -0
- package/dist/font-macro.d.mts +42 -0
- package/dist/font-macro.mjs +6 -0
- package/dist/font-metrics.d.mts +34 -0
- package/dist/font-metrics.mjs +314 -0
- package/dist/font-model.mjs +63 -0
- package/dist/form-states.mjs +82 -0
- package/dist/foundation-macro.d.mts +108 -0
- package/dist/foundation-macro.mjs +6 -0
- package/dist/frame-regions.mjs +253 -0
- package/dist/glyph-set-declaration.d.mts +27 -0
- package/dist/glyph-set-declaration.mjs +36 -0
- package/dist/grid-checks.mjs +94 -0
- package/dist/grid-facts.mjs +148 -0
- package/dist/grid-lowering.mjs +263 -0
- package/dist/guard/cli.mjs +51 -0
- package/dist/guard/config.mjs +67 -0
- package/dist/guard/files.mjs +31 -0
- package/dist/guard/index.mjs +3 -0
- package/dist/guard/run.mjs +56 -0
- package/dist/guard/tsconfig.declarations.json +13 -0
- package/dist/index.mjs +2 -7
- package/dist/init-project.mjs +134 -0
- package/dist/init.mjs +217 -264
- package/dist/input-digests.mjs +109 -163
- package/dist/input-scope.mjs +18 -41
- package/dist/inspected-svg.d.mts +28 -0
- package/dist/inspected-svg.mjs +40 -0
- package/dist/inventories.mjs +149 -0
- package/dist/inventory-query.mjs +15 -0
- package/dist/investigations.mjs +177 -99
- package/dist/json.d.mts +10 -0
- package/dist/json.mjs +36 -0
- package/dist/linaria/atomic-processor.json +96 -0
- package/dist/linaria/atomic-processor.mjs +2452 -0
- package/dist/linaria/backend-identity.mjs +26 -0
- package/dist/linaria/compatibility.json +61 -0
- package/dist/linaria/css-shape.mjs +94 -0
- package/dist/linaria/custom-property-css.mjs +56 -0
- package/dist/linaria/delivery.mjs +111 -0
- package/dist/linaria/direct-extract.mjs +43 -0
- package/dist/linaria/extraction-cache.mjs +31 -0
- package/dist/linaria/extraction-model.mjs +5 -0
- package/dist/linaria/fingerprint.mjs +183 -0
- package/dist/linaria/pair-manifest.json +2315 -0
- package/dist/linaria/persisted-extraction-cache.mjs +352 -0
- package/dist/linaria/preservation.mjs +13 -0
- package/dist/linaria/priority-emitted-rank.mjs +40 -0
- package/dist/linaria/priority-manifest.mjs +87 -0
- package/dist/linaria/priority-table.mjs +47 -0
- package/dist/linaria/priority-tiers.mjs +27 -0
- package/dist/linaria/processor-host.mjs +42 -0
- package/dist/linaria/processor-runtime.mjs +36 -0
- package/dist/linaria-processor-NOTICES.md +147 -0
- package/dist/lowering-components.mjs +14 -0
- package/dist/lowering-effects.mjs +38 -0
- package/dist/lowering-emitter.mjs +29 -0
- package/dist/lowering-enter.mjs +31 -0
- package/dist/lowering-hidden.mjs +30 -0
- package/dist/lowering-layer.mjs +141 -0
- package/dist/lowering-motion.mjs +37 -0
- package/dist/lowering-normalize.mjs +194 -0
- package/dist/lowering-overlaps.mjs +328 -0
- package/dist/lowering-paint.mjs +32 -0
- package/dist/lowering-properties.mjs +165 -0
- package/dist/lowering-region-layout.mjs +225 -0
- package/dist/lowering-sequence.mjs +89 -0
- package/dist/lowering-serialize.mjs +40 -0
- package/dist/lowering-session.mjs +137 -0
- package/dist/lowering-tiers.mjs +23 -0
- package/dist/lowering-transitions.mjs +53 -0
- package/dist/mcp/ads-mcp.mjs +423 -0
- package/dist/mcp/apps.mjs +3 -25
- package/dist/mcp/behavior-pages.mjs +58 -51
- package/dist/mcp/build-status.mjs +233 -267
- package/dist/mcp/catalog.mjs +21 -128
- package/dist/mcp/compiler-channel.mjs +218 -83
- package/dist/mcp/context.mjs +50 -40
- package/dist/mcp/deletions.mjs +147 -0
- package/dist/mcp/draft-discovery.mjs +43 -38
- package/dist/mcp/drafts.mjs +635 -691
- package/dist/mcp/execution-context.mjs +33 -22
- package/dist/mcp/execution-coordinator.mjs +367 -354
- package/dist/mcp/execution-results.mjs +440 -173
- package/dist/mcp/mutation-limits.mjs +1 -2
- package/dist/mcp/mutations.mjs +515 -553
- package/dist/mcp/patch.mjs +117 -75
- package/dist/mcp/preview-http.bundle.js +3 -7
- package/dist/mcp/preview-http.mjs +220 -107
- package/dist/mcp/preview-owner-guard.mjs +81 -43
- package/dist/mcp/preview-watch.mjs +428 -365
- package/dist/mcp/preview-widget.bundle.js +42 -46
- package/dist/mcp/preview-work.mjs +25 -13
- package/dist/mcp/prompts.mjs +22 -16
- package/dist/mcp/resource-loader.js +1 -1
- package/dist/mcp/result-pages.mjs +94 -54
- package/dist/mcp/sandbox-host.mjs +41 -19
- package/dist/mcp/server-discovery.mjs +96 -0
- package/dist/mcp/server-guides.mjs +43 -0
- package/dist/mcp/server-host.mjs +203 -0
- package/dist/mcp/server-observation.mjs +225 -0
- package/dist/mcp/server-project.mjs +371 -0
- package/dist/mcp/server-resources.mjs +466 -0
- package/dist/mcp/server-shared.mjs +79 -0
- package/dist/mcp/server-tools.mjs +791 -0
- package/dist/mcp/server.mjs +2 -2813
- package/dist/mcp/showcase-host.mjs +209 -135
- package/dist/mcp/showcase-http.mjs +50 -28
- package/dist/mcp/skills.mjs +32 -36
- package/dist/mcp/text-diff.mjs +18 -36
- package/dist/measured-geometry.mjs +157 -0
- package/dist/motion-model.mjs +52 -0
- package/dist/non-text-contrast.mjs +118 -0
- package/dist/owner-analysis-check.mjs +711 -0
- package/dist/owner-design.mjs +15 -0
- package/dist/owner-errors.mjs +216 -0
- package/dist/owner-lowering.mjs +206 -0
- package/dist/owner-scenarios.mjs +854 -0
- package/dist/ownership-model.d.mts +6 -0
- package/dist/ownership-model.mjs +143 -0
- package/dist/package-declarations.mjs +34 -0
- package/dist/paint-contrast.mjs +186 -0
- package/dist/palette-generated.mjs +101 -116
- package/dist/pictogram-model.mjs +13 -51
- package/dist/placeholder-contrast.mjs +35 -0
- package/dist/platform-features.mjs +401 -0
- package/dist/press-scale.mjs +26 -0
- package/dist/preview-bun.mjs +334 -404
- package/dist/preview-compile-inputs.mjs +78 -0
- package/dist/preview-contexts.mjs +7 -0
- package/dist/preview-controls.mjs +35 -0
- package/dist/preview-failure.mjs +20 -10
- package/dist/preview-files.mjs +18 -36
- package/dist/preview-imports.mjs +76 -70
- package/dist/preview-incremental.mjs +322 -222
- package/dist/preview-inputs.mjs +26 -26
- package/dist/preview-manifest-update.mjs +67 -49
- package/dist/preview-requests.mjs +10 -17
- package/dist/preview-resources.mjs +275 -323
- package/dist/preview-scope.mjs +15 -17
- package/dist/preview-source.mjs +182 -0
- package/dist/preview-spatial.mjs +27 -0
- package/dist/profile-macro.d.mts +56 -0
- package/dist/profile-macro.mjs +6 -0
- package/dist/profile-model.d.mts +65 -0
- package/dist/profile-model.mjs +213 -0
- package/dist/profile-view-facts.mjs +93 -0
- package/dist/program-cache.mjs +9 -7
- package/dist/project-boundary.mjs +8 -13
- package/dist/project-documents.mjs +25 -29
- package/dist/property-registrations.mjs +44 -35
- package/dist/prose-model.d.mts +81 -0
- package/dist/prose-model.mjs +101 -0
- package/dist/public-catalog.mjs +76 -0
- package/dist/recipe-defaults.mjs +117 -0
- package/dist/recipe-macro.d.mts +502 -0
- package/dist/recipe-macro.mjs +23 -0
- package/dist/recipe-model.d.mts +26 -0
- package/dist/recipe-model.mjs +214 -0
- package/dist/region-lowering.mjs +723 -0
- package/dist/registration-css.mjs +41 -0
- package/dist/registration-roles.mjs +35 -0
- package/dist/render-audit/axe-run.page.mjs +28 -0
- package/dist/render-audit/corner-overpaint.page.mjs +54 -0
- package/dist/render-audit/first-render.page.mjs +35 -0
- package/dist/render-audit/image-shape.page.mjs +42 -0
- package/dist/render-audit/layout-overflow.page.mjs +240 -0
- package/dist/render-audit/layout-shift.page.mjs +36 -0
- package/dist/render-audit/non-text-contrast.page.mjs +138 -0
- package/dist/render-audit/render-states.mjs +66 -293
- package/dist/render-audit/render-states.page.mjs +177 -0
- package/dist/render-audit/text-scale.mjs +42 -0
- package/dist/render-audit/text-scale.page.mjs +25 -0
- package/dist/render-audit/worker.mjs +130 -112
- package/dist/render-audit/worker.page.mjs +21 -0
- package/dist/render-audit.mjs +490 -500
- package/dist/resource-limits.mjs +174 -223
- package/dist/result.d.mts +34 -0
- package/dist/result.mjs +60 -0
- package/dist/role-vocabulary.d.mts +260 -0
- package/dist/role-vocabulary.mjs +258 -0
- package/dist/runtime-paint-contrast.mjs +97 -0
- package/dist/runtime-paint.mjs +42 -0
- package/dist/runtime-requirements.mjs +10 -11
- package/dist/runtime-style.mjs +21 -0
- package/dist/scenario-groups.mjs +42 -33
- package/dist/scenario-inspector.mjs +4 -4
- package/dist/scenario-kit.d.mts +85 -0
- package/dist/scenario-kit.mjs +18 -0
- package/dist/scenario-registry-model.mjs +2 -0
- package/dist/scenario-registry.mjs +89 -108
- package/dist/scenarios-compiler.mjs +875 -662
- package/dist/scheme-switch.d.mts +8 -0
- package/dist/scheme-switch.mjs +1 -0
- package/dist/showcase/ads-views.mjs +166 -0
- package/dist/showcase/assets-view.mjs +252 -0
- package/dist/showcase/client.bundle.js +211 -48
- package/dist/showcase/guide-controls.d.mts +28 -0
- package/dist/showcase/guide-controls.mjs +31 -0
- package/dist/showcase/http-client.bundle.js +172 -9
- package/dist/showcase/index.html +1 -1
- package/dist/showcase/preview-frame.css +18 -0
- package/dist/showcase/preview-frame.d.mts +5 -0
- package/dist/showcase/preview-frame.mjs +4 -0
- package/dist/showcase/preview-root.d.mts +2 -0
- package/dist/showcase/preview-root.mjs +9 -0
- package/dist/showcase/profiles-view.mjs +321 -0
- package/dist/showcase/project-rules.mjs +9 -0
- package/dist/showcase/sandbox.bundle.js +1 -1
- package/dist/showcase/scenario-page.d.mts +49 -0
- package/dist/showcase/scenario-page.mjs +105 -0
- package/dist/showcase/style.css +2 -0
- package/dist/showcase/token-sample.mjs +89 -0
- package/dist/showcase/tokens-view.mjs +233 -0
- package/dist/showcase/ui/apple-touch-icon-9zwv3w79.png +0 -0
- package/dist/showcase/{favicon.ico → ui/favicon-c2c9kvtf.ico} +0 -0
- package/dist/showcase/ui/icon-192-t5zh7mxx.png +0 -0
- package/dist/showcase/ui/icon-512-ed6yz0n0.png +0 -0
- package/dist/showcase/ui/ui.css +1 -1353
- package/dist/showcase/ui/ui.js +165 -1064
- package/dist/showcase-http-routes.mjs +28 -21
- package/dist/skills/README.md +28 -28
- package/dist/skills/ads-designer/README.md +1 -1
- package/dist/skills/ads-designer/SKILL.md +313 -551
- package/dist/skills/ads-designer/references/accessibility.md +162 -114
- package/dist/skills/ads-designer/references/atomic-styles.md +72 -277
- package/dist/skills/ads-designer/references/behaviors.md +144 -280
- package/dist/skills/ads-designer/references/branding.md +137 -222
- package/dist/skills/ads-designer/references/captures.md +13 -7
- package/dist/skills/ads-designer/references/cli.md +80 -63
- package/dist/skills/ads-designer/references/contracts.md +225 -286
- package/dist/skills/ads-designer/references/design-craft.md +2 -2
- package/dist/skills/ads-designer/references/design-data.md +299 -323
- package/dist/skills/ads-designer/references/drafts.md +83 -22
- package/dist/skills/ads-designer/references/evidence.md +2 -1
- package/dist/skills/ads-designer/references/forms.md +199 -0
- package/dist/skills/ads-designer/references/guarded-editing.md +37 -48
- package/dist/skills/ads-designer/references/layers.md +64 -76
- package/dist/skills/ads-designer/references/layout.md +224 -330
- package/dist/skills/ads-designer/references/mobile.md +2 -2
- package/dist/skills/ads-designer/references/motion.md +66 -25
- package/dist/skills/ads-designer/references/performance.md +55 -50
- package/dist/skills/ads-designer/references/pictograms.md +62 -127
- package/dist/skills/ads-designer/references/recipes.md +368 -0
- package/dist/skills/ads-designer/references/review.md +51 -95
- package/dist/skills/ads-designer/references/runtimes.md +34 -33
- package/dist/skills/ads-designer/references/scenarios.md +256 -216
- package/dist/skills/ads-designer/references/stress-test.md +13 -5
- package/dist/skills/ads-designer/references/validation.md +28 -21
- package/dist/skills/ads-designer/references/workflows.md +7 -5
- package/dist/skills/ads-import/SKILL.md +29 -29
- package/dist/skills/ads-import/references/atomic-styles.md +72 -277
- package/dist/skills/ads-import/references/behaviors.md +144 -280
- package/dist/skills/ads-import/references/branding.md +24 -41
- package/dist/skills/ads-import/references/captures.md +13 -7
- package/dist/skills/ads-import/references/cli.md +80 -63
- package/dist/skills/ads-import/references/compatibility.md +3 -3
- package/dist/skills/ads-import/references/contracts.md +225 -286
- package/dist/skills/ads-import/references/design-data.md +299 -323
- package/dist/skills/ads-import/references/drafts.md +83 -22
- package/dist/skills/ads-import/references/evidence.md +2 -1
- package/dist/skills/ads-import/references/forms.md +199 -0
- package/dist/skills/ads-import/references/guarded-editing.md +37 -48
- package/dist/skills/ads-import/references/implementation.md +20 -20
- package/dist/skills/ads-import/references/layers.md +64 -76
- package/dist/skills/ads-import/references/layout.md +224 -330
- package/dist/skills/ads-import/references/recipes.md +368 -0
- package/dist/skills/ads-import/references/review.md +51 -95
- package/dist/skills/ads-import/references/runtimes.md +34 -33
- package/dist/skills/ads-import/references/scenarios.md +256 -216
- package/dist/skills/ads-import/references/tokens.md +26 -17
- package/dist/skills/ads-import/references/validation.md +28 -21
- package/dist/skills/ads-import/references/workflows.md +7 -5
- package/dist/skills/ads-migrate/SKILL.md +20 -5
- package/dist/skills/ads-migrate/references/0.4.1-to-0.4.2.md +6 -0
- package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0-boundary.md +71 -0
- package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0-grid.md +204 -0
- package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0.md +727 -0
- package/dist/skills/ads-migrate/references/0.5.0-to-0.5.1.md +239 -0
- package/dist/skills/ads-port/SKILL.md +27 -28
- package/dist/skills/ads-port/references/atomic-styles.md +72 -277
- package/dist/skills/ads-port/references/behaviors.md +144 -280
- package/dist/skills/ads-port/references/captures.md +13 -7
- package/dist/skills/ads-port/references/cli.md +80 -63
- package/dist/skills/ads-port/references/contracts.md +225 -286
- package/dist/skills/ads-port/references/design-data.md +299 -323
- package/dist/skills/ads-port/references/drafts.md +83 -22
- package/dist/skills/ads-port/references/evidence.md +2 -1
- package/dist/skills/ads-port/references/forms.md +199 -0
- package/dist/skills/ads-port/references/guarded-editing.md +37 -48
- package/dist/skills/ads-port/references/layers.md +64 -76
- package/dist/skills/ads-port/references/layout.md +224 -330
- package/dist/skills/ads-port/references/lint-and-docs.md +2 -3
- package/dist/skills/ads-port/references/native-implementation.md +23 -33
- package/dist/skills/ads-port/references/recipes.md +368 -0
- package/dist/skills/ads-port/references/review.md +51 -95
- package/dist/skills/ads-port/references/runtimes.md +34 -33
- package/dist/skills/ads-port/references/scenarios.md +256 -216
- package/dist/skills/ads-port/references/validation.md +28 -21
- package/dist/skills/ads-port/references/workflows.md +7 -5
- package/dist/source-inventory.mjs +33 -0
- package/dist/source-values.mjs +272 -262
- package/dist/spatial-css.mjs +403 -0
- package/dist/spatial-metadata.mjs +11 -11
- package/dist/spatial-model.mjs +438 -0
- package/dist/spatial-reading.mjs +127 -0
- package/dist/stage-timing.mjs +27 -0
- package/dist/state-conditions.d.mts +80 -0
- package/dist/state-conditions.mjs +107 -0
- package/dist/static-values.mjs +94 -0
- package/dist/surface-contrast.mjs +252 -0
- package/dist/surface-effects.mjs +98 -0
- package/dist/target-size.mjs +177 -0
- package/dist/task-cache.mjs +142 -136
- package/dist/task-worker.mjs +18 -18
- package/dist/test-boundaries.mjs +50 -189
- package/dist/token-checks.mjs +21 -0
- package/dist/token-dtcg.mjs +136 -0
- package/dist/token-expression.mjs +19 -0
- package/dist/token-inventory.mjs +146 -0
- package/dist/token-operations.mjs +37 -0
- package/dist/token-overlap.mjs +29 -0
- package/dist/token-provenance.mjs +260 -0
- package/dist/token-references.mjs +71 -0
- package/dist/token-registrations.mjs +116 -0
- package/dist/token-resolution.mjs +38 -0
- package/dist/token-sections.mjs +123 -0
- package/dist/token-shapes.mjs +121 -0
- package/dist/token-sheet-check.mjs +54 -0
- package/dist/token-type-check.mjs +89 -0
- package/dist/token-view-facts.mjs +111 -0
- package/dist/tsconfig.declarations.json +24 -0
- package/dist/types/css-tree.d.ts +45 -0
- package/dist/ui-framework.mjs +34 -34
- package/dist/units.mjs +186 -226
- package/dist/unknown.d.mts +9 -0
- package/dist/unknown.mjs +13 -0
- package/dist/unreached-sources.mjs +5 -0
- package/dist/validation-checks.mjs +62 -71
- package/dist/validation-inputs.mjs +209 -279
- package/dist/validation.mjs +132 -159
- package/dist/verification/browser.d.mts +21 -25
- package/dist/verification/browser.mjs +281 -124
- package/dist/verification/browser.page.d.mts +22 -0
- package/dist/verification/browser.page.mjs +19 -0
- package/dist/verification/paint-audit.page.d.mts +55 -0
- package/dist/verification/paint-audit.page.mjs +144 -0
- package/dist/verification/playwright-reporter.mjs +160 -0
- package/dist/verification/preview-startup.d.mts +51 -0
- package/dist/verification/preview-startup.mjs +76 -0
- package/dist/verification/request.d.mts +28 -0
- package/dist/verification/request.mjs +30 -0
- package/dist/verification/unit-preload.mjs +37 -0
- package/dist/verification.mjs +574 -607
- package/docs/ADS.md +585 -565
- package/docs/ARCHITECTURE.md +2002 -1384
- package/docs/ASSETS.md +487 -0
- package/docs/BEHAVIORS.md +339 -370
- package/docs/CACHING.md +365 -154
- package/docs/CHANGELOG.md +462 -21
- package/docs/COMPARISON.md +21 -26
- package/docs/DESIGN-REFERENCES.md +40 -27
- package/docs/GUIDE.md +2473 -1292
- package/docs/LANGUAGE.md +1159 -0
- package/docs/LOWERING.md +180 -0
- package/docs/MCP.md +1461 -1179
- package/docs/MOTION.md +491 -0
- package/docs/PROFILE-KINDS.md +544 -0
- package/docs/PROFILES.md +176 -0
- package/docs/RULES.md +590 -0
- package/docs/TOKEN-ROLES.md +377 -0
- package/docs/benchmarks/README.md +26 -27
- package/package.json +59 -45
- package/dist/a11y.mjs +0 -187
- package/dist/assets.mjs +0 -159
- package/dist/atomic-composition.mjs +0 -337
- package/dist/atomic-trace.mjs +0 -162
- package/dist/behavior-libraries.mjs +0 -174
- package/dist/behaviors.mjs +0 -306
- package/dist/brand-assets.mjs +0 -458
- package/dist/brands.mjs +0 -141
- package/dist/component-contrast.mjs +0 -256
- package/dist/construction-styles.cjs +0 -10
- package/dist/contracts/foundation.json +0 -211
- package/dist/contracts/tokens.json +0 -52
- package/dist/contracts.d.mts +0 -30
- package/dist/contrast-composition.mjs +0 -80
- package/dist/contrast-styles.mjs +0 -88
- package/dist/control-padding.mjs +0 -113
- package/dist/css-values.mjs +0 -27
- package/dist/declarative-flow.mjs +0 -244
- package/dist/design-values.mjs +0 -173
- package/dist/font-rules.mjs +0 -108
- package/dist/fonts-generated.mjs +0 -112
- package/dist/foundation-views.mjs +0 -242
- package/dist/foundation.mjs +0 -154
- package/dist/generated-entries.mjs +0 -198
- package/dist/html.mjs +0 -30
- package/dist/icons.mjs +0 -154
- package/dist/image-attributes.mjs +0 -187
- package/dist/image-size.mjs +0 -28
- package/dist/layers.mjs +0 -461
- package/dist/layout-widths.mjs +0 -332
- package/dist/linaria/atomic-css.cjs +0 -2
- package/dist/linaria/atomic-styled.cjs +0 -2
- package/dist/linaria/preserve-values.cjs +0 -58
- package/dist/linaria/spatial-inputs.cjs +0 -56
- package/dist/linaria.d.mts +0 -1
- package/dist/linaria.mjs +0 -9
- package/dist/lockup-composition.mjs +0 -44
- package/dist/lockup-model.cjs +0 -64
- package/dist/paint-contracts.mjs +0 -216
- package/dist/pictograms.mjs +0 -52
- package/dist/public-api.mjs +0 -121
- package/dist/public-props.mjs +0 -91
- package/dist/render-audit/axe-run.mjs +0 -17
- package/dist/render-audit/first-render.mjs +0 -40
- package/dist/render-audit/image-shape.mjs +0 -46
- package/dist/render-audit/layout-overflow.mjs +0 -167
- package/dist/render-audit/layout-shift.mjs +0 -32
- package/dist/render-audit/non-text-contrast.mjs +0 -151
- package/dist/render-audit/pictograms.mjs +0 -88
- package/dist/render-color-probe.mjs +0 -202
- package/dist/render-composition.mjs +0 -186
- package/dist/runtime-contracts.mjs +0 -506
- package/dist/scenario-program.mjs +0 -19
- package/dist/scenario-selectors.mjs +0 -237
- package/dist/scenario-slots.mjs +0 -217
- package/dist/scenario-trace.mjs +0 -314
- package/dist/scenarios-vite.d.mts +0 -2
- package/dist/scenarios-vite.mjs +0 -2
- package/dist/scenarios.mjs +0 -616
- package/dist/selector-match.mjs +0 -94
- package/dist/showcase/comparison.js +0 -48
- package/dist/showcase/connection.js +0 -10
- package/dist/showcase/draft-navigation.js +0 -59
- package/dist/showcase/foundation-view.css +0 -58
- package/dist/showcase/foundation-view.mjs +0 -255
- package/dist/showcase/guide-controls.ads.review.mjs +0 -32
- package/dist/showcase/http-connection.js +0 -86
- package/dist/showcase/http-preview.js +0 -81
- package/dist/showcase/icons.js +0 -2
- package/dist/showcase/navigation.js +0 -13
- package/dist/showcase/pictogram-view.mjs +0 -53
- package/dist/showcase/preview-frame.ads.review.css +0 -46
- package/dist/showcase/preview-frame.ads.review.d.mts +0 -11
- package/dist/showcase/preview-frame.ads.review.mjs +0 -22
- package/dist/showcase/preview-state.js +0 -11
- package/dist/showcase/refresh-scheduler.js +0 -23
- package/dist/showcase/resource-reader.js +0 -37
- package/dist/showcase-coverage.mjs +0 -139
- package/dist/source-symbols.mjs +0 -4
- package/dist/spatial-composition.mjs +0 -322
- package/dist/spatial-contexts.cjs +0 -56
- package/dist/spatial-css.cjs +0 -351
- package/dist/spatial-inputs.cjs +0 -80
- package/dist/spatial-model.cjs +0 -322
- package/dist/spatial.mjs +0 -21
- package/dist/stage-timing.cjs +0 -21
- package/dist/starters/preact/design-system/patterns/Conversation/Conversation.tsx +0 -105
- package/dist/starters/preact/design-system/patterns/Shell/Shell.tsx +0 -275
- package/dist/starters/preact/design-system/review/demo-frame/DemoFrame.ads.review.tsx +0 -7
- package/dist/starters/preact/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +0 -10
- package/dist/starters/preact/design-system/showcase/mcp/main.ads.mount.tsx +0 -8
- package/dist/starters/preact/ds.config.json +0 -37
- package/dist/starters/preact/package.json +0 -35
- package/dist/starters/preact/src/vite-env.d.ts +0 -7
- package/dist/starters/preact/tsconfig.json +0 -35
- package/dist/starters/preact/vite.config.ts +0 -23
- package/dist/starters/react/ADS.md +0 -286
- package/dist/starters/react/README.md +0 -184
- package/dist/starters/react/biome.css.json +0 -21
- package/dist/starters/react/design-system/assets/brand/README.md +0 -41
- package/dist/starters/react/design-system/assets/brand/app-icon.svg +0 -4
- package/dist/starters/react/design-system/assets/brand/logo.dark.svg +0 -6
- package/dist/starters/react/design-system/assets/brand/logo.svg +0 -6
- package/dist/starters/react/design-system/assets/glyphs/README.md +0 -15
- package/dist/starters/react/design-system/assets/glyphs/aliases.json +0 -1
- package/dist/starters/react/design-system/assets/glyphs/check.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/chevron-down.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/chevron-right.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/close.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/external-link.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/info.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/menu.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/plus.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/search.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/warning.svg +0 -1
- package/dist/starters/react/design-system/assets/pictograms/catalog.ads.json +0 -13
- package/dist/starters/react/design-system/assets/pictograms/journey.dark.svg +0 -7
- package/dist/starters/react/design-system/assets/pictograms/journey.svg +0 -7
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.fixture.ts +0 -1
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -13
- package/dist/starters/react/design-system/components/Actions/Button/Button.tsx +0 -56
- package/dist/starters/react/design-system/components/Actions/Button/README.md +0 -12
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.fixture.ts +0 -9
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.scenario.tsx +0 -16
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +0 -60
- package/dist/starters/react/design-system/components/Actions/IconButton/README.md +0 -17
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.fixture.ts +0 -6
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.scenario.tsx +0 -16
- package/dist/starters/react/design-system/components/Content/Icon/Icon.tsx +0 -42
- package/dist/starters/react/design-system/components/Content/Icon/README.md +0 -17
- package/dist/starters/react/design-system/components/Content/Icon/glyphs.ts +0 -17
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.fixture.ts +0 -2
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.scenario.tsx +0 -13
- package/dist/starters/react/design-system/components/Content/Image/Image.tsx +0 -51
- package/dist/starters/react/design-system/components/Content/Image/README.md +0 -20
- package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.fixture.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.scenario.tsx +0 -12
- package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +0 -35
- package/dist/starters/react/design-system/components/Content/Logo/README.md +0 -12
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.fixture.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.scenario.tsx +0 -7
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.tsx +0 -26
- package/dist/starters/react/design-system/components/Forms/TextField/README.md +0 -14
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.fixture.ts +0 -6
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -13
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.tsx +0 -61
- package/dist/starters/react/design-system/composition/Search/SearchPage/README.md +0 -4
- package/dist/starters/react/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +0 -7
- package/dist/starters/react/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +0 -16
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/README.md +0 -5
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.fixture.ts +0 -13
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.scenario.tsx +0 -22
- package/dist/starters/react/design-system/controllers/Palette/Palette.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/controllers/Palette/Palette.ts +0 -164
- package/dist/starters/react/design-system/index.ts +0 -12
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.fixture.ts +0 -7
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.scenario.tsx +0 -15
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.tsx +0 -105
- package/dist/starters/react/design-system/patterns/Conversation/README.md +0 -9
- package/dist/starters/react/design-system/patterns/Search/SearchBar/README.md +0 -12
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +0 -1
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +0 -11
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.tsx +0 -41
- package/dist/starters/react/design-system/patterns/Shell/Floating.ads.fixture.ts +0 -5
- package/dist/starters/react/design-system/patterns/Shell/Floating.ads.scenario.tsx +0 -21
- package/dist/starters/react/design-system/patterns/Shell/README.md +0 -43
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.fixture.ts +0 -5
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.scenario.tsx +0 -21
- package/dist/starters/react/design-system/patterns/Shell/Shell.tsx +0 -274
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.review.tsx +0 -7
- package/dist/starters/react/design-system/review/index.ads.review.ts +0 -4
- package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.review.tsx +0 -6
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +0 -10
- package/dist/starters/react/design-system/showcase/mcp/main.ads.mount.tsx +0 -10
- package/dist/starters/react/design-system/styles.css +0 -7
- package/dist/starters/react/design-system/tokens/base.css +0 -36
- package/dist/starters/react/design-system/tokens/catalog.ads.json +0 -1221
- package/dist/starters/react/design-system/tokens/colors.css +0 -215
- package/dist/starters/react/design-system/tokens/elevation.css +0 -53
- package/dist/starters/react/design-system/tokens/spacing.css +0 -87
- package/dist/starters/react/design-system/tokens/spatial.ads.json +0 -70
- package/dist/starters/react/design-system/tokens/themes.generated.css +0 -142
- package/dist/starters/react/design-system/tokens/themes.generated.ts +0 -402
- package/dist/starters/react/design-system/tokens/typography.css +0 -31
- package/dist/starters/react/ds.config.json +0 -37
- package/dist/starters/react/gitignore.template +0 -8
- package/dist/starters/react/package.json +0 -39
- package/dist/starters/react/scripts/build-mcp-previews.mjs +0 -3
- package/dist/starters/react/src/vite-env.d.ts +0 -7
- package/dist/starters/react/tsconfig.build.json +0 -20
- package/dist/starters/react/tsconfig.json +0 -34
- package/dist/starters/react/vite.config.ts +0 -23
- package/dist/style-boundaries.mjs +0 -106
- package/dist/style-token-rules.mjs +0 -51
- package/dist/themes-generated.mjs +0 -161
- package/dist/themes-watch.mjs +0 -83
- package/dist/themes.mjs +0 -360
- package/dist/token-export.mjs +0 -94
- package/dist/token-origins.mjs +0 -24
- package/dist/token-policy.mjs +0 -26
- package/dist/token-quality.mjs +0 -149
- package/dist/token-samples.mjs +0 -19
- package/dist/tokens.mjs +0 -194
- package/dist/unit-contracts.mjs +0 -396
- package/dist/usage.mjs +0 -184
- package/dist/verification/playwright-reporter.cjs +0 -87
- package/docs/CONTRACTS.md +0 -285
- package/docs/HTTP-SHOWCASE-POC.md +0 -397
- package/docs/SPATIAL-CHECKS.md +0 -69
- package/docs/benchmarks/http-showcase-optimized.json +0 -1879
- package/docs/benchmarks/http-showcase-profile.json +0 -308
- package/docs/benchmarks/http-showcase.json +0 -3069
- /package/dist/{starters/react/design-system/assets/fonts/.gitkeep → analysis/semantic.mjs} +0 -0
- /package/dist/{starters/react/design-system/controllers/.gitkeep → lowering-model.mjs} +0 -0
- /package/dist/showcase/{favicon.svg → ui/favicon-scavmehf.svg} +0 -0
package/docs/GUIDE.md
CHANGED
|
@@ -1,368 +1,402 @@
|
|
|
1
1
|
# ADS tool guide
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
ADS is development tooling for a project's local design system. The package
|
|
4
|
+
contains a Bun CLI, asynchronous native static checks and the design-system
|
|
5
|
+
compiler. `ads init` sets a project up; the design system is the project's own
|
|
6
|
+
to author. `ads emit` compiles it into plain modules and stylesheets. ADS adds no
|
|
7
|
+
runtime dependency to the application's shipped UI.
|
|
8
|
+
|
|
9
|
+
There are two [editing routes](../skills/ads-designer/references/workflows.md).
|
|
10
|
+
Both use ADS's own compiler.
|
|
11
|
+
|
|
12
|
+
- **Direct editing.** Change the owned files normally, and use MCP for preview
|
|
13
|
+
and validation. Drafts and acceptance are not required, but you can use drafts
|
|
14
|
+
for isolation and for the Accepted/Draft comparison.
|
|
15
|
+
- **MCP-only editing.** Change source through
|
|
16
|
+
[tracked drafts](../skills/ads-designer/references/drafts.md), review the
|
|
17
|
+
rendered result, then accept the exact revision.
|
|
18
|
+
|
|
19
|
+
Complete each required tracked proposal before you report a design change as
|
|
20
|
+
finished.
|
|
21
21
|
|
|
22
22
|
## Use ADS through MCP
|
|
23
23
|
|
|
24
|
-
Connect your coding agent
|
|
25
|
-
The client launches `ads mcp` in your project;
|
|
26
|
-
source editing.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
`
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
annotated image before requesting a clean capture: each scenario/target has one
|
|
70
|
-
current slot, so the next capture replaces it. A draft comparison uses the same
|
|
71
|
-
layers for current and candidate.
|
|
72
|
-
|
|
73
|
-
Read `ads://project/captures` and the returned PNG image URIs through MCP
|
|
74
|
-
`resources/read`. Each target keeps only current and candidate: a successful
|
|
75
|
-
standalone screenshot replaces current and clears candidate; a screenshot-enabled
|
|
76
|
-
dry run replaces the pair; applying matching source promotes candidate. Source
|
|
77
|
-
changes mark images stale. There is no previous slot, history or TTL.
|
|
78
|
-
`ads_capture_clear` discards candidate or clears both images. Subscribe to resource
|
|
79
|
-
updates when supported, and explicitly reread otherwise. Screenshots provide visual
|
|
80
|
-
evidence for one state; they do not replace behavior checks.
|
|
81
|
-
|
|
82
|
-
ADS serves its skills over MCP, by what the client speaks:
|
|
83
|
-
|
|
84
|
-
| Client | How it gets skills |
|
|
24
|
+
Connect your coding agent with the [MCP client setup](MCP.md#connect-codex-or-claude).
|
|
25
|
+
The client launches `ads mcp` in your project; `--mutations` enables guarded
|
|
26
|
+
source editing. The server starts its showcase and the ADS-managed preview
|
|
27
|
+
compiler. Use the returned showcase URL; do not start a separate preview
|
|
28
|
+
application. The [MCP guide](MCP.md) gives the tool and resource schemas,
|
|
29
|
+
prompts, skills and notifications.
|
|
30
|
+
|
|
31
|
+
An agent works in these steps:
|
|
32
|
+
|
|
33
|
+
1. Call `ads_status`. It identifies the connected project, the available
|
|
34
|
+
commands, the mutation mode, the showcase URL, the declared themes and brands,
|
|
35
|
+
and the build freshness.
|
|
36
|
+
2. Find the public UI and behavior with `ads_catalog`, the tokens with
|
|
37
|
+
`ads_tokens`, the files of an owner with `ads_units` and the preview IDs with
|
|
38
|
+
`ads_scenarios`.
|
|
39
|
+
3. Read one relevant workflow [skill](MCP.md#skills) before you edit: natively,
|
|
40
|
+
or through `ads_skills` and `ads_read_skill` on an earlier protocol. The host
|
|
41
|
+
decides whether a skill is loaded into an agent's context. `npx skills`
|
|
42
|
+
installs the skills locally for a host that does not read them over MCP.
|
|
43
|
+
4. Open a discovered preview with `ads_show_scenario`. It renders the project's
|
|
44
|
+
actual scenario through MCP Apps. If the client cannot render Apps, use the
|
|
45
|
+
returned showcase link.
|
|
46
|
+
5. Select the editing route. The route does not depend on `mutations.enabled`.
|
|
47
|
+
- With direct source access, edit the owned files. Run `ads check` and the
|
|
48
|
+
relevant project checks before you finish.
|
|
49
|
+
- With MCP-only access and mutation tools enabled, every change goes through
|
|
50
|
+
a draft: `ads_create_draft`, `ads_read_file` and `ads_update_draft` (file
|
|
51
|
+
contents or a Git diff), a rendered `ads_show_draft` review, an optional
|
|
52
|
+
`ads_accept` dry run, then `ads_accept` of the exact revision. An owner is
|
|
53
|
+
in at most one open draft. Accept dependencies first and review dependents
|
|
54
|
+
again.
|
|
55
|
+
- After a series of accepted drafts, run `ads_validate({scope:"changed"})`.
|
|
56
|
+
- To remove declared targets, use `ads_delete`
|
|
57
|
+
([Deleting declared targets](#deleting-declared-targets)).
|
|
58
|
+
- A read-only MCP connection supports direct editors. It cannot edit for an
|
|
59
|
+
MCP-only client.
|
|
60
|
+
6. Review the diagnostics, the execution evidence and the rendered result. Check
|
|
61
|
+
`ads_status.build` again after changes. Notifications alone do not prove that
|
|
62
|
+
the output is current.
|
|
63
|
+
|
|
64
|
+
**Nothing to inspect or run.** A feature with nothing to inspect or run does not
|
|
65
|
+
report an empty match or a pass. Its result carries
|
|
66
|
+
`{ "status": "not-available", "reason", "message" }`:
|
|
67
|
+
|
|
68
|
+
| Reason | Meaning |
|
|
85
69
|
|---|---|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
70
|
+
| `no-scenarios` | No scenarios are registered, so nothing can be rendered, captured or audited |
|
|
71
|
+
| `no-behavior-checks` | No behavior checks are registered |
|
|
72
|
+
| `no-token-inventory` | The design system declares no token sheet (`ads tokens`, `ads_tokens`, `ads://project/tokens`, `ads://project/tokens/dtcg`) |
|
|
73
|
+
| `no-catalog` | The design system has no public barrel, or it exports nothing (`ads_catalog`, `ads://project/catalog`) |
|
|
74
|
+
| `none-selected` | Entries are registered, but the change set or selection reaches none of them |
|
|
75
|
+
| `turned-off` | The project's configuration turns the stage off |
|
|
76
|
+
|
|
77
|
+
A gate stage that ran nothing is listed as skipped, never as passed or
|
|
78
|
+
established.
|
|
79
|
+
|
|
80
|
+
**Screenshots.** For an on-demand screenshot, call `ads_capture` with a
|
|
81
|
+
discovered scenario ID and, optionally, a named `captureTargets` element, one
|
|
82
|
+
of the scenario's named states, a theme, a viewport and layout `guides`. To compare a draft with accepted source,
|
|
83
|
+
pass the `draft` id and the exact `revision`. Acceptance and its dry run create
|
|
84
|
+
no screenshots. A screenshot is visual evidence for one state; it does not
|
|
85
|
+
replace behavior checks. See
|
|
86
|
+
[screenshots and candidate comparison](MCP.md#screenshots-and-candidate-comparison)
|
|
87
|
+
and the portable [capture guide](../skills/ads-designer/references/captures.md)
|
|
88
|
+
(`ads://guides/captures`) for guides, named targets, limits and the
|
|
89
|
+
current/candidate image lifecycle.
|
|
90
|
+
|
|
91
|
+
Capture and the render audit use ADS's own Playwright; the project installs
|
|
92
|
+
nothing. The first capture or audit on a machine installs Playwright's browser
|
|
93
|
+
into its shared cache, with progress. To provision CI or an offline machine
|
|
94
|
+
ahead of time, run the command that a failed installation names:
|
|
95
|
+
`bunx playwright@<ADS's Playwright version> install chromium`.
|
|
88
96
|
|
|
89
|
-
|
|
90
|
-
for a host that does not read them over MCP.
|
|
97
|
+
## Implementation support
|
|
91
98
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
the same guide at `ads://guides/captures`.
|
|
99
|
+
[Design system source](#design-system-source) describes what you author and what
|
|
100
|
+
`ads check` enforces. [Emitting the design system](#emitting-the-design-system)
|
|
101
|
+
describes the output that an application imports.
|
|
96
102
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
restoring rejected revisions may reset the preview. “Checking changes…” is live
|
|
101
|
-
feedback, not acceptance: source gates and selected browser checks still decide
|
|
102
|
-
whether the revision passes. Application production builds are unchanged.
|
|
103
|
+
The emitted output targets the project's framework: React, or
|
|
104
|
+
native Preact (owners typed by Preact's own JSX runtime, `preact/hooks`, no
|
|
105
|
+
`preact/compat`).
|
|
103
106
|
|
|
104
|
-
|
|
107
|
+
The guards do not parse Vue or Svelte single-file components, or HTML templates.
|
|
108
|
+
Keep the framework-specific checks for them. A clean ADS check does not validate
|
|
109
|
+
a surface that ADS does not check.
|
|
105
110
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
Current source checking supports `.js`, `.jsx`, `.ts`, `.tsx`, their module
|
|
113
|
-
variants, `.css`, and imported Linaria `css` and `styled` templates. JSX style/type checks
|
|
114
|
-
support React and native Preact, including imported factory aliases and
|
|
115
|
-
DOM/CSS types. Scenario discovery, coverage, ownership checks and MCP delivery
|
|
116
|
-
apply to both. The empty application starter comes for React and for Preact; this
|
|
117
|
-
checkout’s working example uses native Preact 11 with TypeScript and Linaria. ADS adds neither runtime
|
|
118
|
-
to a receiving application and never silently aliases React to Preact.
|
|
119
|
-
|
|
120
|
-
Vue/Svelte single-file components and HTML templates are not parsed by these
|
|
121
|
-
guards. Web Component JS/TS logic and separate CSS can be checked, but HTML
|
|
122
|
-
template strings and Shadow DOM style constructs lack equivalent coverage.
|
|
123
|
-
Retain framework-specific checks; a clean ADS check does not validate those
|
|
124
|
-
unchecked surfaces.
|
|
111
|
+
For product MCP Apps, make the widget's entry the root of the production bundle,
|
|
112
|
+
and import the necessary public design-system UI by name from the emitted
|
|
113
|
+
output. The app's own MCP server serves the built widget; it does not need ADS's
|
|
114
|
+
server or showcase. Check the runtime code and the emitted CSS and assets for
|
|
115
|
+
unrelated owners. See the
|
|
116
|
+
[product widget integration proof](MCP.md#product-widgets-and-payload-scope).
|
|
125
117
|
|
|
126
118
|
### Controllers and behavior checks
|
|
127
119
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
patterns own presentation.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
120
|
+
A controller is a plain module that the barrel exports, with no recipe and no
|
|
121
|
+
markup. Keep a private controller with its consumer; share reusable behavior
|
|
122
|
+
through `design-system/controllers/<Name>/`. A controller owns lifecycle and
|
|
123
|
+
measurements, and components and patterns own presentation. It can read computed
|
|
124
|
+
styles and use an offscreen canvas. It renders no markup, sets no class or
|
|
125
|
+
style, and writes no styling through the DOM (`source/plain-*`). Use the
|
|
126
|
+
configured framework and the declared project dependencies.
|
|
127
|
+
|
|
128
|
+
Owners register behavior in `<Owner>.ads.behavior.ts`. ADS runs every check
|
|
129
|
+
itself: `unit` specs under its own Bun, `browser` and `strict` (React) specs
|
|
130
|
+
with its own Playwright. The project installs and configures no test runner;
|
|
131
|
+
`mcp.behaviorProfiles` can only set the `timeoutMs` of a built-in profile. A
|
|
132
|
+
design system that registers no checks reports `not-available`
|
|
133
|
+
(`no-behavior-checks`). See
|
|
134
|
+
[registered checks and their status](BEHAVIORS.md#registered-checks-and-their-status).
|
|
135
|
+
|
|
136
|
+
The example design system's form-field bridge (`controllers/FormField`) registers eight
|
|
137
|
+
guarantees with unit checks. In the example design system, `ads behaviors` lists them
|
|
138
|
+
and `ads verify` runs them under the built-in `unit` profile.
|
|
139
|
+
|
|
140
|
+
### Forms
|
|
141
|
+
|
|
142
|
+
A field shows a constraint error only after the user interacts with it (a
|
|
143
|
+
commit, a blur after an edit, a failed submit). It shows an application error (a
|
|
144
|
+
server's verdict) immediately. The example design system's form-field bridge
|
|
145
|
+
(`controllers/FormField`: `bindFormField`, `bindForm`, and the hooks
|
|
146
|
+
`useFormField` and `useFormBridge`) mirrors that timing onto the field's root as
|
|
147
|
+
`data-user-invalid`, `data-user-valid` and `data-autofill`, which recipes select
|
|
148
|
+
as ordinary attribute states. It also sets `aria-invalid` explicitly, links the
|
|
149
|
+
error message with `aria-describedby` only while it is shown, announces an error
|
|
150
|
+
that appears on blur once through the form's one polite live region, and after a
|
|
151
|
+
failed submit focuses the form's error summary, or the first invalid field.
|
|
152
|
+
Where the browser lacks `:user-invalid`, its own tracked events give the same
|
|
153
|
+
timing.
|
|
154
|
+
|
|
155
|
+
The example design system's `TextField` takes `type`, `autoComplete`, `inputMode`,
|
|
156
|
+
`enterKeyHint`, `spellCheck`, `autoCorrect` and `autoCapitalize` (off by default
|
|
157
|
+
for email, tel, url and password), `pattern`, `minLength`, `maxLength`,
|
|
158
|
+
`required`, `error` (the application's), `validationMessage` and
|
|
159
|
+
`nativeValidation`. Its invalid and autofill states draw inset rings, which take
|
|
160
|
+
no space and are not colour alone.
|
|
161
|
+
|
|
162
|
+
`ads check` blocks an error or autofill state shown by colour alone
|
|
163
|
+
(`source/form-state-colour-only`) and an autofill treatment that moves layout
|
|
164
|
+
(`source/autofill-layout-shift`). It reviews a text field that names what it
|
|
165
|
+
collects without `autoComplete` (`review/autocomplete-missing`). Read the forms
|
|
166
|
+
guide ([forms.md](../skills/ads-designer/references/forms.md),
|
|
167
|
+
`ads://guides/forms`) for the timing, the bridge's API, the recipe states and
|
|
168
|
+
the browser limits. ADS's browser tests run in Chromium only.
|
|
169
|
+
|
|
170
|
+
## Set up a design package
|
|
171
|
+
|
|
172
|
+
A design system lives in its own package, the *design package*: a folder with
|
|
173
|
+
its own `package.json`, `ds.config.json`, `tsconfig.json` and `design-system/`.
|
|
174
|
+
ADS runs only there. Applications consume what `ads emit` writes and never
|
|
175
|
+
install ADS. Install Bun 1.4.1 or later for ADS tooling and previews. ADS ships
|
|
176
|
+
everything else it needs (its own Playwright and browser, its test runners) and
|
|
177
|
+
needs nothing from the application.
|
|
178
|
+
|
|
179
|
+
There are two layouts.
|
|
180
|
+
|
|
181
|
+
**Several applications, one design system.** The design package has its own
|
|
182
|
+
repository. Its output is `dist/`, which its `exports` publish and which is
|
|
183
|
+
committed, so a Git reference installs it:
|
|
161
184
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
185
|
+
```sh
|
|
186
|
+
bunx @reqvire-org/ads init acme-design --framework react # or npx … init
|
|
187
|
+
cd acme-design && bun install
|
|
188
|
+
bun run lint:ds # ads check
|
|
189
|
+
bun run emit:ds # ads emit → dist/
|
|
190
|
+
git add . && git commit -m "Design system 1.0.0" && git tag v1.0.0
|
|
191
|
+
```
|
|
167
192
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"name": "@acme/ui",
|
|
196
|
+
"version": "1.0.0",
|
|
197
|
+
"type": "module",
|
|
198
|
+
"exports": { ".": "./dist/index.ts", "./foundation.css": "./dist/foundation.css" },
|
|
199
|
+
"files": ["dist"],
|
|
200
|
+
"sideEffects": ["*.css"],
|
|
201
|
+
"peerDependencies": { "react": "^19.0.0" },
|
|
202
|
+
"devDependencies": { "@reqvire-org/ads": "^0.5.0", "react": "19.2.7", "react-dom": "19.2.7", "@types/react": "19.2.17" },
|
|
203
|
+
"scripts": { "lint:ds": "ads check .", "emit:ds": "ads emit" }
|
|
204
|
+
}
|
|
205
|
+
```
|
|
171
206
|
|
|
172
|
-
|
|
207
|
+
An application in another repository depends on it by Git reference (or a packed
|
|
208
|
+
tarball, or a registry release), and installs its own React:
|
|
173
209
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"name": "shop-app",
|
|
213
|
+
"private": true,
|
|
214
|
+
"type": "module",
|
|
215
|
+
"dependencies": {
|
|
216
|
+
"@acme/ui": "git+ssh://git@github.com/acme/acme-design.git#v1.0.0",
|
|
217
|
+
"react": "^19.0.0",
|
|
218
|
+
"react-dom": "^19.0.0"
|
|
219
|
+
},
|
|
220
|
+
"devDependencies": { "vite": "^7.0.0", "@vitejs/plugin-react": "^5.0.0", "typescript": "^5.9.0" },
|
|
221
|
+
"scripts": { "dev": "vite", "build": "vite build" }
|
|
222
|
+
}
|
|
223
|
+
```
|
|
178
224
|
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
|
|
225
|
+
```tsx
|
|
226
|
+
import "@acme/ui/foundation.css";
|
|
227
|
+
import { Button } from "@acme/ui";
|
|
182
228
|
```
|
|
183
229
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
namespace is also recognized by guards. See the [Preact upgrade guide](https://preactjs.com/guide/v11/upgrade-guide/).
|
|
195
|
-
|
|
196
|
-
The [shared starter](https://github.com/reqvire-org/ads/tree/main/starters/shared)
|
|
197
|
-
and its [native generator](https://github.com/reqvire-org/ads/blob/main/scripts/build-starters.mjs)
|
|
198
|
-
show the setup. `ads init --framework preact --include-starter` adds the generated
|
|
199
|
-
Preact variant of that source. The generator changes runtime dependencies, JSX
|
|
200
|
-
settings, framework imports and the native mount together. For a Preact app without a saved framework, run
|
|
201
|
-
`ads init --framework preact`; newly generated foundation scenarios use native
|
|
202
|
-
hooks. Init preserves the application's compiler, dependencies and mount adapter.
|
|
203
|
-
|
|
204
|
-
### CSS correctness in the tool and starter
|
|
205
|
-
|
|
206
|
-
The tool and starter use Biome only for CSS, configured in
|
|
207
|
-
`biome.css.json`. Parsing rejects malformed CSS and invalid hex colors, including
|
|
208
|
-
token values. Explicit lint rules reject duplicate font names and selectors;
|
|
209
|
-
the starter also rejects duplicate properties. Formatting is disabled. ADS directly checks architecture, token usage and
|
|
210
|
-
ownership in JavaScript/TypeScript. The tool repository uses Oxlint for its own
|
|
211
|
-
ordinary JavaScript linting; consumers do not need that extra pass. `ads init` preserves an existing project's lint tools.
|
|
212
|
-
|
|
213
|
-
CSS regression tests cover rejected input, valid theme/nesting
|
|
214
|
-
contexts, and exclusion of JavaScript and generated outputs.
|
|
215
|
-
|
|
216
|
-
## Set up an existing project
|
|
217
|
-
|
|
218
|
-
Install Bun 1.4.1+ for ADS tooling and previews. The application keeps its own
|
|
219
|
-
Node/npm or Bun pipeline. Run inside the project containing `package.json`:
|
|
230
|
+
To upgrade, move the ref (`#v1.1.0`). To try an unreleased change, use a branch
|
|
231
|
+
ref or a packed tarball. Git references, tarballs and registries install a copy
|
|
232
|
+
without the design package's `devDependencies`. Its React for authoring is thus
|
|
233
|
+
never installed into the application: one React, no bundler setting. Symlinked
|
|
234
|
+
local dependencies (`file:` to a folder, `link:`, `npm link`) are not supported:
|
|
235
|
+
the application would resolve the design package's own `node_modules` first and
|
|
236
|
+
could load a second React.
|
|
237
|
+
|
|
238
|
+
**One application, one design system.** The design package is a folder in the
|
|
239
|
+
application's repository and emits directly into the application's source:
|
|
220
240
|
|
|
221
241
|
```sh
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
242
|
+
cd shop-app
|
|
243
|
+
bunx @reqvire-org/ads init design --framework react --out ../src/ui
|
|
244
|
+
cd design && bun install && bun run emit:ds # → ../src/ui
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
shop-app/
|
|
249
|
+
├── package.json the application (no ADS)
|
|
250
|
+
├── src/ui/ emitted by ADS, committed
|
|
251
|
+
└── design/
|
|
252
|
+
├── package.json the design package (private)
|
|
253
|
+
├── ds.config.json { "compile": { "outDir": "../src/ui" } }
|
|
254
|
+
└── design-system/
|
|
226
255
|
```
|
|
227
256
|
|
|
228
|
-
|
|
229
|
-
`
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
257
|
+
The application imports the output as its own code
|
|
258
|
+
(`import { Button } from "./ui"` and `import "./ui/foundation.css"`). Emitted
|
|
259
|
+
files import `react` and resolve it upward from their folder, so `src/ui`
|
|
260
|
+
reaches the application's `node_modules` and its one React. This is why the
|
|
261
|
+
output does not stay inside the design folder in this layout. The design package
|
|
262
|
+
stays private, with no peers and no `exports`.
|
|
263
|
+
|
|
264
|
+
**Dependencies.** Each package that the emitted output imports must reach the
|
|
265
|
+
application:
|
|
266
|
+
|
|
267
|
+
| Kind | Example | Several applications (design package) | One application |
|
|
268
|
+
| --- | --- | --- | --- |
|
|
269
|
+
| Framework | `react`, `preact` | `peerDependencies` (range), pinned in `devDependencies` | application `dependencies` |
|
|
270
|
+
| Headless library holding shared state (context, focus) | `react-aria` | `peerDependencies` (range), pinned in `devDependencies` | application `dependencies` |
|
|
271
|
+
| Stateless library | `date-fns` | `dependencies` (installed with the design package) | application `dependencies` |
|
|
272
|
+
| Types only | `@types/react` | `devDependencies` | application `devDependencies` if it typechecks the output |
|
|
273
|
+
|
|
274
|
+
A library that holds shared state must be the application's one copy, so it is a
|
|
275
|
+
peer. npm 7+, pnpm and Bun install a missing peer and report a range conflict.
|
|
276
|
+
|
|
277
|
+
- With the output inside the design package, `ads check` reports
|
|
278
|
+
`package-dependency-undeclared` when the output imports a package at runtime
|
|
279
|
+
that the design package declares only in `devDependencies` or nowhere.
|
|
280
|
+
- In the one-application layout, the application's build enforces the rule: a
|
|
281
|
+
missing package is an unresolved import that names it.
|
|
282
|
+
- In both layouts, `ads emit` writes `ads-dependencies.json`: the packages that
|
|
283
|
+
the application must satisfy, with ranges and runtime or types use.
|
|
284
|
+
|
|
285
|
+
`<outDir>/package.json` declares `"sideEffects": ["*.css"]` in both layouts
|
|
286
|
+
([Consuming the output](#consuming-the-output)).
|
|
287
|
+
|
|
288
|
+
**Framework.** `--framework react` or `--framework preact` is required on the
|
|
289
|
+
first init. Init saves it as `framework` in `ds.config.json`, and later runs use
|
|
290
|
+
the saved value. ADS does not detect a framework and has no default. A Preact
|
|
291
|
+
design system's owners import `preact/hooks` and Preact's types
|
|
292
|
+
(`ComponentChildren`). If
|
|
293
|
+
the flag differs from the saved framework, init stops; change `ds.config.json`
|
|
294
|
+
explicitly.
|
|
295
|
+
|
|
296
|
+
**What init does.** `ads init [folder]` (the current folder by default):
|
|
297
|
+
|
|
298
|
+
- Creates the folder and its `package.json` when absent (name from the folder,
|
|
299
|
+
`version` `0.1.0`, `type: "module"`, and `private` with `--out`).
|
|
300
|
+
- Creates the design-system folder when it is absent, and leaves it empty. Init
|
|
301
|
+
installs no design system and generates no source: you author the
|
|
302
|
+
foundation (`foundation.ads.ts`), the public barrel (`index.ts`), the role
|
|
303
|
+
token sheets, the profiles and the owners
|
|
304
|
+
([Design system source](#design-system-source)). Until the foundation and
|
|
305
|
+
the barrel exist, `ads check` fails and names what is missing.
|
|
306
|
+
- Writes `ds.config.json` with `schemaVersion`, `framework`, `dsDir` and the
|
|
307
|
+
`compile` defaults (`outDir` from `--out`). If the file exists, init keeps
|
|
308
|
+
every saved field and adds only the missing ones. Themes and brands are
|
|
309
|
+
declared in `foundation.ads.ts`, never in `ds.config.json`.
|
|
310
|
+
- Adds the tool and the framework's packages (`react`, `react-dom` and
|
|
311
|
+
`@types/react`, or `preact`) to `devDependencies` when neither dependency map
|
|
312
|
+
declares them. It keeps an existing tool version unless `--tool-package`
|
|
313
|
+
overrides it.
|
|
314
|
+
- Without `--out`, also adds the framework to `peerDependencies` and, when
|
|
315
|
+
absent, `exports`, `files` and `sideEffects` that publish `dist/`.
|
|
316
|
+
- Adds `lint:ds` (`ads check .`) and `emit:ds` (`ads emit`), in the spelling of
|
|
317
|
+
the package's package manager.
|
|
318
|
+
- Writes `tsconfig.json` and `ads-env.d.ts` when the package has no tsconfig:
|
|
319
|
+
bundler resolution, the framework's JSX, `@ds` mapped to the barrel, and SVG
|
|
320
|
+
module declarations. Editors and the package's own typecheck thus never use
|
|
321
|
+
the tsconfig of an enclosing application.
|
|
322
|
+
- Never edits `.gitignore`, never writes a lockfile, never follows symlinks and
|
|
323
|
+
never overwrites a project file. Ignore `.ds/` (ADS's caches and working
|
|
324
|
+
files) yourself.
|
|
325
|
+
|
|
326
|
+
A second run changes nothing. If the design-system folder already has content
|
|
327
|
+
and the package has a `ds.config.json`, init keeps the folder unchanged,
|
|
328
|
+
completes only the configuration and dependencies, and prints a notice. Without
|
|
329
|
+
a `ds.config.json`, init stops (`design-system-exists`): move the folder, or add
|
|
330
|
+
a `ds.config.json` (with another `dsDir` if that folder is not the design
|
|
331
|
+
system).
|
|
332
|
+
|
|
333
|
+
Init also stops before any write for an unrelated custom `lint:ds` or `emit:ds`
|
|
334
|
+
script, and for an `--out` folder that ADS cannot own
|
|
335
|
+
([The output folder](#the-output-folder)).
|
|
336
|
+
|
|
337
|
+
The JSON result of `ads init` reports `framework`, `packageManager`,
|
|
338
|
+
`toolDependency`, `designSystem` (`installed` with a file count, or `kept`),
|
|
339
|
+
`notices` and `updatedFiles`.
|
|
293
340
|
|
|
294
341
|
## Package manager detection
|
|
295
342
|
|
|
296
|
-
`init` reads
|
|
343
|
+
This version supports npm and Bun. `init` reads the package manager from the
|
|
344
|
+
design package:
|
|
297
345
|
|
|
298
|
-
1.
|
|
346
|
+
1. The `packageManager` field in its `package.json`.
|
|
299
347
|
2. Its Bun (`bun.lock` or `bun.lockb`) or npm (`package-lock.json`) lockfile.
|
|
300
348
|
|
|
301
|
-
A
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
does not
|
|
308
|
-
including ADS, run on Bun despite Node shebangs.
|
|
309
|
-
Launch the MCP server with `bunx @reqvire-org/ads mcp`, or its generated
|
|
310
|
-
`ads-mcp` script. Managed workers and screenshot capture inherit the interpreter.
|
|
311
|
-
Use `command: "runtime"` for portable preview compiler/behavior profiles;
|
|
312
|
-
explicit `node`, `bun` or other commands are respected. Project-specific tools
|
|
313
|
-
must themselves support the selected runtime. `ads_status.project.runtime`
|
|
314
|
-
reports the actual name, version and executable; package manager and UI framework
|
|
315
|
-
are separate choices.
|
|
316
|
-
|
|
317
|
-
## Migrating from DS
|
|
318
|
-
|
|
319
|
-
ADS uses the package `@reqvire-org/ads`, CLI `ads`, MCP tools named `ads_*`,
|
|
320
|
-
resource namespaces `ads://`, `ui://ads` and `skill://ads`, and skills named
|
|
321
|
-
`ads-*`. Replace the old `@reqvire-org/ds` dependency and package imports, install
|
|
322
|
-
dependencies, then run `ads init` to refresh managed build hooks. Existing
|
|
323
|
-
`ds.config.json`, `.ds/`, `design-system/`, `@ds`, shared token names and
|
|
324
|
-
`--ds-*`/`--ux-*` ownership prefixes remain valid. Project UI requires no rewrite.
|
|
325
|
-
|
|
326
|
-
Use `ads-mcp` and `ads-read-mcp` for the editing and read-only launch scripts.
|
|
327
|
-
Update MCP client configuration to the new package/server name and reconnect;
|
|
328
|
-
tool names and resource URIs have changed. Install the renamed `ads-*` skills
|
|
329
|
-
when using local skill installation. Rebuild previews with the new tool to
|
|
330
|
-
refresh generated resource manifests. Existing `DS.md` project guides are still
|
|
331
|
-
discovered; the tool's contract and new scaffold use `ADS.md`.
|
|
332
|
-
|
|
333
|
-
npm has no in-place package rename: publish `@reqvire-org/ads` as a new package.
|
|
334
|
-
Set up its own trusted publisher for `reqvire-org/ads`, workflow
|
|
335
|
-
`release.yml`, allowing `npm publish` and `npm dist-tag`. Once ADS is available,
|
|
336
|
-
deprecate the old package with a migration message:
|
|
349
|
+
A new design package follows the repository it is created in: the nearest
|
|
350
|
+
enclosing folder with a `packageManager` field or a lockfile (an application, in
|
|
351
|
+
the one-application layout). Otherwise it uses Bun, which runs ADS. An existing
|
|
352
|
+
package that declares neither stops init with an error that names what to add.
|
|
353
|
+
With both lockfile types and no `packageManager`, keep one lockfile or set the
|
|
354
|
+
field. ADS never replaces or removes a lockfile. The launcher (`npx` or `bunx`)
|
|
355
|
+
does not change the package's choice.
|
|
337
356
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
Keep old releases available for existing consumers. See npm's
|
|
343
|
-
[package rename guidance](https://docs.npmjs.com/unpublishing-packages-from-the-registry/),
|
|
344
|
-
[deprecation guidance](https://docs.npmjs.com/deprecating-and-undeprecating-packages-or-package-versions/)
|
|
345
|
-
and [trusted publishing setup](https://docs.npmjs.com/trusted-publishers/).
|
|
357
|
+
Launch the MCP server with `bunx @reqvire-org/ads mcp` or
|
|
358
|
+
`npx @reqvire-org/ads mcp` in the design package. `ads_status.project.runtime`
|
|
359
|
+
reports the actual name, version and executable. The package manager and the UI
|
|
360
|
+
framework are separate choices.
|
|
346
361
|
|
|
347
362
|
## Develop ADS locally
|
|
348
363
|
|
|
349
|
-
|
|
364
|
+
These commands are for work on the ADS repository. Projects that use the
|
|
365
|
+
published package do not need them.
|
|
366
|
+
|
|
367
|
+
**Playground.** `bun run dev` (or `bun run dev:react`, the same command) builds
|
|
368
|
+
the tool and serves the showcase for a playground: a working copy of
|
|
369
|
+
`tests/fixtures/reference-project` in the ignored folder `.ds/playground/`.
|
|
370
|
+
Serving, drafts and accepted changes thus never change the fixture that the
|
|
371
|
+
tests read. `scripts/playground.mjs` creates the copy once.
|
|
372
|
+
`bun scripts/playground.mjs showcase --fresh` replaces it with the fixture's
|
|
373
|
+
current files, and the same script runs `mcp`, `check`, `validate`, `emit` or
|
|
374
|
+
`sync` on it. Playground edits are experiments: promote deliberate changes to
|
|
375
|
+
the fixture by hand.
|
|
376
|
+
|
|
377
|
+
To run the playground's MCP server and showcase together:
|
|
350
378
|
|
|
351
379
|
```sh
|
|
352
|
-
|
|
380
|
+
bun run ads-mcp -- --port 4191 # guarded editing enabled
|
|
353
381
|
# or:
|
|
354
|
-
|
|
382
|
+
bun run ads-read-mcp -- --port 4191 # read-only
|
|
355
383
|
```
|
|
356
384
|
|
|
357
|
-
Run one at a time and open **http://127.0.0.1:4191/**.
|
|
358
|
-
|
|
359
|
-
MCP client's launch configuration,
|
|
360
|
-
`npm --silent run ads-
|
|
361
|
-
|
|
362
|
-
|
|
385
|
+
Run one at a time and open **http://127.0.0.1:4191/**. Each command builds the
|
|
386
|
+
local tool (build logs go to stderr), then starts stdio MCP, the showcase and
|
|
387
|
+
its managed preview compiler. For an MCP client's launch configuration, run the
|
|
388
|
+
script silently (`npm --silent run ads-mcp`), so that a package manager banner
|
|
389
|
+
does not enter the JSON-RPC stream. If you need only the stdio connection, add
|
|
390
|
+
`--no-showcase` after `--`.
|
|
391
|
+
|
|
392
|
+
**Showcase UI.** `bun run dev:ui` serves ADS's own showcase design system
|
|
393
|
+
(`showcase-ui/`) in place, so its scenarios refresh as you edit them.
|
|
394
|
+
`bun run check:ui` validates it. Both build ADS first and link this checkout
|
|
395
|
+
into `showcase-ui/node_modules` (ignored). `bun run build` builds the showcase's
|
|
396
|
+
bundle from it.
|
|
363
397
|
|
|
364
|
-
Use `npm link` to try changes from this checkout in a
|
|
365
|
-
with ADS. From the ADS repository root:
|
|
398
|
+
**Link the checkout.** Use `npm link` to try changes from this checkout in a
|
|
399
|
+
project that is already set up with ADS. From the ADS repository root:
|
|
366
400
|
|
|
367
401
|
```sh
|
|
368
402
|
npm install
|
|
@@ -370,49 +404,58 @@ npm run build
|
|
|
370
404
|
npm link
|
|
371
405
|
```
|
|
372
406
|
|
|
373
|
-
Then
|
|
407
|
+
Then, in the test project, after you install its normal dependencies:
|
|
374
408
|
|
|
375
409
|
```sh
|
|
376
410
|
npm link @reqvire-org/ads
|
|
377
411
|
npm exec -- ads --version
|
|
378
|
-
npm run
|
|
412
|
+
npm run lint:ds
|
|
379
413
|
```
|
|
380
414
|
|
|
381
|
-
The project now uses your checkout through a symlink
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
the client starts in this project. The version check confirms which build is
|
|
385
|
-
running. See [npm's linking documentation](https://docs.npmjs.com/cli/v11/commands/npm-link/)
|
|
415
|
+
The project now uses your checkout through a symlink, and the version check
|
|
416
|
+
confirms which build runs. See
|
|
417
|
+
[npm's linking documentation](https://docs.npmjs.com/cli/v11/commands/npm-link/)
|
|
386
418
|
and [local-package resolution](https://docs.npmjs.com/cli/v11/commands/npm-exec/).
|
|
387
419
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
`npm
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
420
|
+
- Keep the normal published dependency in the project's `package.json`.
|
|
421
|
+
- The versionless `npx -y @reqvire-org/ads mcp` configuration uses the linked
|
|
422
|
+
copy when the client starts in this project.
|
|
423
|
+
- The link points to the built `dist/`; it does not compile source. After you
|
|
424
|
+
change ADS tool code, packaged skills or the showcase client, run
|
|
425
|
+
`npm run build` in this checkout and reconnect MCP.
|
|
426
|
+
- Changes to the test project's design system still use its managed preview
|
|
427
|
+
watcher.
|
|
428
|
+
- If `npm install` or `npm ci` in the test project replaces the link, run
|
|
429
|
+
`npm link @reqvire-org/ads` again.
|
|
430
|
+
- To return to the published version, run
|
|
431
|
+
`npm unlink --no-save @reqvire-org/ads` and then `npm install` in the test
|
|
432
|
+
project. To remove the global development link, run
|
|
433
|
+
`npm unlink --global @reqvire-org/ads`.
|
|
434
|
+
|
|
435
|
+
**MCP Explorer.** For this checkout's diagnostic MCP client, run:
|
|
400
436
|
|
|
401
437
|
```sh
|
|
402
438
|
npm run dev:mcp-explorer
|
|
403
439
|
```
|
|
404
440
|
|
|
405
|
-
Open **http://127.0.0.1:4190/**.
|
|
406
|
-
its showcase and ADS-managed preview compiler. The
|
|
407
|
-
[explorer guide](../mcp-explorer/README.md) covers tools, resources, prompts,
|
|
408
|
-
notifications and widget checks.
|
|
409
|
-
|
|
410
|
-
the
|
|
441
|
+
Open **http://127.0.0.1:4190/**. The command builds ADS and starts the real
|
|
442
|
+
stdio server, its showcase and the ADS-managed preview compiler. The
|
|
443
|
+
[explorer guide](../mcp-explorer/README.md) covers tools, resources, prompts,
|
|
444
|
+
skills, notifications and widget checks.
|
|
445
|
+
|
|
446
|
+
### CSS correctness in the tool
|
|
447
|
+
|
|
448
|
+
The tool repository uses Biome only for CSS, configured in `biome.css.json`.
|
|
449
|
+
Parsing rejects malformed CSS and invalid hex colors. Explicit lint rules reject
|
|
450
|
+
duplicate font names and duplicate selectors. Formatting is disabled. The tool
|
|
451
|
+
repository uses Oxlint for its own JavaScript linting; consumers do not need
|
|
452
|
+
that pass. `ads init` preserves an existing project's lint tools.
|
|
411
453
|
|
|
412
454
|
## Test a local package
|
|
413
455
|
|
|
414
|
-
Use a tarball to verify the packed release and a clean install before
|
|
415
|
-
For iterative development,
|
|
456
|
+
Use a tarball to verify the packed release and a clean install before you
|
|
457
|
+
publish. For iterative development, link the checkout
|
|
458
|
+
([Develop ADS locally](#develop-ads-locally)). From the repository root:
|
|
416
459
|
|
|
417
460
|
```sh
|
|
418
461
|
npm install
|
|
@@ -421,130 +464,134 @@ npm run pack:tool
|
|
|
421
464
|
ads_tool_package="$PWD/output/npm/reqvire-org-ads-$(bun -p 'require("./package.json").version').tgz"
|
|
422
465
|
```
|
|
423
466
|
|
|
424
|
-
Then
|
|
467
|
+
Then create a design package beside (or inside) a test application:
|
|
425
468
|
|
|
426
469
|
```sh
|
|
427
|
-
cd /absolute/path/to/test-
|
|
428
|
-
npx --yes --package "$ads_tool_package" ads init --framework react --tool-package "$ads_tool_package"
|
|
470
|
+
cd /absolute/path/to/test-application
|
|
471
|
+
npx --yes --package "$ads_tool_package" ads init design --framework react --out ../src/ui --tool-package "$ads_tool_package"
|
|
472
|
+
cd design
|
|
429
473
|
npm install
|
|
430
|
-
npm run
|
|
474
|
+
npm run lint:ds
|
|
475
|
+
npm run emit:ds
|
|
431
476
|
```
|
|
432
477
|
|
|
433
|
-
|
|
434
|
-
`--tool-package` accepts an absolute local tarball path, a version, or a
|
|
435
|
-
package/version. A tarball becomes a `file:` development dependency, so
|
|
436
|
-
available for subsequent installs. A published pinned version is
|
|
437
|
-
between machines without an archive. Routine builds need no global
|
|
478
|
+
For Bun, use `bun install` and `bun run lint:ds`. Keep the npx options before
|
|
479
|
+
`ads`. `--tool-package` accepts an absolute local tarball path, a version, or a
|
|
480
|
+
matching package/version. A tarball becomes a `file:` development dependency, so
|
|
481
|
+
keep it available for subsequent installs. A published pinned version is
|
|
482
|
+
portable between machines without an archive. Routine builds need no global
|
|
483
|
+
install.
|
|
438
484
|
|
|
439
485
|
## Commands and checks
|
|
440
486
|
|
|
441
487
|
| Command | Behavior |
|
|
442
488
|
|---------|----------|
|
|
443
|
-
| `ads init --framework react` |
|
|
444
|
-
| `ads check [directory]` | Read-only
|
|
445
|
-
| `ads
|
|
446
|
-
| `ads
|
|
489
|
+
| `ads init [folder] --framework react [--out ../src/ui]` | Set up the design package: tooling, configuration and an empty design-system folder to author in ([Set up a design package](#set-up-a-design-package)). A saved framework can omit the flag |
|
|
490
|
+
| `ads check [directory]` | Read-only check of the design system: structure, imports, owner analysis, mocks and the emitted output ([Design system source](#design-system-source)) |
|
|
491
|
+
| `ads compile [directory]` | Build ADS previews with Bun (`--watch` for incremental previews) |
|
|
492
|
+
| `ads emit [directory]` | Check, then write the compiled design system to its output folder ([Emitting the design system](#emitting-the-design-system)) |
|
|
493
|
+
| `ads sync [directory]` | Regenerate stale generated source files ([Regenerating generated source](#regenerating-generated-source)) |
|
|
494
|
+
| `ads validate [directory]` | The project gate (`--changed` limits it to what changed since the last successful full run) |
|
|
495
|
+
| `ads behaviors [directory]` | Registered behavior checks and current verification evidence |
|
|
496
|
+
| `ads verify [directory]` | Run registered behavior checks (`--unit` and `--check` select) |
|
|
497
|
+
| `ads audit [directory]` | Render audit of registered scenarios (`--scenario`, `--theme` and `--brand` select) |
|
|
498
|
+
| `ads tokens [directory]` | The design system's tokens: values per theme, brand and condition, declarations, profiles, owners and value-shape status (`--query`, `--role`, `--group`, `--limit`; `--format dtcg` exports DTCG JSON) ([Inspecting tokens and the public API](#inspecting-tokens-and-the-public-api)) |
|
|
447
499
|
| `ads mcp [directory]` | Serve tools, resources, prompts, skills and preview Apps; start the local showcase |
|
|
448
500
|
| `ads mcp --mutations` | Enable guarded edits to the local ADS, validated before application |
|
|
449
501
|
| `ads showcase [directory]` | Start the same MCP runtime and showcase for browser-only use |
|
|
450
502
|
| `ads --version`, `ads --help` | Version and usage |
|
|
451
503
|
|
|
452
|
-
`init`
|
|
453
|
-
|
|
454
|
-
for inspection
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
`
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
These are static checks, not framework type checking or browser CSS evaluation.
|
|
502
|
-
Arbitrary computed expressions, combined conditional cascade behavior, computed
|
|
503
|
-
module specifiers, JSX spreads, other styling engines, and renderer-specific APIs
|
|
504
|
-
need the project's existing checks and review. Continue to run its type checking,
|
|
505
|
-
component tests, and browser comparisons. Register component-specific guards as
|
|
506
|
-
explicit project scripts; include them in builds and `acceptance.scripts` when
|
|
507
|
-
required. `ads check` does not invoke project linter plugins.
|
|
504
|
+
`init` takes the folder of the design package to create or complete. Other
|
|
505
|
+
commands inspect the given directory. All default to the current folder.
|
|
506
|
+
`--json` gives structured results for inspection and setup commands; `mcp` uses
|
|
507
|
+
stdout only for JSON-RPC. `--fresh` (check and validate) executes the batch
|
|
508
|
+
checks without task-cache reads ([caching](CACHING.md)).
|
|
509
|
+
|
|
510
|
+
Exit codes:
|
|
511
|
+
|
|
512
|
+
- 0: success.
|
|
513
|
+
- 1: error findings, or a gate that did not pass. `ads audit` also exits 1 when
|
|
514
|
+
it ran nothing (no registered or selected scenario): its result is
|
|
515
|
+
`not-available`, never `ok`.
|
|
516
|
+
- 2: invalid input or configuration, or an execution error. With `--json`, an
|
|
517
|
+
execution error prints `{ "ok": false, "error" }`.
|
|
518
|
+
|
|
519
|
+
Review and info items never change the exit code. A one-shot command exits as
|
|
520
|
+
soon as it has reported: it closes its native compiler clients and does not wait
|
|
521
|
+
for their idle timeout. `ads mcp`, `ads showcase` and the `--watch` modes run
|
|
522
|
+
until stopped.
|
|
523
|
+
|
|
524
|
+
These are static checks. They are not framework type checking of the
|
|
525
|
+
application, and they do not evaluate CSS in a browser. Continue to run the
|
|
526
|
+
project's type checking, tests and browser comparisons. Register
|
|
527
|
+
project-specific guards as explicit project scripts, and include them in builds
|
|
528
|
+
and in `acceptance.scripts` when required. `ads check` does not invoke project
|
|
529
|
+
linter plugins. Keep the normal build gates enabled for edits made by other
|
|
530
|
+
tools.
|
|
531
|
+
|
|
532
|
+
**Guarded editing.** Guarded MCP editing is opt-in. Its mandatory checks and the
|
|
533
|
+
optional project `acceptance.scripts` run in a temporary project copy with
|
|
534
|
+
installed dependencies. See the [editing contract](MCP.md#guarded-editing) for
|
|
535
|
+
unit ownership, Git patches, bounded reads and preview review.
|
|
536
|
+
|
|
537
|
+
- `acceptance.scripts` and `validation.scripts` default to empty; ADS infers no
|
|
538
|
+
names. `ads validate` runs `acceptance.scripts` and then `validation.scripts`,
|
|
539
|
+
so list each script once. After direct source edits, run
|
|
540
|
+
`ads validate --changed`
|
|
541
|
+
([the two gates](../skills/ads-designer/references/validation.md)).
|
|
542
|
+
- Each project script has 60 seconds by default. For measured slower builds, set
|
|
543
|
+
`mcp.mutationCheckTimeoutMs` (100–300000 ms). Behavior profiles have a
|
|
544
|
+
separate whole-run budget.
|
|
545
|
+
- A preview waits up to 5 minutes for its build, including the first build after
|
|
546
|
+
the MCP server starts. `mcp.previewBuildTimeoutMs` (1000–3600000 ms) changes
|
|
547
|
+
this.
|
|
548
|
+
- When acceptance runs the owners' registered behavior checks, or a capture was
|
|
549
|
+
requested, ADS builds production previews and shares them with browser
|
|
550
|
+
verification. The render audit of acceptance renders the owners' UI scenarios
|
|
551
|
+
in the candidate on that host, or compiles only those scenarios when nothing
|
|
552
|
+
else needs previews. Core-only acceptance does not build the whole graph.
|
|
508
553
|
|
|
509
554
|
### Checks and guards
|
|
510
555
|
|
|
511
|
-
Every finding has one of three kinds
|
|
556
|
+
Every finding has one of three kinds. No setting changes the kind of a finding,
|
|
557
|
+
and there is no warning level.
|
|
512
558
|
|
|
513
559
|
- **Error**: fails `ads check`, `ads audit`, `ads validate` and MCP acceptance.
|
|
514
|
-
- **Review**: shown, never blocks
|
|
515
|
-
- **Info**: notes an analysis limit, such as
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
560
|
+
- **Review**: shown, never blocks. It names something only a person can judge.
|
|
561
|
+
- **Info**: notes an analysis limit, such as an owner that is not analysed until
|
|
562
|
+
another owner is fixed.
|
|
563
|
+
|
|
564
|
+
**Repair plan.** When a command fails, its text output ends with a repair plan:
|
|
565
|
+
the failed rules grouped by mistake, in the order to fix them, each with its
|
|
566
|
+
repair hint and the guides to read. An earlier group is often the cause of later
|
|
567
|
+
errors, so fix the first group and check again. After the steps, the plan names
|
|
568
|
+
the owners that are not analysed until those errors are fixed, one line each
|
|
569
|
+
(`Not analysed until fixed: <owner> (blocked by <owner>)`, capped, with the rest
|
|
570
|
+
in `--json`). `--json` output is the command's result unchanged. MCP replies
|
|
571
|
+
carry the plan as `repair`, with the owners in `repair.notAnalysed`.
|
|
572
|
+
[The rule reference](RULES.md) lists every rule under its group; agents read the
|
|
573
|
+
same catalogue as `ads://guides/errors`.
|
|
574
|
+
|
|
575
|
+
**Text output.** Text output prints errors and review items, but not individual
|
|
576
|
+
info notes. The summary line counts them and says where to read them, for
|
|
577
|
+
example
|
|
578
|
+
`ADS check failed: . (1 error, 4 review items, 38 info notes; --json lists them)`.
|
|
579
|
+
The info part is omitted when there are none. `ads validate` adds the same count
|
|
580
|
+
to its summary line. `ads audit` prints its info rows and counts them in its
|
|
581
|
+
summary.
|
|
519
582
|
|
|
520
583
|
**Gates.**
|
|
521
584
|
|
|
522
585
|
| Gate | What runs |
|
|
523
586
|
|---|---|
|
|
524
|
-
| `ads check` |
|
|
525
|
-
| `ads audit` | axe-core (WCAG A/AA rules), ADS's non-text contrast check, `layout-shift
|
|
587
|
+
| `ads check` | Design-system structure, the import closure, owner analysis, mock ownership, declared themes and brands, generated source and the emitted output folder; no browser |
|
|
588
|
+
| `ads audit` | `ads check`, then axe-core (WCAG A/AA rules), ADS's non-text contrast check, `layout-shift`, `layout-overflow`, `img-shape` and `corner-overpainted` in every registered scenario, once per declared brand and theme, and the text passes (`a11y-text-scale`, `a11y-text-spacing-override`, `a11y-reflow`) once per scenario |
|
|
526
589
|
| MCP acceptance | `ads_accept` checks the draft's candidate and writes no source unless it passes (`dryRun:true` writes nothing): `ads check` rules, `acceptance.scripts`, the draft owners' own registered behavior tests (`acceptance.behavior`, default `true`) and the render audit of their own UI scenarios (`acceptance.audit`, default `true`) |
|
|
527
590
|
| `ads validate` | The project gate, applying nothing: `ads check` rules, `acceptance.scripts` then `validation.scripts`, current previews, and every registered behavior test and render audit its change set reaches |
|
|
528
|
-
| `ads validate --changed` | The same for what changed since the last successful full run
|
|
529
|
-
|
|
530
|
-
**Render audit.** `ads validate` always runs it over the scenarios its change set
|
|
531
|
-
reaches; draft acceptance runs it over the draft owners' own scenarios.
|
|
532
|
-
`mcp.auditPages` (1–16, default 4) sets how many pages render at once. Each `a11y-axe`,
|
|
533
|
-
`a11y-non-text-contrast`, `layout-overflow` and `layout-shift` finding is an error that fails the gate, and an audit that cannot run fails it with a `render-audit` error
|
|
534
|
-
naming what to install. Each `a11y-incomplete` finding is an info item that fails nothing: axe could
|
|
535
|
-
not decide that rule on those elements, so check it by hand. It names the axe rule, scenario, themes,
|
|
536
|
-
elements, and axe's reason, such as `bgGradient` for text over a gradient. The audit needs the
|
|
537
|
-
project's Playwright and a browser:
|
|
538
|
-
|
|
539
|
-
```sh
|
|
540
|
-
npm install -D @playwright/test # ads init declares it
|
|
541
|
-
npx playwright install chromium # Bun: bunx playwright install chromium
|
|
542
|
-
```
|
|
591
|
+
| `ads validate --changed` | The same for what changed since the last successful full run. Configuration, foundation or token changes, and changes outside `dsDir` such as manifests, lockfiles or tooling, widen it to everything. Run it after direct edits or a series of accepted drafts |
|
|
543
592
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
render audit off for draft acceptance, set them in `ds.config.json`; `ads validate`
|
|
547
|
-
always runs both:
|
|
593
|
+
To turn the owners' behavior tests or render audit off for draft acceptance, set
|
|
594
|
+
them in `ds.config.json`. `ads validate` always runs both:
|
|
548
595
|
|
|
549
596
|
```json
|
|
550
597
|
{
|
|
@@ -553,930 +600,2064 @@ always runs both:
|
|
|
553
600
|
}
|
|
554
601
|
```
|
|
555
602
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
and
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
`
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
the
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
(
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
`
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
603
|
+
A behavior, preview or audit stage with nothing to run (no registered checks or
|
|
604
|
+
scenarios, none that the change reaches, or turned off) is listed as
|
|
605
|
+
`skipped: true` with `status: "not-available"`, a `reason` code and a `message`.
|
|
606
|
+
In acceptance it does not block the draft; `ads audit` exits 1.
|
|
607
|
+
|
|
608
|
+
**Behavior.** A registered guarantee needs current passing execution evidence.
|
|
609
|
+
`ads verify` runs the registered checks against current source.
|
|
610
|
+
|
|
611
|
+
#### Render audit
|
|
612
|
+
|
|
613
|
+
The audit renders registered scenarios from the emitted preview tree, which
|
|
614
|
+
holds only a revision that passes `ads check`. With no registered scenario it
|
|
615
|
+
reports `not-available` (`no-scenarios`); with none selected, `none-selected`.
|
|
616
|
+
|
|
617
|
+
The audit mounts a scenario's specimens alone, without the page that ADS draws
|
|
618
|
+
around them in the showcase, so every finding is about the project's UI. A
|
|
619
|
+
capture shows the page as the showcase does.
|
|
620
|
+
|
|
621
|
+
- **Kinds.** Without `--scenario`, the audit renders component and pattern
|
|
622
|
+
scenarios. A mock gates nothing and is left out; `ads audit --scenario
|
|
623
|
+
mocks/<Name>` still audits one, as a look at how its owners combine.
|
|
624
|
+
- **States.** Every named state of a scenario is its own render, in every theme
|
|
625
|
+
and brand, with all passes. A finding lists the states it was found in
|
|
626
|
+
(`states`, and "States: Invalid, Long." at the end of its message); the same
|
|
627
|
+
finding in several states is one finding. A scenario has at most 12 states.
|
|
628
|
+
|
|
629
|
+
- Each `a11y-axe`, `a11y-non-text-contrast`, `a11y-text-scale`,
|
|
630
|
+
`a11y-text-spacing-override`, `a11y-reflow`, `layout-overflow`, `layout-shift`
|
|
631
|
+
and `img-shape` finding is an error that fails the gate.
|
|
632
|
+
- Each `a11y-incomplete` finding is an info item that fails nothing: axe could
|
|
633
|
+
not decide that rule on those elements, so check it by hand.
|
|
634
|
+
- An audit that cannot run fails the gate with a `render-audit-unavailable`
|
|
635
|
+
error. When the browser installation cannot run (offline, a blocked download),
|
|
636
|
+
the error names the command that installs the browser by hand (see
|
|
637
|
+
**Screenshots** above).
|
|
638
|
+
- The browser is Chromium by default. `mcp.capture` selects `browser`
|
|
639
|
+
(`chromium`, `firefox`, `webkit`), an installed Chrome `channel` such as
|
|
640
|
+
`"chrome"`, and `timeoutMs`.
|
|
641
|
+
- `mcp.auditPages` (1–16, default 4) sets how many pages render at once.
|
|
642
|
+
- A render that fails because the preview dropped or was slow is retried alone,
|
|
643
|
+
up to 3 attempts, with a new browser and preview. The other renders keep their
|
|
644
|
+
results, and findings never cause a retry. The JSON result and the check list
|
|
645
|
+
the retried passes under `retries`, and `ads audit` prints them. A scenario
|
|
646
|
+
that still fails is a `render-audit` error that names it and the last cause,
|
|
647
|
+
beside any findings.
|
|
648
|
+
|
|
649
|
+
What the audit measures in each render:
|
|
650
|
+
|
|
651
|
+
- **Non-text contrast** (WCAG 1.4.11, which axe-core does not check). A visible,
|
|
652
|
+
enabled control whose background does not stand out from its surroundings
|
|
653
|
+
needs a 3:1 border on its best-contrasting side (a soft field's one rule under
|
|
654
|
+
the text passes). An icon-only control needs a 3:1 icon. Disabled controls,
|
|
655
|
+
browser-drawn native controls and controls over a background image are exempt.
|
|
656
|
+
A text-entry control whose recipe declares an `accessibility` boundary
|
|
657
|
+
(identified by its visible label, or by a boundary that appears on
|
|
658
|
+
interaction) is not failed. It is listed on every run as the review item
|
|
659
|
+
`a11y-boundary-declared`, with a screenshot under `.ds/audit-evidence/`, for a
|
|
660
|
+
person to keep approving.
|
|
661
|
+
- **Overflow** at 390, 768 and 1280 px: horizontal document scrolling, elements
|
|
662
|
+
past the edge of the viewport, and text or a control cut off by
|
|
663
|
+
`overflow-x: hidden` or `clip` (`clipped`; the finding names what is cut).
|
|
664
|
+
- The audit measures what is cut, not the scroll width of the box. Images,
|
|
665
|
+
video, canvas, SVG artwork, iframes, `aria-hidden` and inert layers, and
|
|
666
|
+
pseudo-elements under a clip are not cut content, so a cropped hero image or
|
|
667
|
+
a decorative glow passes.
|
|
668
|
+
- Scrollers, ellipsis text, carousels, pannable widgets, native text fields,
|
|
669
|
+
fixed layers and visually hidden content are exempt.
|
|
670
|
+
- Components and patterns are also rendered in a 240 px container. What does
|
|
671
|
+
not fit a side pane is a `layout-overflow-narrow` review item.
|
|
672
|
+
- **Text scaling** (WCAG 1.4.4, 1.4.10, 1.4.12), once per scenario in the first
|
|
673
|
+
theme and brand, because text does not follow colour. The passes add about a
|
|
674
|
+
tenth to the audit's time.
|
|
675
|
+
- `a11y-text-scale`: at each overflow width the audit doubles the root font
|
|
676
|
+
size (200% text). It also renders the page zoomed to 200% (the 640 px
|
|
677
|
+
viewport that a 1280 px window leaves).
|
|
678
|
+
- `a11y-text-spacing-override`: at each overflow width the audit applies the
|
|
679
|
+
WCAG text-spacing values as the reader's stylesheet does (line height 1.5,
|
|
680
|
+
letter spacing 0.12em, word spacing 0.16em, 2em after paragraphs).
|
|
681
|
+
- `a11y-reflow`: the audit renders the page at 320 px (1280 px at 400%).
|
|
682
|
+
- Each pass reports what the scenario does not already show at rest:
|
|
683
|
+
horizontal overflow as above; text or controls cut off below by
|
|
684
|
+
`overflow: hidden` or `clip` (`block-clipped`); content that spills past a
|
|
685
|
+
box whose height or max-height does not grow (`spilled`); grid or flex items
|
|
686
|
+
that overlap past a reserved track (`overlap`); and a control or its focus
|
|
687
|
+
outline cut off by a clipping ancestor (`focus-clipped`).
|
|
688
|
+
- Each finding names the pass, the widths and the elements. Content that a
|
|
689
|
+
scroll axis hides is scrolled, not cut off. Ellipsis text, line clamps and
|
|
690
|
+
the exemptions of the overflow check stay exempt. Overflow that already
|
|
691
|
+
fails at 390 px is reported once, by `layout-overflow`.
|
|
692
|
+
- **Interaction states**: overlays opened from `aria-haspopup` controls, hovered
|
|
693
|
+
and focused controls, and busy controls, named in the finding's selector
|
|
694
|
+
(`open overlay "Edit": button`, `hover: button`). The result's `coverage`,
|
|
695
|
+
printed as a `Covered:` line, gives what was measured. What was skipped is a
|
|
696
|
+
`render-audit-skipped` info item. A render that measured none of its targets
|
|
697
|
+
is a `render-audit-nothing-measured` review item.
|
|
698
|
+
- **Settling**: the audit waits up to 5 s for the page to settle, and each
|
|
699
|
+
measurement waits for layout to stop moving. A page that never settles is
|
|
700
|
+
measured anyway and reported as `content-still-changing`.
|
|
701
|
+
- **Images and layout shift**: `img-shape` reports a visible image whose box
|
|
702
|
+
differs from its declared ratio. `layout-shift` reports a Cumulative Layout
|
|
703
|
+
Shift above 0.1 on first render, where the browser reports it (Chromium).
|
|
704
|
+
- **Rounded corners**: `corner-overpainted` reports an element with a radius
|
|
705
|
+
and visible overflow whose corner a descendant paints over (a child
|
|
706
|
+
component's background, an image). `ads check` proves the same for a
|
|
707
|
+
recipe's own parts (`construction/corner-overpaint`); the audit covers what
|
|
708
|
+
a recipe cannot see. ADS never clips for you, because clipping also cuts
|
|
709
|
+
focus outlines, shadows and menus: clip the element, inset it, or round what
|
|
710
|
+
it holds.
|
|
659
711
|
|
|
660
|
-
|
|
661
|
-
`@ads-layout fixed`. There is no universal fixed-width pixel cutoff and no warning for a
|
|
662
|
-
legitimate responsive cap around a small part.
|
|
712
|
+
## Showcase
|
|
663
713
|
|
|
664
|
-
|
|
714
|
+
ADS ships a minimal HTTP browser shell with isolated previews. `ads mcp` serves
|
|
715
|
+
the website alongside its stdio connection, and `ads showcase` starts the same
|
|
716
|
+
runtime for browser-only use. `ads mcp --no-showcase` keeps a headless stdio
|
|
717
|
+
server. Run the commands from the project root. Open the printed URL, or use
|
|
718
|
+
`ads_status.showcaseUrl` from a connected runtime: the URL and port of the
|
|
719
|
+
showcase that the server runs. ADS selects an available loopback port by
|
|
720
|
+
default; `--port 4185` selects a fixed port.
|
|
721
|
+
|
|
722
|
+
The browser reads discovery and opens previews through scoped HTTP services,
|
|
723
|
+
backed by the same engine as MCP. The client uses no project catalogue pages and
|
|
724
|
+
no direct component imports.
|
|
725
|
+
|
|
726
|
+
- SSE events refresh the menus and the build state.
|
|
727
|
+
- The selected scenario updates inside its persistent iframe. Compatible edits
|
|
728
|
+
keep component state, typed values and focus. Changed hook signatures follow
|
|
729
|
+
the framework's refresh rules (React Refresh, or Prefresh for Preact). An edit
|
|
730
|
+
that changes hook signatures or module boundaries, or the restoration of a
|
|
731
|
+
rejected revision, can reset the preview.
|
|
732
|
+
- A failed check restores the verified output. Errors identify stale retained
|
|
733
|
+
output.
|
|
734
|
+
- “Checking changes…” is live feedback, not acceptance. The source gates and the
|
|
735
|
+
selected browser checks decide whether the revision passes. Application
|
|
736
|
+
production builds are unchanged.
|
|
737
|
+
- The theme and brand selectors list the themes and brands that
|
|
738
|
+
`foundation.ads.ts` declares, through the preview host context.
|
|
739
|
+
|
|
740
|
+
Previews compile from the design system's emitted preview tree with ADS's Bun
|
|
741
|
+
compiler: incremental modules for watched previews and complete bundles for
|
|
742
|
+
verification. The project supplies no mount file and no preview application.
|
|
743
|
+
There is one managed compiler per runtime, shared by stdio and HTTP clients. The
|
|
744
|
+
App loads only the selected scenario's dependencies. An accepted mutation of a
|
|
745
|
+
configuration unit replaces the managed compiler and keeps MCP connected. See
|
|
746
|
+
[the compiler contract](MCP.md#one-client-command-managed-preview-builds) for
|
|
747
|
+
revisions, diagnostics, invalidation and the shared resource graph.
|
|
665
748
|
|
|
666
749
|
```json
|
|
667
|
-
{
|
|
668
|
-
"
|
|
669
|
-
"
|
|
670
|
-
}
|
|
750
|
+
{
|
|
751
|
+
"framework": "react@19.2.7",
|
|
752
|
+
"mcp": { "showcaseTitle": "My Project Design System" }
|
|
753
|
+
}
|
|
671
754
|
```
|
|
672
755
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
756
|
+
`framework` can pin the exact installed version (`name@1.2.3`). ADS keys preview
|
|
757
|
+
freshness and compiled previews by the files it owns (`ds.config.json` and the
|
|
758
|
+
design-system folder) and by the emitted preview tree. The pin is how a
|
|
759
|
+
framework upgrade reaches previews, so update it with the upgrade. The optional
|
|
760
|
+
title defaults to the project package name followed by ` · Design System`.
|
|
761
|
+
|
|
762
|
+
**Scenarios.** The showcase lists the registered [scenarios](#scenarios) and
|
|
763
|
+
previews them from the emitted preview tree. A project without scenarios lists
|
|
764
|
+
none, and `ads_scenarios`, `ads://project/scenarios` and `ads_status` report
|
|
765
|
+
`not-available` (`no-scenarios`).
|
|
766
|
+
|
|
767
|
+
**Showcase boxes.** A scenario's subject (the owners it covers) is shown in a
|
|
768
|
+
box of the project's own canvas, 16px larger than the subject on each side, on
|
|
769
|
+
the showcase's neutral page; the scenario's own headings and notes stay on the
|
|
770
|
+
page. The ADS views do the same for their samples and drawings. Leave at least
|
|
771
|
+
24px between a heading and the subject under it.
|
|
772
|
+
|
|
773
|
+
**Groups follow folders.** The left menu groups its entries by the design
|
|
774
|
+
system's folders: token folders and their role sheets, profile folders, asset
|
|
775
|
+
folders, the area folders that hold owners, and an owner that has more than
|
|
776
|
+
one scenario. Tokens, Profiles and Artwork each start with a **Summary** entry
|
|
777
|
+
generated from the same data: the folders with their counts. A view opened without the
|
|
778
|
+
showcase (an MCP App in another client) offers the same choices as buttons on
|
|
779
|
+
its page.
|
|
780
|
+
|
|
781
|
+
**ADS views.** Beside the scenarios, the showcase lists entries that ADS draws
|
|
782
|
+
itself from the revision it previews, in a frame of the project with its emitted
|
|
783
|
+
sheets and themes. They are not scenarios: the registry, `ads_scenarios` and
|
|
784
|
+
scenario coverage never list or count them, and no source file declares them.
|
|
785
|
+
They read the preview tree of the emitted revision, never live source, so an
|
|
786
|
+
edit appears after it is emitted.
|
|
787
|
+
|
|
788
|
+
- **Spatial grids** (id `foundation`, in the Profiles section after its
|
|
789
|
+
summary) shows the grid of each
|
|
790
|
+
spatial profile as cards: one per breakpoint with its columns and outer
|
|
791
|
+
margin drawn to scale, one per gutter mode with the content placed in its
|
|
792
|
+
columns, the spacing scale step by step and the units. After the cards come
|
|
793
|
+
example regions that
|
|
794
|
+
step through the breakpoints as you resize the preview: one per gutter mode,
|
|
795
|
+
a hybrid grid when the profile states fixed tracks, and a fixed tiling when
|
|
796
|
+
it states a tile size. Each example is the grid algebra's own expansion,
|
|
797
|
+
carried in the preview tree's facts file with its token references; the
|
|
798
|
+
view derives no margins, bounds or tracks
|
|
799
|
+
itself. A changed margin or gutter token thus changes the example in the
|
|
800
|
+
frame's theme and brand. The guide overlay draws on the examples. It draws
|
|
801
|
+
each element's lattice in the mini unit of the spatial profile that the grids
|
|
802
|
+
of its owner follow, from the same facts.
|
|
803
|
+
`ads_show_scenario({ id: "foundation" })` opens the view like a scenario.
|
|
804
|
+
- **Profiles** (id `profiles`, the Profiles section) lists every profile,
|
|
805
|
+
whether or not an owner selects it. The left menu lists the folders under
|
|
806
|
+
`profiles/`; a folder's page shows its profiles under their kinds. Each
|
|
807
|
+
profile is a card: its sample, its name, and a line of its first fields
|
|
808
|
+
(for a composite, the fields that shape it), what it states itself before
|
|
809
|
+
what it takes from another profile. The sample shows the profile as a whole: text set in a text
|
|
810
|
+
profile, a surface painted with a surface profile, a box framed by a frame
|
|
811
|
+
profile, items spaced by a spacing profile, a control with a focus profile's
|
|
812
|
+
indicator, and a composite's profiles together. A motion profile also
|
|
813
|
+
plays: a square moves by the profile's timing on its own effect (a turn, a
|
|
814
|
+
scale or a distance), with a **Replay** button; it stays still when the
|
|
815
|
+
reader asks for reduced motion. Use it to find profiles
|
|
816
|
+
that repeat each other, and to see what a change to a base profile reaches.
|
|
817
|
+
`ads_show_scenario({ id: "profiles" })` opens the view like a scenario.
|
|
818
|
+
- **Artwork** (id `assets`, the Artwork section) lists every declared asset,
|
|
819
|
+
whether or not an owner draws it. The left menu lists the asset groups (the
|
|
820
|
+
folders under `assets/`). The Summary lists every glyph set with its
|
|
821
|
+
members: a set is a named list of glyphs that a component may choose from by
|
|
822
|
+
name at run time, declared beside the glyphs. A group's assets are sections by paint kind: foreground
|
|
823
|
+
(takes the text colour), slots (takes its paint slots' tokens) and intrinsic
|
|
824
|
+
(keeps its own colours). Each row draws the asset from its authored SVG, made
|
|
825
|
+
inert by ADS's sanitizer, and shows its title, aliases, glyph sets, what
|
|
826
|
+
differs between its drawings (themes, sizes, states), its optical centre
|
|
827
|
+
when that is not the middle of its box, and where it is declared. A themed asset shows the drawing of the preview's theme.
|
|
828
|
+
`ads_show_scenario({ id: "assets" })` opens the view like a scenario.
|
|
829
|
+
- **Tokens** (id `tokens`, the Tokens section) lists every token of the
|
|
830
|
+
token inventory (`ads tokens`), whether or not an owner uses it. No scenario
|
|
831
|
+
thus has to exercise a token. The left menu lists the token folders as groups
|
|
832
|
+
and each role sheet (`tokens/<Group>/<role>.ads.css`) as an entry; an entry's
|
|
833
|
+
page shows that role's tokens. Under
|
|
834
|
+
its name a section says what the role is for, the unit to write it in, the
|
|
835
|
+
profile fields that read it, and whether it may derive from a spacing token. A
|
|
836
|
+
**Problems** choice lists every token whose status is not valid. A group shows
|
|
837
|
+
its first 100 tokens, and **Show more** adds the next 100. A token edit keeps
|
|
838
|
+
the selected group; an edit to an owner alone does not rebuild the view. The
|
|
839
|
+
explorer entry of the view is the token category, whose count is the number of
|
|
840
|
+
tokens. Each token is a card:
|
|
841
|
+
- a sample drawn from the token itself: a swatch as wide as the card for a
|
|
842
|
+
paint, gradient or shadow, or, when the token differs between themes, one
|
|
843
|
+
small swatch per theme with the theme's name and the value there; two
|
|
844
|
+
lines of text for a line height; a bar for a length; a corner for a radius; a
|
|
845
|
+
line eight times as thick for a border width; a type sample for a font
|
|
846
|
+
family, size, weight or letter spacing; for a duration or an easing, a
|
|
847
|
+
square that travels a track for that long, or along that curve (at rest
|
|
848
|
+
when the reader asks for reduced motion);
|
|
849
|
+
- the name, then its value here (what the frame computes in the theme and
|
|
850
|
+
brand selected in the showcase), what its author says it is for (the
|
|
851
|
+
comment above its declaration), what a brand or a condition changes
|
|
852
|
+
(`iris: …; @media (…): …`) and its value-shape status when it is not
|
|
853
|
+
valid. `ads tokens` lists where each token is declared and what reads it.
|
|
854
|
+
|
|
855
|
+
**Phone viewport.** The toggle in the showcase header constrains the real
|
|
856
|
+
preview iframe to 390 CSS pixels, or to the available width on a narrower
|
|
857
|
+
screen. It keeps the mounted example and its state, and does not change the
|
|
858
|
+
selected application host. `?viewport=phone` keeps the choice in a link; turn
|
|
859
|
+
the toggle off to follow the available browser width. On phone browsers the
|
|
860
|
+
catalogue starts collapsed, and the navigation button opens it again. Automated
|
|
861
|
+
captures keep their exact requested viewport.
|
|
862
|
+
|
|
863
|
+
**Approval view.** `?draft=<id>&view=approval&revision=<revision>`, the
|
|
864
|
+
`approvalUrl` that `ads_accept` returns, lists the accessibility declarations
|
|
865
|
+
that a draft revision adds or changes, and what ADS verifies of each. Its
|
|
866
|
+
"Approve and accept" is a person's step. It accepts that exact revision through
|
|
867
|
+
the gates of `ads_accept` and records no name; a changed draft asks for a new
|
|
868
|
+
link. First review the draft's split view in every theme and brand.
|
|
869
|
+
|
|
870
|
+
Run `ads check` and the registered project checks before preview compilation,
|
|
871
|
+
with the framework checks and meaningful tests. Review real entries at narrow
|
|
872
|
+
and wide sizes, in each declared theme and in the relevant states. Browser
|
|
873
|
+
verification establishes layout, keyboard and focus behavior, interactions and
|
|
874
|
+
motion; compiler success does not.
|
|
677
875
|
|
|
678
|
-
|
|
679
|
-
entry matching no token, unit or file is a `layout-config` error; an entry cannot name every
|
|
680
|
-
token or unit.
|
|
876
|
+
## Configuration and component rules
|
|
681
877
|
|
|
682
|
-
|
|
878
|
+
`ds.config.json` uses schema version 1. Every field is optional except the
|
|
879
|
+
framework that init saves. Defaults apply to the other fields:
|
|
683
880
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
881
|
+
```json
|
|
882
|
+
{
|
|
883
|
+
"schemaVersion": 1,
|
|
884
|
+
"framework": "react",
|
|
885
|
+
"dsDir": "design-system",
|
|
886
|
+
"assets": { "generatedPaths": ["dist", "dist-showcase", ".vite", ".ds"], "fontBudgetKb": 150 },
|
|
887
|
+
"acceptance": { "scripts": [], "behavior": true, "audit": true },
|
|
888
|
+
"validation": { "scripts": [], "inputs": [] },
|
|
889
|
+
"resources": { "memoryLimitMb": null },
|
|
890
|
+
"cache": { "extractionMaxMiB": 64, "extractionMaxEntries": 8192 },
|
|
891
|
+
"compile": { "outDir": null, "emitOnAccept": true },
|
|
892
|
+
"mcp": { "showcaseTitle": null, "auditPages": 4, "behaviorProfiles": {}, "capture": {} }
|
|
893
|
+
}
|
|
894
|
+
```
|
|
689
895
|
|
|
690
|
-
|
|
|
896
|
+
| Field | Purpose |
|
|
691
897
|
|---|---|
|
|
692
|
-
| `
|
|
693
|
-
| `
|
|
694
|
-
| `
|
|
695
|
-
| `
|
|
696
|
-
| `
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
- `overlay: start | end` takes the cell out of the tracks at that breakpoint: it covers the
|
|
723
|
-
region from that inline edge and the other cells keep their tracks. `overlay: none` returns
|
|
724
|
-
it to its track. Overlays belong to root fluid or hybrid layouts.
|
|
725
|
-
|
|
726
|
-
`@ads-at <breakpoint> { start; span; end; row; row-span; overlay; visible }` changes a cell from
|
|
727
|
-
that breakpoint on. An overlay keeps its row band, so a panel placed in the body row covers the
|
|
728
|
-
body, not the header.
|
|
729
|
-
Placement is checked against the track count at every breakpoint. Outside any region
|
|
730
|
-
container, a `context: container` layout uses its narrowest placement. The starter's `Shell`
|
|
731
|
-
pattern combines hybrid tracks, overlays and a region container for its panels.
|
|
732
|
-
|
|
733
|
-
`layout-overflow` (render audit) resizes each rendered scenario, in every theme and brand, to
|
|
734
|
-
390, 768 and 1280 px. Each finding names the scenario, widths, themes, brands and elements:
|
|
735
|
-
|
|
736
|
-
- The document scrolls horizontally.
|
|
737
|
-
- An element reaches past the viewport's edge; the outermost such element is named.
|
|
738
|
-
- An element with `overflow-x: hidden` or `clip` cuts off content more than 4 px wider.
|
|
739
|
-
|
|
740
|
-
Exempt: `overflow-x: auto` or `scroll` scrollers and their content, except the outermost one as tall as the window, which is the page or a preview frame; `text-overflow: ellipsis`,
|
|
741
|
-
carousels (`aria-roledescription="carousel"`), pannable widgets (`role="application"`), native text fields, fixed-position layers and visually hidden content.
|
|
742
|
-
|
|
743
|
-
Each measurement waits for layout to stop moving, so a component that refits after a resize is
|
|
744
|
-
measured after it refits. Before measuring anything, the audit waits up to 5 s for the page to settle:
|
|
745
|
-
no change in the scenario for 500 ms, no finite animation running, and nothing still loading. Content
|
|
746
|
-
that arrives late, such as syntax colours, is then measured every run. A page that never settles is
|
|
747
|
-
measured anyway and reported as `content-still-changing`.
|
|
748
|
-
|
|
749
|
-
The audit also renders what a scenario shows after someone acts on it, in every theme and brand.
|
|
750
|
-
Findings name the state in the selector, such as `open overlay "Edit": button` or `hover: button`.
|
|
751
|
-
The result's `coverage`, also printed as a `Covered:` line, gives what was measured. What was skipped is
|
|
752
|
-
a `render-audit-skipped` info item per reason, with up to 5 examples. A render that could measure none
|
|
753
|
-
of its targets is a `render-audit-nothing-measured` review item.
|
|
754
|
-
|
|
755
|
-
- **Overlays.** It clicks each distinct control with `aria-haspopup`, up to 3 per render, once per
|
|
756
|
-
theme and brand across the audit. What opens
|
|
757
|
-
(`dialog`, `alertdialog`, `menu`, `listbox` roles, an open `<dialog>` or popover) gets axe, non-text
|
|
758
|
-
contrast, and must fit the 390 px viewport. Give a trigger `aria-haspopup`, or render the overlay
|
|
759
|
-
open in its scenario. Tooltips are not opened.
|
|
760
|
-
- **Hover and focus.** Up to 6 controls per render, in document order, each distinct control once per
|
|
761
|
-
theme and brand on the same surface, measured by the first scenario in request order. Focus skips a
|
|
762
|
-
control a keyboard cannot reach: `aria-hidden` on it or an ancestor, `inert`, or `tabindex="-1"`
|
|
763
|
-
outside a `group`, `tablist`, `menu`, `menubar`, `radiogroup`, `toolbar`, `listbox`, `tree` or `grid` that
|
|
764
|
-
holds a `tabindex="0"`. Under hover it runs axe
|
|
765
|
-
`color-contrast` and the non-text check. A `:focus-visible` outline needs 3:1 against what is around
|
|
766
|
-
it. A focus ring drawn with `box-shadow` is not read, and an outline beside one is left alone.
|
|
767
|
-
- **Busy.** A control with `aria-busy="true"` is checked even when disabled, and its icon even when it
|
|
768
|
-
has text. Render the busy state in the scenario: the audit does not press buttons to reach it.
|
|
769
|
-
|
|
770
|
-
It also renders each component and pattern scenario with its container narrowed to 240 px, inside
|
|
771
|
-
the 1280 px viewport, once per brand, to show what would not fit a side pane. These are
|
|
772
|
-
`layout-overflow-narrow` review items: fix the part if it can sit in a pane, or change a scenario's
|
|
773
|
-
demo frame to a maximum.
|
|
774
|
-
|
|
775
|
-
- An element past the container's edge, or cut off inside it, is reported when it or something in it
|
|
776
|
-
has a set width, `min-width` or unshrinking `flex-basis` above 96 px. A row or table held open only
|
|
777
|
-
by its content, or by parts of 96 px or less, is not reported.
|
|
778
|
-
- Not rendered this way: compositions, scenarios with a `main` landmark, which are pages, and owners
|
|
779
|
-
in `layout.fixedWidthUnits`, which float above the layout.
|
|
780
|
-
- A finding that clears at the 390 px viewport, still in the 240 px container, is left out: it folds
|
|
781
|
-
on a viewport media query, such as a full-width site header.
|
|
782
|
-
|
|
783
|
-
**Web performance.** MCP serves this as `ads://guides/performance`.
|
|
784
|
-
|
|
785
|
-
| Rule | Gate | Fails |
|
|
786
|
-
|---|---|---|
|
|
787
|
-
| `img-attributes` | `ads check` | A raw `<img>` in components, patterns or compositions without `loading`, or without `width` and `height`, a visible `aspect-ratio`, a width and height in its style, or out-of-flow positioning. A `srcset` with width descriptors and no `sizes`, on `<img>` or the project's `Image`. A spread or a class from elsewhere is an `img-attributes-unresolved` info item |
|
|
788
|
-
| `asset-image-budget` | `ads check` | An image in `assets/` over its limit: SVG 100 KB, WebP and AVIF 300 KB, JPEG 400 KB, PNG and GIF 500 KB. `assets.imageBudgetKb` is one limit for every format |
|
|
789
|
-
| `img-shape` | `ads audit` | A visible image whose CSS sizing box differs from its explicit `aspect-ratio`, or, with none and `object-fit: fill`, whose content box differs from its `width` and `height`. Explicit CSS ratios respect `box-sizing`; attribute ratios exclude border and padding. A height attribute beats `aspect-ratio`: add `height: auto`. `object-fit: cover` in a box of its own with no `aspect-ratio` is a deliberate crop |
|
|
790
|
-
| `layout-shift` | `ads audit` | A scenario with Cumulative Layout Shift above 0.1 on first render, where the browser reports it (Chromium) |
|
|
791
|
-
| `themes-generated` | `ads check` | A stale `tokens/fonts.preload.generated.ts` |
|
|
792
|
-
| `font-weight-missing` | `ads check` | CSS uses a weight of a family `tokens/fonts.css` declares and no face covers it. A range such as `100 900`, or a face with no `font-weight`, covers what it spans. A weight in a rule with no `font-family` counts against the body's family |
|
|
793
|
-
| `asset-font-budget` | `ads check` | A font file in `assets/` above 150 KB. `assets.fontBudgetKb` changes the limit |
|
|
794
|
-
|
|
795
|
-
Review items, which fail nothing: `font-file-unused` (a declared face no CSS uses; weights 400 and 700
|
|
796
|
-
count as used, since browsers apply them by default), `font-display` (none, or `optional`, which decides
|
|
797
|
-
per file and can leave some weights in the fallback on one page) and `font-format` (not WOFF2). A
|
|
798
|
-
project with no `@font-face` gets none of these.
|
|
799
|
-
|
|
800
|
-
The starters' `Image` lazily loads and reserves space; `priority` marks the view's main visible
|
|
801
|
-
image. When body or heading text uses a font from `tokens/fonts.css`, `ads assets` writes
|
|
802
|
-
`tokens/fonts.preload.generated.ts`, and the generated public barrel re-exports it: call
|
|
803
|
-
`preloadFonts()` from the public entry in the app entry before the first render. It imports the files through the bundler, Vite or Bun, so the preload and the stylesheet share
|
|
804
|
-
one URL. For a preload earlier than JavaScript, a build step or prerender can call `fontPreloadTags()`
|
|
805
|
-
for `<link>` tags or `fontPreloadHeader()` for a `Link` header value; `fontPreloads` is the same list.
|
|
806
|
-
A project that sets heading fonts per component names what to preload in `assets.preloadFonts`:
|
|
807
|
-
`[{ "family": "Body", "weight": 400 }, { "family": "Heading", "weight": 700 }]`. That list replaces the
|
|
808
|
-
reading of `base.css`, and an entry `tokens/fonts.css` cannot satisfy is a `font-preload-config` error.
|
|
809
|
-
ADS does not cover page metadata, `noindex`, sitemaps or hosting; run Lighthouse on a production
|
|
810
|
-
build with real URLs.
|
|
811
|
-
|
|
812
|
-
**Themes and brands.** Themed tokens are per-theme halves (`--x-light`, `--x-dark`) on
|
|
813
|
-
`:root`; brands set their own halves on `[data-brand]`. `ads assets` generates
|
|
814
|
-
`themes.generated.css` and `.ts`. Missing or conflicting halves, empty themes or brands,
|
|
815
|
-
stale generated files, `light-dark()` and `[data-theme]`/`[data-brand]` ancestor selectors
|
|
816
|
-
in components are errors; see [Tokens, grid, icons and accessibility](#tokens-grid-icons-and-accessibility).
|
|
817
|
-
|
|
818
|
-
**Tokens.** Ownership, naming, the 2 px spacing rhythm (`token-rhythm`), missing names and
|
|
819
|
-
scenario references are errors; equal values in different roles are a
|
|
820
|
-
`token-overlap-review` item.
|
|
821
|
-
|
|
822
|
-
**Architecture.** Data, UX and Skin ownership, project structure, unit and paint contracts,
|
|
823
|
-
and binding and variable ownership are errors; Linaria atomic composition risks are
|
|
824
|
-
`atomic-composition-review` items. See [Generic architecture guards](#generic-architecture-guards).
|
|
825
|
-
|
|
826
|
-
**Behavior.** A registered guarantee needs current passing execution evidence. `ads verify`
|
|
827
|
-
runs the registered checks against current source (`--unit` and `--check` select);
|
|
828
|
-
`ads validate` runs every one its change set reaches, draft acceptance the draft
|
|
829
|
-
owners' own ones unless `acceptance.behavior` is `false`.
|
|
898
|
+
| `framework` | The UI framework that the design system is written for and that previews mount with (`react` or `preact`), optionally pinned as `react@<version>` |
|
|
899
|
+
| `dsDir` | The design-system folder |
|
|
900
|
+
| `assets.generatedPaths` | Project-relative folders that hold generated output, never source. They are not analysis inputs, and an import from one is a `source-unavailable` error |
|
|
901
|
+
| `assets.fontBudgetKb` | The largest font file that a `font()` declaration may list, in KiB rounded up (default 150). Above it: `font-budget` |
|
|
902
|
+
| `acceptance` | Draft acceptance: extra project scripts, and whether the owners' behavior tests and render audit run |
|
|
903
|
+
| `validation` | `ads validate`: scripts run after `acceptance.scripts`, and extra project files that count as validation inputs |
|
|
904
|
+
| `resources.memoryLimitMb` | An optional memory budget for ADS's managed processes |
|
|
905
|
+
| `cache` | Bounds of the persisted extraction cache ([Cache bounds](#cache-bounds)) |
|
|
906
|
+
| `compile` | The emitted output folder, and emit after acceptance ([Emitting the design system](#emitting-the-design-system)) |
|
|
907
|
+
| `mcp` | Showcase title, check and preview timeouts, audit concurrency, behavior profiles, capture browser and result retention |
|
|
908
|
+
|
|
909
|
+
An unknown field, at the top level or in a section, fails to load; ADS does not
|
|
910
|
+
silently weaken checks. Paths stay within the receiving project. A subfolder
|
|
911
|
+
with its own `ds.config.json` is a separate project: check, validation, audits,
|
|
912
|
+
previews and watches stop there and run in it on their own.
|
|
913
|
+
|
|
914
|
+
ADS reads only the design-system project: the `dsDir` tree, `ds.config.json`,
|
|
915
|
+
package manifests and lockfiles with their dependency-resolution configuration,
|
|
916
|
+
the TypeScript configuration chain, the entry files of configured package
|
|
917
|
+
scripts and their imports, notices and `validation.inputs`. ADS does not read or
|
|
918
|
+
check application source, public directories, the root `index.html` or tests
|
|
919
|
+
outside `dsDir`. An edit to them never makes validation, preview or acceptance
|
|
920
|
+
evidence stale. A policy about how the application uses the design system
|
|
921
|
+
belongs to the application's own tooling.
|
|
922
|
+
|
|
923
|
+
### Cache bounds
|
|
924
|
+
|
|
925
|
+
`cache` bounds ADS's persisted extraction cache in `.ds/cache/extraction/`
|
|
926
|
+
(see [the caching guide](CACHING.md#persisted-extraction-cache)).
|
|
927
|
+
Both fields are optional:
|
|
830
928
|
|
|
831
|
-
|
|
929
|
+
```json
|
|
930
|
+
{ "cache": { "extractionMaxMiB": 64, "extractionMaxEntries": 8192 } }
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
| Field | Default | Range | Bounds |
|
|
934
|
+
| --- | --- | --- | --- |
|
|
935
|
+
| `extractionMaxMiB` | 64 | integer 1–65536 | Disk space of all entries, in MiB |
|
|
936
|
+
| `extractionMaxEntries` | 8192 | integer 128–1000000 | Number of entries |
|
|
937
|
+
|
|
938
|
+
The bound limits disk space only. A lookup costs the same at any size, and
|
|
939
|
+
pruning runs when ADS is idle or about to exit, not during a check. A smaller
|
|
940
|
+
cap extracts more again after restarts. Values outside the ranges fail to load.
|
|
941
|
+
`ADS_CACHE=off` disables the disk layer whatever the bound.
|
|
942
|
+
|
|
943
|
+
### Design system source
|
|
944
|
+
|
|
945
|
+
A design system authors recipe owners (`@reqvire-org/ads/recipe`), role token
|
|
946
|
+
sheets (`tokens/**/*.ads.css`), profiles (`profiles/**/*.ads.ts`), asset
|
|
947
|
+
declarations beside their drawings (`assets/<group>/*.ads.ts` and `*.svg`) and
|
|
948
|
+
`foundation.ads.ts`. The public barrel `index.ts` is written by hand and names
|
|
949
|
+
each public owner (`export *` is rejected). The installed `@reqvire-org/ads`
|
|
950
|
+
package types the macro imports. An `env.d.ts` at the design-system root is
|
|
951
|
+
included when present, but is not required. Source in any other form fails.
|
|
952
|
+
|
|
953
|
+
This section describes what `ads check` enforces, by area. `ads check`, MCP
|
|
954
|
+
checks, previews, emission and draft acceptance use the same findings.
|
|
955
|
+
[The contract](ADS.md#checks) lists the rules of each area,
|
|
956
|
+
[the rule reference](RULES.md) gives the statement and repair of every rule, and
|
|
957
|
+
[the authoring language](LANGUAGE.md) describes the constructs.
|
|
958
|
+
|
|
959
|
+
#### Structure, themes and brands
|
|
960
|
+
|
|
961
|
+
- `project-structure`: `dsDir`, `index.ts` and `foundation.ads.ts` are required.
|
|
962
|
+
- `import-leaves-design-system`: an import leaves the design-system folder.
|
|
963
|
+
- `source-unavailable`: an import names a file that is not an analysis input,
|
|
964
|
+
such as a folder in `assets.generatedPaths` or the emitted output.
|
|
965
|
+
- `source/framework-mismatch` (`owner-analysis`, at the import): a React package
|
|
966
|
+
(`react`, `react-dom`, their subpaths, type imports included) in a Preact
|
|
967
|
+
project, or a Preact package (`preact`, `@preact/*`) in a React project.
|
|
968
|
+
|
|
969
|
+
ADS reads the themes and brands from `foundation({ ..., themes, brands })`, in
|
|
970
|
+
declared order. The first theme and brand are the defaults: the `:root` values
|
|
971
|
+
of the token sheets. The render audit, capture, the showcase and `ads_status`
|
|
972
|
+
read the same declaration. Two optional fields are `true` or omitted:
|
|
973
|
+
|
|
974
|
+
- `followSystemTheme: true`: a root without `data-theme` follows the OS colour
|
|
975
|
+
scheme. It takes the first light-scheme theme for a light preference and the
|
|
976
|
+
first dark-scheme theme for a dark one, so the design system needs one of
|
|
977
|
+
each. An explicit `data-theme` always wins, and brands keep their own values.
|
|
978
|
+
Emission copies the token rules of each such theme for
|
|
979
|
+
`:root:not([data-theme])` under `@media (prefers-color-scheme: …)`, directly
|
|
980
|
+
after the original, so they cascade as the attribute does.
|
|
981
|
+
- `sections: true`: `data-theme` or `data-brand` on any element switches its
|
|
982
|
+
subtree ([Colours that depend on their surroundings](#colours-that-depend-on-their-surroundings)).
|
|
983
|
+
Without it, only the attributes of `<html>` select a context.
|
|
984
|
+
|
|
985
|
+
An invalid list or field is an `owner-analysis` finding at the field
|
|
986
|
+
(`contexts/list-invalid`). A theme or brand that a token sheet or asset variant
|
|
987
|
+
names without a declaration is one finding per reference
|
|
988
|
+
(`contexts/theme-undeclared`, `contexts/brand-undeclared`). A declared
|
|
989
|
+
non-default theme or brand that nothing defines is an error at its entry
|
|
990
|
+
(`theme-undefined`, `brand-undefined`).
|
|
991
|
+
|
|
992
|
+
#### Owner analysis
|
|
993
|
+
|
|
994
|
+
Owner analysis reads the design inputs and discovers every owner that the barrel
|
|
995
|
+
reaches. It type-checks the owners with the scenarios and the fixtures they
|
|
996
|
+
import. It then analyzes, lowers and compiles every reachable construction, and
|
|
997
|
+
resolves each owner's token CSS. Each failure is a blocking `owner-analysis`
|
|
998
|
+
finding with a `code` that names the exact error (`<domain>/<kind>`, for example
|
|
999
|
+
`spec/value-invalid` or `token-css/token-missing`), its `group`, a `repair` hint
|
|
1000
|
+
and a position.
|
|
1001
|
+
|
|
1002
|
+
- ADS analyzes every owner. One check thus reports the first source failure of
|
|
1003
|
+
each failing owner (in discovery order), every TypeScript diagnostic, each
|
|
1004
|
+
failing helper module, the first compile failure of the analyzed owners and
|
|
1005
|
+
every token CSS failure.
|
|
1006
|
+
- Invalid design inputs, owner discovery failures (a cycle, `export *`) and
|
|
1007
|
+
import-graph failures stop analysis of the revision.
|
|
1008
|
+
- An owner whose grid aligns the rows of a failed owner (`alignRows`) cannot be
|
|
1009
|
+
analyzed until that owner is fixed. ADS reports it as a nonblocking
|
|
1010
|
+
`owner-analysis-blocked` info advisory at the aligned component, with the
|
|
1011
|
+
failed owner in `blockedBy`, never as an error that repeats the cause. After
|
|
1012
|
+
the fix, the blocked owner reports its own problems.
|
|
1013
|
+
- What analysis cannot prove is a nonblocking `owner-analysis-review` item with
|
|
1014
|
+
a `review/<kind>` code: a scroll container that nothing focuses, a summary
|
|
1015
|
+
without its marker or artwork, truncated or clamped text without a `title`.
|
|
1016
|
+
|
|
1017
|
+
Three codes concern profile and recipe declarations:
|
|
1018
|
+
|
|
1019
|
+
- `foundation/profile-field-unknown`, at the field: a profile field that its
|
|
1020
|
+
kind does not have (a misspelt composite slot such as `frameProfle`, a text
|
|
1021
|
+
field on a spacing profile, an unknown field in a choice option or spatial
|
|
1022
|
+
clause). The vocabulary is the kind's token and policy fields and the
|
|
1023
|
+
composite slots.
|
|
1024
|
+
- `foundation/profile-argument-default`, at the selection: a slot reference
|
|
1025
|
+
selects the default option of the referenced profile.
|
|
1026
|
+
- `source/recipe-redundant`, at the declaration: a recipe restates what its
|
|
1027
|
+
selected profile supplies. This is a default choice selection, a binding equal
|
|
1028
|
+
to its composite slot (by name, an equivalent alias, `{ slot: "text" }` on a
|
|
1029
|
+
text part, a binding recipe's `visual`, a paint transition's `motion`), the
|
|
1030
|
+
default content gap, or a `when` state that selects the base surface. It is
|
|
1031
|
+
redundant only when it is redundant in every reachable choice. A state surface
|
|
1032
|
+
may overlay part of its base (a colour-only error state).
|
|
1033
|
+
|
|
1034
|
+
#### Tokens
|
|
1035
|
+
|
|
1036
|
+
Shared values obey three contracts: the value shape of each role, the roles that
|
|
1037
|
+
each profile field reads, and the permitted token derivations
|
|
1038
|
+
([token roles](TOKEN-ROLES.md)). ADS checks the tokens in every context that the
|
|
1039
|
+
sheets declare: the base, each theme, each brand, each brand under each theme,
|
|
1040
|
+
and the overrides of each `@media`/`@supports` condition. It first resolves
|
|
1041
|
+
`var()` references through the values of that context. Each finding is at the
|
|
1042
|
+
declaration, unless stated.
|
|
1043
|
+
|
|
1044
|
+
- `token-role-duplicate` (error): a token has one role, the file name of its
|
|
1045
|
+
sheet. Its `:root` default and every theme or brand override are in that
|
|
1046
|
+
sheet.
|
|
1047
|
+
- `token-selector-invalid` (error): token rules are `:root`,
|
|
1048
|
+
`:root[data-theme="…"]`, `:root[data-brand="…"]` or both, directly or inside
|
|
1049
|
+
`@media`, `@supports` or `@layer`. Another selector (`.card`, a selector list,
|
|
1050
|
+
`[data-theme]` without `:root`) or at-rule (`@container`) forms no context. An
|
|
1051
|
+
override of a token with no `:root` default is allowed; each reference to such
|
|
1052
|
+
a token needs a `var()` fallback (`token-css/token-missing`).
|
|
1053
|
+
- `review/context-section-inactive` (review): without `sections: true`, a
|
|
1054
|
+
`data-theme` or `data-brand` attribute on design-system markup switches
|
|
1055
|
+
nothing.
|
|
1056
|
+
- `token-sheet-property` (error): a token sheet declares custom properties only.
|
|
1057
|
+
An ordinary property (`:root { color: red }`) is not read as a token.
|
|
1058
|
+
- `token-type` (error): every token is a value of the shape of its role
|
|
1059
|
+
(`paint` a colour, `spacing` a nonnegative length, `duration` a nonnegative
|
|
1060
|
+
time, `easing` a timing function). A `calc()` that mixes units is accepted
|
|
1061
|
+
where the role has no sign or range bound.
|
|
1062
|
+
- `token-type-unresolved` (review, never a silent pass): a mixed-unit `calc()`
|
|
1063
|
+
where the role has a bound, or a value ADS cannot read statically (an unknown
|
|
1064
|
+
function, `currentColor`, an undefined reference).
|
|
1065
|
+
- `token-provenance` (error): a forbidden authored edge or composite position,
|
|
1066
|
+
including in unused tokens and fallbacks. Repair the named reference with a
|
|
1067
|
+
permitted role or shared literal
|
|
1068
|
+
([provenance](TOKEN-ROLES.md#provenance-and-permitted-derivation)).
|
|
1069
|
+
- `token-overlap-review` (review, at the second token): tokens of one role that
|
|
1070
|
+
are identical in every context are possibly one decision named twice. Pure
|
|
1071
|
+
aliases (`var(--space-lg)` in every context) are not compared.
|
|
1072
|
+
- `a11y-text-resize` (error): a `font-size` token, and a `line-height` token
|
|
1073
|
+
that is a length, resolves to `rem` or `em` (or a `calc()`, `min()`, `max()`
|
|
1074
|
+
or `clamp()` that contains them) in every context (WCAG 2.2 1.4.4). A px line
|
|
1075
|
+
height stays fixed while resized text grows, so lines overlap; a unitless
|
|
1076
|
+
multiplier already scales. See also
|
|
1077
|
+
[Text scaling in the application](#text-scaling-in-the-application).
|
|
1078
|
+
|
|
1079
|
+
**Spatial profiles.**
|
|
1080
|
+
|
|
1081
|
+
- `spatial-profile-invalid` (error, at the profile's declaration): every
|
|
1082
|
+
declared spatial profile, selected or not, reads through the grid algebra
|
|
1083
|
+
(units, scale, ratios, maximum width, breakpoints, margins and gutters), as
|
|
1084
|
+
grid lowering and the preview facts read it, in the base context and in every
|
|
1085
|
+
context that defines a reached token differently. Profiles that compose one
|
|
1086
|
+
definition (`with: ["page-grid"]`) and have the same failure give one finding,
|
|
1087
|
+
at the profile that declares the units. An owner that selects a broken profile
|
|
1088
|
+
also reports its own failure at the construction.
|
|
1089
|
+
- `spatial-context-unsupported` (error, at the profile's declaration): a
|
|
1090
|
+
breakpoint width, column count or named condition bound is compiled into media
|
|
1091
|
+
queries and track lists, so no context can give its token another value.
|
|
1092
|
+
Margins, gutters, the maximum width and fixed tracks are read live and can
|
|
1093
|
+
differ by context, if every grid still holds there
|
|
1094
|
+
(`construction/grid-context-invalid`, at the grid construction).
|
|
1095
|
+
|
|
1096
|
+
#### Contrast
|
|
1097
|
+
|
|
1098
|
+
Each text pair belongs to one of three checks. The minimum is 4.5:1 (WCAG 2.2
|
|
1099
|
+
1.4.3), or 3:1 where the text is provably large: its text profile, own or
|
|
1100
|
+
inherited, resolves to at least 24px, or 18.66px at weight 700, in that context.
|
|
1101
|
+
Inactive elements and states (`:disabled`, `[aria-disabled="true"]`, not a state
|
|
1102
|
+
only excluded with `:not()`) have no minimum. The same is true for placeholder
|
|
1103
|
+
contrast.
|
|
1104
|
+
|
|
1105
|
+
The minimum follows what the colour paints:
|
|
1106
|
+
|
|
1107
|
+
| The colour paints | Minimum | How ADS knows |
|
|
1108
|
+
| --- | --- | --- |
|
|
1109
|
+
| Text | 4.5:1 | the default |
|
|
1110
|
+
| Large text | 3:1 | the element's text profile resolves to 24px, or 18.66px at weight 700 |
|
|
1111
|
+
| Artwork that carries meaning | 3:1 (WCAG 1.4.11) | a visual part, or a control that renders no text |
|
|
1112
|
+
| Decorative artwork | none | a visual part whose element is `aria-hidden` |
|
|
1113
|
+
|
|
1114
|
+
**`surface-contrast`** (error, at the profile's declaration): a surface profile
|
|
1115
|
+
that sets both `color` and `background` reaches 4.5:1 in every context. Its
|
|
1116
|
+
`background-image` gradient stops count as backgrounds. A profile does not state
|
|
1117
|
+
what its colour paints, so 4.5:1 is its default; a pair below it is accepted
|
|
1118
|
+
when it is enough for every place the design system uses the profile (the
|
|
1119
|
+
table above). A quiet icon colour at 3:1 is its own surface profile, selected
|
|
1120
|
+
only by visual parts or text-less controls. These keep 4.5:1: a profile
|
|
1121
|
+
nothing uses, one a composite slot supplies, the document surface, and one the
|
|
1122
|
+
recipe also names for a pseudo-element, a prose element, a backdrop or an
|
|
1123
|
+
entrance. Nothing is released while an owner fails, because its uses are not
|
|
1124
|
+
known.
|
|
1125
|
+
|
|
1126
|
+
- A partly transparent background, an `opacity` below 1 or an image that is not
|
|
1127
|
+
a gradient of known colours is a `surface-contrast-unresolved` review item.
|
|
1128
|
+
- A fully transparent background (a ghost button's `transparent`) is the note
|
|
1129
|
+
`surface-contrast-placed` (info): the profile paints nothing, so its text
|
|
1130
|
+
contrast is decided where it is placed, by the cross-owner check and, for
|
|
1131
|
+
what scenarios show, the render audit.
|
|
1132
|
+
- A surface that paints a disabled control declares `state: "inactive"` among
|
|
1133
|
+
its fields and is not checked. A construction can select it only under an
|
|
1134
|
+
inactive owner state; anywhere else is `construction/inactive-surface-active`.
|
|
1135
|
+
|
|
1136
|
+
**State contrast** (owner analysis): an owner's `when` states pair the colour of
|
|
1137
|
+
one profile with the background of another, such as a colour-only error state
|
|
1138
|
+
over the base fill, or a hover fill under the base colour. Two states that
|
|
1139
|
+
cannot hold on one root together are not paired: two values of one attribute
|
|
1140
|
+
(`[aria-pressed="false"]:hover` and `[aria-pressed="true"]`), a state and its
|
|
1141
|
+
`:not()`, `:disabled` and `:enabled`.
|
|
1142
|
+
`construction/state-contrast-insufficient` blocks the owner;
|
|
1143
|
+
`review/state-contrast-unresolved` is a review item.
|
|
1144
|
+
|
|
1145
|
+
**`component-contrast`** (error, at the surface that chose the colour of the
|
|
1146
|
+
text): text meets the minimum against the backdrop it is rendered on, across
|
|
1147
|
+
elements and owners, without declared pairs.
|
|
1148
|
+
[The contract](ADS.md#composed-text-contrast) defines the rule and its
|
|
1149
|
+
unresolved cases, and [the architecture](ARCHITECTURE.md#composed-contrast)
|
|
1150
|
+
explains the join.
|
|
1151
|
+
|
|
1152
|
+
- ADS follows each text position outward through the elements of its owner, into
|
|
1153
|
+
the slot of every component it is passed to and back out, and up through every
|
|
1154
|
+
placement of its owner. The colour is the nearest one that a surface sets. The
|
|
1155
|
+
backdrop is the nearest opaque background, with translucent backgrounds and
|
|
1156
|
+
gradients of known colours composited over it.
|
|
1157
|
+
- Text sizes inherit across owners: an owner without a text profile takes its
|
|
1158
|
+
renderer's, else the document's. A placement's literal props select the
|
|
1159
|
+
choices of the child that it renders. Hidden elements and absent text
|
|
1160
|
+
(`{null}`, an empty or missing prop) add nothing.
|
|
1161
|
+
- Applications also place a component that the public barrel exports, on the
|
|
1162
|
+
document surface that `foundation({ surface })` declares. ADS thus checks its
|
|
1163
|
+
text there also. An application's own coloured container is outside this
|
|
1164
|
+
check.
|
|
1165
|
+
- An element that renders `data-theme` or `data-brand` is painted with the
|
|
1166
|
+
document surface. With `sections: true`, its subtree is checked in the named
|
|
1167
|
+
context only; without sections, in the page's contexts.
|
|
1168
|
+
- The finding lists the pair's `tokens`, every failing context that differs from
|
|
1169
|
+
the one it extends (`contexts`: theme, brand, condition, ratio, minimum) and,
|
|
1170
|
+
in `related`, the backdrop, the placements and the slots between them.
|
|
1171
|
+
- What ADS cannot prove is a `component-contrast-unresolved` review item at the
|
|
1172
|
+
placement or element, never a pass. Examples are a wrapper component that ADS
|
|
1173
|
+
does not analyze, a same-file component that does not render its `children`, a
|
|
1174
|
+
component placed by a plain module, a user-agent colour, an out-of-flow
|
|
1175
|
+
element without its own backdrop, `opacity` below 1, an unknown image, with
|
|
1176
|
+
sections a `data-theme`/`data-brand` that ADS cannot name, an expression that
|
|
1177
|
+
may be text, and markup rendered outside the markup of its component.
|
|
1178
|
+
|
|
1179
|
+
#### Accessibility in owners
|
|
1180
|
+
|
|
1181
|
+
ADS checks owners and their constructions against WCAG 2.2 AA. Each finding is
|
|
1182
|
+
an owner-analysis finding with its fine-grained code, reported under its
|
|
1183
|
+
`a11y-*` rule.
|
|
1184
|
+
|
|
1185
|
+
- `a11y-focus` (error, at the focus profile; WCAG 2.4.7, 1.4.11): the `width` of
|
|
1186
|
+
every focus profile is at least 2 CSS px in every context, and the document's
|
|
1187
|
+
default indicator has 3:1 against the background of the document surface. What
|
|
1188
|
+
cannot be evaluated is `a11y-focus-unresolved` (review).
|
|
1189
|
+
- `a11y-target-size` (error): every control construction and every
|
|
1190
|
+
`frame: "control"` part is at least 24 × 24 CSS px in every context, its hit
|
|
1191
|
+
area included (`construction/target-size-below-minimum`, naming the element,
|
|
1192
|
+
its size, the context and the deficit).
|
|
1193
|
+
- ADS computes the size from the lowered box, with relative lengths at the
|
|
1194
|
+
16px reference root: min block = max(`min-block-size`, content + 2 × (inset +
|
|
1195
|
+
border)); inline = max(the frame's `min-inline-size`, 2 × (`padding-inline` +
|
|
1196
|
+
border) + content).
|
|
1197
|
+
- Neighbouring hit areas in a stack or inline arrangement must not overlap
|
|
1198
|
+
across their gap (`construction/target-area-overlap`).
|
|
1199
|
+
- A value that ADS cannot evaluate, or an inline extent that reaches 24px only
|
|
1200
|
+
with the width of its label (text is data), is `a11y-target-size-unresolved`
|
|
1201
|
+
(review).
|
|
1202
|
+
- A frame's `min-target-inline-size` / `min-target-block-size` (role
|
|
1203
|
+
`target-min-size`) lower to a hit area that the element owns: a centred,
|
|
1204
|
+
absolutely positioned `::after` that takes no layout space. A top-layer root
|
|
1205
|
+
cannot have one.
|
|
1206
|
+
- `a11y-icon-label` (error, at the control's element): in every reachable choice
|
|
1207
|
+
where a control renders no text part, its root has a non-empty `aria-label`,
|
|
1208
|
+
`aria-labelledby` or `title` (`source/control-name-missing`). Conditions are
|
|
1209
|
+
evaluated in the choice. Application text (a label prop) counts as a name, as
|
|
1210
|
+
it counts as content in a text part.
|
|
1211
|
+
- `source/pressed-state-mismatch` (`owner-analysis` error, at the choice's
|
|
1212
|
+
binding recipe; WCAG 4.1.2): a toggle's `aria-pressed` agrees with its
|
|
1213
|
+
drawing. In every reachable choice where the root of a construction sets
|
|
1214
|
+
`aria-pressed` and its artwork declares a `selected` state, a pressed choice
|
|
1215
|
+
draws `selected` and an unpressed one another state. An `aria-pressed` whose
|
|
1216
|
+
type is not finite (`any`, for example) is a `review/pressed-state-unresolved`
|
|
1217
|
+
item.
|
|
1218
|
+
- `a11y-image-alt` (error, at the image): every `<img>` that an owner renders
|
|
1219
|
+
has `alt`: artwork (`source/intrinsic-alt-missing`), content media and any
|
|
1220
|
+
other image (`source/image-alt-missing`). `alt=""` marks a decorative one.
|
|
1221
|
+
- `a11y-keyboard` (review, at the element): `onClick` on a non-interactive
|
|
1222
|
+
element (div, span, li, img, …) without a role and `tabIndex`
|
|
1223
|
+
(`review/click-without-keyboard`). Composite-widget items (option, tab,
|
|
1224
|
+
menuitem, row, gridcell, …) and backdrops whose handler reads `currentTarget`
|
|
1225
|
+
are exempt.
|
|
1226
|
+
- `a11y-non-text-contrast` (error): the check applies where a construction knows
|
|
1227
|
+
the surface that a control part sits on (an enclosing element that paints an
|
|
1228
|
+
opaque background). A control part is a `frame: "control"` part, or
|
|
1229
|
+
`frame: { kind: "control", rules }` with one-sided rules such as a soft
|
|
1230
|
+
field's underline.
|
|
1231
|
+
- The border colour of the part (base and each owner state) reaches 3:1, when
|
|
1232
|
+
the part's own background does not bound it at 3:1.
|
|
1233
|
+
- The focus outline colour reaches 3:1, on the enclosing background outside
|
|
1234
|
+
the box and on the part's own background inside it.
|
|
1235
|
+
- The error is `construction/non-text-contrast-insufficient`. Unprovable pairs
|
|
1236
|
+
are `review/non-text-contrast-unresolved`.
|
|
1237
|
+
- A part can carry a human-approved `accessibility` declaration. It turns the
|
|
1238
|
+
border error into the review item `review/boundary-identified-otherwise` and
|
|
1239
|
+
needs a person's approval at acceptance (see the accessibility reference of
|
|
1240
|
+
the skill).
|
|
1241
|
+
- A control's artwork paints with its text colour, which `surface-contrast`
|
|
1242
|
+
holds to 4.5:1, or to 3:1 where the control renders no text. The surroundings of a control root are its parent's
|
|
1243
|
+
composition, which the render audit measures.
|
|
1244
|
+
|
|
1245
|
+
#### Assets, fonts and the application icon
|
|
1246
|
+
|
|
1247
|
+
**Assets** ([assets](ASSETS.md#icons-and-glyph-sets)).
|
|
1248
|
+
|
|
1249
|
+
- Asset names, asset aliases and glyph-set names are one namespace
|
|
1250
|
+
(`assets/name-duplicate`, at the repeated field). An alias resolves to its
|
|
1251
|
+
asset wherever an asset name is accepted.
|
|
1252
|
+
- The members of a glyph set are declared, distinct foreground assets on one
|
|
1253
|
+
grid, and its aliases name members (`assets/set-*`, at the member or alias).
|
|
1254
|
+
- An owner that takes an icon takes a glyph reference
|
|
1255
|
+
(`Glyph<"close" | "search">`, made with `glyph()`). An icon chosen from data
|
|
1256
|
+
is looked up in a declared glyph set by a name typed as the names of the set.
|
|
1257
|
+
The constructions do not depend on the glyph (`source/glyph-*` codes).
|
|
1258
|
+
- `asset-unused` (error, at the name in the declaration): an asset that no owner
|
|
1259
|
+
binds, no bound set lists and no `glyph()` references, or a glyph set that no
|
|
1260
|
+
owner binds. ADS reports it only after every owner is analyzed.
|
|
1261
|
+
|
|
1262
|
+
**Fonts.** Declare a font family once, with `font()`, in an `assets/**/*.ads.ts`
|
|
1263
|
+
file beside its files. Keep its licence there also:
|
|
1264
|
+
|
|
1265
|
+
```ts
|
|
1266
|
+
import { font } from "@reqvire-org/ads/font" with { type: "macro" };
|
|
1267
|
+
|
|
1268
|
+
export default font({
|
|
1269
|
+
family: "Inter", // the CSS family name, unique in the design system
|
|
1270
|
+
title: "Inter",
|
|
1271
|
+
description: "UI text face",
|
|
1272
|
+
license: "SIL OFL 1.1 (assets/fonts/inter/OFL.txt)",
|
|
1273
|
+
display: "swap", // swap | fallback | optional | block
|
|
1274
|
+
faces: [
|
|
1275
|
+
{ source: "./Inter-Variable.woff2", weight: [100, 900] },
|
|
1276
|
+
{ source: "./Inter-Italic.woff2", weight: [100, 900], style: "italic" },
|
|
1277
|
+
],
|
|
1278
|
+
preload: [{ weight: 600 }], // optional: faces to preload beyond the document text's
|
|
1279
|
+
fallback: "Arial", // optional: the system font drawn while Inter loads, matched to it
|
|
1280
|
+
});
|
|
1281
|
+
```
|
|
1282
|
+
|
|
1283
|
+
A font is used where a font-family role token names it first
|
|
1284
|
+
(`--font-ui: "Inter", system-ui, sans-serif`), in any theme, brand or condition.
|
|
1285
|
+
The example design system keeps system fonts. A face's file is a design input. A missing file,
|
|
1286
|
+
a source outside the declaration's folder, a file whose bytes are not its
|
|
1287
|
+
format, a repeated family (`fonts/family-duplicate`) or overlapping faces reject
|
|
1288
|
+
the declaration.
|
|
1289
|
+
|
|
1290
|
+
- `font-weight-missing` (error, at the profile): a text profile draws a declared
|
|
1291
|
+
font at a weight that no upright face covers. The weight is its font-weight
|
|
1292
|
+
token in some context; the document text profile without one draws at 400.
|
|
1293
|
+
- `font-budget` (error): a file is above `assets.fontBudgetKb`.
|
|
1294
|
+
- `font-unused` (review): a family that no font-family token names first, or a
|
|
1295
|
+
face of a used family that no profile selects. The 400, 700 and italic faces
|
|
1296
|
+
count as used, because browsers draw plain, bold and emphasized text with
|
|
1297
|
+
them.
|
|
1298
|
+
- `font-format` (review): a file is not WOFF2.
|
|
1299
|
+
- `font-display` (review): display `block` (invisible text while loading) or
|
|
1300
|
+
`optional` (one page can mix the face and the fallback).
|
|
1301
|
+
- `font-fallback` (error, at the token): the family declares a `fallback`, and a
|
|
1302
|
+
font-family token names the family first without `"<family> Fallback"` right
|
|
1303
|
+
after it.
|
|
1304
|
+
|
|
1305
|
+
**A fallback that does not move the page.** With `display: "swap"`, text is
|
|
1306
|
+
drawn in a system font until the family loads. The two fonts have different
|
|
1307
|
+
widths and line heights, so lines rewrap and the page moves when the family
|
|
1308
|
+
arrives. `fallback` makes ADS read each face file's own measurements and emit a
|
|
1309
|
+
second face, `"<family> Fallback"`, which is the system font sized and spaced
|
|
1310
|
+
like the family. For Karla Regular with `fallback: "Arial"` it emits:
|
|
1311
|
+
|
|
1312
|
+
```css
|
|
1313
|
+
@font-face {
|
|
1314
|
+
font-family: "Karla Fallback";
|
|
1315
|
+
src: local("Arial");
|
|
1316
|
+
font-weight: 400;
|
|
1317
|
+
font-style: normal;
|
|
1318
|
+
size-adjust: 102.29%; /* Karla's average width over Arial's */
|
|
1319
|
+
ascent-override: 89.64%; /* Karla's own line metrics */
|
|
1320
|
+
descent-override: 24.63%;
|
|
1321
|
+
line-gap-override: 0%;
|
|
1322
|
+
}
|
|
1323
|
+
```
|
|
1324
|
+
|
|
1325
|
+
Name it right after the family in the font-family token:
|
|
1326
|
+
`--font-ui: "Inter", "Inter Fallback", system-ui, sans-serif`. There is one
|
|
1327
|
+
fallback face per declared face, for the same weights and style; a face from
|
|
1328
|
+
weight 600 falls back to the system font's bold, an italic face to its italic.
|
|
1329
|
+
|
|
1330
|
+
- `fallback` is `"Arial"`, `"Times New Roman"` or `"Courier New"`: fonts every
|
|
1331
|
+
desktop platform has or substitutes, whose widths ADS knows. Choose the one
|
|
1332
|
+
nearest the family: sans-serif, serif or monospaced.
|
|
1333
|
+
- For another system font, state the size yourself:
|
|
1334
|
+
`fallback: { font: "Georgia", sizeAdjust: 104 }` (a percentage; ADS still
|
|
1335
|
+
takes the line metrics from the family's files).
|
|
1336
|
+
- The width is the average over English prose (letters, spaces, capitals and
|
|
1337
|
+
punctuation by their frequency), so text in the two fonts differs by a
|
|
1338
|
+
fraction of a percent in ordinary copy and more in unusual text such as
|
|
1339
|
+
all-capital headings. A face without those characters needs the stated form. A file ADS cannot measure (a font collection, a damaged file)
|
|
1340
|
+
rejects the declaration.
|
|
1341
|
+
- Where the system font is absent, the browser skips the fallback face and uses
|
|
1342
|
+
the next family in the token, as without a fallback.
|
|
1343
|
+
|
|
1344
|
+
**Application icon.** `foundation({ appIcon })` names a declared asset as the
|
|
1345
|
+
icon that browsers, launchers and app stores show
|
|
1346
|
+
([the icon role](ASSETS.md#the-application-icon-a-role-not-a-kind)). `ads emit`
|
|
1347
|
+
renders it ([The output folder](#the-output-folder)). Its drawings count as used
|
|
1348
|
+
(no `asset-unused`).
|
|
1349
|
+
|
|
1350
|
+
```ts
|
|
1351
|
+
export default foundation({
|
|
1352
|
+
// …tokens, profiles, themes…
|
|
1353
|
+
appIcon: {
|
|
1354
|
+
asset: "app-icon", // a declared asset() name or alias
|
|
1355
|
+
background: "--brand-surface", // optional: a paint-role token behind padded renders
|
|
1356
|
+
maskable: { padding: 0.1 }, // optional: or { asset: "app-icon-maskable" }
|
|
1357
|
+
exports: [ // optional: further images, inside the output folder
|
|
1358
|
+
{ file: "icons/128x128.png", size: 128 },
|
|
1359
|
+
{ file: "social/banner.png", asset: "banner", width: 1200, height: 630, background: "--brand-surface" },
|
|
1360
|
+
{ file: "icons/icon.ico", sizes: [16, 32, 48, 256] },
|
|
1361
|
+
{ file: "icons/icon.icns", sizes: [16, 32, 64, 128, 256, 512, 1024] },
|
|
1362
|
+
{ file: "icons/app.svg" },
|
|
1363
|
+
],
|
|
1364
|
+
},
|
|
1365
|
+
});
|
|
1366
|
+
```
|
|
1367
|
+
|
|
1368
|
+
- `app-icon-asset` (error, at `appIcon.asset` or `appIcon.background`): the
|
|
1369
|
+
asset is undeclared, is not `paint: "intrinsic"` (a browser tab or launcher
|
|
1370
|
+
cannot read CSS variables), has optical-size variants, or has a viewBox that
|
|
1371
|
+
is not square. Or a background token is not a paint-role token, or does not
|
|
1372
|
+
resolve to an opaque colour in the default theme and brand. With variants, ADS
|
|
1373
|
+
renders the drawing of the default theme.
|
|
1374
|
+
- `app-icon-export` (error, at the entry): a file outside the output folder
|
|
1375
|
+
(`..`, absolute or hidden segments), or at a path that ADS or another export
|
|
1376
|
+
writes (the platform icons, `fonts/`); a format other than `.svg`, `.png`,
|
|
1377
|
+
`.ico` and `.icns`; a size outside 16–2048 px; an export asset that cannot be
|
|
1378
|
+
rendered; or a sizing that the format does not take. `.png` takes `size`, or
|
|
1379
|
+
`width` and `height`; `.ico` takes `sizes` up to 256; `.icns` takes `sizes`
|
|
1380
|
+
16, 32, 64, 128, 256, 512 and 1024; an `.svg` copy takes none.
|
|
1381
|
+
- `app-icon-maskable` (error, at `appIcon.maskable`): a padded master (`padding`
|
|
1382
|
+
0–0.4 of the width on each side) needs `background`, and its drawing stays
|
|
1383
|
+
inside the safe zone, the central circle of 80% of the width (W3C Web App
|
|
1384
|
+
Manifest). A separate maskable drawing is square and opaque to its edges. ADS
|
|
1385
|
+
reads both from the drawing rendered at 256 px.
|
|
1386
|
+
|
|
1387
|
+
#### Styling ownership
|
|
1388
|
+
|
|
1389
|
+
Styling exists only in owners, and owners style only through their recipes. Each
|
|
1390
|
+
finding is an `owner-analysis` error at its position.
|
|
1391
|
+
|
|
1392
|
+
- `source/css-in-js-import`: an import of a CSS-in-JS package in any
|
|
1393
|
+
design-system file, including owners, scenarios and fixtures. ADS keeps the
|
|
1394
|
+
known packages as one closed list, a backstop for libraries that hide a class
|
|
1395
|
+
name behind a component or a call.
|
|
1396
|
+
- A production module that authors no recipe renders only design-system owners.
|
|
1397
|
+
The errors are intrinsic markup (`source/plain-markup`); `className`, `class`,
|
|
1398
|
+
`style` or `css` on a rendered element (`source/plain-style-attribute`);
|
|
1399
|
+
styling written through the DOM (`source/plain-style-write`); and stylesheet
|
|
1400
|
+
imports (`source/plain-stylesheet-import`). To repair them, move the styling
|
|
1401
|
+
into a recipe in an owner. Then render that owner from the plain module, or
|
|
1402
|
+
make the module an owner by authoring the recipe of its markup.
|
|
1403
|
+
- A scenario styles nothing. It can render fixture markup around owners. Styling
|
|
1404
|
+
props (on owners too), DOM styling writes and stylesheet imports are the same
|
|
1405
|
+
errors, and a `<style>` element is `source/style-element`.
|
|
1406
|
+
- An owner imports no stylesheet (`source/owner-stylesheet-import`, at the
|
|
1407
|
+
import, whether or not the file exists).
|
|
1408
|
+
- An owner writes no styling through the DOM (`source/owner-style-write`).
|
|
1409
|
+
Geometry that it measures at runtime goes through the declared `measured`
|
|
1410
|
+
values of its recipe ([Runtime values](#runtime-values-and-interaction)).
|
|
1411
|
+
- A production module's import that points into a development location
|
|
1412
|
+
(mock media such as `../mocks/…/media/photo.svg`, a fixture) is
|
|
1413
|
+
`source/development-import`. `source/module-unresolved` stays for paths that
|
|
1414
|
+
are really unresolved.
|
|
1415
|
+
- A development file's import of an asset that the preview serves
|
|
1416
|
+
(`./media/mark.svg`, `?raw`, `?url`, `?worker`) needs no module declaration.
|
|
1417
|
+
|
|
1418
|
+
`source/framework-mismatch` is in
|
|
1419
|
+
[Structure, themes and brands](#structure-themes-and-brands).
|
|
1420
|
+
|
|
1421
|
+
**Mocks.** `mock-ownership` (codes `mock/<kind>`) applies
|
|
1422
|
+
to every script under `mocks/` and each helper it imports. A mock is held to
|
|
1423
|
+
what a source application is held to. The script renders only what it imports
|
|
1424
|
+
from `@ds` with explicit props: a pattern, and components only inside a
|
|
1425
|
+
pattern, as its child or in a slot prop (`component-outside-pattern`). It may import
|
|
1426
|
+
any framework hook and declared library. It reaches the design system only
|
|
1427
|
+
through `@ds`: a relative import leads to captured helpers inside `mocks/` or
|
|
1428
|
+
its own `media/` images. Native or local markup,
|
|
1429
|
+
`style`/`className`/`css`/`dangerouslySetInnerHTML`, spreads, re-exports,
|
|
1430
|
+
imperative styles, dynamic code and design hidden in strings are errors at their
|
|
1431
|
+
position.
|
|
1432
|
+
|
|
1433
|
+
##### The same check for a source package
|
|
1434
|
+
|
|
1435
|
+
The part of the mock rule that concerns design use is released as its own npm
|
|
1436
|
+
package, `@reqvire-org/ads-guard`. An application installs it and confirms that
|
|
1437
|
+
its own source does no design and uses the design system only. It is optional.
|
|
1438
|
+
Its purpose is to close the loop for work in the application, where ADS does
|
|
1439
|
+
not look: without it, a person or an agent can add an element or a class in
|
|
1440
|
+
application code and nothing reports it.
|
|
1441
|
+
|
|
1442
|
+
It runs on Node or Bun and needs no ADS in the application.
|
|
1443
|
+
|
|
1444
|
+
```sh
|
|
1445
|
+
npm install --save-dev @reqvire-org/ads-guard # or: bun add --dev @reqvire-org/ads-guard
|
|
1446
|
+
npx ads-guard # or: bunx ads-guard
|
|
1447
|
+
```
|
|
832
1448
|
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
checks restore verified output. Errors identify
|
|
847
|
-
stale retained output. Its neutral header and left pane align and collapse
|
|
848
|
-
together. Themes flow through the preview host context. No project catalogue pages
|
|
849
|
-
or direct component imports are used by this client.
|
|
850
|
-
|
|
851
|
-
The project owns implementations, colocated scenarios/fixtures, foundation
|
|
852
|
-
CSS and a framework mount adapter. ADS runs its preview compiler on Bun, using
|
|
853
|
-
incremental modules for watched previews and complete bundles for verification.
|
|
854
|
-
The starter and init provide the mount under `design-system/showcase/mcp/`.
|
|
855
|
-
Configure the framework; ADS compiles every scenario into one shared preview graph:
|
|
1449
|
+
Where to run it:
|
|
1450
|
+
|
|
1451
|
+
| Stage | How |
|
|
1452
|
+
| --- | --- |
|
|
1453
|
+
| Lint | `"lint": "eslint . && ads-guard"` in the application's `package.json` |
|
|
1454
|
+
| Test | `"pretest": "ads-guard"`, so tests do not start on source that does design |
|
|
1455
|
+
| Build | `"prebuild": "ads-guard"`, when a build must never ship such source |
|
|
1456
|
+
| CI | A step `npx ads-guard` (or `bunx ads-guard`); it exits 1 on findings |
|
|
1457
|
+
| An agent's own loop | Tell the agent to run `npx ads-guard` after it edits application code, and to fix findings by using or adding a pattern, never by excluding the file |
|
|
1458
|
+
|
|
1459
|
+
`npx ads-guard --json` prints the report for tools.
|
|
1460
|
+
|
|
1461
|
+
`ads-guard.config.json`, in the application's root:
|
|
856
1462
|
|
|
857
1463
|
```json
|
|
858
1464
|
{
|
|
859
|
-
"
|
|
860
|
-
"
|
|
861
|
-
"
|
|
862
|
-
|
|
863
|
-
}
|
|
1465
|
+
"designSystem": "@acme/design",
|
|
1466
|
+
"include": ["src"],
|
|
1467
|
+
"exclude": ["src/generated"],
|
|
1468
|
+
"allow": { "react": ["Suspense", "StrictMode"], "react-router": ["Outlet", "RouterProvider"] }
|
|
864
1469
|
}
|
|
865
1470
|
```
|
|
866
1471
|
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
`
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
1472
|
+
- `designSystem` is the specifier the application imports the design system
|
|
1473
|
+
by. The guard reads its public entry to learn which exports are patterns.
|
|
1474
|
+
When the specifier is an alias that Node cannot resolve, `entry` names the
|
|
1475
|
+
entry file.
|
|
1476
|
+
- `include` lists the source folders. `exclude` lists folders and files under
|
|
1477
|
+
them that are not checked. Every run reports what was excluded, and an entry
|
|
1478
|
+
that does not exist is an error, so the list cannot hide anything.
|
|
1479
|
+
- `allow` lists components of other packages that carry no design, one by one:
|
|
1480
|
+
a router's outlet, providers, the framework's own markers.
|
|
1481
|
+
- Tests and the design system's own files are never checked; the report counts
|
|
1482
|
+
them. Document metadata (`<title>`, `<meta>`, `<script>`, a `<link>` that is
|
|
1483
|
+
not a stylesheet) is accepted anywhere.
|
|
1484
|
+
- Exit code 0: the source uses the design system only. 1: findings, each with
|
|
1485
|
+
a file, position, code (`design-usage/<kind>`), message and repair. 2: the
|
|
1486
|
+
configuration is wrong.
|
|
1487
|
+
|
|
1488
|
+
The configuration belongs to the application, not to the design system: ADS
|
|
1489
|
+
reads only the design-system project, and one design system can serve
|
|
1490
|
+
applications on different frameworks.
|
|
1491
|
+
|
|
1492
|
+
**Libraries in an application.** What a library gives decides how it is used.
|
|
1493
|
+
|
|
1494
|
+
| The library gives | Examples | Use |
|
|
1495
|
+
| --- | --- | --- |
|
|
1496
|
+
| Functions and hooks | Image URL builders, a router's hooks, date utilities | Freely. They are behavior. |
|
|
1497
|
+
| Components that render nothing | `Suspense`, `Outlet`, providers | Listed in the guard's `allow`. |
|
|
1498
|
+
| Hooks that return props for an element | `react-aria` | In the design system: the owner spreads them on its own element (`behaviorLibraries`). |
|
|
1499
|
+
| Components with their own design | A styled library, a framework's image component | Not rendered. Take the library's function; the design system owns the element. |
|
|
1500
|
+
|
|
1501
|
+
- **Images.** The application asks the library for the URLs and passes them to
|
|
1502
|
+
the design system's image owner: with Next.js, `getImageProps` from
|
|
1503
|
+
`next/image` gives `src`, `srcSet` and `sizes` as data; Cloudinary and imgix
|
|
1504
|
+
build the same from a source and a width. The example design system's `Image` takes
|
|
1505
|
+
`source` and `responsive: { srcSet, sizes }`.
|
|
1506
|
+
- **Links.** The pattern renders `<a href>` and reports the click; the
|
|
1507
|
+
application navigates in the handler with its router.
|
|
1508
|
+
|
|
1509
|
+
#### Layout
|
|
1510
|
+
|
|
1511
|
+
**Grid containers.** A grid in container context (`context: "container"`)
|
|
1512
|
+
follows the nearest `ads-region` size container. An owned ancestor in the same
|
|
1513
|
+
owner must thus start one in every reachable choice: a region framed
|
|
1514
|
+
`frame: { container: "region" }`. Otherwise the tier rules of the grid never
|
|
1515
|
+
match, wherever the component is placed, and the grid is
|
|
1516
|
+
`source/grid-container-missing` at its construction. A container that a consumer
|
|
1517
|
+
renders around the component, or one inside a public component that the grid is
|
|
1518
|
+
passed to, is not evidence for this owner.
|
|
1519
|
+
|
|
1520
|
+
**Frames in grid cells.** A grid cell whose own construction declares a frame
|
|
1521
|
+
with a fixed inline size needs that width at the lower edge of every tier it is
|
|
1522
|
+
visible in. A fixed inline size is an `inline-size` that its `max-inline-size`
|
|
1523
|
+
does not cap to the region, or a `min-inline-size`.
|
|
1524
|
+
|
|
1525
|
+
- Where the grid algebra bounds the cell and the frame is wider, the cell is
|
|
1526
|
+
`source/frame-exceeds-region` at its construction. The finding names the tier,
|
|
1527
|
+
the condition and the context. The bound is the span of the cell less its
|
|
1528
|
+
gutter insets, in every context whose geometry differs.
|
|
1529
|
+
- Where the algebra cannot bound the cell (inherited tracks, or the placement
|
|
1530
|
+
outside a named condition at a tier that the condition can hold), or the size
|
|
1531
|
+
is not a length that ADS evaluates (an `em` of an unknown font size), it is
|
|
1532
|
+
the review item `review/frame-region-unresolved`, never a pass.
|
|
1533
|
+
- Frames deeper inside a cell are checked against the cell less the inline
|
|
1534
|
+
insets and fixed sizes of the owned elements between. A public component, or a
|
|
1535
|
+
list, figure, blockquote or fieldset in the way, is reviewed.
|
|
1536
|
+
|
|
1537
|
+
##### The text keyline
|
|
1538
|
+
|
|
1539
|
+
In a grid, text should start on one vertical line. That line is the **keyline**:
|
|
1540
|
+
the start inset of the spatial profile's `wide` gutter, which a grid takes when
|
|
1541
|
+
it names no gutter (16px in the example design system).
|
|
1542
|
+
|
|
1543
|
+
A grid on another gutter mode starts its cells nearer the column line: `narrow`
|
|
1544
|
+
at the line itself, `condensed` half a border from it. Such grids are for
|
|
1545
|
+
frames that should sit flush, such as cards. The frame then insets its own
|
|
1546
|
+
content with its padding, and that padding decides where its text lands:
|
|
1547
|
+
|
|
1548
|
+
| Card in a narrow-gutter cell | Its text starts at | On the 16px keyline? |
|
|
1549
|
+
| --- | --- | --- |
|
|
1550
|
+
| 16px inline padding | 16px | Yes |
|
|
1551
|
+
| 24px inline padding | 24px | No: 8px past it |
|
|
1552
|
+
|
|
1553
|
+
`ads check` enforces it. A frame in the same owner as the grid is
|
|
1554
|
+
`source/keyline-missed`; a public component placed in the cell, whose frame
|
|
1555
|
+
belongs to another owner, is `component-keyline`. Both use the same comparison:
|
|
1556
|
+
|
|
1557
|
+
- **What is compared.** The gutter's start inset plus the frame's inline
|
|
1558
|
+
padding, against the wide gutter's start.
|
|
1559
|
+
- **Tolerance.** The spatial profile's fine unit (`fineUnit`, 2px in the
|
|
1560
|
+
example design system). A condensed gutter's half border is inside it.
|
|
1561
|
+
- **Borders are not counted.** A border is the frame's edge. Its width may
|
|
1562
|
+
change with the theme (the example design system draws 2px in its dark and high-contrast
|
|
1563
|
+
themes), and no inset token may be derived from a border width, so an inset
|
|
1564
|
+
cannot follow it. Text therefore sits a border's width past the keyline.
|
|
1565
|
+
- **Where it applies.** The cell's own container frame, or the first padded
|
|
1566
|
+
container frame inside the cell, in a `fluid` or `hybrid` grid whose gutter is
|
|
1567
|
+
a declared mode other than `wide`. It is checked in every theme and brand.
|
|
1568
|
+
- **Across owners.** For a public component in the cell, the frame is the
|
|
1569
|
+
component's root: the outermost element of its markup. A component whose root
|
|
1570
|
+
is another component takes that one's root. The finding is at the placement,
|
|
1571
|
+
and names the root frame as a related position. A root that ADS cannot read
|
|
1572
|
+
is the review item `component-keyline-unresolved`, never a pass.
|
|
1573
|
+
- **Where it does not.** A control (a button or a tile has its own inset, sized
|
|
1574
|
+
for its label and target); a frame without inline padding (flush content is a
|
|
1575
|
+
choice); what is inside a frame that already pads; `gutter: "none"` grids,
|
|
1576
|
+
which are structural layouts such as an application shell and have no text
|
|
1577
|
+
column; fixed tiling.
|
|
1578
|
+
- **Cost.** A design system with no component in a narrower-gutter grid has
|
|
1579
|
+
nothing to join: the cross-owner check returns before reading a token value.
|
|
1580
|
+
|
|
1581
|
+
The repair is a frame whose inline padding is the wide gutter's own token. The
|
|
1582
|
+
example design system's `card-cell` profile does this for the cards in its condensed grid:
|
|
1583
|
+
|
|
1584
|
+
```ts
|
|
1585
|
+
// tokens/Containers/frame-inset.ads.css: --card-cell-inset: var(--grid-gutter-wide-start);
|
|
1586
|
+
export const cardCellFrame = profile({
|
|
1587
|
+
name: "card-cell-frame",
|
|
1588
|
+
kind: "frame",
|
|
1589
|
+
fields: { paddingBlock: "--card-padding", paddingInline: "--card-cell-inset", borderWidth: "--container-border", radius: "--radius-panel" },
|
|
1590
|
+
});
|
|
1591
|
+
```
|
|
1592
|
+
- For the children of a fixed tiling grid, a size wider than the tile fails. Any
|
|
1593
|
+
other fixed size is reviewed, because a tile shrinks to a narrower region.
|
|
1594
|
+
- A public component placed as a cell or tile is reviewed, naming the narrowest
|
|
1595
|
+
region that the grid gives it. Its frame belongs to its own owner.
|
|
1596
|
+
- A nested grid inside a cell is checked against its own regions.
|
|
1597
|
+
|
|
1598
|
+
The overflow check of the render audit stays the rendered backstop.
|
|
1599
|
+
|
|
1600
|
+
**Row width.** An `inline` row is as wide as its content and never wider than
|
|
1601
|
+
its container. `extent: "container"` on its root makes it take the width
|
|
1602
|
+
available in any parent (a block, a column that aligns its children, the space
|
|
1603
|
+
left beside siblings). A part with `extent: "fill"` needs such a row, or one
|
|
1604
|
+
whose frame fixes its width: in a row that hugs, it has nothing to fill
|
|
1605
|
+
(`construction/extent-row-hugs`). `"container"` on a row whose frame fixes its
|
|
1606
|
+
width is `construction/extent-conflict`.
|
|
1607
|
+
|
|
1608
|
+
**Text layout.** Text layout is closed and resolved at compile time. A text
|
|
1609
|
+
part's `wrap` is one of anywhere (`true`/`"anywhere"`), `"never"`, `"balance"`
|
|
1610
|
+
(headings and short titles), `"pretty"` (body text) or `"truncate"`. Truncation
|
|
1611
|
+
is one line with an ellipsis, or a clamp to `lines: 2 | 3`. `reserveLines:
|
|
1612
|
+
1 | 2 | 3` makes the part always take that many lines of the line height of its
|
|
1613
|
+
text profile. Control labels keep their own closed `wrap` (word breaks by
|
|
1614
|
+
default, `"anywhere"` or `"never"`). [The language](LANGUAGE.md#closed-layout-constructs)
|
|
1615
|
+
gives the lowering; the contract's platform inventory lists each lowered feature
|
|
1616
|
+
([Browser targets](#browser-targets)).
|
|
1617
|
+
|
|
1618
|
+
- `spec/value-invalid`: `lines` other than `2 | 3`; `lines` without
|
|
1619
|
+
`wrap: "truncate"`; or a clamp that reserves more lines than it shows
|
|
1620
|
+
(`lines: 2` with `reserveLines: 3`, at `reserveLines`, naming both values).
|
|
1621
|
+
- `spec/value-invalid`, `construction/extent-conflict`: a clamp on a declared
|
|
1622
|
+
native `element`, or beside an arrangement's own display or a scroll
|
|
1623
|
+
container.
|
|
1624
|
+
- `source/clamp-on-control`: a clamp on a control or a form label (a button,
|
|
1625
|
+
label, legend, summary, select, option or text field), or on text inside one.
|
|
1626
|
+
It hides what the control does.
|
|
1627
|
+
- `review/truncated-text-unnamed`: truncated or clamped text without a `title`.
|
|
1628
|
+
Assistive technology reads all of the text. Sighted readers need the title, an
|
|
1629
|
+
expand control or the full content elsewhere, and analysis sees only the
|
|
1630
|
+
title.
|
|
1631
|
+
- `review/balance-on-paragraph`, at the part's `wrap`: `wrap: "balance"` on a
|
|
1632
|
+
text part rendered as a `<p>`. A paragraph is body text, which `"pretty"`
|
|
1633
|
+
suits. Render a heading as a heading element.
|
|
1634
|
+
|
|
1635
|
+
#### Runtime values and interaction
|
|
1636
|
+
|
|
1637
|
+
The authoring language owns these constructs. Each lowers to plain CSS and
|
|
1638
|
+
plain `style.setProperty`/`removeProperty` calls, with no ADS runtime.
|
|
1639
|
+
|
|
1640
|
+
**Measured geometry** ([language](LANGUAGE.md#measured-runtime-geometry),
|
|
1641
|
+
[cropped media](LANGUAGE.md#cropped-media)). A recipe declares what its owner
|
|
1642
|
+
measures at runtime with `measured: { name: { type, property, fallback? } }`.
|
|
1643
|
+
The owner writes the values with `recipe.measured.set` and `.clear`, or spreads
|
|
1644
|
+
`recipe.measured.props(…)` on the element for a value known at render. Codes:
|
|
1645
|
+
`construction/measured-property-unsupported`,
|
|
1646
|
+
`construction/measured-profile-conflict`,
|
|
1647
|
+
`construction/measured-placement-missing`, `source/measured-undeclared`,
|
|
1648
|
+
`review/measured-unused`, `construction/cover-box-missing` and
|
|
1649
|
+
`construction/cover-asset-unsupported`. A measured size on a `frame: "control"`
|
|
1650
|
+
part is checked for target size with its fallback and reviewed
|
|
1651
|
+
(`a11y-target-size-unresolved`). Measured values never take part in contrast.
|
|
1652
|
+
The example design system's `Menu` is a worked example: it places its panel below its trigger,
|
|
1653
|
+
or above it when only that side has room, and clears the values when it closes.
|
|
1654
|
+
|
|
1655
|
+
**Interaction properties** ([language](LANGUAGE.md#interaction-properties)).
|
|
1656
|
+
Drag handles, splitters and carousels declare `cursor`, `touchAction` and
|
|
1657
|
+
`userSelect` in `normalize`, and scroll snap as `snap: { type, align }` on the
|
|
1658
|
+
arrangement that scrolls. Codes: `spec/value-invalid`,
|
|
1659
|
+
`construction/extent-conflict`, `construction/snap-without-scroll`,
|
|
1660
|
+
`review/user-select-text` and `review/touch-action-unhandled`. A splitter
|
|
1661
|
+
combines both constructs: the grip declares the interaction, the pane declares
|
|
1662
|
+
the measured width, and the pointer handlers of the owner write the width
|
|
1663
|
+
through the measured setter.
|
|
1664
|
+
|
|
1665
|
+
**Runtime paint from data** ([language](LANGUAGE.md#runtime-paint-from-data)). A
|
|
1666
|
+
recipe declares the paints that its owner selects by data (a chart series, a
|
|
1667
|
+
status) with `paints: { name: { property, values, fallback } }`. The owner
|
|
1668
|
+
writes `recipe.paints.set` and `.clear`. Codes:
|
|
1669
|
+
`construction/paint-property-unsupported`, `construction/paint-value-role`,
|
|
1670
|
+
`construction/paint-profile-conflict`,
|
|
1671
|
+
`construction/paint-contrast-insufficient`, `source/paint-undeclared`,
|
|
1672
|
+
`source/paint-value-untyped`, `review/paint-unused` and
|
|
1673
|
+
`review/paint-contrast-unresolved`. The example design system's `BarChart` paints its bars
|
|
1674
|
+
from the `--chart-1`…`--chart-3` series tokens (`tokens/Charts/paint.ads.css`,
|
|
1675
|
+
with light, dark and high-contrast values).
|
|
1676
|
+
|
|
1677
|
+
**Press scale** ([language](LANGUAGE.md#state-focus-and-motion),
|
|
1678
|
+
[motion](MOTION.md)). A press effect is a `when` state that reads `scale` from
|
|
1679
|
+
the motion slot of the recipe: on the artwork part of a control, or on a region
|
|
1680
|
+
or control root that declares `transition: ["scale"]`. A scale factor is
|
|
1681
|
+
relative: 0.96 moves a 40px button in by less than 1px per side, and a 400px
|
|
1682
|
+
card by 8px. Select the factor per size class, through the motion profile that
|
|
1683
|
+
the motion slot of the composite selects. The example design system names the classes
|
|
1684
|
+
(`tokens/Motion/motion-scale.ads.css`, `profiles/Motion/feedback.ads.ts`):
|
|
1685
|
+
|
|
1686
|
+
| Element size | Profile | Factor | Shrink |
|
|
1687
|
+
| --- | --- | --- | --- |
|
|
1688
|
+
| Artwork inside a control (~20px) | `press-glyph` | 0.98 in the example design system; 0.9 gives a visible ~1px | ~0.2px per side at 0.98 |
|
|
1689
|
+
| A control (~120 × 40px) | `press-control` | 0.97 | ~1–2px |
|
|
1690
|
+
| A card or tile surface (~300px) | `press-surface` | 0.99 | ~1.5px |
|
|
1691
|
+
| A page-sized region | none | — | no press scale |
|
|
1692
|
+
|
|
1693
|
+
The example design system's Button, IconButton and ToggleTile press their artwork
|
|
1694
|
+
(`action-feedback` composes `press-glyph`). A `frame: "container"` root whose
|
|
1695
|
+
press factor is below 0.98 in some token context, or cannot be read as a number,
|
|
1696
|
+
is the review item `review/press-scale-large-surface` at the `scale` endpoint
|
|
1697
|
+
(`owner-analysis-review`, never blocking, also in a draft's acceptance result).
|
|
1698
|
+
`frame: {}` roots and control roots do not count. Select a surface-class press
|
|
1699
|
+
profile (factor at least 0.98) or no press scale, or keep a deliberate stronger
|
|
1700
|
+
press. Only such roots read token values for this item, so every other owner
|
|
1701
|
+
keeps its analysis across token edits.
|
|
1702
|
+
|
|
1703
|
+
#### Generated source and the emitted output
|
|
1704
|
+
|
|
1705
|
+
- `palette-generated` (error): a declared `palette.generated.ts` is missing or
|
|
1706
|
+
out of date, or one is present without `palette: true`
|
|
1707
|
+
([Regenerating generated source](#regenerating-generated-source)).
|
|
1708
|
+
- `generated-modified` (error) and `generated-stale` (info): see
|
|
1709
|
+
[Hand edits and out-of-date output](#hand-edits-and-out-of-date-output).
|
|
1710
|
+
|
|
1711
|
+
#### Scenarios
|
|
1712
|
+
|
|
1713
|
+
Every public owner needs a scenario. A public owner is a file that the barrel
|
|
1714
|
+
re-exports and that authors recipes; a public plain module needs none. A public
|
|
1715
|
+
owner that no scenario covers is a `scenario-coverage` error at the owner file,
|
|
1716
|
+
naming it and where its scenario goes.
|
|
1717
|
+
|
|
1718
|
+
A scenario is a `*.ads.scenario.tsx` under `components/`, `patterns/` or
|
|
1719
|
+
`mocks/`. It supplies data and subjects; ADS draws the page with its own
|
|
1720
|
+
showcase components, the same for every design system.
|
|
888
1721
|
|
|
889
1722
|
```tsx
|
|
890
1723
|
import { Button } from "@ds";
|
|
891
|
-
import {
|
|
892
|
-
|
|
893
|
-
export
|
|
1724
|
+
import type { Scenario } from "@reqvire-org/ads/showcase";
|
|
1725
|
+
|
|
1726
|
+
export const scenario = {
|
|
1727
|
+
title: "Button",
|
|
1728
|
+
description: "The primary action control.",
|
|
1729
|
+
covers: ["Button"],
|
|
1730
|
+
specimens: [
|
|
1731
|
+
{ title: "Sizes", arrangement: "row",
|
|
1732
|
+
render: () => <><Button label="Continue" size="sm" /><Button label="Continue" size="lg" /></> },
|
|
1733
|
+
],
|
|
1734
|
+
} satisfies Scenario;
|
|
894
1735
|
```
|
|
895
1736
|
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
1737
|
+
- It exports a literal `scenario` and has no default export (`scenario-entry`).
|
|
1738
|
+
ADS draws the title, the description, each specimen's title and note, the box
|
|
1739
|
+
around a specimen, the gaps and the state switch.
|
|
1740
|
+
- `title` is a nonempty static string. `covers` lists the public UI that the
|
|
1741
|
+
specimens render. Optional fields are `description`, `id`, `exercises`,
|
|
1742
|
+
`frame`, `states` and `captureTargets` (up to 20 named, nonempty CSS selectors
|
|
1743
|
+
of at most 500 characters). Another field, a `frame` outside `inline`,
|
|
1744
|
+
`screen` and `phone`, or `states` that is not an object literal of named prop
|
|
1745
|
+
sets is a `scenario-field` error.
|
|
1746
|
+
- `specimens` is a nonempty array literal of object literals
|
|
1747
|
+
(`scenario-specimens`). A specimen has a `render` function and can have a
|
|
1748
|
+
static `title` and `note`, an `arrangement` (`stack`, `row`, `tiles`) and a
|
|
1749
|
+
`width` (`content`, `full`, `small`, `medium`).
|
|
1750
|
+
- `render` is a component of the project's framework. It can hold local state.
|
|
1751
|
+
Its argument is the chosen state's props.
|
|
1752
|
+
- A scenario file writes no markup of its own (`scenario-markup`): no HTML or
|
|
1753
|
+
SVG element, no `style` attribute, and no component that a fixture or helper
|
|
1754
|
+
file declares. It renders owners, text and the scenario kit.
|
|
1755
|
+
|
|
1756
|
+
**States.** `states` names sets of props. ADS draws one switch for the scenario
|
|
1757
|
+
and passes the chosen set to every `render`. A new choice starts each specimen
|
|
1758
|
+
again. Use local state for what a person changes by using the owner. The
|
|
1759
|
+
showcase address names the chosen state (`&state=<name>`), so a state can be
|
|
1760
|
+
linked, and `ads_capture` takes the same name to capture it.
|
|
1761
|
+
|
|
1762
|
+
**Live controls.** `controls: true` asks ADS to draw a control for each closed
|
|
1763
|
+
prop of the first owner in `covers`: a union of literals (`size`, `variant`)
|
|
1764
|
+
or a boolean (`disabled`). ADS takes the list from the owner's own analysis,
|
|
1765
|
+
so it is exactly the props that change the owner's markup or styling; text,
|
|
1766
|
+
numbers, callbacks and data are never controls. Every `render` receives the
|
|
1767
|
+
chosen values as props, over the chosen state's, and takes part by spreading
|
|
1768
|
+
them:
|
|
899
1769
|
|
|
900
|
-
```
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
Switch/ # ungrouped owner
|
|
908
|
-
Switch.ads.scenario.tsx
|
|
1770
|
+
```tsx
|
|
1771
|
+
export const scenario = {
|
|
1772
|
+
title: "Button",
|
|
1773
|
+
covers: ["Button"],
|
|
1774
|
+
controls: true,
|
|
1775
|
+
specimens: [{ title: "Try it", render: (props) => <Button label="Continue" {...props} /> }],
|
|
1776
|
+
} satisfies Scenario;
|
|
909
1777
|
```
|
|
910
1778
|
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
`
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
1779
|
+
Named states are for situations that need data (loaded, empty, failed); the
|
|
1780
|
+
controls are for switches. The render audit renders named states only: a
|
|
1781
|
+
combination made with the controls is not a named case.
|
|
1782
|
+
|
|
1783
|
+
**Frames.** `frame: "inline"` (the default) is a page of boxed specimens.
|
|
1784
|
+
`frame: "screen"` shows the first specimen as a whole screen, with the state
|
|
1785
|
+
switch in a bar above it; a mock uses it. `frame: "phone"` shows it in a
|
|
1786
|
+
390 by 844px box.
|
|
1787
|
+
|
|
1788
|
+
**The scenario kit.** `@reqvire-org/ads/showcase` supplies what a subject
|
|
1789
|
+
sometimes needs around it. The kit renders only in an ADS preview.
|
|
1790
|
+
|
|
1791
|
+
| Kit | Purpose |
|
|
1792
|
+
| --- | --- |
|
|
1793
|
+
| `Container` | A parent of a named size and direction, for a subject that only makes sense inside one. `inline`: `fill`, `pane`, `column`, `page`. `block`: `content`, `short`, `medium`, `tall`. |
|
|
1794
|
+
| `Placeholder` | A labelled, tinted stand-in for a slot that the application fills. |
|
|
1795
|
+
| `Anchor` | The control an overlay opens from. Its child is a function that receives the control's element. |
|
|
1796
|
+
| `EventLog`, `useEvents` | Shows what the owner's callbacks received. |
|
|
1797
|
+
|
|
1798
|
+
**Roles.** The type of an export decides what it is, however it was made
|
|
1799
|
+
(aliases, re-exports, `memo`, any chain of factories).
|
|
1800
|
+
|
|
1801
|
+
- It is rendered UI when calling it returns the framework's element type, or
|
|
1802
|
+
constructing it gives a class component. The element types are React's
|
|
1803
|
+
`ReactNode`, `ReactElement` or `JSX.Element`, and Preact's `VNode`,
|
|
1804
|
+
`ComponentChildren` or `JSX.Element`, identified by the framework's own
|
|
1805
|
+
declarations.
|
|
1806
|
+
- It is a behavioral API when it is callable or constructible and returns
|
|
1807
|
+
anything else (a value, `void`, a controller instance, a hook's result), or is
|
|
1808
|
+
declared under `controllers/` (a context provider).
|
|
1809
|
+
- An export of a recipe owner, or one that aliases it, is UI unless its
|
|
1810
|
+
signatures show otherwise (a hook beside the component).
|
|
1811
|
+
- When its type, or what calling it returns, is `any`, `unknown` or generic, ADS
|
|
1812
|
+
does not guess. An `exercises` entry that names it is a
|
|
1813
|
+
`scenario-exercise-review` item that says why. A `covers` entry that names it
|
|
1814
|
+
is judged by whether the scenario renders it.
|
|
1815
|
+
|
|
1816
|
+
**`covers`.** ADS checks each entry on its own, at that entry
|
|
1817
|
+
(`entry: "covers[1]"`). A bad entry is left out of what the scenario registers,
|
|
1818
|
+
and the valid ones stand.
|
|
1819
|
+
|
|
1820
|
+
- `scenario-covers`: the entry is not a static name, or the barrel does not
|
|
1821
|
+
export it.
|
|
1822
|
+
- `scenario-covers-role`: the entry names a public behavioral API.
|
|
1823
|
+
- `scenario-render`, at the entry: nothing that a specimen's `render` reaches
|
|
1824
|
+
renders the covered export. ADS resolves every JSX tag that a `render` reaches,
|
|
1825
|
+
and every call of the framework's element factory (`createElement`, or
|
|
1826
|
+
Preact's `h`), to its declaration, through `const` aliases. It follows the
|
|
1827
|
+
design system's own components (scenario adapters, owners) into theirs, so a
|
|
1828
|
+
mock renders the owners that its patterns render. An import, or a
|
|
1829
|
+
reference outside the rendered tree, does not count.
|
|
1830
|
+
|
|
1831
|
+
**`exercises`** names the public behavioral APIs that the scenario uses, so that
|
|
1832
|
+
previews and `ads_scenarios` can find them. It is a demonstration, never passing
|
|
1833
|
+
behavior evidence. The scenario stays registered with its valid entries and its
|
|
1834
|
+
covers.
|
|
1835
|
+
|
|
1836
|
+
- `scenario-exercise-api`, at the entry: the entry is not a static name, is not
|
|
1837
|
+
exported by the barrel, names rendered UI, or names a value that is neither
|
|
1838
|
+
callable nor constructible.
|
|
1839
|
+
- `scenario-field`: `exercises` is not an array.
|
|
1840
|
+
- `scenario-exercise`: the mounted code never uses the API (it is only imported,
|
|
1841
|
+
or used in a function that nothing reaches). A use is a call, a construction
|
|
1842
|
+
or a render (a context provider), in a specimen's `render` or in a development
|
|
1843
|
+
adapter that it reaches: a component it renders, a function it calls, an event
|
|
1844
|
+
handler. A call of a method attached to the API (`api.success()`) counts,
|
|
1845
|
+
through aliases, namespace imports and re-exports.
|
|
1846
|
+
- `scenario-exercise-review` (review, never blocks): the mounted code only
|
|
1847
|
+
passes the API on or reads it, or ADS cannot tell the role of the entry.
|
|
1848
|
+
|
|
1849
|
+
**Other rules.** The location, entry, metadata and identity of a scenario are
|
|
1850
|
+
checked as `scenario-location`, `scenario-entry`, `scenario-metadata`,
|
|
1851
|
+
`scenario-field` and `scenario-identity`. After a field error (an unknown field,
|
|
1852
|
+
an empty `title`, an invalid `id` or `captureTargets`), the scenario stays
|
|
1853
|
+
registered and its coverage counts while `covers` reads. Unreadable metadata
|
|
1854
|
+
(`scenario-metadata`, marked `coverage: "not-established"`) leaves its coverage
|
|
1855
|
+
unknown, not missing.
|
|
1856
|
+
|
|
1857
|
+
#### Previews
|
|
1858
|
+
|
|
1859
|
+
A scenario previews the emitted owner: the bytes that `ads emit` writes, with
|
|
1860
|
+
the emitted `foundation.css` as the document CSS.
|
|
1861
|
+
|
|
1862
|
+
- While a preview compiler runs, ADS emits each settled edit of the design
|
|
1863
|
+
system into a preview-owned tree (`.ds/emitted/live`, never the output
|
|
1864
|
+
folder), and the open previews rebuild from it. Scenario and fixture edits
|
|
1865
|
+
rebuild without an emit.
|
|
1866
|
+
- A revision whose check fails is not emitted, and the previews keep the last
|
|
1867
|
+
good revision. `ads://project/build` reports `freshness`
|
|
1868
|
+
`{ kind: "stale", shown, reason: { kind: "emit-failed", failure } }` with the
|
|
1869
|
+
findings of the check until the edit is fixed, then
|
|
1870
|
+
`{ kind: "current", revision }`.
|
|
1871
|
+
- The showcase marks such a preview stale. The preview status in the toolbar
|
|
1872
|
+
becomes an error. Its details list the findings of the check (or of emission)
|
|
1873
|
+
and offer Retry preview, until the revision is current again.
|
|
1874
|
+
- Several MCP servers on one project share that tree. They write it one at a
|
|
1875
|
+
time under a lock in `.ds/locks/`, and an earlier revision never replaces the
|
|
1876
|
+
revision of the latest edit.
|
|
1877
|
+
|
|
1878
|
+
#### Touch density
|
|
1879
|
+
|
|
1880
|
+
Input modality is a token context, like a theme or a brand, so controls can grow
|
|
1881
|
+
on touch screens without a new construct. Override the size tokens in their own
|
|
1882
|
+
role sheets under `@media (pointer: coarse)`. Every owner that reads them
|
|
1883
|
+
follows:
|
|
936
1884
|
|
|
937
|
-
```
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1885
|
+
```css
|
|
1886
|
+
/* tokens/Controls/control-min-size.ads.css */
|
|
1887
|
+
:root { --control-height-sm: 1.75rem; --control-height-md: 2.25rem; --control-height-lg: 2.75rem; }
|
|
1888
|
+
@media (pointer: coarse) {
|
|
1889
|
+
:root { --control-height-sm: 2.25rem; --control-height-md: 2.75rem; --control-height-lg: 3rem; }
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
/* tokens/Controls/frame-inset.ads.css: the insets that go with the taller frames */
|
|
1893
|
+
:root { --control-inset-inline: 0.75rem; }
|
|
1894
|
+
@media (pointer: coarse) {
|
|
1895
|
+
:root { --control-inset-inline: 1rem; }
|
|
945
1896
|
}
|
|
946
1897
|
```
|
|
947
1898
|
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
`
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
ADS has fixed token names and ownership namespaces. Change values in the existing
|
|
994
|
-
token files; `--accent`, `--font-sans`, `--radius-md`, and the other shared roles
|
|
995
|
-
keep their meanings across projects. Foreign shared prefixes such as `--nuv-*` or
|
|
996
|
-
`--brand-*` fail. There are no independent owner-local token namespaces. Components own `--ds-*`, patterns own `--ux-*`, and the showcase
|
|
997
|
-
reserves `--showcase-*` for showcase boundaries. Fixture files still define no
|
|
998
|
-
custom styling; the frame pattern uses `--ux-*`. Branding never assigns
|
|
999
|
-
component state variables.
|
|
1000
|
-
|
|
1001
|
-
Keep original artwork (SVG masters, finished PNG/JPEG/WebP images, delivered
|
|
1002
|
-
`.ico`/`.icns` files, in any mix) and a usage/credits/license README in
|
|
1003
|
-
`design-system/assets/brand/`, and font files in `assets/fonts/`. `ads check` fails
|
|
1004
|
-
when artwork is undescribed in that README (`brand-readme`), the README states no
|
|
1005
|
-
license (`brand-license`), and lists artwork nothing uses for review (`brand-unused`). Name a dark-theme variant
|
|
1006
|
-
`<name>.dark.svg`; the component showing it renders both and shows each with a display switch
|
|
1007
|
-
(`display: var(--display-dark, block)`). ADS renders the showcase's first
|
|
1008
|
-
section, **Brand** (`brand/Assets`), from the artwork in `assets/brand/` and its subfolders: artwork in the
|
|
1009
|
-
current theme and the app icon at its actual sizes. Projects author no brand preview scenarios. A finished image renders only at or below its own
|
|
1010
|
-
pixel size; ADS never enlarges it. The [branding guide](../skills/ads-designer/references/branding.md)
|
|
1011
|
-
(`ads://guides/branding`) covers the whole flow. Font declarations
|
|
1012
|
-
belong in optional `tokens/fonts.css`. ADS generates the import-only foundation entry
|
|
1013
|
-
(`styles.css`) from the sheets present, in this order: fonts, colors, typography, spacing,
|
|
1014
|
-
elevation, base, themes.generated.css. Never edit it by hand.
|
|
1015
|
-
Fixed artwork colors and geometry are permitted inside SVG assets; they do not
|
|
1016
|
-
permit raw visual values in component or pattern styles.
|
|
1017
|
-
|
|
1018
|
-
Foundation sheets are checked source. Keep root token definitions in value sheets,
|
|
1019
|
-
font faces in `fonts.css`, and closed-role defaults in `base.css` (document
|
|
1020
|
-
typography/canvas/theme, limited native resets, global focus/reduced motion).
|
|
1021
|
-
Owner hooks, contextual UI selectors, keyframes, extra CSS imports, raw visual
|
|
1022
|
-
values and missing token references fail checks there too. Move component-specific
|
|
1023
|
-
repairs into their Linaria owner; see the [foundation contract](ADS.md#shared-token-contract).
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
Select one square master, an SVG or a PNG/JPEG/WebP of at least 512 px, with an
|
|
1027
|
-
ADS-relative path:
|
|
1899
|
+
- The token checks evaluate the overrides of each `@media` condition as a
|
|
1900
|
+
context of its own, crossed with every theme and brand. Thus
|
|
1901
|
+
`a11y-target-size`, contrast and `token-type` all check the touch values. A
|
|
1902
|
+
coarse value that makes a control smaller than 24 px fails in that context,
|
|
1903
|
+
and the finding names it (for example `:root under @media (pointer: coarse)`).
|
|
1904
|
+
- `ads emit` writes the overrides into the emitted sheets unchanged. Nothing
|
|
1905
|
+
runs at runtime.
|
|
1906
|
+
- ADS checks WCAG 2.2 AA (2.5.8): 24 px, whatever the pointer. Larger touch
|
|
1907
|
+
targets (44 px is a common platform guideline) are a design choice that the
|
|
1908
|
+
tokens express, not a rule that ADS enforces. An owned hit area
|
|
1909
|
+
(`minTargetBlockSize`, `minTargetInlineSize` on a frame profile) can enlarge
|
|
1910
|
+
the target without a change to the layout.
|
|
1911
|
+
- To see a coarse-pointer density, open a scenario in a touch context: Chromium DevTools device
|
|
1912
|
+
emulation, or Playwright's `hasTouch: true`, which makes Chromium report a
|
|
1913
|
+
coarse primary pointer.
|
|
1914
|
+
- Prefer `(pointer: coarse)` for the primary input. `(any-pointer: coarse)` also
|
|
1915
|
+
matches a laptop with a touch screen, which then gets touch density with a
|
|
1916
|
+
mouse also.
|
|
1917
|
+
|
|
1918
|
+
### Surface effects
|
|
1919
|
+
|
|
1920
|
+
A surface profile can blur its element (`blur`), blur and saturate what is
|
|
1921
|
+
behind it (`backdropBlur`, `backdropSaturate`: a glass bar over scrolling
|
|
1922
|
+
content), and cast a shadow that follows a shape instead of a box
|
|
1923
|
+
(`shapeShadow` on an image or artwork part, `groupShadow` on a container whose
|
|
1924
|
+
contents should cast one shadow). ADS composes them into the element's one
|
|
1925
|
+
`filter` and one `backdrop-filter` in a fixed order and writes the `-webkit-`
|
|
1926
|
+
companion. Their values are tokens: blur radii in `tokens/<Group>/blur.ads.css`,
|
|
1927
|
+
the saturation percentage in `saturation.ads.css`, and shadows in
|
|
1928
|
+
`shadow.ads.css`, where a shape or group shadow is one layer without spread.
|
|
1929
|
+
[Profile kinds](PROFILE-KINDS.md#surface-effects) has the fields, the rules and
|
|
1930
|
+
an example; the example design system's `profiles/Surfaces/materials.ads.ts` declares a
|
|
1931
|
+
translucent surface and a lifted drawing.
|
|
1932
|
+
|
|
1933
|
+
### Colours that depend on their surroundings
|
|
1934
|
+
|
|
1935
|
+
Some UI must change its colours with what it sits on. Examples are a dark footer
|
|
1936
|
+
or dark card on a light page, a button over a photo or a strongly coloured
|
|
1937
|
+
banner, the cells and icons of a selected table row, and the links inside a
|
|
1938
|
+
warning banner. ADS has two checked patterns for this.
|
|
1939
|
+
|
|
1940
|
+
#### Nested theme and brand sections
|
|
1941
|
+
|
|
1942
|
+
A design system opts in with `sections: true` in its foundation declaration:
|
|
1028
1943
|
|
|
1029
|
-
```
|
|
1030
|
-
|
|
1944
|
+
```ts
|
|
1945
|
+
// foundation.ads.ts
|
|
1946
|
+
export default foundation({
|
|
1947
|
+
// …
|
|
1948
|
+
themes: [
|
|
1949
|
+
{ name: "light", scheme: "light" },
|
|
1950
|
+
{ name: "dark", scheme: "dark" },
|
|
1951
|
+
],
|
|
1952
|
+
sections: true,
|
|
1953
|
+
});
|
|
1031
1954
|
```
|
|
1032
1955
|
|
|
1033
|
-
|
|
1034
|
-
|
|
1956
|
+
Then `data-theme="<name>"` or `data-brand="<name>"` on any element switches
|
|
1957
|
+
every token in the subtree of that element, exactly as the same attribute on
|
|
1958
|
+
`<html>` switches the page.
|
|
1035
1959
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
| `apple-touch-icon.png` | 180 × 180 |
|
|
1041
|
-
| `icon-192.png` | 192 × 192 |
|
|
1042
|
-
| `icon-512.png` | 512 × 512 |
|
|
1960
|
+
**Cost.** Sections are opt-in because they cost CSS. Every owner sheet carries
|
|
1961
|
+
toggle rules and a section rule for its context-dependent tokens. Without `sections: true`, ADS emits
|
|
1962
|
+
no section rule, and `data-theme` or `data-brand` below `<html>` changes
|
|
1963
|
+
nothing: the subtree keeps the page's values.
|
|
1043
1964
|
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
before generated files are replaced, so invalid artwork leaves prior outputs
|
|
1049
|
-
intact. Sources, duplicate output mounts, and symlinked write paths are checked.
|
|
1965
|
+
**Authoring.** Token sheets continue to declare their contexts on the root only
|
|
1966
|
+
(`:root`, `:root[data-theme="dark"]`, `:root[data-brand="iris"]`,
|
|
1967
|
+
`:root[data-brand="iris"][data-theme="dark"]`). Emission applies each context to
|
|
1968
|
+
sections also ([The output folder](#the-output-folder)).
|
|
1050
1969
|
|
|
1051
|
-
|
|
1970
|
+
**Selection.** The nearest `data-theme` and the nearest `data-brand` select the
|
|
1971
|
+
context independently, at any depth. The nearest attribute is the element's own
|
|
1972
|
+
or an ancestor's, `<html>` included.
|
|
1052
1973
|
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1974
|
+
- A `data-brand="iris"` section inside a dark page gets iris's dark values.
|
|
1975
|
+
- A `data-theme="light"` section inside a dark page resets to the values of the
|
|
1976
|
+
default theme.
|
|
1977
|
+
- The `color-scheme` of the section follows its theme, so native controls and
|
|
1978
|
+
`light-dark()` match.
|
|
1979
|
+
- `foundation.css` repaints its document surface.
|
|
1056
1980
|
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1981
|
+
The checks already evaluate every theme, brand and brand × theme context. The
|
|
1982
|
+
same findings thus prove contrast inside a section and on the page.
|
|
1983
|
+
|
|
1984
|
+
A dark footer on a light page:
|
|
1985
|
+
|
|
1986
|
+
```tsx
|
|
1987
|
+
// Application code: the footer and everything in it take the dark theme's values.
|
|
1988
|
+
<footer data-theme="dark">
|
|
1989
|
+
<p>Northstar · Terms · Privacy</p>
|
|
1990
|
+
<Button onClick={subscribe}>Subscribe</Button>
|
|
1991
|
+
</footer>
|
|
1066
1992
|
```
|
|
1067
1993
|
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
and
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
hook and size token for a logo/icon beside text. It centers the artwork and aligns
|
|
1115
|
-
the text runs, preserving intrinsic artwork proportions. The blocking check rejects
|
|
1116
|
-
conflicting styles and unresolved hooks; it does not restrict standalone artwork
|
|
1117
|
-
or prove optical balance. See the [worked branding example](../skills/ads-designer/references/branding.md#aligning-artwork-with-text)
|
|
1118
|
-
for markup, font trimming, browser support and review boundaries.
|
|
1119
|
-
|
|
1120
|
-
`ads audit` runs `ads check` first. A policy error such as `layout-fixed-width` or `img-attributes`
|
|
1121
|
-
does not stop it: it renders every scenario and reports those errors with its own, and exits 1. Only
|
|
1122
|
-
an error that stops rendering blocks it (`source-syntax`, `css-syntax`, `project-structure`,
|
|
1123
|
-
`styles-entry`, `scenario-contract`); a broken import fails the scenarios that reach it. `ads check`,
|
|
1124
|
-
`ads compile` and `ads validate` stop on every error, as before.
|
|
1125
|
-
|
|
1126
|
-
It adds a rendered check: axe-core (WCAG A/AA rules) in every component, pattern
|
|
1127
|
-
and composition scenario, once per declared brand and theme (`--scenario`, `--theme` and
|
|
1128
|
-
`--brand` narrow it). Each violation is an `a11y-axe` error naming the axe rule, WCAG
|
|
1129
|
-
criterion, themes and brands, failing elements and help link, and `ads audit` exits 1. It
|
|
1130
|
-
needs the project's Playwright and browser, as captures do. `ads validate` runs it too,
|
|
1131
|
-
over every scenario its change set reaches; MCP draft acceptance audits the draft
|
|
1132
|
-
owners' own scenarios before writing source unless `acceptance.audit` is `false`, and an
|
|
1133
|
-
`a11y-axe`, `a11y-non-text-contrast` or `layout-overflow` error rejects the change.
|
|
1134
|
-
`ads tokens --format dtcg` exports the tokens as W3C Design Tokens JSON for design tools
|
|
1135
|
-
(`--theme <name>` and `--brand <name>` select one context). MCP clients read the same export
|
|
1136
|
-
from `ads://project/tokens/dtcg` (`?theme=` and `?brand=`).
|
|
1137
|
-
|
|
1138
|
-
`themes` in `ds.config.json` declares the themes (a name and the color scheme for native
|
|
1139
|
-
controls; the first is the default), and the optional `brands` the brands (the first is the
|
|
1140
|
-
default). `data-theme="<name>"` and `data-brand="<name>"` on `<html>` theme the page, on any
|
|
1141
|
-
element one section; each element follows its nearest theme and its nearest brand, at any
|
|
1142
|
-
nesting depth, in every browser with CSS variables.
|
|
1143
|
-
|
|
1144
|
-
Write a token that differs per theme as one plain value per theme, named with the theme as
|
|
1145
|
-
suffix, on `:root`:
|
|
1994
|
+
**Guarantees.**
|
|
1995
|
+
|
|
1996
|
+
- Any element below a section resolves the context of the nearest `data-theme`
|
|
1997
|
+
and the nearest `data-brand` above it, at any depth and in any order of the
|
|
1998
|
+
two attributes.
|
|
1999
|
+
- A token whose value reads another token (`var(--action-fill)`) resolves with
|
|
2000
|
+
the values of the section.
|
|
2001
|
+
- A token that a context leaves undefined is undefined in such a section also.
|
|
2002
|
+
Its readers take their `var()` fallback.
|
|
2003
|
+
- Only declared names switch. An undeclared `data-theme` value leaves the
|
|
2004
|
+
section on the context of its parent.
|
|
2005
|
+
|
|
2006
|
+
**Limits.**
|
|
2007
|
+
|
|
2008
|
+
- A section switches whole themes and brands, never a subset of tokens.
|
|
2009
|
+
- A recipe's own declaration of a token on the section element wins over the
|
|
2010
|
+
value of the section. Sections apply at zero specificity, as the root values
|
|
2011
|
+
of the page are overridable.
|
|
2012
|
+
- Conditional overrides (`@media`, `@supports`) follow each condition as the
|
|
2013
|
+
checks evaluate it, one condition at a time. When two conditions hold at once
|
|
2014
|
+
and override the same token in different contexts, a section takes the value
|
|
2015
|
+
of the later condition, where the page root cascades them by specificity.
|
|
2016
|
+
- `@layer` is read as the checks read it. The contexts of a token in one layer
|
|
2017
|
+
behave exactly. A layered and an unlayered override of the same token are not
|
|
2018
|
+
ranked by layer.
|
|
2019
|
+
|
|
2020
|
+
#### Explicit choices
|
|
2021
|
+
|
|
2022
|
+
Sometimes a child must look different on one particular background that is not a
|
|
2023
|
+
whole theme, such as a photo or a brand-coloured banner. The child then exposes
|
|
2024
|
+
a closed choice that the caller sets, as Spectrum's `staticColor` prop does. The
|
|
2025
|
+
choice is typed and checked like any other choice. The caller must pass it.
|
|
2026
|
+
|
|
2027
|
+
```tsx
|
|
2028
|
+
// IconButton.tsx (sketch): tone selects a precompiled surface; the default adds nothing.
|
|
2029
|
+
export interface IconButtonProps {
|
|
2030
|
+
// …
|
|
2031
|
+
/** "on-dark" over a photo or dark fill the theme does not know about. */
|
|
2032
|
+
tone?: "default" | "on-dark";
|
|
2033
|
+
}
|
|
2034
|
+
const toneChoices = {
|
|
2035
|
+
default: undefined,
|
|
2036
|
+
"on-dark": recipe({ surface: "control-on-dark-surface" }).root,
|
|
2037
|
+
};
|
|
2038
|
+
// … className={`ds-icon-button ${anatomy} ${toneChoices[tone] ?? ""} …`}
|
|
2039
|
+
```
|
|
1146
2040
|
|
|
1147
2041
|
```css
|
|
2042
|
+
/* tokens/Surfaces/paint.ads.css: static paints, the same in every context. */
|
|
1148
2043
|
:root {
|
|
1149
|
-
--
|
|
1150
|
-
--
|
|
1151
|
-
--bg-canvas-light: var(--slate-1-light); /* a half refers to halves */
|
|
1152
|
-
--bg-canvas-dark: var(--slate-2-dark);
|
|
1153
|
-
--accent: var(--color-accent-9); /* single values stay single */
|
|
1154
|
-
}
|
|
1155
|
-
[data-brand="acme"] { /* a brand sets its own halves */
|
|
1156
|
-
--color-accent-9-light: oklch(55% .2 25);
|
|
1157
|
-
--color-accent-9-dark: oklch(70% .16 25);
|
|
2044
|
+
--static-dark-fill: #101c19;
|
|
2045
|
+
--static-light-text: #ffffff;
|
|
1158
2046
|
}
|
|
1159
2047
|
```
|
|
1160
2048
|
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
`"followSystemTheme": true` makes a page without `data-theme` take the first declared theme
|
|
1171
|
-
whose scheme matches the OS `prefers-color-scheme`; an explicit `data-theme` wins.
|
|
1172
|
-
|
|
1173
|
-
Beside it ADS generates `tokens/themes.generated.ts`, written, checked and kept current
|
|
1174
|
-
together with the CSS: every color token resolved for every theme and brand as `{ css, rgba }`
|
|
1175
|
-
for Canvas, WebGL and SVG renderers. The starter's `controllers/Palette` reads it:
|
|
1176
|
-
`paletteFor(element)` (the nearest theme and brand's palette), `observePalette(element,
|
|
1177
|
-
callback)` (once per theme or brand change) and `resolveColor(element, value)` (a non-token
|
|
1178
|
-
color, cached, without inserting elements). `render-color-probe` (review) flags color reads
|
|
1179
|
-
from the page inside per-item render callbacks. The same module exports `themed({ light,
|
|
1180
|
-
dark, … })` and `themedByScheme({ light, dark })` for per-theme values that come from data at
|
|
1181
|
-
runtime; `light-dark()` is an error in token sheets, component CSS and component string
|
|
1182
|
-
literals (`theme-light-dark`).
|
|
1183
|
-
|
|
1184
|
-
Errors: a token value set under `[data-theme]`, `prefers-color-scheme` or a combined brand
|
|
1185
|
-
selector (`theme-old-form`); a component or pattern styled by a `[data-theme]` or
|
|
1186
|
-
`[data-brand]` ancestor selector (`theme-selector`); a themed token without a half for every theme
|
|
1187
|
-
(`theme-coverage`); a token set both as one value and as halves (`theme-half-conflict`); a
|
|
1188
|
-
half that refers to a theme-following token instead of its half (`theme-half-reference`); a
|
|
1189
|
-
lone half (`theme-new-token`); themes without any halves (`theme-empty`); an undeclared
|
|
1190
|
-
brand name (`brand-undeclared`); a brand that gives a theme-following token one value
|
|
1191
|
-
(`brand-theme-value`) or only some of its halves or ramp steps (`brand-coverage`); a token
|
|
1192
|
-
only a brand defines (`brand-new-token`); a declared brand without values (`brand-empty`).
|
|
1193
|
-
See the [token guide](../skills/ads-designer/references/design-data.md) and the
|
|
1194
|
-
[accessibility guide](../skills/ads-designer/references/accessibility.md).
|
|
1195
|
-
|
|
1196
|
-
Initialized builds run:
|
|
2049
|
+
```ts
|
|
2050
|
+
// profiles/Surfaces/controls.ads.ts: the treatment.
|
|
2051
|
+
export const controlOnDarkSurface = profile({
|
|
2052
|
+
name: "control-on-dark-surface",
|
|
2053
|
+
kind: "surface",
|
|
2054
|
+
with: ["control-surface"],
|
|
2055
|
+
fields: { background: "--static-dark-fill", color: "--static-light-text" },
|
|
2056
|
+
});
|
|
2057
|
+
```
|
|
1197
2058
|
|
|
1198
|
-
```
|
|
1199
|
-
|
|
2059
|
+
```tsx
|
|
2060
|
+
// Application code: the caller knows what is behind the button.
|
|
2061
|
+
<figure>
|
|
2062
|
+
<img src={photo} alt="" />
|
|
2063
|
+
<IconButton icon={closeGlyph} label="Close" tone="on-dark" />
|
|
2064
|
+
</figure>
|
|
1200
2065
|
```
|
|
1201
2066
|
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
Mount `.ds/assets/` using the application's existing bundler. Init does not change
|
|
1208
|
-
framework configuration. For a Vite app with no other public directory, a project
|
|
1209
|
-
can set `publicDir: path.resolve(import.meta.dirname, ".ds/assets")`; when it
|
|
1210
|
-
already has public assets, use its existing asset merge/copy step and reject
|
|
1211
|
-
duplicate output paths. Use the same assets in development and production.
|
|
1212
|
-
Application manifest metadata and other platform exports remain project-owned.
|
|
1213
|
-
|
|
1214
|
-
### Generic architecture guards
|
|
1215
|
-
|
|
1216
|
-
`ads check` enforces reusable architecture policies alongside token checks:
|
|
1217
|
-
|
|
1218
|
-
| Guard | Shared enforcement |
|
|
1219
|
-
|----------------|------------------------------|
|
|
1220
|
-
| Public APIs | Inherited/explicit style props and open-ended visual color/fill/stroke strings |
|
|
1221
|
-
| Renderer boundaries | JSX inline styles, React/Preact CSS types, imperative `.style` writes, bulk style writes, and style-object escapes |
|
|
1222
|
-
| Asset ownership | ADS/public mount collisions, configured generated assets in source, and tracked generated output |
|
|
1223
|
-
| Product patterns | CSS/JSX namespace ownership; ADS implementations and showcase cannot import app source |
|
|
1224
|
-
| Primitive state | State-variable overrides outside components; undocumented non-state component variables |
|
|
1225
|
-
| Literal visual values | Absolute/font-relative lengths (including `ch` and root font units), durations and color/effect formulas require tokens; geometry angles and responsive viewport/container relationships remain available |
|
|
1226
|
-
| Fixed token ownership | Foreign token names, shared token overrides, misplaced component/pattern/showcase variables, and noncanonical foundation imports |
|
|
1227
|
-
| Showcase ownership | Fixture CSS/Linaria definitions, custom JSX classes, native controls/widget roles, state styling, private CSS/aliased imports, catalogue dependencies of a project's own showcase pages and source ownership, and runtime imports of fixtures/test helpers |
|
|
1228
|
-
| Scenario coverage | All public renderable UI has path-discovered entries, colocated fixtures, literal metadata and reachable public render references; runtime imports of scenarios/fixtures are rejected |
|
|
1229
|
-
| Data access | Direct global fetch/XHR/WebSocket/EventSource in ADS source is rejected; injected services, workers and lazy imports remain allowed |
|
|
1230
|
-
| Showcase coverage | Public ADS UI referenced by production JSX/React `createElement` has showcase render references; imports and tests alone do not count |
|
|
1231
|
-
|
|
1232
|
-
ES module imports, re-exports, and dynamic imports with literal specifiers use
|
|
1233
|
-
TypeScript's project configuration, including aliases and bundler resource
|
|
1234
|
-
queries. ADS implementations and showcase fixtures cannot import app code.
|
|
1235
|
-
Private imports within ADS implementations remain allowed, including when the ADS
|
|
1236
|
-
is nested inside `src/`. Application integration harnesses belong in test support.
|
|
1237
|
-
|
|
1238
|
-
Unknown configuration fields fail rather than silently weakening checks.
|
|
1239
|
-
|
|
1240
|
-
Notification usage can be enforced directly by ADS, without a project lint
|
|
1241
|
-
plugin or another parse/lint pass:
|
|
2067
|
+
Surface contrast proves the pair of the profile in every context, and these
|
|
2068
|
+
static paints do not change between contexts. The on-dark treatment is thus
|
|
2069
|
+
readable whatever theme the page uses. Whether the photo needs the treatment is
|
|
2070
|
+
the caller's decision, which the type makes explicit.
|
|
1242
2071
|
|
|
1243
|
-
|
|
1244
|
-
{
|
|
1245
|
-
"usage": {
|
|
1246
|
-
"notifications": [{
|
|
1247
|
-
"api": "toast",
|
|
1248
|
-
"host": "Toaster",
|
|
1249
|
-
"rootFiles": ["src/App.tsx", "design-system/components/Toast.ads.scenario.tsx"]
|
|
1250
|
-
}],
|
|
1251
|
-
"restrictedImports": ["sonner"]
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
```
|
|
2072
|
+
#### What neither pattern covers
|
|
1255
2073
|
|
|
1256
|
-
|
|
1257
|
-
recognizes named aliases and namespace imports, respecting shadowed bindings.
|
|
1258
|
-
It rejects direct module/render calls and calls in `use server` modules, requires
|
|
1259
|
-
a stable `id` for directly effect-created notifications with inspectable options,
|
|
1260
|
-
and restricts the host to the exact declared roots. Direct conditional hosts and
|
|
1261
|
-
duplicate static host IDs in one file fail. `restrictedImports` rejects runtime
|
|
1262
|
-
package and subpath imports, re-exports, literal dynamic imports and unshadowed
|
|
1263
|
-
`require` calls; type-only imports are exempt. Both policies are empty by default.
|
|
1264
|
-
|
|
1265
|
-
These native guards run in `ads check`, acceptance and validation. They inspect
|
|
1266
|
-
source and ADS runtime/scenario files, excluding tests and declaration contracts.
|
|
1267
|
-
They do not prove cross-module host uniqueness or trace helper calls, dynamic
|
|
1268
|
-
IDs/options, aliases assigned to local variables or framework render callbacks.
|
|
1269
|
-
Keep route persistence and lifecycle browser tests. ADS does not assume a toast
|
|
1270
|
-
implementation exists or install one.
|
|
1271
|
-
|
|
1272
|
-
Component interaction variables such as `--ds-button-hover-bg` cannot be
|
|
1273
|
-
assigned by app code, patterns, or showcase code. This includes static JSX style
|
|
1274
|
-
objects in files with inline-style exceptions. Reading a variable is allowed;
|
|
1275
|
-
the component owns its state definitions. Documented non-state customizations
|
|
1276
|
-
are registered explicitly. State variables cannot be allowlisted.
|
|
1277
|
-
|
|
1278
|
-
Keep renderer-, framework-, and component-specific project guards too. The
|
|
1279
|
-
shared tool does not validate a third-party graph renderer's own APIs, arbitrary
|
|
1280
|
-
runtime spreads, or the semantic meaning of a
|
|
1281
|
-
measured value. Register project-specific guard scripts in the existing build
|
|
1282
|
-
and configured acceptance/validation scripts. The project's own linter remains
|
|
1283
|
-
an independent build tool.
|
|
1284
|
-
|
|
1285
|
-
### Project boundaries and assets
|
|
1286
|
-
|
|
1287
|
-
Style permissions belong to their owner, in its `<Owner>.ads.contract.ts`, with paths
|
|
1288
|
-
relative to the contract:
|
|
2074
|
+
Two cases are not covered:
|
|
1289
2075
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
customization: ["--ds-panel-gap"],
|
|
1295
|
-
} satisfies UnitContract;
|
|
1296
|
-
```
|
|
2076
|
+
- state that cascades to children: a selected table row whose cells, icons and
|
|
2077
|
+
checkbox switch to "on selected" colours;
|
|
2078
|
+
- tinted containers: a success or warning banner whose links and icons must stay
|
|
2079
|
+
readable on its tint.
|
|
1297
2080
|
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
exception and never permits imperative writes by itself. `customization` lists a
|
|
1304
|
-
component's non-state `--ds-*` variables that patterns, the showcase and the
|
|
1305
|
-
application may set.
|
|
2081
|
+
These cases need a prop passed through each child (an explicit choice at every
|
|
2082
|
+
level), or a construct that lets a surface set the context that its descendants
|
|
2083
|
+
read. ADS has no such surface-context construct. Do not emulate one with a theme
|
|
2084
|
+
per state: a theme is a whole colour mode, and the checks would prove every
|
|
2085
|
+
token of it.
|
|
1306
2086
|
|
|
1307
|
-
|
|
2087
|
+
### Emitting the design system
|
|
1308
2088
|
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
"generatedPaths": ["dist", "dist-showcase", ".vite", ".ds"],
|
|
1315
|
-
"generatedFiles": ["icon-generated.png"]
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
```
|
|
2089
|
+
`ads emit [directory] [--json] [--force] [--watch]` compiles the design system
|
|
2090
|
+
into plain modules that an application can install without ADS. It captures the
|
|
2091
|
+
current revision of the design system once, runs `ads check` on it, and writes
|
|
2092
|
+
output only when that check passes. A failing check returns its findings and
|
|
2093
|
+
writes nothing.
|
|
1319
2094
|
|
|
1320
|
-
|
|
2095
|
+
Exit codes:
|
|
1321
2096
|
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
directories; nothing is inferred from filenames such as `favicon.ico`.
|
|
2097
|
+
- `0`: emitted, including "nothing changed".
|
|
2098
|
+
- `1`: a failing check or emission, or an output folder with hand edits.
|
|
2099
|
+
- `2`: an invalid invocation, an unusable output folder, a concurrent emit,
|
|
2100
|
+
cancellation, a source change during the emit, or a write failure.
|
|
1327
2101
|
|
|
1328
|
-
`
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
Git inspects tracked files, including nested workspaces. Outside a Git repo,
|
|
1332
|
-
there are no tracked outputs to check; other asset checks still run. Real Git
|
|
1333
|
-
inspection errors fail the check. These guards read files and never delete them.
|
|
2102
|
+
`--json` prints `{ "ok": true, "revision", "outDir", "written", "unchanged",
|
|
2103
|
+
"removed", "contract", "owners", "forced" }` or
|
|
2104
|
+
`{ "ok": false, "failure": { "kind", … } }`.
|
|
1334
2105
|
|
|
1335
|
-
|
|
2106
|
+
#### The output folder
|
|
1336
2107
|
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
2108
|
+
By default ADS writes the design package's `dist/`, which the package's
|
|
2109
|
+
`exports` publish. The one-application layout emits into the application's
|
|
2110
|
+
source ([Set up a design package](#set-up-a-design-package)):
|
|
1340
2111
|
|
|
1341
2112
|
```json
|
|
1342
|
-
{
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
2113
|
+
{ "compile": { "outDir": "../src/ui", "emitOnAccept": true } }
|
|
2114
|
+
```
|
|
2115
|
+
|
|
2116
|
+
- `compile.outDir` is relative to the design package, or `null` for the default.
|
|
2117
|
+
It can be outside the package (an application's source). It is never the
|
|
2118
|
+
package's root, the design-system folder or an ancestor of either, and never
|
|
2119
|
+
inside `node_modules`, `.git` or `.ds`, judged from the package root. Any
|
|
2120
|
+
other value fails to load.
|
|
2121
|
+
- `compile.emitOnAccept` (`true` or `false`, default `true`) emits after
|
|
2122
|
+
`ads_accept` publishes a draft ([Emit after acceptance](#emit-after-acceptance)).
|
|
2123
|
+
- ADS owns the output folder entirely: after every emit it holds exactly the
|
|
2124
|
+
emitted files. Emission refuses to replace a folder that holds files it did
|
|
2125
|
+
not write, so an `outDir` that points at existing application code cannot
|
|
2126
|
+
erase that code.
|
|
2127
|
+
- The folder is never an input. ADS does not capture, watch or analyze it, so an
|
|
2128
|
+
emit never changes the revision that a check or a preview sees.
|
|
2129
|
+
- The repository owner decides whether the folder is committed. ADS never edits
|
|
2130
|
+
`.gitignore`, and emission, checks and the contract behave the same in both
|
|
2131
|
+
cases.
|
|
2132
|
+
|
|
2133
|
+
The folder holds:
|
|
2134
|
+
|
|
2135
|
+
- **Owner modules and sheets**, at the owner's path inside the design system.
|
|
2136
|
+
The module is the authored source with class expressions replaced by compiled
|
|
2137
|
+
classes. `<Owner>.css` holds the token CSS that the owner uses and its
|
|
2138
|
+
compiled atomic rules. With `sections: true` it also holds the section rules
|
|
2139
|
+
that apply the contexts of those tokens to nested `data-theme`/`data-brand`
|
|
2140
|
+
sections.
|
|
2141
|
+
- **`foundation.css`**, the document CSS that `foundation.ads.ts` declares, once
|
|
2142
|
+
for the design system
|
|
2143
|
+
([contents](ARCHITECTURE.md#the-foundation-has-a-narrow-styling-role)): one
|
|
2144
|
+
`@font-face` per declared font face (`font-family`,
|
|
2145
|
+
`src: url("./fonts/…") format(…)`, `font-weight` value or range, `font-style`
|
|
2146
|
+
and `font-display`); the document reset (box sizing, body margin, inherited
|
|
2147
|
+
control fonts, and `display: none` for every `[hidden]` element except
|
|
2148
|
+
`hidden="until-found"`); the `text` and `surface` profile fields on `body`;
|
|
2149
|
+
the default focus indicator from the `focus` profile
|
|
2150
|
+
(`foundation({ focus: "keyboard-focus" })`) on every `:focus-visible` element,
|
|
2151
|
+
at zero specificity so that the indicator of a construction wins;
|
|
2152
|
+
`color-scheme` for each declared theme, with the two scheme switches beside
|
|
2153
|
+
it (`--ads-not-light`, `--ads-not-dark`) that display a
|
|
2154
|
+
[light or dark content image](ASSETS.md#a-content-image-with-a-light-and-a-dark-file);
|
|
2155
|
+
the page scroll lock behind a modal
|
|
2156
|
+
dialog, when an owner needs it; and the tokens that these use.
|
|
2157
|
+
- **`index.ts`**, the public barrel: the authored `<dsDir>/index.ts` with the
|
|
2158
|
+
same exports, which resolve to the emitted modules (public `@ds` imports, if
|
|
2159
|
+
any, made relative). It imports `foundation.css` first. It is the import entry
|
|
2160
|
+
of the output: an application imports the emitted design system, with its
|
|
2161
|
+
document CSS, through it, as it imports `@ds` while authoring. With declared
|
|
2162
|
+
fonts it also re-exports `fonts.ts`, and with an application icon
|
|
2163
|
+
`app-icons.ts`.
|
|
2164
|
+
- **Fonts**, with declared fonts: each face's file at
|
|
2165
|
+
`fonts/<family-slug>/<source>`, and `fonts.ts`, the preload list. Previews use
|
|
2166
|
+
the emitted tree, so they draw the faces also. `fonts.ts` exports:
|
|
2167
|
+
- `fontPreloads` (`{ href, type }[]`): the face that the document `text`
|
|
2168
|
+
profile draws first, in the default context, then the `preload` faces of
|
|
2169
|
+
each declaration, once each;
|
|
2170
|
+
- `preloadFonts(doc = document)`, which adds one
|
|
2171
|
+
`<link rel="preload" as="font" crossorigin>` per face, once;
|
|
2172
|
+
- `fontPreloadTags()` and `fontPreloadHeader()`, for a build step, a server
|
|
2173
|
+
render or a `Link` header.
|
|
2174
|
+
|
|
2175
|
+
Each href is a standard asset import of the file
|
|
2176
|
+
(`import font0 from "./fonts/…"`), which the application's bundler resolves to
|
|
2177
|
+
its public URL: the same in the client and server builds, and the same as the
|
|
2178
|
+
`url()` of the stylesheet, so a preloaded font downloads once. Call
|
|
2179
|
+
`preloadFonts()` in the app entry before the first render, or render
|
|
2180
|
+
`fontPreloadTags()` into the server's `<head>` (`preloadFonts()` then adds
|
|
2181
|
+
nothing).
|
|
2182
|
+
- **Application icon**, with `foundation({ appIcon })`: each export at its
|
|
2183
|
+
`file`, and the platform set under `icons/`: `favicon.svg` (the drawing),
|
|
2184
|
+
`favicon.ico` (16, 32 and 48 px), `apple-touch-icon.png` (180 px),
|
|
2185
|
+
`icon-192.png` and `icon-512.png`, and with a maskable icon
|
|
2186
|
+
`icon-maskable-192.png` and `icon-maskable-512.png`. `app-icons.ts` exports:
|
|
2187
|
+
- `appIconLinks` (`{ rel, href, sizes?, type }[]`): the ICO, the SVG and the
|
|
2188
|
+
touch icon;
|
|
2189
|
+
- `appIconTags()`: the same as `<link>` tags for the head of the page, from a
|
|
2190
|
+
build step, prerender or server render;
|
|
2191
|
+
- `webManifestIcons` (`{ src, sizes, type, purpose }[]`) for the `icons` of a
|
|
2192
|
+
web app manifest, the maskable ones with `purpose: "maskable"`.
|
|
2193
|
+
|
|
2194
|
+
Each URL is an asset import of the file (`import icon0 from "./icons/…"`). ADS
|
|
2195
|
+
does not write into the application's `public/` folder: copy the files, or
|
|
2196
|
+
import them from the output. ADS caches renders by the bytes of the drawing
|
|
2197
|
+
and the settings, so an emit with an unchanged icon renders nothing. Committed
|
|
2198
|
+
launcher or installer icons are committed with the folder.
|
|
2199
|
+
- **Helper modules** that the owners or the barrel import, with public `@ds`
|
|
2200
|
+
imports made relative. A public helper that no owner imports is emitted also.
|
|
2201
|
+
A module's `glyph("close")` becomes the reference literal `{ asset, source }`
|
|
2202
|
+
(the SVG text of its drawing), and the declaration of a glyph set under
|
|
2203
|
+
`assets/` becomes its name list. The application's bundler thus drops a glyph
|
|
2204
|
+
that is not imported.
|
|
2205
|
+
- **`ads-glyph.ts`**, the types-only `Glyph`/`GlyphSet` module, when an emitted
|
|
2206
|
+
module uses glyph references. Their `@reqvire-org/ads/asset` type imports are
|
|
2207
|
+
rewritten to it.
|
|
2208
|
+
- **`ads-dependencies.json`**, the packages that the emitted modules require.
|
|
2209
|
+
- **`package.json`**, `{ "sideEffects": ["*.css"] }`: an emitted module does
|
|
2210
|
+
nothing when it loads except import its stylesheet. The file has no `type`
|
|
2211
|
+
field, because the output is source for bundlers, not a package that Node
|
|
2212
|
+
runs.
|
|
2213
|
+
- **`ads-contract.json`**, the record of the emission: `format`
|
|
2214
|
+
(`"ads-contract"`), `version` (2), the source `revision`, `files` with the
|
|
2215
|
+
`sha256` of each emitted file, and `platform`
|
|
2216
|
+
([Browser targets](#browser-targets)). The contract does not list itself. ADS
|
|
2217
|
+
also reads a version 1 contract, which has no `platform`, and verifies its
|
|
2218
|
+
folder in the same way; the next emit replaces it.
|
|
2219
|
+
|
|
2220
|
+
#### Consuming the output
|
|
2221
|
+
|
|
2222
|
+
The output ships source only: `.ts`/`.tsx` modules, `.css` sheets and the JSON
|
|
2223
|
+
records, plus the files of the declared fonts and the images of the application
|
|
2224
|
+
icon. An application consumes it through a bundler (Vite, Bun, Next.js, or a
|
|
2225
|
+
library build such as tsup or Vite library mode). Applications import the
|
|
2226
|
+
emitted barrel, never authoring source, which holds build-time macros. With the
|
|
2227
|
+
default output folder, for example:
|
|
2228
|
+
|
|
2229
|
+
```jsonc
|
|
2230
|
+
// tsconfig.json
|
|
2231
|
+
{ "compilerOptions": { "paths": { "@ds": ["./design-system/dist/index.ts"] } } }
|
|
2232
|
+
```
|
|
2233
|
+
|
|
2234
|
+
```ts
|
|
2235
|
+
// vite.config.ts
|
|
2236
|
+
export default defineConfig({ resolve: { alias: { "@ds": "/design-system/dist/index.ts" } } });
|
|
2237
|
+
```
|
|
2238
|
+
|
|
2239
|
+
**JSX.** The output carries no JSX pragma: compile it with the JSX runtime of
|
|
2240
|
+
the project's framework. For Preact, set `"jsx": "react-jsx"` and
|
|
2241
|
+
`"jsxImportSource": "preact"` in the application's `tsconfig.json` (Vite and Bun
|
|
2242
|
+
read them from there).
|
|
2243
|
+
|
|
2244
|
+
**Stylesheets.** Each owner module begins with a side-effect import of its own
|
|
2245
|
+
sheet (`import "./Button.css";`). There is no separate stylesheet to include: a
|
|
2246
|
+
bundle that imports an owner gets its CSS. The JavaScript of unused owners is
|
|
2247
|
+
tree-shaken with every bundler.
|
|
2248
|
+
|
|
2249
|
+
- Vite, webpack and Next.js read the nearest `package.json` of each file. A
|
|
2250
|
+
bundler that honours the output's `sideEffects` bundles, through `index.ts`,
|
|
2251
|
+
only the sheets of the owners that the application uses: an owner imported
|
|
2252
|
+
through the barrel bundles the same CSS as a direct import of its module.
|
|
2253
|
+
- Bun.build ignores `sideEffects` for CSS and bundles every public owner's sheet
|
|
2254
|
+
that the barrel reaches. With Bun.build, import the owners you use directly from the
|
|
2255
|
+
output (`<outDir>/components/Actions/Button/Button`, with
|
|
2256
|
+
`<outDir>/foundation.css`).
|
|
2257
|
+
- Other bundlers that honour `sideEffects` for CSS imports should behave as Vite
|
|
2258
|
+
does. ADS tests Vite and Bun.build
|
|
2259
|
+
(`tests/integration/packed-emitted-app.test.ts`).
|
|
2260
|
+
|
|
2261
|
+
**Asset imports.** `fonts.ts` and `app-icons.ts` import their files (`.woff2`,
|
|
2262
|
+
`.woff`, `.ttf`, `.otf`, `.ico`, `.svg`, `.png`) as standard asset imports, each
|
|
2263
|
+
marked `// @ts-ignore`. A bundler's own types (`vite/client`) declare those
|
|
2264
|
+
modules, and a second wildcard declaration would conflict with them.
|
|
2265
|
+
|
|
2266
|
+
- Vite resolves the `url()` of the stylesheet and those imports to one hashed
|
|
2267
|
+
file, in client and SSR builds. It inlines files under
|
|
2268
|
+
`build.assetsInlineLimit` (4 KiB by default) as data URLs in both; set `0` to
|
|
2269
|
+
keep every icon a file.
|
|
2270
|
+
- Bun.build reads the `paths` alias itself and copies each imported file under a
|
|
2271
|
+
hashed name. Set `publicPath` (for example `"/"`) so that the imported URLs
|
|
2272
|
+
are absolute, not relative to the page.
|
|
2273
|
+
- Bun.build inlines a `url()` file of a stylesheet smaller than 128 KiB as a
|
|
2274
|
+
data URL. A small font thus arrives with the CSS, and a preload of its file is
|
|
2275
|
+
a second download. With Bun.build, preload only faces of 128 KiB or more.
|
|
2276
|
+
|
|
2277
|
+
**Server rendering.** The generated modules (`fonts.ts`, `app-icons.ts`, the
|
|
2278
|
+
palette) touch no `window` or `document` when they load. The example design system's owners
|
|
2279
|
+
use the DOM only in effects, ref callbacks and handlers, so the emitted example design system
|
|
2280
|
+
renders with `react-dom/server` or `preact-render-to-string` and hydrates
|
|
2281
|
+
without mismatch. For other owners, their own module-level code decides this.
|
|
2282
|
+
|
|
2283
|
+
- Values spread with `recipe.measured.props(…)` are in the server's markup.
|
|
2284
|
+
Values set with `recipe.measured.set` or `recipe.paints.set` are written by
|
|
2285
|
+
the client after hydration.
|
|
2286
|
+
- The server render can put `fontPreloadTags()` and `appIconTags()` in the head
|
|
2287
|
+
of the page. A Vite SSR build gives each file the URL that the client build
|
|
2288
|
+
gives it, so the server's tags are the client's and the client's
|
|
2289
|
+
`preloadFonts()` adds nothing
|
|
2290
|
+
(`tests/browser/emitted-ssr-hydration-browser.test.ts`).
|
|
2291
|
+
|
|
2292
|
+
#### Browser targets
|
|
2293
|
+
|
|
2294
|
+
ADS does not certify browser versions. The `platform` section of the contract
|
|
2295
|
+
states, as facts read from the emitted sheets, what the emitted CSS uses beyond
|
|
2296
|
+
the CSS core. The core is CSS 2.1 and the long-established CSS3 modules:
|
|
2297
|
+
selectors level 3, media queries, flexbox, grid layout, custom properties,
|
|
2298
|
+
`calc()` and the comparison functions, transforms, transitions, animations and
|
|
2299
|
+
web fonts.
|
|
2300
|
+
|
|
2301
|
+
```jsonc
|
|
2302
|
+
"platform": {
|
|
2303
|
+
"features": {
|
|
2304
|
+
"popover": { "css": [":popover-open"], "owners": ["components/Overlays/Menu/Menu.tsx"],
|
|
2305
|
+
"degrades": "Required by popovers and menus: …" },
|
|
2306
|
+
"lh-unit": { "css": ["lh"], "owners": ["components/Actions/Button/Button.tsx", "…"],
|
|
2307
|
+
"degrades": "Declarations measured in lines are dropped: control boxes sized by 1lh fall back to their content height, …" },
|
|
2308
|
+
"user-select": { "css": ["user-select"], "prefixed": ["-webkit-user-select"], "owners": ["…"], "degrades": "Text stays selectable; …" },
|
|
2309
|
+
"text-wrap-balance": { "css": ["text-wrap: balance"], "owners": ["…"], "degrades": "Normal wrapping: line lengths are not balanced." }
|
|
2310
|
+
},
|
|
2311
|
+
"unrecognized": {},
|
|
2312
|
+
"assumptions": ["foundation.css loads before every owner sheet: …", "…"]
|
|
1348
2313
|
}
|
|
1349
2314
|
```
|
|
1350
2315
|
|
|
1351
|
-
`
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
the
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
2316
|
+
- `features`, by feature id:
|
|
2317
|
+
- `css`: the constructs found (properties, value keywords such as
|
|
2318
|
+
`display: -webkit-box`, at-rules, media features, pseudo-classes, units,
|
|
2319
|
+
functions);
|
|
2320
|
+
- `prefixed`: the vendor-prefixed forms that ADS writes beside or for the
|
|
2321
|
+
standard one (the clamp's `-webkit-box` form, `-webkit-user-select`);
|
|
2322
|
+
- `owners`: the owners whose sheets use it (`foundation.css` for the document
|
|
2323
|
+
sheet);
|
|
2324
|
+
- `degrades`: what happens in a browser without it. Required features
|
|
2325
|
+
(popover, modal dialogs, logical properties, `:focus-visible`) say so.
|
|
2326
|
+
Progressive enhancements (balanced and pretty wrapping, `@starting-style`,
|
|
2327
|
+
text-box trim) describe the plainer result.
|
|
2328
|
+
- `unrecognized`: constructs that the inventory has no entry for, with their
|
|
2329
|
+
owners. Typically this is a function in the project's own token values. Check
|
|
2330
|
+
them yourself.
|
|
2331
|
+
- `assumptions`: what the output needs of the document. `foundation.css` loads
|
|
2332
|
+
first (or, for a namespaced emission, the host page's own document styles).
|
|
2333
|
+
Themes and brands are selected with `data-theme`/`data-brand` on the root or a
|
|
2334
|
+
section. The root font size is the 16px that ADS's pixel-equivalent checks
|
|
2335
|
+
assume. Operating-system text scaling is not audited.
|
|
2336
|
+
|
|
2337
|
+
Check the listed features against your own browser targets, for example with
|
|
2338
|
+
Baseline data, before you rely on a degradation that you cannot accept. ADS has
|
|
2339
|
+
no declared targets with generated fallbacks.
|
|
2340
|
+
|
|
2341
|
+
#### Text scaling in the application
|
|
2342
|
+
|
|
2343
|
+
ADS owns the design system, not the application's `index.html`, and never writes
|
|
2344
|
+
document metadata (no `<meta name="text-scale">`). A design system is safe for
|
|
2345
|
+
the reader's text size, including the text scaling of the operating system where
|
|
2346
|
+
the browser passes it on, under three conditions.
|
|
2347
|
+
|
|
2348
|
+
ADS checks the two that belong to the design system. Every font size and length
|
|
2349
|
+
line height is in `rem` or `em` (`a11y-text-resize`). Every scenario keeps its
|
|
2350
|
+
content with 200% text, 200% zoom, WCAG text spacing and at 320 px (the text
|
|
2351
|
+
passes of the [render audit](#render-audit)). `foundation.css` sets no root font
|
|
2352
|
+
size, so `rem` starts from the browser's default (`medium`), which is where the
|
|
2353
|
+
reader's setting arrives.
|
|
2354
|
+
|
|
2355
|
+
The third is the application's document, which ADS does not check:
|
|
2356
|
+
|
|
2357
|
+
- Leave the root font size to the reader: no `px` `font-size` on `html` or
|
|
2358
|
+
`:root`. A percentage or `rem` scales with the setting; a `px` value replaces
|
|
2359
|
+
it.
|
|
2360
|
+
- Let the reader zoom: no `user-scalable=no`, and no `maximum-scale` below 2, in
|
|
2361
|
+
the viewport `<meta>` (WCAG 1.4.4).
|
|
2362
|
+
- To receive the operating system's text scale on browsers that support it, opt
|
|
2363
|
+
in with `<meta name="text-scale" content="scale">` in the head of the
|
|
2364
|
+
document. The tag tells the browser that the page scales its own text. The
|
|
2365
|
+
browser then sets the default font size from the system setting, and does not
|
|
2366
|
+
zoom or enlarge text on its own. Without the tag, those browsers keep their
|
|
2367
|
+
own adjustment, which the zoom pass covers. Add the tag when the application's
|
|
2368
|
+
own CSS also sizes text in `rem` or `em`: ADS checks the owners of the design
|
|
2369
|
+
system for this, not the pages of the application.
|
|
2370
|
+
|
|
2371
|
+
#### How an emit writes
|
|
2372
|
+
|
|
2373
|
+
- **Incremental.** An emit writes only the files whose bytes changed, and
|
|
2374
|
+
removes the files that are no longer emitted. An emit with no source change
|
|
2375
|
+
writes nothing. Owners whose analysis is unchanged keep their emitted module
|
|
2376
|
+
and are not analyzed or serialized again. This applies within one running ADS
|
|
2377
|
+
process, such as the MCP server or `ads emit --watch`; a one-off CLI run
|
|
2378
|
+
reuses only the persisted extraction cache.
|
|
2379
|
+
- **Whole-folder swap.** ADS stages the new tree beside the output folder and
|
|
2380
|
+
swaps it in with two renames, so a reader never sees a mix of old and new
|
|
2381
|
+
files. Between the renames the folder is briefly absent, because Bun offers no
|
|
2382
|
+
atomic directory exchange. A tool that reads it at that instant can see it
|
|
2383
|
+
missing and must retry. A failure or cancellation leaves the old tree
|
|
2384
|
+
untouched.
|
|
2385
|
+
- **One writer.** One emit writes a given output folder at a time, under a lock
|
|
2386
|
+
in `.ds/locks/`. An emit from another process is refused as `output-busy`. ADS
|
|
2387
|
+
removes a lock that a stopped process left. Within one process
|
|
2388
|
+
(`ads emit --watch`, or the MCP server's `ads_emit` and emit after
|
|
2389
|
+
acceptance), an emit requested while another runs is queued: at most one
|
|
2390
|
+
follow-up per output folder, which emits the source as it is when it starts.
|
|
2391
|
+
|
|
2392
|
+
**Watch mode.** `ads emit --watch` emits once, then again whenever the inputs of
|
|
2393
|
+
the design system change (the files that `ads check` captures, never the output
|
|
2394
|
+
folder).
|
|
2395
|
+
|
|
2396
|
+
- Changes that arrive within 150 ms of the first one share one emit. An event
|
|
2397
|
+
that leaves the bytes of every input as they were emitted (a touched file, a
|
|
2398
|
+
restored edit) emits nothing.
|
|
2399
|
+
- Each emit prints one line with the revision, the written, unchanged and
|
|
2400
|
+
removed counts and its duration, or its failure (findings on stderr). The
|
|
2401
|
+
watch continues after a failure. With `--json`, each emit is one JSON object
|
|
2402
|
+
per line: the `--json` result plus `event: "emit"` and `elapsedMs`.
|
|
2403
|
+
- The analysis stays warm, so after a one-owner edit only that owner is analyzed
|
|
2404
|
+
and serialized again.
|
|
2405
|
+
- SIGINT, SIGTERM or the end of stdin stops the watch. Run it with an open
|
|
2406
|
+
stdin; `< /dev/null` stops it immediately. A running emit is cancelled without
|
|
2407
|
+
a partial folder, and the lock, the watchers and the analysis process are
|
|
2408
|
+
released (exit 0).
|
|
2409
|
+
|
|
2410
|
+
#### Emit after acceptance
|
|
2411
|
+
|
|
2412
|
+
When `ads_accept` publishes a draft, the MCP server writes the published
|
|
2413
|
+
revision into the output folder, unless `compile.emitOnAccept` is `false`. It
|
|
2414
|
+
does not emit on a dry run, a rejection, a cancellation before publication or a
|
|
2415
|
+
stale revision. [Emitting from MCP](MCP.md#emitting-from-mcp) gives the `emit`
|
|
2416
|
+
result, including its `from` (`candidate-tree` or `published-source`).
|
|
2417
|
+
|
|
2418
|
+
- The source is published first, then the output folder. Acceptance never
|
|
2419
|
+
depends on the emit, and no owner is analyzed again for it.
|
|
2420
|
+
- A failed write (a hand edit, a busy folder, a cancellation, a write error) is
|
|
2421
|
+
reported as a failed emit with its `repair`, never as a success. The folder
|
|
2422
|
+
keeps its previous emission whole, `ads check` reports it `generated-stale`
|
|
2423
|
+
until `ads emit` runs, and nothing retries the emit.
|
|
2424
|
+
- The emit is never forced. Hand edits are reported as `output-modified`.
|
|
2425
|
+
- The MCP tool `ads_emit` (mutation-enabled servers) runs the same emit on
|
|
2426
|
+
demand. `ads_delete` publishes and emits in the same way.
|
|
2427
|
+
|
|
2428
|
+
#### Hand edits and out-of-date output
|
|
2429
|
+
|
|
2430
|
+
**Hand edits.** Before it writes, ADS verifies the folder against its
|
|
2431
|
+
`ads-contract.json`. A file edited after emission, a missing file, a file that
|
|
2432
|
+
ADS did not emit, or a non-empty folder without a contract refuses the emit
|
|
2433
|
+
(`output-modified`, exit 1), and nothing is written. Make the change in the
|
|
2434
|
+
design-system source, or run `ads emit --force` to overwrite the folder.
|
|
2435
|
+
`ads check` reports the same differences as blocking `generated-modified`
|
|
2436
|
+
findings, each hand-edited, missing or foreign file on its own. It reports
|
|
2437
|
+
nothing while the folder does not exist. The contract reports a hand-edited icon
|
|
2438
|
+
like any emitted file.
|
|
2439
|
+
|
|
2440
|
+
**Out-of-date output.** The contract records the source revision that the output
|
|
2441
|
+
was emitted from: the digest of the inputs that `ads check` captures for the
|
|
2442
|
+
same bytes. When the design system has changed since then, `ads check` (in the
|
|
2443
|
+
CLI, MCP and validation) lists a `generated-stale` info item at the contract,
|
|
2444
|
+
naming both revisions and `ads emit`. The item never blocks a check or an
|
|
2445
|
+
acceptance. After an accept with `compile.emitOnAccept: false`, it is expected
|
|
2446
|
+
until the next emit. `ads check --json` lists it, and the text report counts it
|
|
2447
|
+
among the info notes. A folder without a readable contract is
|
|
2448
|
+
`generated-modified`.
|
|
2449
|
+
|
|
2450
|
+
#### Renderer palette
|
|
2451
|
+
|
|
2452
|
+
Code that draws on a canvas or with WebGL needs theme colours as JavaScript
|
|
2453
|
+
values. A design system that declares `palette: true` in `foundation()` (the
|
|
2454
|
+
example design system does) keeps `<dsDir>/palette.generated.ts`: every paint-role token,
|
|
2455
|
+
resolved in every declared context (each theme of the default brand, then
|
|
2456
|
+
`<brand>/<theme>`). A design system that does not declare it gets none.
|
|
2457
|
+
|
|
2458
|
+
- The module exports `palette`, `themes`, `brands`, `contexts`,
|
|
2459
|
+
`defaultContext`, `systemThemes`, `themeSchemes` and `unresolved`, and the
|
|
2460
|
+
types `ColorToken`, `Palette`, `PaletteColor`, `PaletteContext` and `Theme`.
|
|
2461
|
+
- Themes, brands and the default come from `foundation.ads.ts`, in declared
|
|
2462
|
+
order. A value is what the `:root` rules of the token sheets cascade to on a
|
|
2463
|
+
root with that `data-theme`/`data-brand`. `@media`/`@supports` variants are
|
|
2464
|
+
not contexts.
|
|
2465
|
+
- `systemThemes` names the theme that each OS colour scheme selects when the
|
|
2466
|
+
foundation declares `followSystemTheme: true`. Otherwise it is `null`.
|
|
2467
|
+
- The module is generated source. Owners and controllers import it relatively
|
|
2468
|
+
and typecheck against its exact token union, and emission copies it as a plain
|
|
2469
|
+
module. The example design system's `controllers/Palette/Palette.ts` reads it (`paletteFor`,
|
|
2470
|
+
`observePalette`, `resolveColor`, `paletteContext`, exported from the barrel).
|
|
2471
|
+
- `ads emit` never writes source, so it refuses while `ads check` reports
|
|
2472
|
+
`palette-generated`
|
|
2473
|
+
([Regenerating generated source](#regenerating-generated-source)).
|
|
2474
|
+
|
|
2475
|
+
### Deleting declared targets
|
|
2476
|
+
|
|
2477
|
+
Through MCP (`--mutations`), `ads_delete` removes declared targets (tokens,
|
|
2478
|
+
profiles, components, patterns, assets, glyph sets, fonts) without a draft.
|
|
2479
|
+
[Guarded deletion](MCP.md#guarded-deletion) gives the inputs, what each target
|
|
2480
|
+
kind removes, the refusals and the result.
|
|
2481
|
+
|
|
2482
|
+
- Name each target by identity: a token's custom property (`--radius-spare`); a
|
|
2483
|
+
profile, asset, glyph-set or font family name; or a component or pattern owner
|
|
2484
|
+
path (`Actions/Button`). Pass the `ads_status.sourceRevision` at which you
|
|
2485
|
+
inspected them, and try `dryRun: true` first.
|
|
2486
|
+
- ADS refuses the deletion while anything that survives still refers to a
|
|
2487
|
+
target, while an open draft holds a changed file, and at another source
|
|
2488
|
+
revision. Change a dependent first, or name it in the same request. ADS never
|
|
2489
|
+
deletes dependents on its own.
|
|
2490
|
+
- The candidate runs the same checks as `ads_accept`. On success ADS writes the
|
|
2491
|
+
source, then the output folder.
|
|
2492
|
+
- The protection covers the design system that ADS checks. ADS cannot see
|
|
2493
|
+
applications maintained elsewhere, or consumers of a published package, that
|
|
2494
|
+
still import a removed export.
|
|
2495
|
+
|
|
2496
|
+
### Inspecting tokens and the public API
|
|
2497
|
+
|
|
2498
|
+
`ads tokens [directory]` lists every token that the role sheets
|
|
2499
|
+
(`tokens/**/<role>.ads.css`) declare, by group (the folder of the sheet below
|
|
2500
|
+
`tokens/`), role (the name of the sheet) and name. Each token has one line with
|
|
2501
|
+
its role, its `:root` value (the default theme and brand), its value-shape
|
|
2502
|
+
status when it is not valid, and its first declaration. Below it is each theme,
|
|
2503
|
+
brand or condition whose value differs:
|
|
2504
|
+
|
|
2505
|
+
```text
|
|
2506
|
+
ADS tokens: 1 of 1
|
|
2507
|
+
--action-fill Surfaces/paint #145e50 design-system/tokens/Surfaces/paint.ads.css:8
|
|
2508
|
+
:root[data-theme="dark"]: #a6e8cf
|
|
2509
|
+
:root[data-brand="iris"]: #51429a
|
|
2510
|
+
```
|
|
2511
|
+
|
|
2512
|
+
- `--query text` keeps tokens whose name, role or group contains the text. Token
|
|
2513
|
+
names are accepted as written (`--query --action-fill`). `--role` and
|
|
2514
|
+
`--group` select exactly, and `--limit n` bounds the listing.
|
|
2515
|
+
- `--json` prints the page `{ total, tokens, nextOffset?, groups, contexts,
|
|
2516
|
+
reach }`. [The token inventory](MCP.md#the-token-inventory) describes the
|
|
2517
|
+
fields of each token: `role`, `group`, `shape`, `value`, `values`,
|
|
2518
|
+
`declarations`, `profiles`, `owners` and `type`. `reach.complete` is false
|
|
2519
|
+
while an owner was not analyzed.
|
|
2520
|
+
- `--format dtcg` prints every token as one
|
|
2521
|
+
[W3C Design Tokens (DTCG)](https://www.designtokens.org/tr/2025.10/format/)
|
|
2522
|
+
document. The selection options do not apply to the export.
|
|
2523
|
+
- The structure is `group → role → name` (without `--`), with `$type` from
|
|
2524
|
+
the value shape of the role.
|
|
2525
|
+
- `$value` is the `:root` value: an exact `var(--token)` as a
|
|
2526
|
+
`{group.role.name}` reference; a colour, dimension, duration, font family
|
|
2527
|
+
or cubic Bézier as its DTCG object; other values as CSS text marked
|
|
2528
|
+
`css: true`.
|
|
2529
|
+
- `$extensions["org.reqvire.ads"]` has the token's `name`, `role`, `group` and
|
|
2530
|
+
`modes`: the value of every theme, brand and condition that differs, keyed
|
|
2531
|
+
`dark`, `iris`, `iris/dark` or `dark @media (…)`. The document's own
|
|
2532
|
+
extension lists the context of each mode.
|
|
2533
|
+
- The output is deterministic (keys sorted), so you can commit and diff it.
|
|
2534
|
+
|
|
2535
|
+
Both forms read the sources as `ads check` does, never a generated file. The
|
|
2536
|
+
inventory reports value-shape problems but never fails (exit 0); `ads check`
|
|
2537
|
+
fails for them. Tokens that do not read (for example, a sheet names an
|
|
2538
|
+
undeclared theme) are an execution error (exit 2) that names the first finding
|
|
2539
|
+
of `ads check`.
|
|
2540
|
+
|
|
2541
|
+
MCP serves the same inventory (`ads_tokens`, `ads://project/tokens`,
|
|
2542
|
+
`ads://project/tokens/dtcg`) and the public catalogue: `ads_catalog` lists every
|
|
2543
|
+
public export with its API role, source, scenarios and props and, for an owner,
|
|
2544
|
+
the profiles it selects ([MCP inspection](MCP.md#inspect-the-design-system)).
|
|
2545
|
+
|
|
2546
|
+
### Regenerating generated source
|
|
2547
|
+
|
|
2548
|
+
`ads sync [directory] [--json]` creates and refreshes the generated source files
|
|
2549
|
+
that `foundation.ads.ts` declares. The only such file is
|
|
2550
|
+
`<dsDir>/palette.generated.ts` (`palette: true`), generated from the token
|
|
2551
|
+
sheets and `foundation.ads.ts`.
|
|
2552
|
+
|
|
2553
|
+
- If you edit source directly, run `ads sync` after you declare the palette, or
|
|
2554
|
+
change colour tokens or the declared themes and brands. Until then,
|
|
2555
|
+
`ads check` reports a blocking `palette-generated` finding. It reports the
|
|
2556
|
+
same finding for a module that is present without the declaration.
|
|
2557
|
+
- Drafts need no sync: acceptance creates or regenerates the file in the
|
|
2558
|
+
candidate before its check, so the published change includes it.
|
|
2559
|
+
- The command prints each file that it created or wrote, or that every generated
|
|
2560
|
+
file is current. It never creates an undeclared file, and leaves a file that
|
|
2561
|
+
is present without its declaration unchanged (declare it or delete it).
|
|
2562
|
+
- Exit codes: 0 created, written or current; 1 the inputs of a generated file do
|
|
2563
|
+
not read, or the file is present without its declaration (run `ads check` for
|
|
2564
|
+
the located finding); 2 a usage error.
|
|
2565
|
+
- With `--json` it prints `{ ok, root, files: [{ source, file, outcome }] }`.
|
|
2566
|
+
`outcome` is `absent` (neither declared nor present), `undeclared`, `current`,
|
|
2567
|
+
`created`, `written` or `inputs-unreadable`.
|
|
2568
|
+
|
|
2569
|
+
**Project guards.** Put a component-specific guard beside its owner, and
|
|
2570
|
+
register its command in the project build or in `acceptance.scripts`. Core
|
|
2571
|
+
tooling imports no particular component. For native ADS gates outside
|
|
2572
|
+
package-manager scripts, run the installed tool directly:
|
|
1383
2573
|
|
|
1384
2574
|
```sh
|
|
1385
2575
|
ads check .
|
|
1386
|
-
ads
|
|
2576
|
+
ads emit .
|
|
1387
2577
|
```
|
|
1388
2578
|
|
|
1389
|
-
|
|
2579
|
+
Keep unrelated lint, type checking and framework build commands. Ignore `.ds/`.
|
|
2580
|
+
Generated paths refer to the project and its locally installed tool.
|
|
1390
2581
|
|
|
1391
2582
|
## External content
|
|
1392
2583
|
|
|
1393
|
-
Use the repository's `ads-import` skill for selected external ADS source or
|
|
1394
|
-
values, and `ads-port` for a native implementation inspired by an upstream
|
|
1395
|
-
library. These agent workflows
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
2584
|
+
Use the repository's `ads-import` skill for selected external ADS source or
|
|
2585
|
+
theme values, and `ads-port` for a native implementation inspired by an upstream
|
|
2586
|
+
library. These are agent workflows, not CLI import or design subcommands.
|
|
2587
|
+
|
|
2588
|
+
- The workflows handle dependency closure, token mapping, motion comparisons,
|
|
2589
|
+
source credits, applicable notices and local documentation.
|
|
2590
|
+
- A port reuses the project's visual language and consolidates equivalent design
|
|
2591
|
+
roles that upstream dependencies introduce. Verify the required behavior and
|
|
2592
|
+
the consistency with the project. Exact visual replication is an explicit
|
|
2593
|
+
requirement, not the default.
|
|
2594
|
+
- Install the skills through `npx skills`, or read the packaged skills through
|
|
2595
|
+
the [stdio MCP server](MCP.md#skills). MCP serving does not install or
|
|
2596
|
+
automatically activate a skill.
|
|
2597
|
+
- The tool bundles no UI component or example library, and no design system.
|
|
1405
2598
|
|
|
1406
2599
|
## Release maintenance
|
|
1407
2600
|
|
|
1408
|
-
|
|
1409
|
-
Published npm versions cannot be replaced, even
|
|
2601
|
+
Select a version that is not already in `npm view @reqvire-org/ads versions`.
|
|
2602
|
+
Published npm versions cannot be replaced, even if you move or recreate a Git
|
|
1410
2603
|
tag; see [npm publishing rules](https://docs.npmjs.com/cli/v11/commands/npm-publish/).
|
|
1411
2604
|
|
|
1412
|
-
Update `package.json` and its lockfile with
|
|
1413
|
-
`npm version <new-version> --no-git-tag-version --ignore-scripts`.
|
|
1414
|
-
[local verification and changelog stamp workflow](#releasing-the-ads-tool)
|
|
1415
|
-
|
|
1416
|
-
and the committed local proof,
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
`<Owner>.ads.contract.ts` consolidates token/behavior declarations with typed
|
|
1426
|
-
paint and declarative-consumer contracts. Production APIs/types stay in runtime
|
|
1427
|
-
files. ADS reads contract data statically; no project import runs during discovery.
|
|
1428
|
-
See [CONTRACTS.md](CONTRACTS.md) for exact fields, supported producer forms and
|
|
1429
|
-
source/browser limits. Only `.ads.`-marked filenames are development roles.
|
|
1430
|
-
|
|
1431
|
-
Project scale policies remain explicit. A registered check can call
|
|
1432
|
-
`inspectTokenOrigins(await inspectTokens(root), target, {stopAt: allowedSharedTokens})`
|
|
1433
|
-
from the tooling package. Check `aliasOnly` for strict alias-only policies across
|
|
1434
|
-
all themes; inspect `literals`/`diagnostics` for raw values, cycles and limits.
|
|
1435
|
-
Choose exact targets/origins and documented geometry exceptions in project code;
|
|
1436
|
-
register the command in `acceptance.scripts` and the normal build. ADS owns no
|
|
1437
|
-
universal spacing scale and infers no design meaning from token names.
|
|
2605
|
+
1. Update `package.json` and its lockfile with
|
|
2606
|
+
`npm version <new-version> --no-git-tag-version --ignore-scripts`.
|
|
2607
|
+
2. Follow the [local verification and changelog stamp workflow](#releasing-the-ads-tool).
|
|
2608
|
+
3. Push the matching `v<new-version>` tag. `release.yml` checks version
|
|
2609
|
+
availability and the committed local proof, builds, packs and publishes the
|
|
2610
|
+
tagged version, and creates the GitHub release with the changelog entry as
|
|
2611
|
+
the release notes. It does not repeat the local browser and package suite.
|
|
2612
|
+
Stable tags publish as `latest`; prerelease tags publish as `next`.
|
|
2613
|
+
4. Check the workflow result and the npm version before you update consumer
|
|
2614
|
+
dependencies.
|
|
2615
|
+
|
|
2616
|
+
The manual workflow moves a label to an existing published version. It does not
|
|
2617
|
+
publish new source.
|
|
1438
2618
|
|
|
1439
2619
|
## Releasing the ADS tool
|
|
1440
2620
|
|
|
1441
|
-
Run the complete tool, browser and packed npm/Bun suite locally before
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
2621
|
+
Run the complete tool, browser and packed npm/Bun suite locally before you tag.
|
|
2622
|
+
|
|
2623
|
+
1. Commit the implementation, the documentation and the package version. The
|
|
2624
|
+
runner refuses uncommitted inputs, untracked release source and source
|
|
2625
|
+
changes during the run.
|
|
2626
|
+
2. Run `bun run release:verify` with Bun, Chrome, npm and Node available. The
|
|
2627
|
+
packed tests install ADS into an npm project and check the Node-facing
|
|
2628
|
+
exports. The runner rejects failed or skipped tests.
|
|
2629
|
+
3. Commit the generated stamp and tag the resulting commit. Do not write a
|
|
2630
|
+
passing stamp by hand.
|
|
2631
|
+
4. Run `bun run release:proof` to verify the stamp.
|
|
2632
|
+
|
|
2633
|
+
**The suite.** It runs the same grouped command as `bun run test`: one shared
|
|
2634
|
+
build, then the unit, integration and browser groups. The worker defaults and
|
|
2635
|
+
per-group overrides of [test configuration](../tests/README.md) also apply to
|
|
2636
|
+
release verification.
|
|
2637
|
+
|
|
2638
|
+
Bun's optional `[test] smol = true` in `bunfig.toml` reduces heap growth through
|
|
2639
|
+
more frequent garbage collection. It can slow tests, and it is not a hard limit
|
|
2640
|
+
for the runner or its compiler and browser children. For a hard memory cap, use
|
|
2641
|
+
an OS or container limit.
|
|
2642
|
+
|
|
2643
|
+
**Make targets.** `make test` runs the same full suite, `make test-grid` uses
|
|
2644
|
+
serial compact dots, and `make test-analysis` runs the focused analysis tests.
|
|
2645
|
+
`make release-verify` records release evidence and `make release-proof` verifies
|
|
2646
|
+
it. These targets enable terminal colors. Direct `bun run release:verify` also
|
|
2647
|
+
preserves colors while it saves its output. To disable colors, use
|
|
2648
|
+
`make test FORCE_COLOR=0` or `FORCE_COLOR=0 bun run release:verify`.
|
|
2649
|
+
|
|
2650
|
+
**The stamp.** A successful run writes a generated verification stamp under the
|
|
2651
|
+
matching version in `docs/CHANGELOG.md`. It records the tested implementation
|
|
2652
|
+
commit, command, counts, runtimes, completion time, duration, source SHA-256 and
|
|
2653
|
+
log SHA-256, per-group counts and report hashes, and explicit test-setting
|
|
2654
|
+
overrides. All three fresh JUnit reports must pass without skips. The full log
|
|
2655
|
+
is in `output/local-tests.log`, and the group reports are in
|
|
2656
|
+
`output/local-tests.junit/`.
|
|
2657
|
+
|
|
2658
|
+
**The proof.** `bun run release:proof` verifies that the tested commit is an
|
|
2659
|
+
ancestor, and that its source digest matches both the release tree and the
|
|
2660
|
+
working inputs. Only generated proof blocks and the machine-specific, unpackaged
|
|
2661
|
+
`.mcp.json` launcher are excluded from the digest. Other tracked changes require
|
|
2662
|
+
another local run. The proof is a record of trusted local verification. It is
|
|
2663
|
+
not a signed attestation or a substitute for review.
|