@reqvire-org/ads 0.3.18 → 0.3.20

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 (78) hide show
  1. package/dist/behaviors.mjs +5 -5
  2. package/dist/bootstrap-ds/ADS.md +2 -2
  3. package/dist/bootstrap-ds/README.md +1 -1
  4. package/dist/bootstrap-ds/design-system/index.ts +0 -1
  5. package/dist/bootstrap-ds/design-system/review/index.ts +1 -0
  6. package/dist/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +1 -1
  7. package/dist/bootstrap-ds/ds.config.json +1 -1
  8. package/dist/bootstrap-ds/tsconfig.json +18 -3
  9. package/dist/bootstrap-ds/vite.config.ts +1 -1
  10. package/dist/boundaries.mjs +4 -2
  11. package/dist/check.mjs +20 -13
  12. package/dist/config.mjs +13 -2
  13. package/dist/init.mjs +17 -14
  14. package/dist/layers.mjs +288 -0
  15. package/dist/lint-config.mjs +1 -1
  16. package/dist/mcp/context.mjs +2 -1
  17. package/dist/mcp/edit-preparation.mjs +3 -3
  18. package/dist/mcp/mutations.mjs +1 -1
  19. package/dist/mcp/prompts.mjs +1 -1
  20. package/dist/mcp/server.mjs +6 -2
  21. package/dist/mcp/widget.bundle.js +1 -1
  22. package/dist/oxlint.mjs +3 -1
  23. package/dist/preview-resources.mjs +11 -1
  24. package/dist/public-api.mjs +13 -6
  25. package/dist/scenario-trace.mjs +6 -6
  26. package/dist/scenarios-vite.mjs +2 -1
  27. package/dist/scenarios.mjs +10 -7
  28. package/dist/showcase/client.bundle.js +1 -1
  29. package/dist/showcase/sandbox.bundle.js +1 -1
  30. package/dist/skills/ads-break-ui/SKILL.md +21 -6
  31. package/dist/skills/ads-break-ui/references/guarded-editing.md +1 -1
  32. package/dist/skills/ads-break-ui/references/layers.md +123 -0
  33. package/dist/skills/ads-break-ui/references/review.md +96 -0
  34. package/dist/skills/ads-break-ui/references/scenarios.md +24 -3
  35. package/dist/skills/ads-designer/SKILL.md +22 -7
  36. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +2 -2
  37. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +1 -1
  38. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +0 -1
  39. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/index.ts +1 -0
  40. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +1 -1
  41. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -1
  42. package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.json +18 -3
  43. package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +1 -1
  44. package/dist/skills/ads-designer/references/guarded-editing.md +1 -1
  45. package/dist/skills/ads-designer/references/layers.md +123 -0
  46. package/dist/skills/ads-designer/references/review.md +96 -0
  47. package/dist/skills/ads-designer/references/scenarios.md +24 -3
  48. package/dist/skills/ads-import/SKILL.md +21 -6
  49. package/dist/skills/ads-import/references/guarded-editing.md +1 -1
  50. package/dist/skills/ads-import/references/layers.md +123 -0
  51. package/dist/skills/ads-import/references/review.md +96 -0
  52. package/dist/skills/ads-import/references/scenarios.md +24 -3
  53. package/dist/skills/ads-migrate/SKILL.md +21 -6
  54. package/dist/skills/ads-migrate/references/guarded-editing.md +1 -1
  55. package/dist/skills/ads-migrate/references/layers.md +123 -0
  56. package/dist/skills/ads-migrate/references/review.md +96 -0
  57. package/dist/skills/ads-migrate/references/scenarios.md +24 -3
  58. package/dist/skills/ads-motion/SKILL.md +22 -7
  59. package/dist/skills/ads-motion/references/audit.md +1 -1
  60. package/dist/skills/ads-motion/references/guarded-editing.md +1 -1
  61. package/dist/skills/ads-motion/references/layers.md +123 -0
  62. package/dist/skills/ads-motion/references/motion-review.md +35 -0
  63. package/dist/skills/ads-motion/references/review.md +96 -35
  64. package/dist/skills/ads-motion/references/scenarios.md +24 -3
  65. package/dist/units.mjs +17 -14
  66. package/docs/ADS.md +32 -5
  67. package/docs/ARCHITECTURE.md +37 -4
  68. package/docs/BEHAVIORS.md +7 -0
  69. package/docs/CHANGELOG.md +23 -0
  70. package/docs/GUIDE.md +3 -2
  71. package/docs/MCP.md +27 -6
  72. package/package.json +1 -1
  73. package/dist/bootstrap-ds/design-system/patterns/token-preview/Scenario.tsx +0 -4
  74. package/dist/bootstrap-ds/design-system/patterns/token-preview/fixture.ts +0 -8
  75. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/token-preview/Scenario.tsx +0 -4
  76. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/token-preview/fixture.ts +0 -8
  77. /package/dist/bootstrap-ds/design-system/{patterns → review}/token-preview/TokenPreview.tsx +0 -0
  78. /package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/{patterns → review}/token-preview/TokenPreview.tsx +0 -0
