@reqvire-org/ads 0.4.0 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/README.md +115 -87
  2. package/dist/a11y.mjs +133 -48
  3. package/dist/analysis/compiler-options.mjs +13 -0
  4. package/dist/analysis/context.mjs +46 -0
  5. package/dist/analysis/file-tree.mjs +52 -0
  6. package/dist/analysis/helpers.mjs +142 -0
  7. package/dist/analysis/impact.mjs +20 -0
  8. package/dist/analysis/inputs.mjs +22 -0
  9. package/dist/analysis/module-resolvers.mjs +46 -0
  10. package/dist/analysis/native-adapter.mjs +180 -0
  11. package/dist/analysis/native-project.mjs +323 -0
  12. package/dist/analysis/queries.mjs +133 -0
  13. package/dist/analysis/service.mjs +153 -0
  14. package/dist/analysis/standalone.mjs +57 -0
  15. package/dist/analysis/syntax.mjs +179 -0
  16. package/dist/analysis/worker.mjs +182 -0
  17. package/dist/assets.mjs +6 -6
  18. package/dist/atomic-composition.mjs +191 -70
  19. package/dist/atomic-trace.mjs +120 -50
  20. package/dist/behavior-libraries.mjs +106 -37
  21. package/dist/behaviors.mjs +219 -77
  22. package/dist/boundaries.mjs +140 -41
  23. package/dist/brand-assets.mjs +219 -47
  24. package/dist/brands.mjs +86 -27
  25. package/dist/bun-compiler.mjs +28 -14
  26. package/dist/bun-worker.mjs +7 -5
  27. package/dist/capture/worker.mjs +15 -4
  28. package/dist/capture-store.mjs +4 -2
  29. package/dist/capture.mjs +17 -14
  30. package/dist/check-service.mjs +44 -58
  31. package/dist/check.mjs +754 -188
  32. package/dist/cli.mjs +200 -99
  33. package/dist/color-values.mjs +21 -21
  34. package/dist/component-contrast.mjs +127 -9
  35. package/dist/config.mjs +303 -135
  36. package/dist/construction-styles.cjs +10 -0
  37. package/dist/contrast-composition.mjs +134 -0
  38. package/dist/control-padding.mjs +45 -25
  39. package/dist/css-values.mjs +3 -2
  40. package/dist/declarative-flow.mjs +209 -109
  41. package/dist/design-values.mjs +136 -51
  42. package/dist/development-runtime.mjs +4 -6
  43. package/dist/draft-boundary.mjs +11 -6
  44. package/dist/evidence.mjs +1 -1
  45. package/dist/finding-rules.mjs +9 -5
  46. package/dist/font-rules.mjs +22 -17
  47. package/dist/fonts-generated.mjs +23 -16
  48. package/dist/foundation-views.mjs +242 -0
  49. package/dist/foundation.mjs +63 -39
  50. package/dist/generated-entries.mjs +101 -34
  51. package/dist/icons.mjs +79 -32
  52. package/dist/image-attributes.mjs +143 -66
  53. package/dist/image-size.mjs +1 -1
  54. package/dist/index.mjs +0 -2
  55. package/dist/init.mjs +122 -41
  56. package/dist/investigations.mjs +2 -2
  57. package/dist/layers.mjs +298 -129
  58. package/dist/layout-widths.mjs +180 -85
  59. package/dist/linaria/preserve-values.cjs +7 -0
  60. package/dist/linaria/spatial-inputs.cjs +56 -0
  61. package/dist/lockup-composition.mjs +44 -0
  62. package/dist/lockup-model.cjs +64 -0
  63. package/dist/mcp/THIRD_PARTY_NOTICES.md +51 -1
  64. package/dist/mcp/apps.mjs +4 -30
  65. package/dist/mcp/behavior-pages.mjs +72 -24
  66. package/dist/mcp/build-status.mjs +257 -64
  67. package/dist/mcp/catalog.mjs +90 -26
  68. package/dist/mcp/context.mjs +17 -18
  69. package/dist/mcp/draft-discovery.mjs +44 -21
  70. package/dist/mcp/drafts.mjs +903 -281
  71. package/dist/mcp/execution-coordinator.mjs +417 -167
  72. package/dist/mcp/execution-results.mjs +7 -7
  73. package/dist/mcp/mutations.mjs +673 -234
  74. package/dist/mcp/preview-watch.mjs +448 -170
  75. package/dist/mcp/preview-widget.bundle.js +44 -50
  76. package/dist/mcp/prompts.mjs +5 -5
  77. package/dist/mcp/result-pages.mjs +1 -1
  78. package/dist/mcp/sandbox-host.mjs +1 -1
  79. package/dist/mcp/server.mjs +2409 -577
  80. package/dist/mcp/showcase-host.mjs +165 -41
  81. package/dist/mcp/skills.mjs +1 -1
  82. package/dist/mcp/text-diff.mjs +29 -10
  83. package/dist/paint-contracts.mjs +174 -81
  84. package/dist/palette-generated.mjs +2 -2
  85. package/dist/pictogram-model.mjs +59 -0
  86. package/dist/pictograms.mjs +52 -0
  87. package/dist/preview-bun.mjs +494 -187
  88. package/dist/preview-failure.mjs +1 -1
  89. package/dist/preview-files.mjs +13 -13
  90. package/dist/preview-imports.mjs +104 -55
  91. package/dist/preview-inputs.mjs +2 -2
  92. package/dist/preview-requests.mjs +24 -0
  93. package/dist/preview-resources.mjs +288 -147
  94. package/dist/preview-scope.mjs +5 -4
  95. package/dist/program-cache.mjs +8 -34
  96. package/dist/project-documents.mjs +1 -1
  97. package/dist/public-api.mjs +69 -31
  98. package/dist/public-props.mjs +39 -22
  99. package/dist/{browser-audit → render-audit}/axe-run.mjs +3 -3
  100. package/dist/{browser-audit → render-audit}/image-shape.mjs +15 -5
  101. package/dist/{browser-audit → render-audit}/layout-overflow.mjs +86 -23
  102. package/dist/{browser-audit → render-audit}/non-text-contrast.mjs +86 -27
  103. package/dist/render-audit/pictograms.mjs +88 -0
  104. package/dist/{browser-audit → render-audit}/render-states.mjs +208 -52
  105. package/dist/{browser-audit → render-audit}/worker.mjs +98 -30
  106. package/dist/render-audit.mjs +838 -0
  107. package/dist/render-color-probe.mjs +96 -42
  108. package/dist/render-composition.mjs +164 -0
  109. package/dist/resource-limits.mjs +229 -97
  110. package/dist/runtime-contracts.mjs +467 -185
  111. package/dist/scenario-groups.mjs +22 -10
  112. package/dist/scenario-inspector.mjs +6 -43
  113. package/dist/scenario-program.mjs +8 -25
  114. package/dist/scenario-registry.mjs +72 -30
  115. package/dist/scenario-selectors.mjs +161 -64
  116. package/dist/scenario-slots.mjs +149 -56
  117. package/dist/scenario-trace.mjs +215 -109
  118. package/dist/scenarios-compiler.mjs +719 -378
  119. package/dist/scenarios-vite.d.mts +1 -3
  120. package/dist/scenarios-vite.mjs +2 -81
  121. package/dist/scenarios.mjs +421 -157
  122. package/dist/selector-match.mjs +2 -2
  123. package/dist/showcase/client.bundle.js +57 -56
  124. package/dist/showcase/draft-navigation.js +21 -3
  125. package/dist/showcase/favicon.ico +0 -0
  126. package/dist/showcase/favicon.svg +1 -0
  127. package/dist/showcase/foundation-view.css +58 -0
  128. package/dist/showcase/foundation-view.mjs +255 -0
  129. package/dist/showcase/guide-controls.ads.review.mjs +32 -0
  130. package/dist/showcase/icons.js +1 -145
  131. package/dist/showcase/index.html +3 -31
  132. package/dist/showcase/pictogram-view.mjs +53 -0
  133. package/dist/showcase/preview-frame.ads.review.css +46 -0
  134. package/dist/showcase/preview-frame.ads.review.d.mts +11 -0
  135. package/dist/showcase/preview-frame.ads.review.mjs +22 -0
  136. package/dist/showcase/preview-state.js +0 -9
  137. package/dist/showcase/refresh-scheduler.js +23 -0
  138. package/dist/showcase/style.css +5 -47
  139. package/dist/showcase/ui/ui.css +1353 -0
  140. package/dist/showcase/ui/ui.js +1064 -0
  141. package/dist/showcase-coverage.mjs +58 -37
  142. package/dist/skills/README.md +24 -23
  143. package/dist/skills/ads-designer/README.md +8 -2
  144. package/dist/skills/ads-designer/SKILL.md +143 -120
  145. package/dist/skills/ads-designer/references/accessibility.md +78 -15
  146. package/dist/skills/ads-designer/references/atomic-styles.md +4 -4
  147. package/dist/skills/ads-designer/references/behaviors.md +30 -27
  148. package/dist/skills/ads-designer/references/branding.md +101 -24
  149. package/dist/skills/ads-designer/references/captures.md +25 -0
  150. package/dist/skills/ads-designer/references/cli.md +21 -24
  151. package/dist/skills/ads-designer/references/contracts.md +7 -6
  152. package/dist/skills/ads-designer/references/design-data.md +49 -52
  153. package/dist/skills/ads-designer/references/drafts.md +20 -17
  154. package/dist/skills/ads-designer/references/evidence.md +1 -5
  155. package/dist/skills/ads-designer/references/guarded-editing.md +14 -18
  156. package/dist/skills/ads-designer/references/layers.md +1 -1
  157. package/dist/skills/ads-designer/references/layout.md +347 -0
  158. package/dist/skills/ads-designer/references/mobile.md +2 -1
  159. package/dist/skills/{ads-motion/references/performance.md → ads-designer/references/motion-performance.md} +5 -1
  160. package/dist/skills/{ads-motion/references/build.md → ads-designer/references/motion.md} +73 -5
  161. package/dist/skills/ads-designer/references/performance.md +3 -2
  162. package/dist/skills/ads-designer/references/pictograms.md +131 -0
  163. package/dist/skills/ads-designer/references/review.md +37 -34
  164. package/dist/skills/ads-designer/references/runtimes.md +33 -30
  165. package/dist/skills/ads-designer/references/scenarios.md +16 -18
  166. package/dist/skills/{ads-break-ui/references/catalog.md → ads-designer/references/stress-catalog.md} +3 -1
  167. package/dist/skills/ads-designer/references/stress-test.md +68 -0
  168. package/dist/skills/ads-designer/references/validation.md +83 -75
  169. package/dist/skills/ads-designer/references/workflows.md +8 -33
  170. package/dist/skills/ads-import/SKILL.md +43 -325
  171. package/dist/skills/ads-import/references/atomic-styles.md +4 -4
  172. package/dist/skills/ads-import/references/behaviors.md +30 -27
  173. package/dist/skills/ads-import/references/branding.md +5 -5
  174. package/dist/skills/ads-import/references/captures.md +25 -0
  175. package/dist/skills/ads-import/references/cli.md +21 -24
  176. package/dist/skills/ads-import/references/compatibility.md +1 -1
  177. package/dist/skills/ads-import/references/contracts.md +7 -6
  178. package/dist/skills/ads-import/references/design-data.md +49 -52
  179. package/dist/skills/ads-import/references/drafts.md +20 -17
  180. package/dist/skills/ads-import/references/evidence.md +1 -5
  181. package/dist/skills/ads-import/references/guarded-editing.md +14 -18
  182. package/dist/skills/ads-import/references/implementation.md +2 -1
  183. package/dist/skills/ads-import/references/layers.md +1 -1
  184. package/dist/skills/ads-import/references/layout.md +347 -0
  185. package/dist/skills/ads-import/references/review.md +37 -34
  186. package/dist/skills/ads-import/references/runtimes.md +33 -30
  187. package/dist/skills/ads-import/references/scenarios.md +16 -18
  188. package/dist/skills/ads-import/references/tokens.md +3 -3
  189. package/dist/skills/ads-import/references/validation.md +83 -75
  190. package/dist/skills/ads-import/references/workflows.md +8 -33
  191. package/dist/skills/ads-migrate/SKILL.md +56 -0
  192. package/dist/skills/ads-migrate/references/0.4.1-to-0.4.2.md +602 -0
  193. package/dist/skills/ads-port/SKILL.md +58 -344
  194. package/dist/skills/ads-port/references/atomic-styles.md +4 -4
  195. package/dist/skills/ads-port/references/behaviors.md +30 -27
  196. package/dist/skills/ads-port/references/captures.md +25 -0
  197. package/dist/skills/ads-port/references/cli.md +21 -24
  198. package/dist/skills/ads-port/references/contracts.md +7 -6
  199. package/dist/skills/ads-port/references/design-data.md +49 -52
  200. package/dist/skills/ads-port/references/drafts.md +20 -17
  201. package/dist/skills/ads-port/references/evidence.md +1 -5
  202. package/dist/skills/ads-port/references/guarded-editing.md +14 -18
  203. package/dist/skills/ads-port/references/layers.md +1 -1
  204. package/dist/skills/ads-port/references/layout.md +347 -0
  205. package/dist/skills/ads-port/references/lint-and-docs.md +8 -11
  206. package/dist/skills/ads-port/references/native-implementation.md +2 -1
  207. package/dist/skills/ads-port/references/review.md +37 -34
  208. package/dist/skills/ads-port/references/runtimes.md +33 -30
  209. package/dist/skills/ads-port/references/scenarios.md +16 -18
  210. package/dist/skills/ads-port/references/validation.md +83 -75
  211. package/dist/skills/ads-port/references/workflows.md +8 -33
  212. package/dist/source-symbols.mjs +1 -8
  213. package/dist/source-values.mjs +270 -129
  214. package/dist/spatial-composition.mjs +322 -0
  215. package/dist/spatial-contexts.cjs +56 -0
  216. package/dist/spatial-css.cjs +351 -0
  217. package/dist/spatial-inputs.cjs +80 -0
  218. package/dist/spatial-metadata.mjs +18 -0
  219. package/dist/spatial-model.cjs +322 -0
  220. package/dist/spatial.mjs +21 -0
  221. package/dist/stage-timing.cjs +20 -0
  222. package/dist/starters/preact/design-system/patterns/Conversation/Conversation.tsx +105 -0
  223. package/dist/starters/preact/design-system/patterns/Shell/Shell.tsx +275 -0
  224. package/dist/starters/preact/design-system/review/demo-frame/DemoFrame.ads.review.tsx +7 -0
  225. package/dist/starters/preact/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +10 -0
  226. package/dist/starters/preact/design-system/showcase/mcp/main.ads.mount.tsx +8 -0
  227. package/dist/starters/preact/ds.config.json +25 -6
  228. package/dist/starters/preact/package.json +4 -8
  229. package/dist/starters/preact/tsconfig.json +4 -5
  230. package/dist/starters/preact/vite.config.ts +3 -3
  231. package/dist/starters/react/ADS.md +42 -47
  232. package/dist/starters/react/README.md +47 -49
  233. package/dist/starters/react/design-system/assets/pictograms/catalog.ads.json +13 -0
  234. package/dist/starters/react/design-system/assets/pictograms/journey.dark.svg +7 -0
  235. package/dist/starters/react/design-system/assets/pictograms/journey.svg +7 -0
  236. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +18 -2
  237. package/dist/starters/react/design-system/components/Actions/IconButton/README.md +3 -0
  238. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.exports.ts +1 -0
  239. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.fixture.ts +1 -0
  240. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.scenario.tsx +7 -0
  241. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.tsx +26 -0
  242. package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/README.md +5 -0
  243. package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.fixture.ts +13 -0
  244. package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.scenario.tsx +22 -0
  245. package/dist/starters/react/design-system/index.ts +2 -1
  246. package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.exports.ts +1 -0
  247. package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.fixture.ts +7 -0
  248. package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.scenario.tsx +15 -0
  249. package/dist/starters/react/design-system/patterns/Conversation/Conversation.tsx +105 -0
  250. package/dist/starters/react/design-system/patterns/Conversation/README.md +9 -0
  251. package/dist/starters/react/design-system/patterns/Shell/Floating.ads.fixture.ts +5 -0
  252. package/dist/starters/react/design-system/patterns/Shell/Floating.ads.scenario.tsx +21 -0
  253. package/dist/starters/react/design-system/patterns/Shell/README.md +43 -0
  254. package/dist/starters/react/design-system/patterns/Shell/Shell.ads.exports.ts +1 -0
  255. package/dist/starters/react/design-system/patterns/Shell/Shell.ads.fixture.ts +5 -0
  256. package/dist/starters/react/design-system/patterns/Shell/Shell.ads.scenario.tsx +21 -0
  257. package/dist/starters/react/design-system/patterns/Shell/Shell.tsx +274 -0
  258. package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.exports.ts +1 -1
  259. package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.review.tsx +7 -0
  260. package/dist/starters/react/design-system/review/index.ads.review.ts +4 -0
  261. package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.exports.ts +1 -0
  262. package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.review.tsx +6 -0
  263. package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.exports.ts +1 -1
  264. package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +10 -0
  265. package/dist/starters/react/design-system/showcase/mcp/{main.tsx → main.ads.mount.tsx} +4 -2
  266. package/dist/starters/react/design-system/tokens/catalog.ads.json +1221 -0
  267. package/dist/starters/react/design-system/tokens/colors.css +1 -1
  268. package/dist/starters/react/design-system/tokens/spacing.css +22 -32
  269. package/dist/starters/react/design-system/tokens/spatial.ads.json +70 -0
  270. package/dist/starters/react/design-system/tokens/themes.generated.ts +1 -1
  271. package/dist/starters/react/ds.config.json +25 -6
  272. package/dist/starters/react/package.json +2 -6
  273. package/dist/starters/react/tsconfig.json +2 -3
  274. package/dist/starters/react/vite.config.ts +3 -3
  275. package/dist/style-boundaries.mjs +70 -25
  276. package/dist/task-cache.mjs +173 -72
  277. package/dist/task-worker.mjs +22 -11
  278. package/dist/test-boundaries.mjs +132 -59
  279. package/dist/themes-generated.mjs +1 -1
  280. package/dist/themes-watch.mjs +57 -22
  281. package/dist/themes.mjs +176 -73
  282. package/dist/token-export.mjs +39 -14
  283. package/dist/token-policy.mjs +6 -3
  284. package/dist/token-quality.mjs +6 -6
  285. package/dist/token-samples.mjs +16 -5
  286. package/dist/tokens.mjs +71 -26
  287. package/dist/ui-framework.mjs +16 -14
  288. package/dist/unit-contracts.mjs +251 -104
  289. package/dist/units.mjs +209 -99
  290. package/dist/usage.mjs +138 -38
  291. package/dist/validation-checks.mjs +115 -38
  292. package/dist/validation-inputs.mjs +191 -78
  293. package/dist/validation.mjs +268 -102
  294. package/dist/verification/browser.mjs +27 -5
  295. package/dist/verification.mjs +711 -187
  296. package/docs/ADS.md +96 -80
  297. package/docs/ARCHITECTURE.md +368 -137
  298. package/docs/BEHAVIORS.md +29 -25
  299. package/docs/CACHING.md +77 -17
  300. package/docs/CHANGELOG.md +332 -17
  301. package/docs/CONTRACTS.md +12 -4
  302. package/docs/DESIGN-REFERENCES.md +40 -0
  303. package/docs/GUIDE.md +300 -263
  304. package/docs/MCP.md +187 -324
  305. package/docs/SPATIAL-CHECKS.md +69 -0
  306. package/docs/benchmarks/README.md +39 -0
  307. package/package.json +43 -34
  308. package/dist/browser-audit.mjs +0 -429
  309. package/dist/create.mjs +0 -48
  310. package/dist/lint-config.mjs +0 -50
  311. package/dist/mcp/project-widget.bundle.js +0 -114
  312. package/dist/mcp/reports.mjs +0 -101
  313. package/dist/mcp/widget.bundle.js +0 -147
  314. package/dist/oxlint.mjs +0 -89
  315. package/dist/preview-builder.mjs +0 -133
  316. package/dist/preview-workers.mjs +0 -184
  317. package/dist/showcase.mjs +0 -77
  318. package/dist/skills/ads-break-ui/LICENSE.upstream +0 -21
  319. package/dist/skills/ads-break-ui/README.md +0 -16
  320. package/dist/skills/ads-break-ui/SKILL.md +0 -412
  321. package/dist/skills/ads-break-ui/agents/openai.yaml +0 -4
  322. package/dist/skills/ads-break-ui/references/atomic-styles.md +0 -293
  323. package/dist/skills/ads-break-ui/references/behaviors.md +0 -412
  324. package/dist/skills/ads-break-ui/references/captures.md +0 -135
  325. package/dist/skills/ads-break-ui/references/contracts.md +0 -317
  326. package/dist/skills/ads-break-ui/references/design-data.md +0 -354
  327. package/dist/skills/ads-break-ui/references/drafts.md +0 -194
  328. package/dist/skills/ads-break-ui/references/evidence.md +0 -128
  329. package/dist/skills/ads-break-ui/references/guarded-editing.md +0 -165
  330. package/dist/skills/ads-break-ui/references/layers.md +0 -145
  331. package/dist/skills/ads-break-ui/references/reporting.md +0 -101
  332. package/dist/skills/ads-break-ui/references/review.md +0 -97
  333. package/dist/skills/ads-break-ui/references/runtimes.md +0 -203
  334. package/dist/skills/ads-break-ui/references/scenarios.md +0 -246
  335. package/dist/skills/ads-break-ui/references/validation.md +0 -166
  336. package/dist/skills/ads-break-ui/references/verification.md +0 -58
  337. package/dist/skills/ads-break-ui/references/workflows.md +0 -90
  338. package/dist/skills/ads-designer/references/reporting.md +0 -101
  339. package/dist/skills/ads-import/references/reporting.md +0 -101
  340. package/dist/skills/ads-motion/LICENSE.upstream +0 -21
  341. package/dist/skills/ads-motion/README.md +0 -22
  342. package/dist/skills/ads-motion/SKILL.md +0 -385
  343. package/dist/skills/ads-motion/agents/openai.yaml +0 -4
  344. package/dist/skills/ads-motion/references/atomic-styles.md +0 -293
  345. package/dist/skills/ads-motion/references/audit.md +0 -44
  346. package/dist/skills/ads-motion/references/behaviors.md +0 -412
  347. package/dist/skills/ads-motion/references/captures.md +0 -135
  348. package/dist/skills/ads-motion/references/contracts.md +0 -317
  349. package/dist/skills/ads-motion/references/design-data.md +0 -354
  350. package/dist/skills/ads-motion/references/drafts.md +0 -194
  351. package/dist/skills/ads-motion/references/evidence.md +0 -128
  352. package/dist/skills/ads-motion/references/guarded-editing.md +0 -165
  353. package/dist/skills/ads-motion/references/layers.md +0 -145
  354. package/dist/skills/ads-motion/references/motion-review.md +0 -35
  355. package/dist/skills/ads-motion/references/reporting.md +0 -101
  356. package/dist/skills/ads-motion/references/review.md +0 -97
  357. package/dist/skills/ads-motion/references/runtimes.md +0 -203
  358. package/dist/skills/ads-motion/references/scenarios.md +0 -246
  359. package/dist/skills/ads-motion/references/validation.md +0 -166
  360. package/dist/skills/ads-motion/references/verification.md +0 -39
  361. package/dist/skills/ads-motion/references/workflows.md +0 -90
  362. package/dist/skills/ads-port/references/reporting.md +0 -101
  363. package/dist/starters/preact/design-system/components/Layout/Grid/Grid.ads.contract.ts +0 -6
  364. package/dist/starters/preact/design-system/components/Layout/Grid/Grid.tsx +0 -76
  365. package/dist/starters/preact/design-system/review/demo-frame/DemoFrame.tsx +0 -29
  366. package/dist/starters/preact/design-system/review/screen-frame/ScreenFrame.tsx +0 -34
  367. package/dist/starters/preact/design-system/review/token-preview/TokenPreview.ads.contract.ts +0 -6
  368. package/dist/starters/preact/design-system/review/token-preview/TokenPreview.tsx +0 -137
  369. package/dist/starters/preact/design-system/showcase/mcp/main.tsx +0 -6
  370. package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.fixture.ts +0 -7
  371. package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.scenario.tsx +0 -4
  372. package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.fixture.ts +0 -7
  373. package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.scenario.tsx +0 -4
  374. package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.contract.ts +0 -6
  375. package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.exports.ts +0 -1
  376. package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.fixture.ts +0 -12
  377. package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.scenario.tsx +0 -17
  378. package/dist/starters/react/design-system/components/Layout/Grid/Grid.tsx +0 -75
  379. package/dist/starters/react/design-system/components/Layout/Grid/README.md +0 -21
  380. package/dist/starters/react/design-system/review/brand-preview/BrandPreview.ads.exports.ts +0 -1
  381. package/dist/starters/react/design-system/review/brand-preview/BrandPreview.tsx +0 -112
  382. package/dist/starters/react/design-system/review/demo-frame/DemoFrame.tsx +0 -29
  383. package/dist/starters/react/design-system/review/grid-cell/GridCell.ads.exports.ts +0 -1
  384. package/dist/starters/react/design-system/review/grid-cell/GridCell.tsx +0 -18
  385. package/dist/starters/react/design-system/review/index.ts +0 -6
  386. package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.tsx +0 -34
  387. package/dist/starters/react/design-system/review/token-preview/TokenPreview.ads.contract.ts +0 -6
  388. package/dist/starters/react/design-system/review/token-preview/TokenPreview.ads.exports.ts +0 -1
  389. package/dist/starters/react/design-system/review/token-preview/TokenPreview.tsx +0 -137
  390. package/dist/starters/react/design-system/showcase/mcp/index.html +0 -1
  391. package/dist/starters/react/design-system/tokens/Color.ads.fixture.ts +0 -124
  392. package/dist/starters/react/design-system/tokens/Color.ads.scenario.tsx +0 -4
  393. package/dist/starters/react/design-system/tokens/Layout.ads.fixture.ts +0 -39
  394. package/dist/starters/react/design-system/tokens/Layout.ads.scenario.tsx +0 -4
  395. package/dist/starters/react/design-system/tokens/Motion.ads.fixture.ts +0 -18
  396. package/dist/starters/react/design-system/tokens/Motion.ads.scenario.tsx +0 -4
  397. package/dist/starters/react/design-system/tokens/Shape.ads.fixture.ts +0 -30
  398. package/dist/starters/react/design-system/tokens/Shape.ads.scenario.tsx +0 -4
  399. package/dist/starters/react/design-system/tokens/Space.ads.fixture.ts +0 -37
  400. package/dist/starters/react/design-system/tokens/Space.ads.scenario.tsx +0 -4
  401. package/dist/starters/react/design-system/tokens/Type.ads.fixture.ts +0 -29
  402. package/dist/starters/react/design-system/tokens/Type.ads.scenario.tsx +0 -4
  403. package/dist/starters/react/package-lock.json +0 -4707
  404. package/dist/token-fixtures.mjs +0 -30
  405. package/docs/benchmarks/bun-previews.md +0 -91
  406. package/docs/benchmarks/preview-memory.md +0 -147
  407. package/docs/benchmarks/turbo-poc.md +0 -284
  408. package/docs/plans/execution-coordination.md +0 -57
  409. /package/dist/{browser-audit → render-audit}/first-render.mjs +0 -0
  410. /package/dist/{browser-audit → render-audit}/layout-shift.mjs +0 -0
