@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.
- package/README.md +115 -87
- package/dist/a11y.mjs +133 -48
- package/dist/analysis/compiler-options.mjs +13 -0
- package/dist/analysis/context.mjs +46 -0
- package/dist/analysis/file-tree.mjs +52 -0
- package/dist/analysis/helpers.mjs +142 -0
- package/dist/analysis/impact.mjs +20 -0
- package/dist/analysis/inputs.mjs +22 -0
- package/dist/analysis/module-resolvers.mjs +46 -0
- package/dist/analysis/native-adapter.mjs +180 -0
- package/dist/analysis/native-project.mjs +323 -0
- package/dist/analysis/queries.mjs +133 -0
- package/dist/analysis/service.mjs +153 -0
- package/dist/analysis/standalone.mjs +57 -0
- package/dist/analysis/syntax.mjs +179 -0
- package/dist/analysis/worker.mjs +182 -0
- package/dist/assets.mjs +6 -6
- package/dist/atomic-composition.mjs +191 -70
- package/dist/atomic-trace.mjs +120 -50
- package/dist/behavior-libraries.mjs +106 -37
- package/dist/behaviors.mjs +219 -77
- package/dist/boundaries.mjs +140 -41
- package/dist/brand-assets.mjs +219 -47
- package/dist/brands.mjs +86 -27
- package/dist/bun-compiler.mjs +28 -14
- package/dist/bun-worker.mjs +7 -5
- package/dist/capture/worker.mjs +15 -4
- package/dist/capture-store.mjs +4 -2
- package/dist/capture.mjs +17 -14
- package/dist/check-service.mjs +44 -58
- package/dist/check.mjs +754 -188
- package/dist/cli.mjs +200 -99
- package/dist/color-values.mjs +21 -21
- package/dist/component-contrast.mjs +127 -9
- package/dist/config.mjs +303 -135
- package/dist/construction-styles.cjs +10 -0
- package/dist/contrast-composition.mjs +134 -0
- package/dist/control-padding.mjs +45 -25
- package/dist/css-values.mjs +3 -2
- package/dist/declarative-flow.mjs +209 -109
- package/dist/design-values.mjs +136 -51
- package/dist/development-runtime.mjs +4 -6
- package/dist/draft-boundary.mjs +11 -6
- package/dist/evidence.mjs +1 -1
- package/dist/finding-rules.mjs +9 -5
- package/dist/font-rules.mjs +22 -17
- package/dist/fonts-generated.mjs +23 -16
- package/dist/foundation-views.mjs +242 -0
- package/dist/foundation.mjs +63 -39
- package/dist/generated-entries.mjs +101 -34
- package/dist/icons.mjs +79 -32
- package/dist/image-attributes.mjs +143 -66
- package/dist/image-size.mjs +1 -1
- package/dist/index.mjs +0 -2
- package/dist/init.mjs +122 -41
- package/dist/investigations.mjs +2 -2
- package/dist/layers.mjs +298 -129
- package/dist/layout-widths.mjs +180 -85
- package/dist/linaria/preserve-values.cjs +7 -0
- package/dist/linaria/spatial-inputs.cjs +56 -0
- package/dist/lockup-composition.mjs +44 -0
- package/dist/lockup-model.cjs +64 -0
- package/dist/mcp/THIRD_PARTY_NOTICES.md +51 -1
- package/dist/mcp/apps.mjs +4 -30
- package/dist/mcp/behavior-pages.mjs +72 -24
- package/dist/mcp/build-status.mjs +257 -64
- package/dist/mcp/catalog.mjs +90 -26
- package/dist/mcp/context.mjs +17 -18
- package/dist/mcp/draft-discovery.mjs +44 -21
- package/dist/mcp/drafts.mjs +903 -281
- package/dist/mcp/execution-coordinator.mjs +417 -167
- package/dist/mcp/execution-results.mjs +7 -7
- package/dist/mcp/mutations.mjs +673 -234
- package/dist/mcp/preview-watch.mjs +448 -170
- package/dist/mcp/preview-widget.bundle.js +44 -50
- package/dist/mcp/prompts.mjs +5 -5
- package/dist/mcp/result-pages.mjs +1 -1
- package/dist/mcp/sandbox-host.mjs +1 -1
- package/dist/mcp/server.mjs +2409 -577
- package/dist/mcp/showcase-host.mjs +165 -41
- package/dist/mcp/skills.mjs +1 -1
- package/dist/mcp/text-diff.mjs +29 -10
- package/dist/paint-contracts.mjs +174 -81
- package/dist/palette-generated.mjs +2 -2
- package/dist/pictogram-model.mjs +59 -0
- package/dist/pictograms.mjs +52 -0
- package/dist/preview-bun.mjs +494 -187
- package/dist/preview-failure.mjs +1 -1
- package/dist/preview-files.mjs +13 -13
- package/dist/preview-imports.mjs +104 -55
- package/dist/preview-inputs.mjs +2 -2
- package/dist/preview-requests.mjs +24 -0
- package/dist/preview-resources.mjs +288 -147
- package/dist/preview-scope.mjs +5 -4
- package/dist/program-cache.mjs +8 -34
- package/dist/project-documents.mjs +1 -1
- package/dist/public-api.mjs +69 -31
- package/dist/public-props.mjs +39 -22
- package/dist/{browser-audit → render-audit}/axe-run.mjs +3 -3
- package/dist/{browser-audit → render-audit}/image-shape.mjs +15 -5
- package/dist/{browser-audit → render-audit}/layout-overflow.mjs +86 -23
- package/dist/{browser-audit → render-audit}/non-text-contrast.mjs +86 -27
- package/dist/render-audit/pictograms.mjs +88 -0
- package/dist/{browser-audit → render-audit}/render-states.mjs +208 -52
- package/dist/{browser-audit → render-audit}/worker.mjs +98 -30
- package/dist/render-audit.mjs +838 -0
- package/dist/render-color-probe.mjs +96 -42
- package/dist/render-composition.mjs +164 -0
- package/dist/resource-limits.mjs +229 -97
- package/dist/runtime-contracts.mjs +467 -185
- package/dist/scenario-groups.mjs +22 -10
- package/dist/scenario-inspector.mjs +6 -43
- package/dist/scenario-program.mjs +8 -25
- package/dist/scenario-registry.mjs +72 -30
- package/dist/scenario-selectors.mjs +161 -64
- package/dist/scenario-slots.mjs +149 -56
- package/dist/scenario-trace.mjs +215 -109
- package/dist/scenarios-compiler.mjs +719 -378
- package/dist/scenarios-vite.d.mts +1 -3
- package/dist/scenarios-vite.mjs +2 -81
- package/dist/scenarios.mjs +421 -157
- package/dist/selector-match.mjs +2 -2
- package/dist/showcase/client.bundle.js +57 -56
- package/dist/showcase/draft-navigation.js +21 -3
- package/dist/showcase/favicon.ico +0 -0
- package/dist/showcase/favicon.svg +1 -0
- package/dist/showcase/foundation-view.css +58 -0
- package/dist/showcase/foundation-view.mjs +255 -0
- package/dist/showcase/guide-controls.ads.review.mjs +32 -0
- package/dist/showcase/icons.js +1 -145
- package/dist/showcase/index.html +3 -31
- package/dist/showcase/pictogram-view.mjs +53 -0
- package/dist/showcase/preview-frame.ads.review.css +46 -0
- package/dist/showcase/preview-frame.ads.review.d.mts +11 -0
- package/dist/showcase/preview-frame.ads.review.mjs +22 -0
- package/dist/showcase/preview-state.js +0 -9
- package/dist/showcase/refresh-scheduler.js +23 -0
- package/dist/showcase/style.css +5 -47
- package/dist/showcase/ui/ui.css +1353 -0
- package/dist/showcase/ui/ui.js +1064 -0
- package/dist/showcase-coverage.mjs +58 -37
- package/dist/skills/README.md +24 -23
- package/dist/skills/ads-designer/README.md +8 -2
- package/dist/skills/ads-designer/SKILL.md +143 -120
- package/dist/skills/ads-designer/references/accessibility.md +78 -15
- package/dist/skills/ads-designer/references/atomic-styles.md +4 -4
- package/dist/skills/ads-designer/references/behaviors.md +30 -27
- package/dist/skills/ads-designer/references/branding.md +101 -24
- package/dist/skills/ads-designer/references/captures.md +25 -0
- package/dist/skills/ads-designer/references/cli.md +21 -24
- package/dist/skills/ads-designer/references/contracts.md +7 -6
- package/dist/skills/ads-designer/references/design-data.md +49 -52
- package/dist/skills/ads-designer/references/drafts.md +20 -17
- package/dist/skills/ads-designer/references/evidence.md +1 -5
- package/dist/skills/ads-designer/references/guarded-editing.md +14 -18
- package/dist/skills/ads-designer/references/layers.md +1 -1
- package/dist/skills/ads-designer/references/layout.md +347 -0
- package/dist/skills/ads-designer/references/mobile.md +2 -1
- package/dist/skills/{ads-motion/references/performance.md → ads-designer/references/motion-performance.md} +5 -1
- package/dist/skills/{ads-motion/references/build.md → ads-designer/references/motion.md} +73 -5
- package/dist/skills/ads-designer/references/performance.md +3 -2
- package/dist/skills/ads-designer/references/pictograms.md +131 -0
- package/dist/skills/ads-designer/references/review.md +37 -34
- package/dist/skills/ads-designer/references/runtimes.md +33 -30
- package/dist/skills/ads-designer/references/scenarios.md +16 -18
- package/dist/skills/{ads-break-ui/references/catalog.md → ads-designer/references/stress-catalog.md} +3 -1
- package/dist/skills/ads-designer/references/stress-test.md +68 -0
- package/dist/skills/ads-designer/references/validation.md +83 -75
- package/dist/skills/ads-designer/references/workflows.md +8 -33
- package/dist/skills/ads-import/SKILL.md +43 -325
- package/dist/skills/ads-import/references/atomic-styles.md +4 -4
- package/dist/skills/ads-import/references/behaviors.md +30 -27
- package/dist/skills/ads-import/references/branding.md +5 -5
- package/dist/skills/ads-import/references/captures.md +25 -0
- package/dist/skills/ads-import/references/cli.md +21 -24
- package/dist/skills/ads-import/references/compatibility.md +1 -1
- package/dist/skills/ads-import/references/contracts.md +7 -6
- package/dist/skills/ads-import/references/design-data.md +49 -52
- package/dist/skills/ads-import/references/drafts.md +20 -17
- package/dist/skills/ads-import/references/evidence.md +1 -5
- package/dist/skills/ads-import/references/guarded-editing.md +14 -18
- package/dist/skills/ads-import/references/implementation.md +2 -1
- package/dist/skills/ads-import/references/layers.md +1 -1
- package/dist/skills/ads-import/references/layout.md +347 -0
- package/dist/skills/ads-import/references/review.md +37 -34
- package/dist/skills/ads-import/references/runtimes.md +33 -30
- package/dist/skills/ads-import/references/scenarios.md +16 -18
- package/dist/skills/ads-import/references/tokens.md +3 -3
- package/dist/skills/ads-import/references/validation.md +83 -75
- package/dist/skills/ads-import/references/workflows.md +8 -33
- package/dist/skills/ads-migrate/SKILL.md +56 -0
- package/dist/skills/ads-migrate/references/0.4.1-to-0.4.2.md +602 -0
- package/dist/skills/ads-port/SKILL.md +58 -344
- package/dist/skills/ads-port/references/atomic-styles.md +4 -4
- package/dist/skills/ads-port/references/behaviors.md +30 -27
- package/dist/skills/ads-port/references/captures.md +25 -0
- package/dist/skills/ads-port/references/cli.md +21 -24
- package/dist/skills/ads-port/references/contracts.md +7 -6
- package/dist/skills/ads-port/references/design-data.md +49 -52
- package/dist/skills/ads-port/references/drafts.md +20 -17
- package/dist/skills/ads-port/references/evidence.md +1 -5
- package/dist/skills/ads-port/references/guarded-editing.md +14 -18
- package/dist/skills/ads-port/references/layers.md +1 -1
- package/dist/skills/ads-port/references/layout.md +347 -0
- package/dist/skills/ads-port/references/lint-and-docs.md +8 -11
- package/dist/skills/ads-port/references/native-implementation.md +2 -1
- package/dist/skills/ads-port/references/review.md +37 -34
- package/dist/skills/ads-port/references/runtimes.md +33 -30
- package/dist/skills/ads-port/references/scenarios.md +16 -18
- package/dist/skills/ads-port/references/validation.md +83 -75
- package/dist/skills/ads-port/references/workflows.md +8 -33
- package/dist/source-symbols.mjs +1 -8
- package/dist/source-values.mjs +270 -129
- package/dist/spatial-composition.mjs +322 -0
- package/dist/spatial-contexts.cjs +56 -0
- package/dist/spatial-css.cjs +351 -0
- package/dist/spatial-inputs.cjs +80 -0
- package/dist/spatial-metadata.mjs +18 -0
- package/dist/spatial-model.cjs +322 -0
- package/dist/spatial.mjs +21 -0
- package/dist/stage-timing.cjs +20 -0
- package/dist/starters/preact/design-system/patterns/Conversation/Conversation.tsx +105 -0
- package/dist/starters/preact/design-system/patterns/Shell/Shell.tsx +275 -0
- package/dist/starters/preact/design-system/review/demo-frame/DemoFrame.ads.review.tsx +7 -0
- package/dist/starters/preact/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +10 -0
- package/dist/starters/preact/design-system/showcase/mcp/main.ads.mount.tsx +8 -0
- package/dist/starters/preact/ds.config.json +25 -6
- package/dist/starters/preact/package.json +4 -8
- package/dist/starters/preact/tsconfig.json +4 -5
- package/dist/starters/preact/vite.config.ts +3 -3
- package/dist/starters/react/ADS.md +42 -47
- package/dist/starters/react/README.md +47 -49
- package/dist/starters/react/design-system/assets/pictograms/catalog.ads.json +13 -0
- package/dist/starters/react/design-system/assets/pictograms/journey.dark.svg +7 -0
- package/dist/starters/react/design-system/assets/pictograms/journey.svg +7 -0
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +18 -2
- package/dist/starters/react/design-system/components/Actions/IconButton/README.md +3 -0
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.fixture.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.scenario.tsx +7 -0
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.tsx +26 -0
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/README.md +5 -0
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.fixture.ts +13 -0
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.scenario.tsx +22 -0
- package/dist/starters/react/design-system/index.ts +2 -1
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.fixture.ts +7 -0
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.scenario.tsx +15 -0
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.tsx +105 -0
- package/dist/starters/react/design-system/patterns/Conversation/README.md +9 -0
- package/dist/starters/react/design-system/patterns/Shell/Floating.ads.fixture.ts +5 -0
- package/dist/starters/react/design-system/patterns/Shell/Floating.ads.scenario.tsx +21 -0
- package/dist/starters/react/design-system/patterns/Shell/README.md +43 -0
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.fixture.ts +5 -0
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.scenario.tsx +21 -0
- package/dist/starters/react/design-system/patterns/Shell/Shell.tsx +274 -0
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.exports.ts +1 -1
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.review.tsx +7 -0
- package/dist/starters/react/design-system/review/index.ads.review.ts +4 -0
- package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.review.tsx +6 -0
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.exports.ts +1 -1
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +10 -0
- package/dist/starters/react/design-system/showcase/mcp/{main.tsx → main.ads.mount.tsx} +4 -2
- package/dist/starters/react/design-system/tokens/catalog.ads.json +1221 -0
- package/dist/starters/react/design-system/tokens/colors.css +1 -1
- package/dist/starters/react/design-system/tokens/spacing.css +22 -32
- package/dist/starters/react/design-system/tokens/spatial.ads.json +70 -0
- package/dist/starters/react/design-system/tokens/themes.generated.ts +1 -1
- package/dist/starters/react/ds.config.json +25 -6
- package/dist/starters/react/package.json +2 -6
- package/dist/starters/react/tsconfig.json +2 -3
- package/dist/starters/react/vite.config.ts +3 -3
- package/dist/style-boundaries.mjs +70 -25
- package/dist/task-cache.mjs +173 -72
- package/dist/task-worker.mjs +22 -11
- package/dist/test-boundaries.mjs +132 -59
- package/dist/themes-generated.mjs +1 -1
- package/dist/themes-watch.mjs +57 -22
- package/dist/themes.mjs +176 -73
- package/dist/token-export.mjs +39 -14
- package/dist/token-policy.mjs +6 -3
- package/dist/token-quality.mjs +6 -6
- package/dist/token-samples.mjs +16 -5
- package/dist/tokens.mjs +71 -26
- package/dist/ui-framework.mjs +16 -14
- package/dist/unit-contracts.mjs +251 -104
- package/dist/units.mjs +209 -99
- package/dist/usage.mjs +138 -38
- package/dist/validation-checks.mjs +115 -38
- package/dist/validation-inputs.mjs +191 -78
- package/dist/validation.mjs +268 -102
- package/dist/verification/browser.mjs +27 -5
- package/dist/verification.mjs +711 -187
- package/docs/ADS.md +96 -80
- package/docs/ARCHITECTURE.md +368 -137
- package/docs/BEHAVIORS.md +29 -25
- package/docs/CACHING.md +77 -17
- package/docs/CHANGELOG.md +332 -17
- package/docs/CONTRACTS.md +12 -4
- package/docs/DESIGN-REFERENCES.md +40 -0
- package/docs/GUIDE.md +300 -263
- package/docs/MCP.md +187 -324
- package/docs/SPATIAL-CHECKS.md +69 -0
- package/docs/benchmarks/README.md +39 -0
- package/package.json +43 -34
- package/dist/browser-audit.mjs +0 -429
- package/dist/create.mjs +0 -48
- package/dist/lint-config.mjs +0 -50
- package/dist/mcp/project-widget.bundle.js +0 -114
- package/dist/mcp/reports.mjs +0 -101
- package/dist/mcp/widget.bundle.js +0 -147
- package/dist/oxlint.mjs +0 -89
- package/dist/preview-builder.mjs +0 -133
- package/dist/preview-workers.mjs +0 -184
- package/dist/showcase.mjs +0 -77
- package/dist/skills/ads-break-ui/LICENSE.upstream +0 -21
- package/dist/skills/ads-break-ui/README.md +0 -16
- package/dist/skills/ads-break-ui/SKILL.md +0 -412
- package/dist/skills/ads-break-ui/agents/openai.yaml +0 -4
- package/dist/skills/ads-break-ui/references/atomic-styles.md +0 -293
- package/dist/skills/ads-break-ui/references/behaviors.md +0 -412
- package/dist/skills/ads-break-ui/references/captures.md +0 -135
- package/dist/skills/ads-break-ui/references/contracts.md +0 -317
- package/dist/skills/ads-break-ui/references/design-data.md +0 -354
- package/dist/skills/ads-break-ui/references/drafts.md +0 -194
- package/dist/skills/ads-break-ui/references/evidence.md +0 -128
- package/dist/skills/ads-break-ui/references/guarded-editing.md +0 -165
- package/dist/skills/ads-break-ui/references/layers.md +0 -145
- package/dist/skills/ads-break-ui/references/reporting.md +0 -101
- package/dist/skills/ads-break-ui/references/review.md +0 -97
- package/dist/skills/ads-break-ui/references/runtimes.md +0 -203
- package/dist/skills/ads-break-ui/references/scenarios.md +0 -246
- package/dist/skills/ads-break-ui/references/validation.md +0 -166
- package/dist/skills/ads-break-ui/references/verification.md +0 -58
- package/dist/skills/ads-break-ui/references/workflows.md +0 -90
- package/dist/skills/ads-designer/references/reporting.md +0 -101
- package/dist/skills/ads-import/references/reporting.md +0 -101
- package/dist/skills/ads-motion/LICENSE.upstream +0 -21
- package/dist/skills/ads-motion/README.md +0 -22
- package/dist/skills/ads-motion/SKILL.md +0 -385
- package/dist/skills/ads-motion/agents/openai.yaml +0 -4
- package/dist/skills/ads-motion/references/atomic-styles.md +0 -293
- package/dist/skills/ads-motion/references/audit.md +0 -44
- package/dist/skills/ads-motion/references/behaviors.md +0 -412
- package/dist/skills/ads-motion/references/captures.md +0 -135
- package/dist/skills/ads-motion/references/contracts.md +0 -317
- package/dist/skills/ads-motion/references/design-data.md +0 -354
- package/dist/skills/ads-motion/references/drafts.md +0 -194
- package/dist/skills/ads-motion/references/evidence.md +0 -128
- package/dist/skills/ads-motion/references/guarded-editing.md +0 -165
- package/dist/skills/ads-motion/references/layers.md +0 -145
- package/dist/skills/ads-motion/references/motion-review.md +0 -35
- package/dist/skills/ads-motion/references/reporting.md +0 -101
- package/dist/skills/ads-motion/references/review.md +0 -97
- package/dist/skills/ads-motion/references/runtimes.md +0 -203
- package/dist/skills/ads-motion/references/scenarios.md +0 -246
- package/dist/skills/ads-motion/references/validation.md +0 -166
- package/dist/skills/ads-motion/references/verification.md +0 -39
- package/dist/skills/ads-motion/references/workflows.md +0 -90
- package/dist/skills/ads-port/references/reporting.md +0 -101
- package/dist/starters/preact/design-system/components/Layout/Grid/Grid.ads.contract.ts +0 -6
- package/dist/starters/preact/design-system/components/Layout/Grid/Grid.tsx +0 -76
- package/dist/starters/preact/design-system/review/demo-frame/DemoFrame.tsx +0 -29
- package/dist/starters/preact/design-system/review/screen-frame/ScreenFrame.tsx +0 -34
- package/dist/starters/preact/design-system/review/token-preview/TokenPreview.ads.contract.ts +0 -6
- package/dist/starters/preact/design-system/review/token-preview/TokenPreview.tsx +0 -137
- package/dist/starters/preact/design-system/showcase/mcp/main.tsx +0 -6
- package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.fixture.ts +0 -7
- package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.fixture.ts +0 -7
- package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.contract.ts +0 -6
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.fixture.ts +0 -12
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.scenario.tsx +0 -17
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.tsx +0 -75
- package/dist/starters/react/design-system/components/Layout/Grid/README.md +0 -21
- package/dist/starters/react/design-system/review/brand-preview/BrandPreview.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/review/brand-preview/BrandPreview.tsx +0 -112
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.tsx +0 -29
- package/dist/starters/react/design-system/review/grid-cell/GridCell.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/review/grid-cell/GridCell.tsx +0 -18
- package/dist/starters/react/design-system/review/index.ts +0 -6
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.tsx +0 -34
- package/dist/starters/react/design-system/review/token-preview/TokenPreview.ads.contract.ts +0 -6
- package/dist/starters/react/design-system/review/token-preview/TokenPreview.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/review/token-preview/TokenPreview.tsx +0 -137
- package/dist/starters/react/design-system/showcase/mcp/index.html +0 -1
- package/dist/starters/react/design-system/tokens/Color.ads.fixture.ts +0 -124
- package/dist/starters/react/design-system/tokens/Color.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/tokens/Layout.ads.fixture.ts +0 -39
- package/dist/starters/react/design-system/tokens/Layout.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/tokens/Motion.ads.fixture.ts +0 -18
- package/dist/starters/react/design-system/tokens/Motion.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/tokens/Shape.ads.fixture.ts +0 -30
- package/dist/starters/react/design-system/tokens/Shape.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/tokens/Space.ads.fixture.ts +0 -37
- package/dist/starters/react/design-system/tokens/Space.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/tokens/Type.ads.fixture.ts +0 -29
- package/dist/starters/react/design-system/tokens/Type.ads.scenario.tsx +0 -4
- package/dist/starters/react/package-lock.json +0 -4707
- package/dist/token-fixtures.mjs +0 -30
- package/docs/benchmarks/bun-previews.md +0 -91
- package/docs/benchmarks/preview-memory.md +0 -147
- package/docs/benchmarks/turbo-poc.md +0 -284
- package/docs/plans/execution-coordination.md +0 -57
- /package/dist/{browser-audit → render-audit}/first-render.mjs +0 -0
- /package/dist/{browser-audit → render-audit}/layout-shift.mjs +0 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# Starter native design system
|
|
2
2
|
|
|
3
|
-
This private React or Preact TypeScript workspace contains semantic CSS tokens, a
|
|
4
|
-
|
|
5
|
-
adapter, plus
|
|
6
|
-
|
|
7
|
-
`
|
|
8
|
-
`components/
|
|
9
|
-
`components/Content/
|
|
10
|
-
|
|
3
|
+
This private React or Preact TypeScript workspace contains semantic CSS tokens, a spatial
|
|
4
|
+
definition for `@ads-layout`, a generated public barrel, Linaria extraction and a preview compiler
|
|
5
|
+
adapter, plus examples of each layer to build on: a token foundation in six groups (Color, Type,
|
|
6
|
+
Space & sizing, Shape & elevation, Motion, Grid system) that ADS renders from the token sheets and
|
|
7
|
+
`tokens/catalog.ads.json`, components in four groups (`components/Actions/Button`,
|
|
8
|
+
`components/Actions/IconButton`, `components/Content/Icon`, `components/Content/Image`,
|
|
9
|
+
`components/Content/Logo`, `components/Forms/TextField`), a 24 px icon set in `assets/glyphs/`
|
|
10
|
+
generated into `components/Content/Icon/glyphs.ts`, three patterns (`patterns/Search/SearchBar`,
|
|
11
|
+
`patterns/Conversation`, `patterns/Shell`) and two compositions (`composition/Search/SearchPage`,
|
|
12
|
+
`composition/Workspace/WorkspacePage`),
|
|
11
13
|
plus placeholder brand artwork in `assets/brand/` (a logo with its dark-theme
|
|
12
14
|
variant, and the app icon that `assets.iconSource` names), and a shared
|
|
13
15
|
`controllers/Palette` that gives Canvas, WebGL and SVG renderers their colors. Rename,
|
|
@@ -20,30 +22,29 @@ Read the local [contract](ADS.md) and the
|
|
|
20
22
|
|
|
21
23
|
## Start
|
|
22
24
|
|
|
23
|
-
This
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
This design system was added by `ads init --include-starter`, which copied the starter
|
|
26
|
+
shipped in that ADS version, generated for the selected native framework from one
|
|
27
|
+
shared design source, where the project had nothing, and set ADS up. The project's `package.json`
|
|
28
|
+
declares its package manager (`"packageManager"`, or its lockfile). Install Bun 1.4.1+ for
|
|
29
|
+
ADS tooling and previews. The application can keep its Node/npm build pipeline.
|
|
27
30
|
|
|
28
31
|
```sh
|
|
29
|
-
npx @reqvire-org/ads
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
npm run build
|
|
32
|
+
npx @reqvire-org/ads init --framework react --include-starter # or preact; Bun: bunx
|
|
33
|
+
npm install # bun install
|
|
34
|
+
npx playwright install chromium # browser for the render audit in ads validate and draft acceptance
|
|
35
|
+
npm run build # bun --bun run build
|
|
34
36
|
npm run dev:showcase
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
For unreleased tooling,
|
|
39
|
+
For unreleased tooling, initialize from the real local package:
|
|
38
40
|
|
|
39
41
|
```sh
|
|
40
|
-
ads_tool_package="/absolute/path/to/reqvire-org-ads
|
|
41
|
-
npx --yes --package "$ads_tool_package" ads
|
|
42
|
+
ads_tool_package="/absolute/path/to/reqvire-org-ads-<version>.tgz"
|
|
43
|
+
npx --yes --package "$ads_tool_package" ads init --framework react --include-starter --tool-package "$ads_tool_package"
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
1.4.1+. ADS supplies its Bun preview compiler independently of the project build.
|
|
46
|
+
In a Bun project the scripts use `bun run`. Node is unnecessary with Bun 1.4.1+. ADS
|
|
47
|
+
supplies its Bun preview compiler independently of the project build.
|
|
47
48
|
|
|
48
49
|
For an existing application, merge only the ADS source and required extraction,
|
|
49
50
|
aliases and preview adapter. Preserve its framework, entry points and build.
|
|
@@ -100,22 +101,22 @@ The foundation meets WCAG 2.2 AA:
|
|
|
100
101
|
- **Motion** (`elevation.css`): durations 70/110/150/240/400/700 ms, easing for moving between
|
|
101
102
|
places (standard), entering and leaving, each with a `-strong` variant for rare important
|
|
102
103
|
moments; all durations are 0 under reduced motion.
|
|
103
|
-
- **
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
side pane and rail.
|
|
107
|
-
in media queries, or container queries as `components/Layout/Grid` does.
|
|
104
|
+
- **Grid system** (`spatial.ads.json` over the `--grid-*` roles): an 8 px mini unit, breakpoints at
|
|
105
|
+
320/672/1056/1312/1584 px with 4/8/16 columns and margins of 0/16/24 px, wide, narrow and
|
|
106
|
+
condensed gutter modes, ratios, `--content-max` (72ch), container widths `--container-*`,
|
|
107
|
+
header height, side pane and rail.
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
Layouts are written with `@ads-layout` in owned styles; ADS validates them against
|
|
110
|
+
`spatial.ads.json` and compiles them to plain CSS, with no layout component. `patterns/Shell`
|
|
111
|
+
(application regions and panels) and `patterns/Conversation` (fourteen local tracks) are worked
|
|
112
|
+
examples. The showcase's layout-guides button inspects the actual rendered tracks, gutters,
|
|
113
|
+
padding and margins.
|
|
112
114
|
|
|
113
115
|
`components/Content/Image` loads lazily and reserves its space; give `priority` to the view's main
|
|
114
116
|
visible image only. If you add fonts in `tokens/fonts.css`, `ads assets` writes
|
|
115
|
-
`tokens/fonts.preload.generated.ts
|
|
117
|
+
`tokens/fonts.preload.generated.ts`; call `preloadFonts()` from the public entry in the app entry.
|
|
116
118
|
|
|
117
|
-
|
|
118
|
-
query, or use `%` or `fr`. Small parts use plain sizes up to 96 px, and a panel takes
|
|
119
|
+
Outside `@ads-layout`, widths stay fluid: use `%` or `fr`. Small parts use plain sizes up to 96 px, and a panel takes
|
|
119
120
|
`min(100%, 280px)`. `layout.widthTokens` in `ds.config.json` names widths that stay fixed, and
|
|
120
121
|
`layout.fixedWidthUnits` the owners whose widths are not checked, such as overlays. `ads check`
|
|
121
122
|
lists both for review.
|
|
@@ -123,20 +124,15 @@ lists both for review.
|
|
|
123
124
|
`ads check` fails when a text or control pair falls below WCAG AA in any theme or brand
|
|
124
125
|
(`token-contrast`, `component-contrast`), when a spacing step leaves the 2 px rhythm
|
|
125
126
|
(`token-rhythm`) and on fixed widths (`layout-fixed-width`). `ads audit` fails horizontal
|
|
126
|
-
overflow at 390, 768 and 1280 px
|
|
127
|
-
(`layout-overflow`).
|
|
127
|
+
overflow at 390, 768 and 1280 px (`layout-overflow`) and lists a set width that overflows a
|
|
128
|
+
240 px container for review (`layout-overflow-narrow`).
|
|
128
129
|
`ads tokens --format dtcg` exports the tokens as W3C Design Tokens JSON for design tools.
|
|
129
130
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
missing coverage and invented names; the App verifies the declared CSS bindings
|
|
136
|
-
in the browser. Extend or replace the project-owned review renderer as your tokens evolve.
|
|
137
|
-
`ads_prepare_token_samples` can prepare a fixture patch from explicit project
|
|
138
|
-
property/probe bindings. It preserves existing samples and reports unmapped tokens;
|
|
139
|
-
it does not guess how a new value should look. Design values belong in the shared
|
|
131
|
+
ADS renders the Tokens section from the token sheets and `tokens/catalog.ads.json`, which
|
|
132
|
+
groups the tokens and gives each its `{ token, property, probe }` sample binding. Each group is
|
|
133
|
+
a sidebar group with one page per kind of token, such as Typography → Line heights. Add a token's
|
|
134
|
+
catalogue entry alongside its definition; the view verifies the declared CSS bindings in the
|
|
135
|
+
browser, and `ads check` reports invalid entries (`foundation-catalog`). Design values belong in the shared
|
|
140
136
|
foundation. Component/pattern variables map shared roles; they do not define
|
|
141
137
|
independent token catalogues. See [ADS.md](ADS.md).
|
|
142
138
|
|
|
@@ -152,7 +148,7 @@ styles, fixtures and assets. The App loads the selected dependency closure and
|
|
|
152
148
|
reuses unchanged runtime/CSS/font resources across selections. The MCP client
|
|
153
149
|
refreshes successful revisions inside that App; failures show diagnostics and
|
|
154
150
|
stale retained output. Changing a selected view's dependency closure unmounts its previous state;
|
|
155
|
-
background warming retains unchanged mounted views. `showcase/mcp/main.tsx` exports `mountScenario(Scenario, container)` and
|
|
151
|
+
background warming retains unchanged mounted views. `showcase/mcp/main.ads.mount.tsx` exports `mountScenario(Scenario, container)` and
|
|
156
152
|
returns an unmount callback; it is not the shell. Keep the saved `framework`,
|
|
157
153
|
compiler and mount adapter consistent.
|
|
158
154
|
Managed sessions own their graph output; standalone prebuilds cannot replace it.
|
|
@@ -182,5 +178,7 @@ build or delivered HTML alone does not establish those behaviors.
|
|
|
182
178
|
Opt-in MCP editing goes through drafts: `ads_create_draft` opens a draft of one or
|
|
183
179
|
more owners, `ads_update_draft` patches it, `ads_show_draft` renders it beside the
|
|
184
180
|
accepted version, and `ads_accept` validates and applies the exact revision you
|
|
185
|
-
reviewed (`dryRun` runs every check without writing)
|
|
186
|
-
|
|
181
|
+
reviewed (`dryRun` runs every check without writing): `ads check`, `acceptance.scripts`,
|
|
182
|
+
and the draft owners' own behavior tests and render audit. Drafts change no live source
|
|
183
|
+
until accepted; one open draft holds each owner. After a series of accepted drafts,
|
|
184
|
+
`ads_validate({scope:"changed"})` checks everything they reach.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"pictograms": [
|
|
4
|
+
{
|
|
5
|
+
"id": "journey",
|
|
6
|
+
"title": "Journey",
|
|
7
|
+
"description": "A route connecting three destinations. Use for onboarding or an empty journey list; decorative beside equivalent text.",
|
|
8
|
+
"license": "Original ADS starter artwork, MIT",
|
|
9
|
+
"schemes": { "light": "journey.svg", "dark": "journey.dark.svg" },
|
|
10
|
+
"minHeight": 48
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 64">
|
|
2
|
+
<defs><linearGradient id="route" x1="12" y1="48" x2="84" y2="16" gradientUnits="userSpaceOnUse"><stop stop-color="#83beff"/><stop offset="1" stop-color="#e0a6fa"/></linearGradient></defs>
|
|
3
|
+
<path d="M12 48h20c9 0 8-32 20-32h32" fill="none" stroke="url(#route)" stroke-width="5" stroke-linecap="round"/>
|
|
4
|
+
<circle cx="12" cy="48" r="7" fill="#83beff"/>
|
|
5
|
+
<circle cx="48" cy="28" r="7" fill="#f9bd58" stroke="#ffe5b6" stroke-width="2"/>
|
|
6
|
+
<path d="m84 7 9 9-9 9-9-9z" fill="#e0a6fa"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 64">
|
|
2
|
+
<defs><linearGradient id="route" x1="12" y1="48" x2="84" y2="16" gradientUnits="userSpaceOnUse"><stop stop-color="#216ac4"/><stop offset="1" stop-color="#9954b8"/></linearGradient></defs>
|
|
3
|
+
<path d="M12 48h20c9 0 8-32 20-32h32" fill="none" stroke="url(#route)" stroke-width="5" stroke-linecap="round"/>
|
|
4
|
+
<circle cx="12" cy="48" r="7" fill="#216ac4"/>
|
|
5
|
+
<circle cx="48" cy="28" r="7" fill="#f9bd58" stroke="#553b19" stroke-width="2"/>
|
|
6
|
+
<path d="m84 7 9 9-9 9-9-9z" fill="#9954b8"/>
|
|
7
|
+
</svg>
|
|
@@ -7,6 +7,12 @@ export interface IconButtonProps {
|
|
|
7
7
|
label: string;
|
|
8
8
|
size?: "sm" | "md" | "lg";
|
|
9
9
|
disabled?: boolean;
|
|
10
|
+
/** Element id, for example so a panel can return focus to its toggle. */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** For a disclosure toggle: whether the controlled region is open (`aria-expanded`). */
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
/** For a disclosure toggle: the id of the region it opens (`aria-controls`). */
|
|
15
|
+
controls?: string;
|
|
10
16
|
onClick?: () => void;
|
|
11
17
|
}
|
|
12
18
|
|
|
@@ -35,9 +41,19 @@ const sizes = {
|
|
|
35
41
|
};
|
|
36
42
|
|
|
37
43
|
/** An action shown as an icon, named for assistive technology and in its tooltip. */
|
|
38
|
-
export function IconButton({ icon, label, size = "md", disabled, onClick }: IconButtonProps) {
|
|
44
|
+
export function IconButton({ icon, label, size = "md", disabled, id, expanded, controls, onClick }: IconButtonProps) {
|
|
39
45
|
return (
|
|
40
|
-
<button
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
id={id}
|
|
49
|
+
className={cx("ds-icon-button", base, sizes[size])}
|
|
50
|
+
aria-label={label}
|
|
51
|
+
aria-expanded={expanded}
|
|
52
|
+
aria-controls={controls}
|
|
53
|
+
title={label}
|
|
54
|
+
disabled={disabled}
|
|
55
|
+
onClick={onClick}
|
|
56
|
+
>
|
|
41
57
|
<Icon name={icon} size={size === "lg" ? "md" : "sm"} />
|
|
42
58
|
</button>
|
|
43
59
|
);
|
|
@@ -11,4 +11,7 @@ pressed, disabled); the icon keeps the text color.
|
|
|
11
11
|
| `label` | `string` | — |
|
|
12
12
|
| `size` | `"sm" \| "md" \| "lg"` | `"md"` |
|
|
13
13
|
| `disabled` | `boolean` | `false` |
|
|
14
|
+
| `id` | `string` | — |
|
|
15
|
+
| `expanded` | `boolean` | — (sets `aria-expanded` when given, for disclosure toggles) |
|
|
16
|
+
| `controls` | `string` | — (id of the region the toggle opens, as `aria-controls`) |
|
|
14
17
|
| `onClick` | `() => void` | — |
|
package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.exports.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pictogram, type PictogramProps } from "./Pictogram";
|
package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.fixture.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const fixture = { title: "Pictogram", label: "A journey connecting three destinations" } as const;
|
package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.scenario.tsx
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Pictogram } from "@ds";
|
|
2
|
+
import { DemoFrame } from "@ds/review";
|
|
3
|
+
import { fixture } from "./Pictogram.ads.fixture";
|
|
4
|
+
export const scenario = { title: fixture.title, covers: ["Pictogram"] };
|
|
5
|
+
export default function Scenario() {
|
|
6
|
+
return <DemoFrame><Pictogram label={fixture.label} size="small" /><Pictogram label={fixture.label} /><Pictogram label={fixture.label} size="large" /></DemoFrame>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { css, cx } from "@linaria/atomic";
|
|
2
|
+
import journey from "../../../assets/pictograms/journey.svg";
|
|
3
|
+
import journeyDark from "../../../assets/pictograms/journey.dark.svg";
|
|
4
|
+
|
|
5
|
+
export interface PictogramProps {
|
|
6
|
+
/** Omit when adjacent text already conveys the same meaning. */
|
|
7
|
+
label?: string;
|
|
8
|
+
size?: "small" | "medium" | "large";
|
|
9
|
+
}
|
|
10
|
+
const base = css`display: inline-flex;`;
|
|
11
|
+
const sizes = {
|
|
12
|
+
small: css`height: var(--space-24);`,
|
|
13
|
+
medium: css`height: var(--space-32);`,
|
|
14
|
+
large: css`height: var(--space-48);`,
|
|
15
|
+
};
|
|
16
|
+
const image = css`height: 100%; width: auto; object-fit: contain;`;
|
|
17
|
+
const light = css`display: var(--display-light, block);`;
|
|
18
|
+
const dark = css`display: var(--display-dark, block);`;
|
|
19
|
+
|
|
20
|
+
/** Project-owned illustration; theme switches work without an ADS runtime. */
|
|
21
|
+
export function Pictogram({ label, size = "medium" }: PictogramProps) {
|
|
22
|
+
return <span className={cx("ds-pictogram", base, sizes[size])} role={label ? "img" : undefined} aria-label={label} aria-hidden={label ? undefined : true}>
|
|
23
|
+
<img data-ads-pictogram="journey" className={cx(image, light)} src={journey} width={96} height={64} loading="eager" alt="" />
|
|
24
|
+
<img data-ads-pictogram="journey" className={cx(image, dark)} src={journeyDark} width={96} height={64} loading="eager" alt="" />
|
|
25
|
+
</span>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Workspace page
|
|
2
|
+
|
|
3
|
+
A review-only screen: the `Shell` pattern with `SearchBar` and `Conversation` in its main region. The Conversation uses
|
|
4
|
+
`context: container`, so expanding or collapsing the Shell's pushing panels changes its placement while covering panels
|
|
5
|
+
do not. Compositions show how public components and patterns fit together; they are not exported from `@ds`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const fixture = {
|
|
2
|
+
title: "Workspace page",
|
|
3
|
+
id: "workspace-page",
|
|
4
|
+
heading: "Support inbox",
|
|
5
|
+
navigation: ["Inbox", "Assigned to me", "Archive", "Settings"],
|
|
6
|
+
aside: "Customer: Ari · Plan: Team · Opened 2 days ago",
|
|
7
|
+
search: { id: "workspace-page-search", label: "Search conversations", placeholder: "Name or message…" },
|
|
8
|
+
messages: [
|
|
9
|
+
{ id: "a", name: "Ari", text: "The conversation follows the main region's width. Open the details panel on a wide screen and my reply's indent stays; your prompt moves to full width once the region is narrower than the large breakpoint." },
|
|
10
|
+
{ id: "b", name: "You", text: "And a covering panel on a small screen leaves the layout underneath unchanged?", fromUser: true },
|
|
11
|
+
{ id: "c", name: "Ari", text: "Yes. Only pushing panels change the region's tracks." },
|
|
12
|
+
],
|
|
13
|
+
} as const;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Button, Conversation, IconButton, SearchBar, Shell } from "@ds";
|
|
2
|
+
import { fixture } from "./WorkspacePage.ads.fixture";
|
|
3
|
+
|
|
4
|
+
// A screen composed from public parts, for review only: it is not exported from @ds.
|
|
5
|
+
// The Conversation uses container context, so the Shell's panels change its placement.
|
|
6
|
+
export const scenario = { title: fixture.title, covers: ["Shell", "Conversation", "SearchBar", "Button", "IconButton"] };
|
|
7
|
+
export default function Scenario() {
|
|
8
|
+
return (
|
|
9
|
+
<Shell
|
|
10
|
+
id={fixture.id}
|
|
11
|
+
header={<strong>{fixture.heading}</strong>}
|
|
12
|
+
navigation={fixture.navigation.map((item) => <Button key={item} label={item} variant="secondary" />)}
|
|
13
|
+
rail={<IconButton icon="search" label="Search" />}
|
|
14
|
+
aside={<p>{fixture.aside}</p>}
|
|
15
|
+
defaultNavigationExpanded
|
|
16
|
+
defaultAsideOpen
|
|
17
|
+
>
|
|
18
|
+
<SearchBar {...fixture.search} />
|
|
19
|
+
<Conversation messages={fixture.messages} composer="Reply" />
|
|
20
|
+
</Shell>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -6,6 +6,7 @@ export { Icon, iconNames, type IconName, type IconProps } from "./components/Con
|
|
|
6
6
|
export { Image, type ImageProps } from "./components/Content/Image/Image";
|
|
7
7
|
export { Logo, type LogoProps } from "./components/Content/Logo/Logo";
|
|
8
8
|
export { TextField, type TextFieldProps } from "./components/Forms/TextField/TextField";
|
|
9
|
-
export { Grid, GridItem, type GridProps, type GridItemProps } from "./components/Layout/Grid/Grid";
|
|
10
9
|
export { observePalette, paletteContext, paletteFor, resolveColor, type ColorToken, type Palette, type PaletteColor, type PaletteContext } from "./controllers/Palette/Palette";
|
|
10
|
+
export { Conversation, type ConversationProps } from "./patterns/Conversation/Conversation";
|
|
11
11
|
export { SearchBar, type SearchBarProps } from "./patterns/Search/SearchBar/SearchBar";
|
|
12
|
+
export { Shell, type ShellAsideMode, type ShellProps } from "./patterns/Shell/Shell";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Conversation, type ConversationProps } from "./Conversation";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const fixture = {
|
|
2
|
+
messages: [
|
|
3
|
+
{ id: "a", name: "Ari", text: "The avatar occupies one master track. Its glyph keeps the same size as the track grows." },
|
|
4
|
+
{ id: "b", name: "You", text: "Can the reading indent stay fixed?", fromUser: true },
|
|
5
|
+
{ id: "c", name: "Ari", text: "Yes. The second example fixes the first track and lets the remaining thirteen tracks share the available space." },
|
|
6
|
+
],
|
|
7
|
+
} as const;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Conversation } from "@ds";
|
|
2
|
+
import { previewFrameClasses as frame } from "@reqvire-org/ads/preview";
|
|
3
|
+
import { fixture } from "./Conversation.ads.fixture";
|
|
4
|
+
export const scenario = { title: "Conversation · fixed and fluid avatar track", covers: ["Conversation"] };
|
|
5
|
+
// Each example sits in a region container: placement follows the region, not the window.
|
|
6
|
+
export default function Scenario() {
|
|
7
|
+
return <div className={frame("page-wide", "column")}>
|
|
8
|
+
<h2 className={frame("heading")}>Fixed avatar track (default)</h2>
|
|
9
|
+
<div className={frame("region")}><Conversation messages={fixture.messages} composer="Composer spans the whole region" /></div>
|
|
10
|
+
<h2 className={frame("heading")}>Fluid avatar track</h2>
|
|
11
|
+
<div className={frame("region")}><Conversation messages={fixture.messages} fixedIndent={false} composer="Composer spans the whole region" /></div>
|
|
12
|
+
<h2 className={frame("heading")}>Narrow region</h2>
|
|
13
|
+
<div className={frame("region", "width-large")}><Conversation messages={fixture.messages} composer="Prompts take the full width in a narrow region" /></div>
|
|
14
|
+
</div>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { css, cx } from "@linaria/atomic";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
export interface ConversationProps {
|
|
5
|
+
messages: readonly { id: string; name: string; text: string; fromUser?: boolean }[];
|
|
6
|
+
composer?: ReactNode;
|
|
7
|
+
/** The leading avatar track is fixed (default), so text starts right after the avatar; false makes it one fluid column. */
|
|
8
|
+
fixedIndent?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const cells = `
|
|
12
|
+
@ads-cell .ux-conversation-message {
|
|
13
|
+
span: full;
|
|
14
|
+
@ads-layout inherited {
|
|
15
|
+
gutter: none;
|
|
16
|
+
@ads-cell .ux-conversation-avatar { span: 1; }
|
|
17
|
+
@ads-cell .ux-conversation-content { start: 2; span: 11; }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
@ads-cell .ux-conversation-prompt {
|
|
21
|
+
span: full;
|
|
22
|
+
@ads-at lg { start: 6; span: 9; }
|
|
23
|
+
}
|
|
24
|
+
@ads-cell .ux-conversation-composer { span: full; }
|
|
25
|
+
`;
|
|
26
|
+
const fluid = css`
|
|
27
|
+
@ads-layout fluid {
|
|
28
|
+
context: container;
|
|
29
|
+
columns: 14;
|
|
30
|
+
gutter: none;
|
|
31
|
+
margin: --space-0;
|
|
32
|
+
row-gap: --space-12;
|
|
33
|
+
${cells}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
const hybrid = css`
|
|
37
|
+
@ads-layout hybrid {
|
|
38
|
+
context: container;
|
|
39
|
+
columns: 14;
|
|
40
|
+
fixed-start: --space-16;
|
|
41
|
+
gutter: none;
|
|
42
|
+
margin: --space-0;
|
|
43
|
+
row-gap: --space-12;
|
|
44
|
+
${cells}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
// The conversation owns the region its tracks respond to: a container query measures an
|
|
48
|
+
// ancestor, never the grid element itself.
|
|
49
|
+
const region = css`
|
|
50
|
+
container-type: inline-size;
|
|
51
|
+
container-name: ads-region;
|
|
52
|
+
min-inline-size: 0;
|
|
53
|
+
`;
|
|
54
|
+
const avatar = css`
|
|
55
|
+
inline-size: var(--icon-lg);
|
|
56
|
+
max-inline-size: 100%;
|
|
57
|
+
aspect-ratio: 1;
|
|
58
|
+
border-radius: var(--radius-full);
|
|
59
|
+
background: var(--accent);
|
|
60
|
+
color: var(--accent-fg);
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
font-size: var(--text-xs);
|
|
65
|
+
font-weight: var(--weight-semibold);
|
|
66
|
+
`;
|
|
67
|
+
const content = css`
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
gap: var(--space-2);
|
|
71
|
+
overflow-wrap: anywhere;
|
|
72
|
+
color: var(--text-body);
|
|
73
|
+
font-size: var(--text-base);
|
|
74
|
+
line-height: var(--leading-normal);
|
|
75
|
+
`;
|
|
76
|
+
const name = css`font-weight: var(--weight-semibold); color: var(--text-strong);`;
|
|
77
|
+
const text = css`margin: 0;`;
|
|
78
|
+
const prompt = css`
|
|
79
|
+
padding: var(--space-8);
|
|
80
|
+
background: var(--bg-surface);
|
|
81
|
+
border-radius: var(--radius-lg);
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
/** A locally defined fourteen-track conversation that responds to its region's width; no layout wrapper components. */
|
|
85
|
+
export function Conversation({ messages, composer, fixedIndent = true }: ConversationProps) {
|
|
86
|
+
return (
|
|
87
|
+
<section aria-label="Conversation" className={region}>
|
|
88
|
+
<div className={fixedIndent ? hybrid : fluid}>
|
|
89
|
+
{messages.map(message => message.fromUser ? (
|
|
90
|
+
<article key={message.id} className={cx("ux-conversation-prompt", prompt, content)}>
|
|
91
|
+
<strong className={name}>{message.name}</strong><p className={text}>{message.text}</p>
|
|
92
|
+
</article>
|
|
93
|
+
) : (
|
|
94
|
+
<article key={message.id} className="ux-conversation-message">
|
|
95
|
+
<span aria-hidden="true" className={cx("ux-conversation-avatar", avatar)}>{message.name.slice(0, 1)}</span>
|
|
96
|
+
<div className={cx("ux-conversation-content", content)}>
|
|
97
|
+
<strong className={name}>{message.name}</strong><p className={text}>{message.text}</p>
|
|
98
|
+
</div>
|
|
99
|
+
</article>
|
|
100
|
+
))}
|
|
101
|
+
<div className="ux-conversation-composer">{composer}</div>
|
|
102
|
+
</div>
|
|
103
|
+
</section>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Conversation
|
|
2
|
+
|
|
3
|
+
A fourteen-track local region using the shared spatial definition. Assistant rows inherit the parent tracks through native CSS subgrid. The avatar occupies track 1, content occupies tracks 2–12, user prompts occupy tracks 6–14 when the region reaches the large breakpoint, and the composer spans the region. Narrow user prompts take the full width.
|
|
4
|
+
|
|
5
|
+
By default the layout is hybrid: track 1 is a fixed `--space-16` (32px) track holding the 24px avatar, so the text starts one mini unit after it. `fixedIndent={false}` makes track 1 one fluid column instead, which widens the gap with the region. The avatar glyph stays at the shared icon size in both variants. Content remains naturally sized vertically. Place a product composer in the `composer` slot.
|
|
6
|
+
|
|
7
|
+
The layout uses `context: container`, and the conversation owns that container: its outer element is the region its tracks respond to, so placement follows the space the conversation actually has. Opening a side panel narrows it and can move prompts back to full width.
|
|
8
|
+
|
|
9
|
+
Placement is compiled into the initial CSS. There are no placement effects, runtime layout validation or layout wrapper components.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Shell } from "@ds";
|
|
2
|
+
import { RegionBlock } from "@ds/review";
|
|
3
|
+
import { fixture } from "./Floating.ads.fixture";
|
|
4
|
+
|
|
5
|
+
// A floating aside always covers the main region.
|
|
6
|
+
export const scenario = { title: "Shell · floating aside", covers: ["Shell"] };
|
|
7
|
+
export default function Scenario() {
|
|
8
|
+
return (
|
|
9
|
+
<Shell
|
|
10
|
+
id={fixture.id}
|
|
11
|
+
header={<RegionBlock label={fixture.regions.header} tone="blue" />}
|
|
12
|
+
navigation={<RegionBlock label={fixture.regions.navigation} tone="mint" />}
|
|
13
|
+
rail={<RegionBlock label={fixture.regions.rail} tone="mint" />}
|
|
14
|
+
aside={<RegionBlock label={fixture.regions.aside} tone="warm" />}
|
|
15
|
+
defaultAsideOpen
|
|
16
|
+
asideMode="floating"
|
|
17
|
+
>
|
|
18
|
+
<RegionBlock label={fixture.regions.main} tone="lavender" />
|
|
19
|
+
</Shell>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Shell
|
|
2
|
+
|
|
3
|
+
Application regions: a header, a navigation panel at the inline start, the main region and an optional aside at the inline end. The geometry is one validated `@ads-layout hybrid` construction per state; there are no placement effects or layout wrapper components.
|
|
4
|
+
|
|
5
|
+
| State | Below `lg` | From `lg` |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| Navigation collapsed | Rail track (`--navigation-rail-width`) | Rail track |
|
|
8
|
+
| Navigation expanded | Rail track stays; the panel **covers** the main region from the start edge | Panel track (`--side-pane-width`) **pushes** the main region |
|
|
9
|
+
| Aside closed | Empty end track | Empty end track |
|
|
10
|
+
| Aside open, `asideMode="docked"` | Covers the main region from the end edge | Panel track pushes the main region |
|
|
11
|
+
| Aside open, `asideMode="floating"` | Covers | Covers; the main region's tracks are unchanged |
|
|
12
|
+
|
|
13
|
+
Rows are `auto fill`: the header keeps its content height and the panels and main region fill the rest. The header continues the column tracks (an inherited layout), so the navigation toggle stays over the navigation track and the header bar starts on the same keyline as the main region's content. Covering panels keep to the body row, so the header stays reachable.
|
|
14
|
+
|
|
15
|
+
A backdrop (`--bg-overlay`) appears wherever a panel covers the main region: below `lg` for an expanded navigation or a docked aside, and at every size for a floating aside. It is hidden with per-breakpoint `visible: false`, so no script decides when it shows.
|
|
16
|
+
|
|
17
|
+
The compiler checks every state at every breakpoint: placements stay within the three tracks and the fixed tracks always leave fluid space for the main region (at `lg`, 1056 − 280 − 280 px).
|
|
18
|
+
|
|
19
|
+
The main region declares `container: region`. Layouts inside it that use `context: container`, such as Conversation, respond to the main region's width, so opening a pushing panel can change their placement while a covering panel does not.
|
|
20
|
+
|
|
21
|
+
## Behaviour
|
|
22
|
+
|
|
23
|
+
- The header's navigation toggle and the aside toggle are `IconButton`s with `aria-expanded` and `aria-controls`.
|
|
24
|
+
- A panel that opens over the content takes focus. Escape closes a covering panel and focus returns to its toggle; a press on the backdrop closes it too. A pushing navigation panel stays open on Escape; the aside's close button and Escape always close it.
|
|
25
|
+
- Navigation content renders only while expanded; `rail` renders while collapsed.
|
|
26
|
+
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Default |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `id` | `string` | — (prefix for region and toggle ids) |
|
|
32
|
+
| `header` | `ReactNode` | — |
|
|
33
|
+
| `navigation` | `ReactNode` | — |
|
|
34
|
+
| `rail` | `ReactNode` | — |
|
|
35
|
+
| `navigationLabel` | `string` | `"Navigation"` |
|
|
36
|
+
| `navigationExpanded` / `defaultNavigationExpanded` / `onNavigationExpandedChange` | controlled or uncontrolled | `false` |
|
|
37
|
+
| `aside` | `ReactNode` | — (no aside or aside toggle) |
|
|
38
|
+
| `asideLabel` | `string` | `"Details"` |
|
|
39
|
+
| `asideMode` | `"docked" \| "floating"` | `"docked"` |
|
|
40
|
+
| `asideOpen` / `defaultAsideOpen` / `onAsideOpenChange` | controlled or uncontrolled | `false` |
|
|
41
|
+
| `children` | `ReactNode` | — (main region content) |
|
|
42
|
+
|
|
43
|
+
The Shell fills its parent's block size; give the application root a height (for example `100dvh`). The main region scrolls.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Shell, type ShellAsideMode, type ShellProps } from "./Shell";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Shell } from "@ds";
|
|
2
|
+
import { RegionBlock } from "@ds/review";
|
|
3
|
+
import { fixture } from "./Shell.ads.fixture";
|
|
4
|
+
|
|
5
|
+
// From the large breakpoint both panels push the main region; below it they cover it.
|
|
6
|
+
export const scenario = { title: "Shell · expanded navigation, docked aside", covers: ["Shell"] };
|
|
7
|
+
export default function Scenario() {
|
|
8
|
+
return (
|
|
9
|
+
<Shell
|
|
10
|
+
id={fixture.id}
|
|
11
|
+
header={<RegionBlock label={fixture.regions.header} tone="blue" />}
|
|
12
|
+
navigation={<RegionBlock label={fixture.regions.navigation} tone="mint" />}
|
|
13
|
+
rail={<RegionBlock label={fixture.regions.rail} tone="mint" />}
|
|
14
|
+
aside={<RegionBlock label={fixture.regions.aside} tone="warm" />}
|
|
15
|
+
defaultNavigationExpanded
|
|
16
|
+
defaultAsideOpen
|
|
17
|
+
>
|
|
18
|
+
<RegionBlock label={fixture.regions.main} tone="lavender" />
|
|
19
|
+
</Shell>
|
|
20
|
+
);
|
|
21
|
+
}
|