@@ -0,0 +1,96 @@
1
+ # Development-only review UI
2
+
3
+ Read this when creating or migrating demo frames, preview sizing helpers, token
4
+ renderers or demonstration controls. MCP serves it as `ads://guides/review`.
5
+
6
+ ## Responsibilities and boundaries
7
+
8
+ Components provide cohesive production capabilities. Patterns provide reusable
9
+ application structures/workflows. Both receive variable application data and
10
+ callbacks through their APIs. Their scenarios import the same implementation
11
+ used by the application and supply fixtures; do not create a second implementation
12
+ that only looks correct in the showcase.
13
+
14
+ `design-system/review/` owns development-only presentation: example frames,
15
+ arrangement, demonstration controls, token sample renderers and their styles.
16
+ It remains project-owned. The MCP host shell stays generic; review code executes
17
+ inside the preview App with the project's framework, foundation, fonts and styles.
18
+ Nothing depends on particular helper names or an imported component library.
19
+
20
+ The development entry defaults to `review/index.ts` relative to `dsDir`; configure
21
+ `reviewEntry` for another script inside `review/`. Its import alias is the
22
+ configured `publicAlias` plus `/review`, normally `@ds/review`. Discover the actual
23
+ entry/alias through `ads_status.project.review`. Export helpers there, never from
24
+ the production public barrel. Review implementations, types and styles must not
25
+ enter application, component, pattern or controller dependencies. Tests, fixtures,
26
+ scenarios and preview mounts can consume review code.
27
+
28
+ Review helpers can own Linaria presentation, local state and demo controls. Normal
29
+ style-token, variable ownership, measured-style-write and application separation
30
+ gates still apply. They consume deliberate public component/pattern/controller
31
+ contracts and may reuse local foundation helpers. They cannot target private
32
+ component styles or replace real product behavior. Keep one-off fixture data in
33
+ the scenario; a helper need not become a product API to frame an example.
34
+
35
+ ## Scenario and token contracts
36
+
37
+ ```tsx
38
+ import { Panel } from "@ds";
39
+ import { ReviewFrame } from "@ds/review";
40
+ import { fixture } from "./Panel.fixture";
41
+
42
+ export const scenario = { title: "Panel", covers: ["Panel"] };
43
+ export default function Scenario() {
44
+ return <ReviewFrame><Panel {...fixture} /></ReviewFrame>;
45
+ }
46
+ ```
47
+
48
+ The names above are illustrative. `covers` names the production subjects actually
49
+ demonstrated, not every review wrapper. A review export has no product catalogue
50
+ entry and needs no standalone catalogue scenario. Keep review unit tests/specs
51
+ beside their owner; optional behavior contracts can verify review guarantees
52
+ through an existing real scenario. They establish no production coverage.
53
+
54
+ A token scenario may name its real review renderer in `covers`, import it from
55
+ the development entry, declare `samples: fixture.samples`, and pass those samples
56
+ into the renderer. Existing real product patterns may also serve as token UI.
57
+ Empty covers, unused samples, fabricated tokens and plain value lists remain
58
+ invalid. The rendered App must still pass token-binding checks. See
59
+ [scenarios.md](scenarios.md) for the full token/render contract.
60
+
61
+ Review class helpers can supply source-proven Linaria classes to a scenario.
62
+ Arbitrary scenario classes/styles remain forbidden. A review wrapper's own native
63
+ controls do not authorize arbitrary native controls in its consuming scenario;
64
+ slot/selector exceptions still need actual production-owner evidence. Keep
65
+ production and review export names distinct where `covers` would be ambiguous.
66
+
67
+ ## Build and guarded edits
68
+
69
+ The normal preview plugin registers the exact review alias before broader product
70
+ aliases. Configure the same alias in project TypeScript and any independent
71
+ preview/dev harness. In an ordered bundler alias map, put `@ds/review` before
72
+ `@ds`; the broad `@ds` mapping must not resolve it as `index.ts/review`.
73
+ Production entrypoints never import the development entry. Inspect the product
74
+ bundle for review modules/CSS; passing static checks does not prove bundle parity.
75
+
76
+ Use `ads_units` for `review/<Owner>` units. Scenarios, local specs and helper files
77
+ follow ordinary flat/directory ownership. A review patch may update only its own
78
+ re-exports in the development entry and its own documented style boundaries.
79
+ Product owners retain the separate production entry companion. Use prepared
80
+ patches/dry runs and coupled transactions as described in
81
+ [guarded-editing.md](guarded-editing.md); do not bypass a rejected mutation.
82
+
83
+ For an existing project, identify helpers by responsibility and actual consumers,
84
+ not names or the number of imported components. Preserve real application patterns.
85
+ Move only demo helpers, their styles and relevant guides to `review/`; update
86
+ scenario/preview imports, style-boundary paths, TypeScript/bundler aliases and
87
+ links. Remove their production exports and obsolete standalone product scenarios.
88
+ Do not copy old example fixtures or export demonstration controls as product UI.
89
+
90
+ Upgrade ADS before migrating a consuming project: older versions do not know the
91
+ separate review entry. For staged guarded edits, first add distinctly named review
92
+ exports, migrate consumers in passing owner patches, then remove the old pattern
93
+ exports/owners once unused. Required coupled changes use a transaction. Check
94
+ source gates, typecheck, preview and production builds, real browser rendering,
95
+ registered behaviors and token bindings. A source move alone establishes none
96
+ of those rendered guarantees.
@@ -34,10 +34,31 @@ do not add scenario `preventDefault` handlers merely to hide it. Explicit App
34
34
  bases retain their declared behavior and CSP requirements; external hosts own