@@ -1,317 +0,0 @@
1
- # Static owner contracts and development files
2
-
3
- Use one optional `<Owner>.ads.contract.ts` for constrained
4
- paint inputs, scoped runtime bindings, declarative parts and behavioral checks.
5
- The import `import type { UnitContract } from "@reqvire-org/ads/contracts"` supplies
6
- development typing. ADS reads its AST and resolves real symbols without importing
7
- or executing project modules. It adds no production runtime.
8
-
9
- ## Files and ownership
10
-
11
- ```text
12
- components/Plot/
13
- Plot.tsx production API/root
14
- Series.tsx production declarative API
15
- renderer.tsx production consumer
16
- paints.ts production binding producer
17
- types.ts production prop types
18
- Plot.ads.contract.ts static tool declaration
19
- Plot.ads.scenario.tsx demonstration
20
- Plot.ads.fixture.ts demonstration data
21
- Plot.ads.behavior.spec.ts registered browser checks
22
- Plot.ads.test.tsx optional unit tests
23
- Plot.ads.helpers.ts development-only adapters
24
- README.md API/provenance
25
- ```
26
-
27
- This is an example, not a required inventory. Use the same roles for patterns,
28
- controllers and relevant development owners. `review/` remains a separate
29
- shared development layer; its implementation filenames need no extra marker.
30
- Runtime components, types and styles cannot import `.ads.` files, tests, fixtures
31
- or review code through aliases, barrels or helpers. Unknown `.ads.` roles are
32
- still development-only and are diagnosed. Fixtures/helpers cannot define styles;
33
- put demo framing in review. Ordinary README/license files retain their names.
34
-
35
- Scenarios/fixtures/review enter only the selected preview closure. Contracts are
36
- never executable preview modules; derived audit descriptors are data. Specs run
37
- only in the configured test runner. Production declaration emission must also
38
- start from the public runtime entry, rather than include every file under the
39
- design-system folder. The starter’s `tsconfig.build.json` does this; its normal
40
- no-emit typecheck still checks development sources. Core import guards protect
41
- the runtime dependency closure. Review custom emitter configurations through
42
- the configuration owner before migrating a consuming project. Guards remain tooling. Production prop types
43
- belong in runtime files, never inferred from a development contract.
44
-
45
- ## Public names and generated entries
46
-
47
- Each owner declares its public names in its own `<Owner>.ads.exports.ts`, beside its
48
- source (`components/Button.ads.exports.ts` for a flat owner,
49
- `components/Forms/Input/Input.ads.exports.ts` for a directory owner):
50
-
51
- ```ts
52
- export { Button } from "./Button";
53
- export type { ButtonProps } from "./Button";
54
- ```
55
-
56
- An exports file holds only named re-exports of its own owner's modules by relative
57
- path: no `export *`, no other code, no peers' files. Public names are unique across
58
- owners. ADS generates the public barrel (`publicEntry`, normally `index.ts`) by copying
59
- every exports file's re-exports with paths rebased onto the barrel, so it names each
60
- public export directly from its source and a product build never includes an exports
61
- file. The review entry is generated the same way from the exports files under `review/`. It also generates the styles entry (`stylesEntry`) with one `@import`
62
- per canonical token sheet in foundation order; the public barrel imports it first.
63
- Never edit a generated entry: `ads check` reports a stale or hand-edited one
64
- (`generated-entry`), and the showcase, the MCP server, draft previews, acceptance
65
- and `ads assets` rewrite them. An exports file belongs to its owner's layer:
66
- production, or development under `review/`.
67
-
68
- ## Style permissions
69
-
70
- An owner declares the style permissions its own code needs in its contract, with
71
- paths relative to the contract:
72
-
73
- ```ts
74
- export default {
75
- schemaVersion: 1,
76
- styles: {
77
- writes: { "./Menu.tsx": ["--ds-menu-x", "--ds-menu-y"] },
78
- inline: ["./Menu.tsx"],
79
- },
80
- customization: ["--ds-menu-gap"],
81
- } satisfies UnitContract;
82
- ```
83
-
84
- `styles.writes` lists the CSS properties or owned `--ds-`/`--ux-`/`--showcase-`
85
- variables a file writes at runtime (never `cssText`, state variables or shared
86
- tokens); `styles.inline` lists files that may use inline JSX/factory styles for
87
- measured geometry; `customization` lists a component's non-state `--ds-*` variables
88
- that patterns, the showcase and the application may set. Contracts are allowed for
89
- component, pattern, controller, review and showcase owners; `customization` only for
90
- components. An unused permission is reported as stale on the contract.
91
- `ds.config.json` holds no per-owner entries.
92
-
93
- ## A contract uses actual implementation references
94
-
95
- ```ts
96
- import type { UnitContract } from "@reqvire-org/ads/contracts";
97
- import { Plot } from "./Plot";
98
- import { Series } from "./Series";
99
- import { Renderer } from "./renderer";
100
- import { paints } from "./paints";
101
-
102
- export default {
103
- schemaVersion: 1,
104
- paintInputs: [
105
- { api: Plot, property: "config.*.paint", kind: "paint-reference" },
106
- { api: Series, property: "fill", kind: "paint-reference", bindings: ["items"] },
107
- ],
108
- bindings: {
109
- items: {
110
- input: { api: Plot, property: "config" },
111
- producer: paints,
112
- valueFrom: "paint",
113
- variable: "--plot-runtime-${key}",
114
- scope: { api: Plot, selector: '[data-plot-root=""]' },
115
- checks: ["isolation"],
116
- },
117
- },
118
- declarativeParts: [
119
- { api: Series, parent: Plot, consumer: Renderer, checks: ["isolation"] },
120
- ],
121
- behavior: {
122
- subjects: { plot: { api: Plot }, renderer: { implementation: Renderer, role: "implementation" } },
123
- guarantees: [{
124
- id: "scoped-output",
125
- description: "Changing either instance updates only its own output.",
126
- subjects: ["plot", "renderer"], checks: ["isolation"],
127
- }],
128
- checks: {
129
- isolation: {
130
- file: "./Plot.ads.behavior.spec.ts", case: "isolation",
131
- scenario: "components/Plot", profile: "widget",
132
- },
133
- },
134
- },
135
- } satisfies UnitContract;
136
- ```
137
-
138
- Keep contracts small; most owners need none or one section. Supported data are
139
- literal objects/arrays, static constants/spreads, `as const` and `satisfies`.
140
- Symbol references resolve through normal imports, aliases and re-exports.
141
- Calls, getters, methods, computed metadata and environment-dependent expressions
142
- are rejected. Function references are opaque identities, never executed.
143
- Private implementation subjects may be internal module exports without becoming
144
- public barrel exports. Private subjects default to the existing headless controller
145
- contract. Use `role: "controller"` explicitly for behavior-only code, or
146
- `role: "implementation"` for a private visual renderer or binding producer whose
147
- guarantees should be tracked without classifying it as a controller. Shared
148
- `controllers/` source always remains headless. An implementation role retains
149
- normal ownership, dependency, styling and development boundaries; it is not a
150
- style exception. Producers/consumers must belong to the same owner. Required
151
- checks must exist, back named guarantees and use a browser profile with the
152
- corresponding scenario. A relationship is registration, not a passing guarantee.
153
-
154
- ## Typed paints and runtime bindings
155
-
156
- Production-facing types can use:
157
-
158
- ```ts
159
- export type Paint = `var(--${string})` | `url(#${string})` | "none" | "currentColor";
160
- export interface SeriesProps { fill?: Paint }
161
- export type Config = Readonly<Record<string, { paint: Paint }>>;
162
- ```
163
-
164
- ADS follows the actual property path/type, including nested maps. A name such as
165
- `Paint`, an arbitrary `string`, `any` or a forged metadata role grants no waiver.
166
- Supported references are a single accessible token/binding `var(--name)`, a local
167
- SVG paint `url(#id)`, `none` or `currentColor`. Fallbacks, raw colours, external
168
- URLs and arbitrary CSS are outside this role. Raw domain colours need a separately
169
- reviewed validated input boundary; they are not implicitly supported here.
170
-
171
- A runtime family is instance data, not an infinite design-token inventory. Its
172
- source proof requires the declared config map, exact key/value mapping and actual
173
- root attachment. Supported producers use `Object.entries(config)` with a loop,
174
- or `Object.fromEntries(...map(...))`; same-owner helper returns are traceable.
175
- Guard each key before the write/return using
176
- `if (!/^[A-Za-z0-9_-]+$/.test(key)) throw new Error("Invalid key")` (a loop may
177
- `continue`). Return only the computed map. For example:
178
-
179
- ```ts
180
- export function paints(config: Config) {
181
- const result: Record<string, string> = {};
182
- for (const [key, entry] of Object.entries(config)) {
183
- if (!/^[A-Za-z0-9_-]+$/.test(key)) throw new Error("Invalid key");
184
- result[`--plot-runtime-${key}`] = entry.paint;
185
- }
186
- return result;
187
- }
188
- ```
189
-
190
- The runtime root attaches that returned map using `style={paints(config)}` or a
191
- traceable local/useMemo result and the declared class/exact data attribute.
192
- Place spreading props before the explicit scope/style so an unknown spread
193
- cannot replace them. This grants permission to that binding attachment only;
194
- it does not authorize arbitrary inline styling, CSSProperties APIs or bulk writes.
195
- Unsupported dynamic producers/attachment paths fail with an analysis diagnostic.
196
- Keep the implementation project-owned; there is no required ADS binding helper.
197
-
198
- A producer with alternative/derived sources declares each entry path, for example:
199
-
200
- ```ts
201
- valueFrom: ["paint", "scheme.day", "scheme.night"],
202
- ```
203
-
204
- Register each matching `config.*.<path>` in `paintInputs`. The producer may write
205
- one declared field, or a per-theme value built with the generated helpers from
206
- `tokens/themes.generated.ts`: `themed({ light: entry.scheme.day, dark: entry.scheme.night })`
207
- (keys exactly the declared themes) or `themedByScheme({ light: …, dark: … })` (each theme
208
- takes the value for its color scheme). Every value is a declared field and the argument is
209
- an object literal without spreads. The normal key/map/root proof still applies. Raw
210
- constants, undeclared fields, `light-dark()`, extra writes and unknown transforms are
211
- rejected. The browser audit checks an accessible color reference in every theme's branch;
212
- a local SVG URL or `none` is not a color there.
213
-
214
- Families cannot overlap shared tokens, private runtime
215
- prefixes or other bindings. A broad family such as `--color-${key}` grants no
216
- shared-token exception. Use a distinct private family where collision freedom
217
- cannot be established. Registered paint consumers list their allowed binding IDs;
218
- borrowing a peer's binding family or private runtime variable remains invalid. Bindings are scoped
219
- to their actual root; portals outside it need deliberate project integration.
220
-
221
- A registered binding producer gives a per-theme value with `themed()` or
222
- `themedByScheme()`; its output is `var(--ads-if-<theme>, <reference>)` once per declared
223
- theme, in declared order. The App paint audit checks every branch and its observed effect
224
- in the active theme. Raw colors, undefined tokens and SVG URLs in a branch remain invalid.
225
- This derived binding form does not widen public paint-input types; use constrained
226
- references for each theme input and verify every theme in browser checks.
227
-
228
- The App audit checks current mounted instances, accessible values, local SVG
229
- resources and computed paint-property responses. Visibility and complete rendered
230
- output still need assertions in the registered browser checks. It rejects missing/duplicate IDs and reports unobserved written values separately. It is bounded to 100 families, 20 instances per family, 100 keys
231
- and 1000 elements per instance. Exceeding a budget reports limits and complete: false; it does not invalidate a
232
- working component. An unobserved paint effect also remains unverified until its
233
- relevant consumer/state is checked. It does
234
- not prove every future input, visibility state or interaction. In registered
235
- Playwright checks, use `auditBehaviorPaints(frame)` from
236
- `@reqvire-org/ads/verification` after updates. Assert `result.ok` and, when claiming complete current-map
237
- evidence, `result.complete` and the expected `verified` entries.
238
- Exercise two instances with identical keys/different paints, key updates/removal,
239
- themes, local SVG IDs and invalid/inaccessible references. Keep normal runner
240
- profiles; React StrictMode still needs a project development harness.
241
-
242
- ## Rendered and declarative evidence
243
-
244
- `covers` names rendered public UI. A null-returning declarative part belongs in
245
- `exercises`, alongside behavioral APIs:
246
-
247
- ```tsx
248
- export const scenario = {
249
- title: "Plot", covers: ["Plot"], exercises: ["Series"],
250
- };
251
- ```
252
-
253
- A part may register several distinct parents; each API/parent pair has one
254
- consumer/check declaration. A parent may itself be a registered declarative part.
255
- The graph must be acyclic and every parent chain must reach a public rendering
256
- root. Duplicate pairs, cycles and detached part graphs fail.
257
-
258
- For example, `Entry` can belong to `FirstView` and `SecondView`, while `Detail`
259
- belongs to `Entry`. The scenario covers the rendering roots and exercises both
260
- `Entry` and `Detail`. A nested `Detail` outside its registered parent does not count.
261
-
262
- The real part must reach its registered consumer through a rendering parent.
263
- ADS resolves source identity comparisons (`child.type === Series`, including a
264
- traceable comparison helper) and reads of that same child’s props traced from the consumer’s children input.
265
- Traceable paths include local recursive fragment flattening, `find`/`filter`,
266
- callback aliases and props carried through local records. Reusing a review layout
267
- inside another instance of itself is ordinary component composition, not a
268
- recursive helper call. Source sites/work limits still bound analysis.
269
-
270
- `exercises` establishes reachable behavioral use, including a conditional state
271
- and mapped literal fixture data; it does not promise unconditional initial DOM.
272
- Always-false branches, unused adapters, empty/unknown fixture maps and broken
273
- parent chains grant no credit. `covers` retains its rendering contract. Required
274
- browser checks cover a rendering root and exercise the relevant parent/child
275
- chain, then verify adding/removing/updating the part changes actual output.
276
-
277
- A comparison against a decoy object gives no evidence. An import, unrelated parent, unused
278
- child or metadata claim gives no consumption credit. Unknown render branches are
279
- conservative. Browser checks must verify that adding/removing/changing the part
280
- changes output. Source relationships and current browser evidence are separate.
281
- Do not add fake DOM, hide public parts or rewrite a valid API to appease tracing.
282
-
283
- Scenario metadata is validated by field/entry with positions and reasons.
284
- A bad entry still blocks acceptance while valid independent render evidence is
285
- retained. Unreadable prerequisites report coverage as not established. Inspect
286
- the exact source diagnostic and bounded results; do not assume every subsequent
287
- missing preview means its runtime API is invalid.
288
-
289
- ## Shared Data and project consistency
290
-
291
- Data has one shared design vocabulary in the configured token foundation. There
292
- is no owner-contract token namespace or private value stylesheet. Components map
293
- shared values into `--ds-*`; patterns use `--ux-*`. Static literals cannot bypass
294
- this boundary through aliases, fallbacks, themes or helper/import interpolation.
295
- Shared token samples belong under the token directory. See
296
- [shared Data and component mappings](design-data.md).
297
-
298
- `inspectTokenOrigins(inventory, name, {stopAt: names})` remains available for
299
- project-specific audits of shared alias relationships. It supplements mandatory
300
- core source checks and does not enable independent local values.
301
-
302
- ## MCP editing
303
-
304
- The static owner contract is the only token, paint, declarative-part and behavior
305
- registration. Competing declarations fail.
306
- Contracts participate in discovery, ownership, source revisions, affected-check
307
- selection and candidate gates. `ads_units` exposes `contractFile`; `ads_catalog`
308
- reports constrained paint paths and declarative parent/consumer/check references.
309
- Use bounded file reads and paged detailed results, not repeated whole-project dumps.
310
-
311
- A canonical `<Dir>/<Dir>.ads.scenario.tsx` is the development entry of the
312
- directory owner `<Dir>`, even without a production entry or owner contract. In a
313
- folder without that entry, each `<Owner>.ads.scenario.tsx` belongs to its own flat
314
- owner, and an explicit flat `scenario.id` (`<Dir>/<Dir>`) keeps the canonical file
315
- a flat entry. An optional static `scenario.id` keeps an identity stable when a
316
- renamed filename would otherwise be ambiguous; it must stay inside the owning unit
317
- and be unique.
@@ -1,354 +0,0 @@
1
- # Shared Data, component mappings and design consistency
2
-
3
- ADS has three cooperating responsibilities: Data supplies one shared design
4
- vocabulary; UX owns structure, behavior and accessibility; Skin maps Data to
5
- states and variants. Components own their implementation, not separate design
6
- systems. Project values and themes remain project-owned.
7
-
8
- ## One design catalogue
9
-
10
- Define static design values, semantic roles, formulas and themes in the configured
11
- shared token foundation: colors, typography, spacing and elevation. Reuse existing
12
- roles before introducing another token. A new value is a visible project design
13
- decision. Do not copy every imported library constant into another name merely to
14
- satisfy a guard. Existing project font, text, spacing and other semantic roles
15
- take precedence over divergent upstream constants. Preserve the capability and
16
- interaction contract, then document deliberate visual differences from the
17
- migration reference. Do not add a private or duplicate role to recover an
18
- upstream font or size that project policy intentionally replaces.
19
-
20
- Porting should converge on the destination's visual language. Different upstream
21
- dependencies do not justify separate scales or duplicate roles. Consolidate
22
- equivalent roles introduced by the selected port, update their consumers and
23
- samples, and remove obsolete source sheets when unused. Compare semantics,
24
- themes, states and actual use before merging; equal numbers alone are not enough.
25
- For an empty destination, establish a coherent initial vocabulary across the
26
- selected scope. Exact upstream pixels are not a default acceptance requirement.
27
- Document intentional adaptations and verify consistency with existing UI while
28
- preserving required behavior. Unrelated cleanup or removal of an existing public
29
- token needs its own scope/compatibility decision.
30
-
31
- There are no owner-local token namespaces, token manifests, component token value
32
- sheets or `tokens` sections in owner contracts. Token previews and their fixtures
33
- belong under the shared token directory. The public contract remains about shared
34
- names, meanings, types and alias relationships; ADS supplies no hardcoded palette,
35
- spacing grid or component catalogue.
36
-
37
- ## Component variables are mappings and runtime mechanics
38
-
39
- `--ds-*` belongs to component implementations, `--ux-*` to patterns and review
40
- presentation, and `--showcase-*` to development scaffolding. They are not additional
41
- token vocabularies. State styling remains owned by the control. Documented non-state
42
- customization hooks keep their narrow registration and ownership rules.
43
-
44
- ```css
45
- /* In component Linaria: map project Data into a state. */
46
- --ds-control-bg: var(--accent);
47
- --ds-control-hover-bg: var(--accent-hover);
48
- --ds-control-gap: var(--space-4);
49
- --ds-control-font: var(--font-sans);
50
-
51
- /* Rejected: private design values, even behind aliases or fallbacks. */
52
- --ds-control-gap: 7px;
53
- --ds-control-bg: red;
54
- --ds-control-gap: var(--space-4, 7px);
55
- --ds-control-font: Arial;
56
- ```
57
-
58
- Styles and static interpolations from imports/helpers obey the same source rule.
59
- Unknown interpolation is not proof of a valid design source. Typography/layering
60
- roles follow variable references to their actual consuming properties; a different
61
- variable name cannot conceal an independent font, weight or stacking level.
62
-
63
- Zero, structural unitless geometry, percentages, grid fractions, responsive
64
- viewport/container relationships and structural angles retain their existing use.
65
- Measured instance geometry still uses exact, documented style-write boundaries;
66
- those boundaries do not authorize another static design palette. Typed per-instance
67
- paint bindings retain their provenance and browser checks. Inputs select shared
68
- paints or local SVG resources, rather than supplying arbitrary visual strings.
69
-
70
- A calculation containing a raw design length/color is still rejected. Structural
71
- calculations using shared values can remain valid; static analysis cannot prove
72
- whether a dimensionless factor represents real geometry or an invented scale.
73
- Review that intent and do not disguise a new design decision as arithmetic.
74
-
75
- ## Review overlap without deleting legitimate roles
76
-
77
- `token-overlap-review` is a nonblocking review item for shared tokens with identical
78
- normalized definitions across their declared theme/condition scopes. It identifies
79
- the tokens and source. Inspect their consumers and roles. If one decision is being
80
- copied, reuse one shared token or make its relationship explicit with an alias.
81
- Equal values alone do not prove equal purpose: body text and strong text, spacing
82
- and control sizes, or two motion roles may intentionally differ later. A light-only
83
- match does not justify merging tokens whose dark/reduced-motion values differ.
84
-
85
- For existing workspaces, convert independent component constants explicitly:
86
- select an existing shared role when it means the same thing; centralize genuinely
87
- missing decisions; remove private sheets/imports and contract fields; update token
88
- sample coverage in the shared directory. Preserve themes, units, public APIs and
89
- behavior unless changing the visual policy was explicitly intended. Review a Git
90
- diff and run core, project and browser checks. There is no compatibility mode that
91
- keeps independent component token definitions valid.
92
-
93
- ## Accessibility and rhythm checks
94
-
95
- `ads check` checks token values in every theme and brand. Each finding below is an error unless marked info:
96
-
97
- - `token-contrast`: the roles that meet on screen fall below WCAG 2.2 AA: `--text-strong`,
98
- `--text-body`, `--text-muted`, `--text-link` and `--accent-text` on `--bg-canvas`,
99
- `--bg-surface` and `--bg-hover`; `--accent-fg` on `--accent` and `--accent-hover`; each
100
- status's `-fg` on its solid and `-text` on its `-bg` (4.5:1); `--border-focus` and
101
- `--border-strong` on the canvas and surface (3:1). Fix it by choosing a different ramp
102
- step for the role, in the theme the message names, never with a one-off color.
103
- Any CSS color is evaluated (hex, named, `rgb()`, `hsl()`, `hwb()`, `lab()`, `lch()`,
104
- `oklab()`, `oklch()`, `color()`, `color-mix()`, `light-dark()`), through halves and
105
- aliases. A translucent background counts as composited over `--bg-canvas`, a translucent
106
- foreground as composited over its background.
107
- - `token-contrast-unresolved` (info): a pair color ADS cannot resolve statically
108
- (`currentColor`, relative color syntax, a system color), so that pair is not checked. Give
109
- the role a color or a ramp step, or check the pages that use it with `ads audit`.
110
- - `token-rhythm`: a numbered spacing step leaves the scale `--space-N` = N × 2 px.
111
- - `control-padding`: pad a control with the token for its size. A block sized with
112
- `--control-height-<size>` pads its sides with `--control-padding-<size>`; the small gap
113
- inside a track (segmented control, switch) uses `--control-inset` (add it to the spacing
114
- tokens if the project has none). Anything that is not a control does not use
115
- `--control-height-*`.
116
-
117
- `token-overlap-review` (review) compares values only within a token family (`--radius-*`
118
- with `--radius-*`): a radius equal to a spacing step is two scales meeting, not a duplicate.
119
-
120
- ## Exchange format
121
-
122
- `ads tokens --format dtcg` prints the tokens as W3C Design Tokens (Community Group draft)
123
- JSON: groups by family, typed `$value`s, `{group.token}` references for `var()` aliases.
124
- Values the format cannot express (fluid `clamp()` sizes, layered shadows) keep their CSS in
125
- `$extensions["org.reqvire.ads"].css`; other themes' values are in
126
- `$extensions["org.reqvire.ads"].scopes`.
127
-
128
- ## Grid
129
-
130
- The `--grid-*` tokens describe a column grid: `--grid-columns-sm/md/lg` (the starter's 4, 8
131
- and 16), `--grid-gutter`, `--grid-gutter-narrow`, `--grid-gutter-condensed` and
132
- `--grid-margin-sm/md/lg`, aliasing spacing steps. The starter's `Grid` switches columns by
133
- container width (768 and 1024 px) with container queries, since CSS variables cannot be
134
- breakpoints. The showcase's grid overlay draws these tokens over every preview at the same
135
- widths; a project without them shows no overlay. Align text to a cell's edge, not its gutter.
136
-
137
- ### Widths are fluid on the grid
138
-
139
- `--grid-span-1` to `--grid-span-16` are widths of N of 16 columns, fluid in their container.
140
- Set one inside a container query, under a `Grid` or another `container-type: inline-size`
141
- ancestor, and leave narrow containers at full width:
142
-
143
- ```css
144
- inline-size: 100%;
145
- @container (min-width: 1024px) { max-inline-size: var(--grid-span-10); }
146
- ```
147
-
148
- Atomic CSS does not keep rule order, so two queries on one property need exclusive ranges:
149
-
150
- ```css
151
- @container (min-width: 768px) and (max-width: 1023.98px) { max-inline-size: var(--grid-span-12); }
152
- @container (min-width: 1024px) { max-inline-size: var(--grid-span-10); }
153
- ```
154
-
155
- Use `%` or `fr` for a share of the parent and a `ch` measure for running text
156
- (`max-inline-size: 65ch`).
157
-
158
- `layout-fixed-width` is an error for `width`, `min-width`, the logical inline sizes, `flex-basis`,
159
- `flex`'s basis and `grid-template-columns` tracks that cannot shrink below 96 px, in any unit, raw,
160
- through a token or by arithmetic. `max-width` and `max-inline-size` are not read: a maximum cannot
161
- force overflow, so cap with them freely.
162
-
163
- When it fires, pick the fix by what the element is:
164
-
165
- | The element | Do |
166
- |---|---|
167
- | A small part: an icon, control, handle or thumbnail | Size it at 96 px or less, plainly: `width: 64px`, `width: var(--control-height-lg)` |
168
- | A panel, column or anything that can give way | `width: min(100%, 280px)`, `flex: 1 1 280px` or a `minmax(0, 280px)` track |
169
- | A part that truly stays that wide | A token listed in `layout.widthTokens` in `ds.config.json`, used plainly: `width: var(--side-pane-width)` |
170
- | A resizable part | A `clamp()` of three such tokens; a runtime variable needs a declared fallback: `clamp(var(--pane-min), var(--ux-pane, var(--pane)), var(--pane-max))` |
171
- | An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
172
-
173
- These do not fix it:
174
-
175
- - Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
176
- `ch` and `em` are measured at the rule's `font-size`, or 16 px.
177
- - `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
178
- their fixed part.
179
- - `min(100%, 64px)` around a small part. `layout-width-noop` asks for the plain size; in a flex or
180
- grid parent the percentage can affect wrapping, so compare the scenario after changing it.
181
- - A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
182
-
183
- `ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
184
- per-declaration exception.
185
-
186
- `ads audit` opens each control with `aria-haspopup` and measures what opens, hovers and focuses
187
- controls for contrast, and checks a control with `aria-busy="true"`. So give overlay triggers
188
- `aria-haspopup`, or render the overlay open in its scenario, and render a busy example.
189
-
190
- `layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
191
- horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
192
- scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
193
- 240 px container, and fails when a set width above 96 px overflows it. Make that width fluid, or
194
- scroll it. Only an overlay's owner, listed in `layout.fixedWidthUnits`, stays out of this render.
195
-
196
- ## Color roles and states
197
-
198
- Name roles by element and purpose, the same in every theme; only their values change. Point roles at ramp steps rather than raw colors, so a theme is a ramp swap:
199
-
200
- - Layers: `--bg-canvas` → `--bg-surface` → `--bg-raised` (menus, popovers), with `--bg-field`
201
- for inputs. In dark themes each layer up is one step lighter; in light themes surfaces stay
202
- near white.
203
- - States move along the ramp: hover one step, pressed or active two, selected a subtle accent
204
- step (`--bg-selected`). Solid fills hover one step darker (`--accent-hover`).
205
- - Disabled is always neutral (`--bg-disabled`, `--text-disabled`, `--border-disabled`) with no
206
- hover or focus response; WCAG exempts it from contrast, so `token-contrast` skips it.
207
- - `--bg-overlay` is the translucent scrim behind modals; `--bg-skeleton` fills loading
208
- placeholders.
209
- - Never signal state or status by color alone: pair it with text, an icon or a shape.
210
-
211
- ## Themes
212
-
213
- Declare themes in `ds.config.json` (`themes: [{ name, scheme }]`, the first is the default;
214
- `scheme` sets `color-scheme` for native controls and scrollbars).
215
-
216
- Write a token that differs per theme as one half per theme, named with the theme as suffix,
217
- on `:root`:
218
-
219
- ```css
220
- :root {
221
- --color-accent-9-light: oklch(55% .2 280);
222
- --color-accent-9-dark: oklch(70% .16 280);
223
- --bg-canvas-light: var(--slate-1-light);
224
- --bg-canvas-dark: var(--slate-2-dark);
225
- --accent: var(--color-accent-9);
226
- }
227
- ```
228
-
229
- - A half is a plain value or refers to halves: `--text-muted-dark: var(--slate-11-dark)`,
230
- never `var(--slate-11)` (`theme-half-reference`).
231
- - Give every themed token a half for every declared theme (`theme-coverage`). Tokens that do
232
- not change per theme stay single values; a role that aliases a ramp step
233
- (`--accent: var(--color-accent-9)`) needs no halves.
234
- - Never set token values under `[data-theme]` or `prefers-color-scheme` (`theme-old-form`),
235
- and never set a token both as one value and as halves (`theme-half-conflict`).
236
- - ADS writes `tokens/themes.generated.css` from the halves and the declared themes and
237
- brands: `ads assets` writes it, and the showcase and MCP server rewrite it whenever tokens
238
- or `ds.config.json` change. Commit it, never edit it; it is the last foundation import.
239
- After editing tokens without a running showcase, run `ads assets` (`themes-generated`
240
- fails when it is stale).
241
- - `data-theme="<name>"` on `<html>` themes the page; on any element it themes that section
242
- and everything inside it, down to the next `data-theme`. A themed section paints its own
243
- canvas and text (`base.css`).
244
- - Add a theme for a real need: high contrast, a dimmed reading mode. Add a half for it to
245
- every themed token. Check a theme in the showcase (the theme button steps through declared
246
- themes) and capture it by name.
247
- - Show content that belongs to one theme (a dark logo variant) with the generated display
248
- switch: `display: var(--display-dark, block)`. It is `none` outside the nearest dark
249
- theme. Never style by theme or brand with a selector (`[data-theme="dark"] &`,
250
- `:root[data-brand] &`): it ignores the nearest section (`theme-selector`). Give per-theme
251
- values as token halves instead.
252
- - A per-theme value that comes from data at runtime (a chart series color, a highlighter
253
- color) uses the generated helpers, never `light-dark()` (`theme-light-dark`):
254
- `style={{ "--series": themed({ light: a, dark: b }) }}` with every declared theme as a key,
255
- or `themedByScheme({ light: a, dark: b })` when the data has only light and dark (each
256
- theme takes the value for its scheme). Values are complete colors.
257
- - To follow the OS setting, set `"followSystemTheme": true` in `ds.config.json`: a page
258
- without `data-theme` takes the first declared theme whose scheme matches
259
- `prefers-color-scheme`. An explicit `data-theme` always wins. Letting the user choose and
260
- remembering it is application code: it sets `data-theme`.
261
-
262
- ## Brands
263
-
264
- A brand is a second axis beside the theme: the theme sets the color mode, the brand sets
265
- identity (an accent ramp, a font). Use brands for white label (one product, each customer's
266
- accent, font and logo, each in light and dark), a product family, or a co-branded partner
267
- section; without them every combination becomes a theme (`acme-light`, `acme-dark`, …).
268
-
269
- Declare brands in `ds.config.json` (`brands: [{ name }]`, the first is the default; leave
270
- `brands` out for one brand). The default brand's values are the ones on `:root`. Another
271
- brand re-sets existing tokens on its own selector only, with every half of a themed token it
272
- changes:
273
-
274
- ```css
275
- [data-brand="acme"] {
276
- --color-accent-9-light: oklch(55% .2 25);
277
- --color-accent-9-dark: oklch(70% .16 25);
278
- --font-sans: Georgia, serif;
279
- }
280
- ```
281
-
282
- - `data-brand="<name>"` on `<html>` brands the page; on any element that section. Brand and
283
- theme are independent: each element takes its nearest brand and its nearest theme, at any
284
- nesting depth, including the default brand inside another brand's section.
285
- - Errors: a brand that gives a themed token one value (`brand-theme-value`) or only some of
286
- its halves or ramp steps (`brand-coverage`), a token only a brand defines
287
- (`brand-new-token`), a declared brand without values (`brand-empty`), a `data-brand` name
288
- the config does not declare (`brand-undeclared`). `token-contrast` runs for every brand
289
- in every theme.
290
- - A brand's logo is brand artwork (`ads://guides/branding`). Render every brand's logo and
291
- show each with `display: var(--display-brand-<brand>, block)`, so a section shows its
292
- nearest brand's logo.
293
- - The showcase shows a brand selector next to the theme button; captures take `brand`;
294
- `ads tokens --format dtcg --brand <name>` exports a brand (with `--theme`, one brand in
295
- one theme).
296
-
297
- ## Colors in Canvas, WebGL and SVG renderers
298
-
299
- A renderer that needs colors as values (a graph, a chart, a canvas) reads them from the
300
- generated palette, never from the page per item. `tokens/themes.generated.ts` holds every
301
- color token resolved for every context (`<theme>`, and `<brand>/<theme>` for other brands)
302
- as `{ css, rgba }`: `css` is `#rrggbb`, or `rgba(…)` when translucent; `rgba` is sRGB
303
- 0–255 with alpha 0–1. Aliases, halves and `color-mix()` are resolved; out-of-gamut colors
304
- are clipped per channel, as a canvas does. ADS writes it with `themes.generated.css`.
305
-
306
- ```ts
307
- import { paletteFor, observePalette } from "@ds";
308
-
309
- let colors = paletteFor(container); // once per render pass
310
- const fill = colors["--accent"].rgba; // inside the per-node loop
311
- const stop = observePalette(container, next => { colors = next; redraw(); });
312
- ```
313
-
314
- - `paletteFor(element)` returns the palette of the element's nearest theme and brand (and
315
- the OS setting under `followSystemTheme`). Call it once per render or context change; look
316
- colors up inside loops.
317
- - `observePalette(element, callback)` calls back once when the element's theme or brand
318
- changes; redraw from it instead of rebuilding the renderer. It returns the unsubscribe.
319
- - `paletteContext(element)` returns the context key (`<theme>` or `<brand>/<theme>`) for
320
- `palette[key]` or for caching per context.
321
- - `resolveColor(element, value)` resolves a color that is not a palette token (currentColor,
322
- a value from data) once, without inserting elements, and caches it.
323
- - A token whose value cannot be resolved ahead of time (currentColor, relative color syntax,
324
- system colors) is not in the palette in any context; `unresolved` lists it. Use
325
- `resolveColor` for those.
326
- - The palette reflects token sheets, not inline token overrides at runtime or `@media`
327
- variants.
328
-
329
- `render-color-probe` (review) flags a computed-style color read or `getImageData` inside a
330
- per-item path (an array callback, a loop body, `nodeReducer`/`edgeReducer`, d3 `.attr`/
331
- `.style` callbacks). Move the read out with `paletteFor`.
332
-
333
- ## Spacing
334
-
335
- `--space-N` is N × 2 px, from 2 to 160 px; the same values hold at every screen size, and a
336
- layout steps down one or two sizes at narrow widths instead of scaling. Use the scale for
337
- padding inside components and for gaps between them; a value off the scale needs a reason.
338
-
339
- - Distance says how related things are: closer means more related. Group with space before
340
- reaching for dividers, borders or cards.
341
- - More space around an element gives it more importance. Sections can be dense, but leave the
342
- page as a whole room to breathe.
343
- - Parents own the space between their children (`gap`, stack tokens); a component carries no
344
- outer margin, so it fits wherever it is placed.
345
- - Horizontal layout follows the column grid; percentages are fine for splitting a region and
346
- for minimum and maximum widths.
347
-
348
- ## Motion tokens
349
-
350
- Six durations (`--dur-instant` 70 ms, `--dur-fast` 110, `--dur-moderate` 150, `--dur-normal`
351
- 240, `--dur-slow` 400, `--dur-slower` 700) and three curve pairs (standard, enter and exit, each everyday and
352
- `-strong`). Every duration is 0 under `prefers-reduced-motion`. Pick by purpose, not by
353
- number: the ads-motion skill's build guide maps each token to its use and gives the easing
354
- rules.