35
35
  their document-loading policy. Verify link activation as well as rendering.
36
36
 
37
+ ## Forms inside Apps
38
+
39
+ Use real form semantics and the runtime owner's intended submit handler. ADS's
40
+ showcase and diagnostic explorer permit `allow-forms` at every iframe layer,
41
+ including legacy widgets. Browser constraint validation, Submit clicks, Enter and
42
+ `requestSubmit()` can reach the normal submit path. Client-side forms call
43
+ `preventDefault()` in their submit handlers; the host does not synthesize clicks
44
+ or submit events. Native action requests are blocked by CSP `form-action 'none'`.
45
+ Submit effects that use tools or resources still follow the MCP bridge.
46
+
47
+ If a click fires but the `submit` handler never runs, inspect the browser's sandbox
48
+ diagnostic and every ancestor iframe's permissions. Distinguish that host problem
49
+ from native constraint validation legitimately preventing submission. Do not add
50
+ scenario click interception to disguise a missing sandbox permission. External
51
+ MCP hosts control their own sandbox/CSP policy.
52
+
53
+ Verify an invalid submit, a valid submit, implicit Enter submission and the promised
54
+ state effects. A working Next button is not evidence that form submission works.
55
+ Keep native action navigation separate from client-side submission behavior;
56
+ `allow-forms` does not grant host DOM access or top-level navigation.
57
+
37
58
  ## Owner-local token previews load their own definitions
38
59
 
39
60
  Keep the registered token sheet imported by its runtime owner for product use.
40
- A colocated `kind: "tokens"` scenario may render only the public review pattern
61
+ A colocated `kind: "tokens"` scenario may render only the development-only review renderer
41
62
  with its fixture samples. Discovery adds the registered owner sheet to the
42
63
  generated record's `stylesheets`; `previewEntriesPlugin` imports those paths
43
64
  into the token preview independently of the runtime component. Custom builders
@@ -91,7 +112,7 @@ These examples describe verification mistakes, not component-specific rules:
91
112
 
92
113
  | Situation | Do not | Do instead |
93
114
  |-----------|--------|------------|
94
- | A reference example sets `width: 15rem`, while the native popup uses its default width. | Remove the reference width and claim the original example now matches. | Keep the baseline intact. Reproduce demo sizing through the project's public review/layout pattern or supported style helper. If a different native size is intentional, document it. Label any additional normalized comparison separately. |
115
+ | A reference example sets `width: 15rem`, while the native popup uses its default width. | Remove the reference width and claim the original example now matches. | Keep the baseline intact. Reproduce demo sizing through the project's development-only review helper or supported style helper. If a different native size is intentional, document it. Label any additional normalized comparison separately. |
95
116
  | Static tracing cannot prove that a public clear control renders when a value is selected. | Remove its export, drop its required coverage, or change runtime behavior merely to pass the gate. | Preserve the intended public API. Try a meaningful selected-state fixture or another real scenario. If valid rendering remains untraceable, report the tooling limitation with a small reproduction. |
96
117
  | A screenshot shows the clear control in a selected state. | Treat its presence as evidence that clearing works. | Add a browser check: start selected, activate Clear, assert the value and selection are empty, verify the control's resulting visibility and documented focus behavior, then select again. |
97
118
 
@@ -207,6 +228,6 @@ An `exercises` entry records behavioral use; it never grants styling permission.
207
228
  Keep helper signatures compatible with the product API. Fix ownership/provenance
208
229
  in the runtime owner when genuinely wrong; retain intentional public APIs when
209
230
  reporting an unsupported trace. Demo-only sizing, framing and arrangement still
210
- belong in public review/layout patterns. A style helper is not permission to
231
+ belong in development-only review helpers. A style helper is not permission to
211
232
  author a second design in the scenario. For cascade risks and extraction issues,
212
233
  read [atomic-styles.md](atomic-styles.md).
@@ -56,6 +56,19 @@ one `ads_investigate({unit,check,runId})` summary before changing APIs or policy
56
56
  load request/error/artifact details only when relevant.
57
57
 
58
58
 
59
+ Review/demo layout belongs in development-only `review/`, exported through the
60
+ separate `${publicAlias}/review` entry (normally `@ds/review`), never the production
61
+ barrel. Product patterns are application UI. For ownership, migration, token
62
+ renderers, build aliases or `review-import` / `review-contract` diagnostics, read
63
+ [development review UI](references/review.md), also served as `ads://guides/review`.
64
+
65
+ A component provides one cohesive UI capability; a pattern arranges capabilities
66
+ into reusable structures or workflows. Components may compose components/controllers;
67
+ layout patterns may arrange slots. Do not classify by component count. For owner
68
+ selection or `component-dependency`, `component-contract` or `component-style`, read
69
+ [layer responsibilities and contracts](references/layers.md), also served as
70
+ `ads://guides/layers`. Preserve public APIs and documented non-state styling hooks.
71
+
59
72
  For parent/child `covers`, conditional-control review, reference comparisons,
60
73
  public style-helper use, native slot/selector composition, fragment navigation,
61
74
  or `scenario-render` / `showcase-control` / `showcase-class` findings, read [scenario contracts](references/scenarios.md). Its verification
@@ -269,7 +282,7 @@ fixture under the configured token directory. Declare metadata
269
282
  The renderer name is project-owned; use its real public API. Each literal fixture
270
283
  sample declares `{ token, property, probe }`: a real token, the CSS property its
271
284
  sample demonstrates, and a valid test value different from that token's current
272
- value. Pass `samples` into the rendered public review pattern. Names, sample text,
285
+ value. Pass `samples` into the rendered development-only review renderer. Names, sample text,
273
286
  bindings and probes are fixture data; displayed values come from foundation CSS.
274
287
  There is no property catalogue, token-name mapping or probe palette in ADS.
275
288
  Every token needs sample coverage; fabricated tokens, missing bindings/probes,
@@ -290,10 +303,12 @@ source definitions and values; inspecting definitions does not prove UI parity.
290
303
  The tool keeps the shared naming contract; sample templates and their token
291
304
  lists belong to the project.
292
305
 
293
- A public review pattern may be covered by real token or composition scenarios;
294
- it needs no redundant standalone entry. Remove an optional scenario only while
295
- retaining reachable render coverage. Keep directory ownership anchored by its
296
- runtime entry (`index` or a file matching the directory name) or colocated fixture.
306
+ Development review helpers need no product catalogue scenario. A token scenario
307
+ may name its review renderer in `covers`; ordinary component/pattern scenarios
308
+ cover their production subjects. Keep review exports in the separate review entry.
309
+ Remove redundant helper catalogue scenarios during migration. Product UI retains
310
+ its real render-coverage requirement. Keep directory ownership anchored by its
311
+ implementation entry (`index` or a file matching the directory name) or colocated fixture.
297
312
  Import colocated image/font fixtures so MCP serves them through asset resources.
298
313
  For a broken-image case, use a local failing fixture, rather than an external
299
314
  network failure or a domain-specific CSP exception. Production asset APIs remain
@@ -317,7 +332,7 @@ branch, property and value must fit its role. Token-backed control skins, layout
317
332
  interactive state rules and owner hooks are rejected even through `:where()`.
318
333
  Do not copy an unchecked upstream preflight or turn a component repair into a reset.
319
334
  Keep behavior and skin in their runtime owner. Put demo-only sizing and framing
320
- in a public review/layout pattern; add component props for a deliberate runtime
335
+ in a development-only review helper; add component props for a deliberate runtime
321
336
  API need. Preserve required capabilities while following ownership rules.
322
337
  Use tokens for absolute/font-relative lengths, including `ch`, `ex`, `cap`, `ic`
323
338
  and `lh`; calculations and fallback values follow the same rule. Structural
@@ -103,7 +103,7 @@ and a definition-only `tokens.css`, imported by its runtime source. Flat owners
103
103
  shared or --ds-/--ux-/--showcase- variables. Only that owner consumes/defines its
104
104
  local tokens; aliases can use shared or own tokens. UI styles stay in Linaria.
105
105
  Add a colocated token scenario with `kind:"tokens"`, real fixture `samples` and a
106
- public review pattern. These inputs belong to the same owner and need real sample
106
+ development-only review renderer. These inputs belong to the same owner and need real sample
107
107
  coverage. Manifests and fixtures stay out of the product bundle.
108
108
 
109
109
  `ads_prepare_token_samples({id, bindings?})` preserves existing project samples,
@@ -0,0 +1,123 @@
1
+ # Components, patterns and application adapters
2
+
3
+ Read this when choosing an owner, moving UI between layers, or resolving
4
+ `component-dependency`, `component-contract`, `component-style`, `no-app-import`
5
+ or `showcase-import`. MCP also serves this guide as `ads://guides/layers`.
6
+
7
+ ## Choose by responsibility
8
+
9
+ A **component** provides one cohesive UI capability: semantics, input handling,
10
+ focus, accessibility, states and appearance. It may compose other components and
11
+ controllers. A notification using an icon, action button and spinner can still
12
+ be one component.
13
+
14
+ A **pattern** arranges capabilities and content slots into a reusable structure
15
+ or workflow, such as navigation with search/account controls or a report screen.
16
+ Layout parts may arrange `children` without importing several components.
17
+ Patterns may compose other patterns. A native wrapper or a large implementation
18
+ does not decide the layer.
19
+
20
+ An **application adapter** supplies domain data, store access, route state and
21
+ navigation/service callbacks. Domain-shaped inputs are valid in project-owned
22
+ patterns; importing a particular application store/router is not.
23
+
24
+ A **scenario** supplies demonstration inputs, local state and simulated services.
25
+ A component scenario may compose several public components and development review helpers
26
+ to demonstrate its subject. That does not turn its fixture or variant selectors
27
+ into production API. Keep `covers` aligned with the scenario's subject layer.
28
+
29
+ Do not classify by import count, JSX element count, names or file length. Review
30
+ the capability and its consumer contract. Preserve valid APIs when tracing is
31
+ inconclusive; do not make an export private or add a product prop just to pass.
32
+
33
+ ## Demonstrate the production implementation
34
+
35
+ Product patterns are reusable application UI, not showcase replicas. A scenario
36
+ imports the same production owner and supplies fixtures through its public API;
37
+ the application supplies live data and callbacks to that API. Keep mock records,
38
+ demo selections and simulated services in development files. Legitimate defaults,
39
+ control labels and the pattern's own interaction logic remain with their owner.
40
+
41
+ Demo framing must not replace a product pattern's styling or behavior. Browser
42
+ checks should exercise both the demonstrated contract and relevant application
43
+ integration; a successful showcase does not establish production parity. A new
44
+ pattern need not already have an application consumer, and import counts cannot
45
+ detect a duplicated implementation. Existing import guards prevent fixture/test
46
+ dependencies; review and browser checks must assess hardcoded mock data and
47
+ unrepresentative rendering that source ownership alone cannot prove.
48
+
49
+ Review framing belongs in development-only `review/`, not production patterns.
50
+ Use the separate review entry and [review.md](review.md) for the migration and
51
+ build contract.
52
+
53
+ ## Dependency contracts (blocking)
54
+
55
+ - Component runtime may depend on components, shared controllers and lower-level
56
+ helpers. It cannot depend on patterns or composition, including indirectly
57
+ through aliases, forwarding exports, helpers or literal dynamic imports.
58
+ Type-only pattern references do not introduce runtime dependencies.
59
+ - Patterns consume component symbols published by the configured public entry,
60
+ including intentional public types. A relative import of a public symbol is
61
+ allowed inside the ADS; requiring a self-import through the barrel can create
62
+ cycles. Private state, class blocks and implementation helpers stay internal.
63
+ A public component may use its own private implementation dependencies.
64
+ - Runtime code cannot import review implementations/types/styles, scenarios, fixtures or checks, including through
65
+ forwarding exports. Scenarios also cannot import application source.
66
+ - ADS implementations receive application data/effects through inputs and
67
+ callbacks. Re-exporting application stores, routers or services from a helper
68
+ does not make them part of the ADS.
69
+
70
+ For example, `components/Control → shared/helper → patterns/Navigation` fails
71
+ `component-dependency`. Extract a lower-level capability/controller, or move the
72
+ arrangement to a pattern. `patterns/Navigation → components/Control` is valid
73
+ when `Control` is public. Replacing that import with its private state helper
74
+ fails `component-contract` even through a forwarding module.
75
+
76
+ ## Styling contracts (blocking when ownership is established)
77
+
78
+ Components own their control states and appearance. Patterns own arrangement,
79
+ spacing and their own presentation. Use typed component props/variants, an
80
+ intentional public class helper/hook, or registered non-state customization
81
+ variables. Registration does not authorize overriding interaction policy.
82
+
83
+ ```tsx
84
+ // Component-owned implementation; the marker is not a consumer styling API.
85
+ function Control() {
86
+ return <button><span className="control-private-label">Label</span></button>;
87
+ }
88
+
89
+ // Pattern: rejected because it styles the component's private rendered part.
90
+ const wrong = css`
91
+ & .control-private-label { color: var(--text-muted); }
92
+ `;
93
+
94
+ // Pattern: its own arrangement remains valid.
95
+ const layout = css`
96
+ display: flex;
97
+ gap: var(--space-4);
98
+ `;
99
+ ```
100
+
101
+ The source guard matches component-emitted class names and unambiguous literal
102
+ data markers to the selector's styled subject, including `:is()`/`:where()`.
103
+ It also rejects reads of known private component variables. It does not treat
104
+ an ancestor predicate or `:has()` query as styling that ancestor/descendant:
105
+ `[data-layout="expanded"] > & { gap: var(--space-4); }` changes the pattern's
106
+ own arrangement. Public hooks and registered non-state variables remain valid.
107
+ Token definitions, namespaces and writes retain their existing guards.
108
+
109
+ Opaque/computed imports, generated selectors, ambiguous shared markers, forwarded
110
+ consumer classes and arbitrary service abstractions are not a complete static
111
+ proof. Passing source checks does not prove that every visual override is safe.
112
+ Review the real rendered states, computed styles, keyboard interactions and
113
+ responsive layouts; use registered browser checks for promised behavior.
114
+
115
+ ## Refactoring an owner
116
+
117
+ Move runtime source, its scenarios/fixtures and guides together; update public
118
+ exports, dependent imports and documented scenario IDs. Keep callers on the
119
+ same intentional public API. Navigation stays in an application callback or a
120
+ normal link supplied by the consumer, rather than a hidden router mutation in
121
+ the pattern. Validate the complete migration with project checks, product and
122
+ preview builds, and behavior tests. An existing guard rejection is not permission
123
+ to write around the guarded editing workflow.
@@ -0,0 +1,96 @@
1
+ # Development-only review UI
2
+
3
+ Read this when creating or migrating demo frames, preview sizing helpers, token
4
+ renderers or demonstration controls. MCP serves it as `ads://guides/review`.
5
+
6
+ ## Responsibilities and boundaries
7
+
8
+ Components provide cohesive production capabilities. Patterns provide reusable
9
+ application structures/workflows. Both receive variable application data and
10
+ callbacks through their APIs. Their scenarios import the same implementation
11
+ used by the application and supply fixtures; do not create a second implementation
12
+ that only looks correct in the showcase.
13
+
14
+ `design-system/review/` owns development-only presentation: example frames,
15
+ arrangement, demonstration controls, token sample renderers and their styles.
16
+ It remains project-owned. The MCP host shell stays generic; review code executes
17
+ inside the preview App with the project's framework, foundation, fonts and styles.
18
+ Nothing depends on particular helper names or an imported component library.
19
+
20
+ The development entry defaults to `review/index.ts` relative to `dsDir`; configure
21
+ `reviewEntry` for another script inside `review/`. Its import alias is the
22
+ configured `publicAlias` plus `/review`, normally `@ds/review`. Discover the actual
23
+ entry/alias through `ads_status.project.review`. Export helpers there, never from
24
+ the production public barrel. Review implementations, types and styles must not
25
+ enter application, component, pattern or controller dependencies. Tests, fixtures,
26
+ scenarios and preview mounts can consume review code.
27
+
28
+ Review helpers can own Linaria presentation, local state and demo controls. Normal
29
+ style-token, variable ownership, measured-style-write and application separation
30
+ gates still apply. They consume deliberate public component/pattern/controller
31
+ contracts and may reuse local foundation helpers. They cannot target private
32
+ component styles or replace real product behavior. Keep one-off fixture data in
33
+ the scenario; a helper need not become a product API to frame an example.
34
+
35
+ ## Scenario and token contracts
36
+
37
+ ```tsx
38
+ import { Panel } from "@ds";
39
+ import { ReviewFrame } from "@ds/review";
40
+ import { fixture } from "./Panel.fixture";
41
+
42
+ export const scenario = { title: "Panel", covers: ["Panel"] };
43
+ export default function Scenario() {
44
+ return <ReviewFrame><Panel {...fixture} /></ReviewFrame>;
45
+ }
46
+ ```
47
+
48
+ The names above are illustrative. `covers` names the production subjects actually
49
+ demonstrated, not every review wrapper. A review export has no product catalogue
50
+ entry and needs no standalone catalogue scenario. Keep review unit tests/specs
51
+ beside their owner; optional behavior contracts can verify review guarantees
52
+ through an existing real scenario. They establish no production coverage.
53
+
54
+ A token scenario may name its real review renderer in `covers`, import it from
55
+ the development entry, declare `samples: fixture.samples`, and pass those samples
56
+ into the renderer. Existing real product patterns may also serve as token UI.
57
+ Empty covers, unused samples, fabricated tokens and plain value lists remain
58
+ invalid. The rendered App must still pass token-binding checks. See
59
+ [scenarios.md](scenarios.md) for the full token/render contract.
60
+
61
+ Review class helpers can supply source-proven Linaria classes to a scenario.
62
+ Arbitrary scenario classes/styles remain forbidden. A review wrapper's own native
63
+ controls do not authorize arbitrary native controls in its consuming scenario;
64
+ slot/selector exceptions still need actual production-owner evidence. Keep
65
+ production and review export names distinct where `covers` would be ambiguous.
66
+
67
+ ## Build and guarded edits
68
+
69
+ The normal preview plugin registers the exact review alias before broader product
70
+ aliases. Configure the same alias in project TypeScript and any independent
71
+ preview/dev harness. In an ordered bundler alias map, put `@ds/review` before
72
+ `@ds`; the broad `@ds` mapping must not resolve it as `index.ts/review`.
73
+ Production entrypoints never import the development entry. Inspect the product
74
+ bundle for review modules/CSS; passing static checks does not prove bundle parity.
75
+
76
+ Use `ads_units` for `review/<Owner>` units. Scenarios, local specs and helper files
77
+ follow ordinary flat/directory ownership. A review patch may update only its own
78
+ re-exports in the development entry and its own documented style boundaries.
79
+ Product owners retain the separate production entry companion. Use prepared
80
+ patches/dry runs and coupled transactions as described in
81
+ [guarded-editing.md](guarded-editing.md); do not bypass a rejected mutation.
82
+
83
+ For an existing project, identify helpers by responsibility and actual consumers,
84
+ not names or the number of imported components. Preserve real application patterns.
85
+ Move only demo helpers, their styles and relevant guides to `review/`; update
86
+ scenario/preview imports, style-boundary paths, TypeScript/bundler aliases and
87
+ links. Remove their production exports and obsolete standalone product scenarios.
88
+ Do not copy old example fixtures or export demonstration controls as product UI.
89
+
90
+ Upgrade ADS before migrating a consuming project: older versions do not know the
91
+ separate review entry. For staged guarded edits, first add distinctly named review
92
+ exports, migrate consumers in passing owner patches, then remove the old pattern
93
+ exports/owners once unused. Required coupled changes use a transaction. Check
94
+ source gates, typecheck, preview and production builds, real browser rendering,
95
+ registered behaviors and token bindings. A source move alone establishes none
96
+ of those rendered guarantees.
@@ -34,10 +34,31 @@ do not add scenario `preventDefault` handlers merely to hide it. Explicit App
34
34
  bases retain their declared behavior and CSP requirements; external hosts own
35
35
  their document-loading policy. Verify link activation as well as rendering.
36
36
 
37
+ ## Forms inside Apps
38
+
39
+ Use real form semantics and the runtime owner's intended submit handler. ADS's
40
+ showcase and diagnostic explorer permit `allow-forms` at every iframe layer,
41
+ including legacy widgets. Browser constraint validation, Submit clicks, Enter and
42
+ `requestSubmit()` can reach the normal submit path. Client-side forms call
43
+ `preventDefault()` in their submit handlers; the host does not synthesize clicks
44
+ or submit events. Native action requests are blocked by CSP `form-action 'none'`.
45
+ Submit effects that use tools or resources still follow the MCP bridge.
46
+
47
+ If a click fires but the `submit` handler never runs, inspect the browser's sandbox
48
+ diagnostic and every ancestor iframe's permissions. Distinguish that host problem
49
+ from native constraint validation legitimately preventing submission. Do not add
50
+ scenario click interception to disguise a missing sandbox permission. External
51
+ MCP hosts control their own sandbox/CSP policy.
52
+
53
+ Verify an invalid submit, a valid submit, implicit Enter submission and the promised
54
+ state effects. A working Next button is not evidence that form submission works.
55
+ Keep native action navigation separate from client-side submission behavior;
56
+ `allow-forms` does not grant host DOM access or top-level navigation.
57
+
37
58
  ## Owner-local token previews load their own definitions
38
59
 
39
60
  Keep the registered token sheet imported by its runtime owner for product use.
40
- A colocated `kind: "tokens"` scenario may render only the public review pattern
61
+ A colocated `kind: "tokens"` scenario may render only the development-only review renderer
41
62
  with its fixture samples. Discovery adds the registered owner sheet to the
42
63
  generated record's `stylesheets`; `previewEntriesPlugin` imports those paths
43
64
  into the token preview independently of the runtime component. Custom builders
@@ -91,7 +112,7 @@ These examples describe verification mistakes, not component-specific rules:
91
112
 
92
113
  | Situation | Do not | Do instead |
93
114
  |-----------|--------|------------|
94
- | A reference example sets `width: 15rem`, while the native popup uses its default width. | Remove the reference width and claim the original example now matches. | Keep the baseline intact. Reproduce demo sizing through the project's public review/layout pattern or supported style helper. If a different native size is intentional, document it. Label any additional normalized comparison separately. |
115
+ | A reference example sets `width: 15rem`, while the native popup uses its default width. | Remove the reference width and claim the original example now matches. | Keep the baseline intact. Reproduce demo sizing through the project's development-only review helper or supported style helper. If a different native size is intentional, document it. Label any additional normalized comparison separately. |
95
116
  | Static tracing cannot prove that a public clear control renders when a value is selected. | Remove its export, drop its required coverage, or change runtime behavior merely to pass the gate. | Preserve the intended public API. Try a meaningful selected-state fixture or another real scenario. If valid rendering remains untraceable, report the tooling limitation with a small reproduction. |
96
117
  | A screenshot shows the clear control in a selected state. | Treat its presence as evidence that clearing works. | Add a browser check: start selected, activate Clear, assert the value and selection are empty, verify the control's resulting visibility and documented focus behavior, then select again. |
97
118
 
@@ -207,6 +228,6 @@ An `exercises` entry records behavioral use; it never grants styling permission.
207
228
  Keep helper signatures compatible with the product API. Fix ownership/provenance
208
229
  in the runtime owner when genuinely wrong; retain intentional public APIs when
209
230
  reporting an unsupported trace. Demo-only sizing, framing and arrangement still
210
- belong in public review/layout patterns. A style helper is not permission to
231
+ belong in development-only review helpers. A style helper is not permission to
211
232
  author a second design in the scenario. For cascade risks and extraction issues,
212
233
  read [atomic-styles.md](atomic-styles.md).
@@ -76,6 +76,19 @@ one `ads_investigate({unit,check,runId})` summary before changing APIs or policy
76
76
  load request/error/artifact details only when relevant.
77
77
 
78
78
 
79
+ Review/demo layout belongs in development-only `review/`, exported through the
80
+ separate `${publicAlias}/review` entry (normally `@ds/review`), never the production
81
+ barrel. Product patterns are application UI. For ownership, migration, token
82
+ renderers, build aliases or `review-import` / `review-contract` diagnostics, read
83
+ [development review UI](references/review.md), also served as `ads://guides/review`.
84
+
85
+ A component provides one cohesive UI capability; a pattern arranges capabilities
86
+ into reusable structures or workflows. Components may compose components/controllers;
87
+ layout patterns may arrange slots. Do not classify by component count. For owner
88
+ selection or `component-dependency`, `component-contract` or `component-style`, read
89
+ [layer responsibilities and contracts](references/layers.md), also served as
90
+ `ads://guides/layers`. Preserve public APIs and documented non-state styling hooks.
91
+
79
92
  For parent/child `covers`, conditional-control review, reference comparisons,
80
93
  public style-helper use, native slot/selector composition, fragment navigation,
81
94
  or `scenario-render` / `showcase-control` / `showcase-class` findings, read [scenario contracts](references/scenarios.md). Its verification
@@ -116,7 +129,7 @@ reach the agent.
116
129
  | Request | Reference | Outcome |
117
130
  |---------|-----------|---------|
118
131
  | Build or change an animation | [build.md](references/build.md) | Implement purposeful motion in its owning component/pattern |
119
- | Review existing motion | [review.md](references/review.md) | Findings grounded in source and observed behavior |
132
+ | Review existing motion | [motion-review.md](references/motion-review.md) | Findings grounded in source and observed behavior |
120
133
  | Audit a component or screen, or find opportunities | [audit.md](references/audit.md) | Prioritized findings or a concrete implementation plan when requested |
121
134
  | Investigate jank or rendering cost | [performance.md](references/performance.md) | Evidence, a focused fix when requested, and a comparison |
122
135
 
@@ -216,7 +229,7 @@ fixture under the configured token directory. Declare metadata
216
229
  The renderer name is project-owned; use its real public API. Each literal fixture
217
230
  sample declares `{ token, property, probe }`: a real token, the CSS property its
218
231
  sample demonstrates, and a valid test value different from that token's current
219
- value. Pass `samples` into the rendered public review pattern. Names, sample text,
232
+ value. Pass `samples` into the rendered development-only review renderer. Names, sample text,
220
233
  bindings and probes are fixture data; displayed values come from foundation CSS.
221
234
  There is no property catalogue, token-name mapping or probe palette in ADS.
222
235
  Every token needs sample coverage; fabricated tokens, missing bindings/probes,
@@ -237,10 +250,12 @@ source definitions and values; inspecting definitions does not prove UI parity.
237
250
  The tool keeps the shared naming contract; sample templates and their token
238
251
  lists belong to the project.
239
252
 
240
- A public review pattern may be covered by real token or composition scenarios;
241
- it needs no redundant standalone entry. Remove an optional scenario only while
242
- retaining reachable render coverage. Keep directory ownership anchored by its
243
- runtime entry (`index` or a file matching the directory name) or colocated fixture.
253
+ Development review helpers need no product catalogue scenario. A token scenario
254
+ may name its review renderer in `covers`; ordinary component/pattern scenarios
255
+ cover their production subjects. Keep review exports in the separate review entry.
256
+ Remove redundant helper catalogue scenarios during migration. Product UI retains
257
+ its real render-coverage requirement. Keep directory ownership anchored by its
258
+ implementation entry (`index` or a file matching the directory name) or colocated fixture.
244
259
  Import colocated image/font fixtures so MCP serves them through asset resources.
245
260
  For a broken-image case, use a local failing fixture, rather than an external
246
261
  network failure or a domain-specific CSP exception. Production asset APIs remain
@@ -264,7 +279,7 @@ branch, property and value must fit its role. Token-backed control skins, layout
264
279
  interactive state rules and owner hooks are rejected even through `:where()`.
265
280
  Do not copy an unchecked upstream preflight or turn a component repair into a reset.
266
281
  Keep behavior and skin in their runtime owner. Put demo-only sizing and framing
267
- in a public review/layout pattern; add component props for a deliberate runtime
282
+ in a development-only review helper; add component props for a deliberate runtime
268
283
  API need. Preserve required capabilities while following ownership rules.
269
284
  Use tokens for absolute/font-relative lengths, including `ch`, `ex`, `cap`, `ic`
270
285
  and `lh`; calculations and fallback values follow the same rule. Structural
@@ -5,7 +5,7 @@ public inputs, state transitions, motion tokens, styles, geometry helpers,
5
5
  timers, cleanup, and tests. Read nearby call sites to understand frequency and
6
6
  composition. Track documented tradeoffs and accepted upstream comparisons.
7
7
 
8
- Review using the categories in [review.md](review.md). Expand into rendering
8
+ Review using the categories in [motion-review.md](motion-review.md). Expand into rendering
9
9
  performance only where observations or source evidence justify it; use
10
10
  [performance.md](performance.md) if profiling is requested. An audit does not
11
11
  silently apply production changes or rewrite configuration.
@@ -103,7 +103,7 @@ and a definition-only `tokens.css`, imported by its runtime source. Flat owners
103
103
  shared or --ds-/--ux-/--showcase- variables. Only that owner consumes/defines its
104
104
  local tokens; aliases can use shared or own tokens. UI styles stay in Linaria.
105
105
  Add a colocated token scenario with `kind:"tokens"`, real fixture `samples` and a
106
- public review pattern. These inputs belong to the same owner and need real sample
106
+ development-only review renderer. These inputs belong to the same owner and need real sample
107
107
  coverage. Manifests and fixtures stay out of the product bundle.
108
108
 
109
109
  `ads_prepare_token_samples({id, bindings?})` preserves existing project samples,