@reqvire-org/ads 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/dist/ads-errors.mjs +275 -12
- package/dist/ads-views.mjs +4 -4
- package/dist/analysis/design-usage.mjs +20 -4
- package/dist/analysis/mock-check.mjs +5 -4
- package/dist/analysis/owner-analysis-key.mjs +1 -1
- package/dist/analysis/owner-choices.mjs +172 -39
- package/dist/analysis/owner-composition.mjs +37 -13
- package/dist/analysis/owner-controls.mjs +27 -0
- package/dist/analysis/owner-source.mjs +67 -18
- package/dist/analysis/prose-owners.mjs +57 -0
- package/dist/analysis/styling-ownership.mjs +22 -0
- package/dist/check.mjs +7 -1
- package/dist/cli-arguments.mjs +2 -2
- package/dist/cli.mjs +3 -3
- package/dist/composed-contrast.mjs +28 -8
- package/dist/composed-keyline.mjs +107 -0
- package/dist/construction-output.mjs +146 -18
- package/dist/construction-spec.d.mts +212 -9
- package/dist/construction-spec.mjs +297 -56
- package/dist/corner-overpaint.mjs +53 -0
- package/dist/design-foundation.mjs +6 -1
- package/dist/design-usage.mjs +8 -2
- package/dist/emit/emission.mjs +11 -4
- package/dist/emit/font-emission.mjs +21 -1
- package/dist/emit/foundation-sheet.mjs +6 -5
- package/dist/emit/preview-tree.mjs +1 -1
- package/dist/finding-rules.mjs +7 -0
- package/dist/font-checks.mjs +42 -0
- package/dist/font-declaration.d.mts +10 -0
- package/dist/font-declaration.mjs +25 -3
- package/dist/font-fallback.d.mts +37 -0
- package/dist/font-fallback.mjs +25 -0
- package/dist/font-macro.d.mts +10 -0
- package/dist/font-metrics.d.mts +34 -0
- package/dist/font-metrics.mjs +314 -0
- package/dist/font-model.mjs +28 -2
- package/dist/foundation-macro.d.mts +1 -1
- package/dist/frame-regions.mjs +66 -3
- package/dist/grid-facts.mjs +72 -16
- package/dist/grid-lowering.mjs +11 -5
- package/dist/init.mjs +14 -23
- package/dist/lowering-enter.mjs +31 -0
- package/dist/lowering-properties.mjs +22 -1
- package/dist/lowering-region-layout.mjs +42 -8
- package/dist/lowering-sequence.mjs +89 -0
- package/dist/lowering-session.mjs +7 -0
- package/dist/lowering-transitions.mjs +22 -8
- package/dist/mcp/preview-http.bundle.js +2 -2
- package/dist/mcp/preview-widget.bundle.js +5 -5
- package/dist/motion-model.mjs +2 -0
- package/dist/owner-analysis-check.mjs +67 -7
- package/dist/owner-errors.mjs +16 -0
- package/dist/owner-lowering.mjs +36 -16
- package/dist/owner-scenarios.mjs +25 -3
- package/dist/ownership-model.mjs +23 -4
- package/dist/paint-contrast.mjs +5 -0
- package/dist/placeholder-contrast.mjs +1 -0
- package/dist/platform-features.mjs +26 -2
- package/dist/preview-bun.mjs +17 -16
- package/dist/preview-controls.mjs +35 -0
- package/dist/preview-incremental.mjs +1 -1
- package/dist/preview-source.mjs +2 -2
- package/dist/profile-macro.d.mts +15 -0
- package/dist/profile-model.mjs +3 -3
- package/dist/profile-view-facts.mjs +55 -4
- package/dist/prose-model.d.mts +81 -0
- package/dist/prose-model.mjs +101 -0
- package/dist/recipe-macro.d.mts +105 -3
- package/dist/recipe-model.mjs +31 -7
- package/dist/region-lowering.mjs +241 -41
- package/dist/render-audit/corner-overpaint.page.mjs +54 -0
- package/dist/render-audit/worker.mjs +6 -1
- package/dist/render-audit.mjs +25 -0
- package/dist/role-vocabulary.d.mts +38 -2
- package/dist/role-vocabulary.mjs +39 -4
- package/dist/scenario-kit.d.mts +6 -0
- package/dist/scenario-registry.mjs +1 -1
- package/dist/scheme-switch.d.mts +8 -0
- package/dist/scheme-switch.mjs +1 -0
- package/dist/showcase/ads-views.mjs +116 -53
- package/dist/showcase/assets-view.mjs +117 -86
- package/dist/showcase/client.bundle.js +65 -65
- package/dist/showcase/http-client.bundle.js +17 -17
- package/dist/showcase/preview-frame.css +2 -0
- package/dist/showcase/profiles-view.mjs +163 -122
- package/dist/showcase/scenario-page.d.mts +11 -1
- package/dist/showcase/scenario-page.mjs +18 -3
- package/dist/showcase/token-sample.mjs +47 -4
- package/dist/showcase/tokens-view.mjs +82 -34
- package/dist/showcase/ui/ui.css +1 -1
- package/dist/showcase/ui/ui.js +5 -5
- package/dist/skills/README.md +5 -5
- package/dist/skills/ads-designer/README.md +1 -1
- package/dist/skills/ads-designer/SKILL.md +13 -12
- package/dist/skills/ads-designer/references/accessibility.md +2 -2
- package/dist/skills/ads-designer/references/atomic-styles.md +8 -1
- package/dist/skills/ads-designer/references/branding.md +7 -2
- package/dist/skills/ads-designer/references/cli.md +4 -4
- package/dist/skills/ads-designer/references/contracts.md +9 -2
- package/dist/skills/ads-designer/references/design-craft.md +1 -1
- package/dist/skills/ads-designer/references/design-data.md +3 -3
- package/dist/skills/ads-designer/references/forms.md +6 -6
- package/dist/skills/ads-designer/references/layout.md +42 -3
- package/dist/skills/ads-designer/references/motion.md +37 -1
- package/dist/skills/ads-designer/references/performance.md +7 -1
- package/dist/skills/ads-designer/references/recipes.md +67 -6
- package/dist/skills/ads-designer/references/runtimes.md +1 -1
- package/dist/skills/ads-designer/references/scenarios.md +1 -0
- package/dist/skills/ads-import/references/atomic-styles.md +8 -1
- package/dist/skills/ads-import/references/cli.md +4 -4
- package/dist/skills/ads-import/references/contracts.md +9 -2
- package/dist/skills/ads-import/references/design-data.md +3 -3
- package/dist/skills/ads-import/references/forms.md +6 -6
- package/dist/skills/ads-import/references/layout.md +42 -3
- package/dist/skills/ads-import/references/recipes.md +67 -6
- package/dist/skills/ads-import/references/runtimes.md +1 -1
- package/dist/skills/ads-import/references/scenarios.md +1 -0
- package/dist/skills/ads-migrate/SKILL.md +2 -1
- package/dist/skills/ads-migrate/references/0.5.0-to-0.5.1.md +239 -0
- package/dist/skills/ads-port/references/atomic-styles.md +8 -1
- package/dist/skills/ads-port/references/cli.md +4 -4
- package/dist/skills/ads-port/references/contracts.md +9 -2
- package/dist/skills/ads-port/references/design-data.md +3 -3
- package/dist/skills/ads-port/references/forms.md +6 -6
- package/dist/skills/ads-port/references/layout.md +42 -3
- package/dist/skills/ads-port/references/recipes.md +67 -6
- package/dist/skills/ads-port/references/runtimes.md +1 -1
- package/dist/skills/ads-port/references/scenarios.md +1 -0
- package/dist/spatial-model.mjs +20 -4
- package/dist/state-conditions.d.mts +29 -0
- package/dist/state-conditions.mjs +42 -2
- package/dist/surface-contrast.mjs +68 -10
- package/dist/surface-effects.mjs +98 -0
- package/dist/target-size.mjs +1 -1
- package/dist/task-cache.mjs +1 -1
- package/dist/token-dtcg.mjs +1 -0
- package/dist/token-view-facts.mjs +54 -5
- package/dist/unreached-sources.mjs +5 -0
- package/dist/validation.mjs +1 -1
- package/docs/ADS.md +36 -13
- package/docs/ARCHITECTURE.md +160 -16
- package/docs/ASSETS.md +81 -10
- package/docs/CACHING.md +1 -1
- package/docs/CHANGELOG.md +346 -21
- package/docs/DESIGN-REFERENCES.md +5 -5
- package/docs/GUIDE.md +241 -72
- package/docs/LANGUAGE.md +287 -21
- package/docs/LOWERING.md +13 -1
- package/docs/MOTION.md +233 -7
- package/docs/PROFILE-KINDS.md +167 -13
- package/docs/PROFILES.md +2 -2
- package/docs/RULES.md +49 -18
- package/docs/TOKEN-ROLES.md +9 -7
- package/package.json +1 -1
- package/dist/starter-files.mjs +0 -155
- package/dist/starter-overlay.mjs +0 -189
- package/dist/starters/preact/design-system/assets/avatars/avatar.ads.ts +0 -10
- package/dist/starters/preact/design-system/assets/avatars/member.svg +0 -1
- package/dist/starters/preact/design-system/assets/brand/emblem.ads.ts +0 -18
- package/dist/starters/preact/design-system/assets/brand/emblem.svg +0 -4
- package/dist/starters/preact/design-system/assets/brand/iris-emblem.ads.ts +0 -14
- package/dist/starters/preact/design-system/assets/brand/iris-emblem.svg +0 -4
- package/dist/starters/preact/design-system/assets/brand/mark.ads.ts +0 -14
- package/dist/starters/preact/design-system/assets/brand/mark.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/arrow.ads.ts +0 -14
- package/dist/starters/preact/design-system/assets/glyphs/arrow.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/chevron-20.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/chevron-24.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/chevron.ads.ts +0 -20
- package/dist/starters/preact/design-system/assets/glyphs/close.ads.ts +0 -13
- package/dist/starters/preact/design-system/assets/glyphs/close.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/favorite.ads.ts +0 -23
- package/dist/starters/preact/design-system/assets/glyphs/favorite.normal.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/favorite.selected.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/search.ads.ts +0 -10
- package/dist/starters/preact/design-system/assets/glyphs/search.svg +0 -1
- package/dist/starters/preact/design-system/assets/illustrations/journey.ads.ts +0 -32
- package/dist/starters/preact/design-system/assets/illustrations/journey.contrast.svg +0 -6
- package/dist/starters/preact/design-system/assets/illustrations/journey.dark.svg +0 -13
- package/dist/starters/preact/design-system/assets/illustrations/journey.light.svg +0 -13
- package/dist/starters/preact/design-system/assets/logos/harbor-pay.ads.ts +0 -17
- package/dist/starters/preact/design-system/assets/logos/harbor-pay.dark.svg +0 -10
- package/dist/starters/preact/design-system/assets/logos/harbor-pay.light.svg +0 -10
- package/dist/starters/preact/design-system/assets/logos/lumen-cloud.ads.ts +0 -15
- package/dist/starters/preact/design-system/assets/logos/lumen-cloud.dark.svg +0 -9
- package/dist/starters/preact/design-system/assets/logos/lumen-cloud.light.svg +0 -9
- package/dist/starters/preact/design-system/assets/status/error.svg +0 -1
- package/dist/starters/preact/design-system/assets/status/outcomes.ads.ts +0 -31
- package/dist/starters/preact/design-system/assets/status/status.ads.ts +0 -16
- package/dist/starters/preact/design-system/assets/status/success.svg +0 -1
- package/dist/starters/preact/design-system/assets/status/sync-status.ads.ts +0 -14
- package/dist/starters/preact/design-system/assets/status/sync-status.svg +0 -7
- package/dist/starters/preact/design-system/assets/status/warning.svg +0 -1
- package/dist/starters/preact/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -12
- package/dist/starters/preact/design-system/components/Actions/Button/Button.tsx +0 -198
- package/dist/starters/preact/design-system/components/Actions/IconButton/IconButton.tsx +0 -95
- package/dist/starters/preact/design-system/components/Actions/ToggleTile/ToggleTile.ads.scenario.tsx +0 -22
- package/dist/starters/preact/design-system/components/Actions/ToggleTile/ToggleTile.tsx +0 -60
- package/dist/starters/preact/design-system/components/Containers/Disclosure/Disclosure.ads.scenario.tsx +0 -24
- package/dist/starters/preact/design-system/components/Containers/Disclosure/Disclosure.tsx +0 -50
- package/dist/starters/preact/design-system/components/Content/Artwork/Artwork.ads.scenario.tsx +0 -8
- package/dist/starters/preact/design-system/components/Content/Artwork/Artwork.tsx +0 -110
- package/dist/starters/preact/design-system/components/Content/BarChart/BarChart.ads.scenario.tsx +0 -25
- package/dist/starters/preact/design-system/components/Content/BarChart/BarChart.tsx +0 -72
- package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx +0 -8
- package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.tsx +0 -43
- package/dist/starters/preact/design-system/components/Content/Icon/Icon.ads.scenario.tsx +0 -21
- package/dist/starters/preact/design-system/components/Content/Icon/Icon.tsx +0 -41
- package/dist/starters/preact/design-system/components/Content/Icon/glyphs/arrow.tsx +0 -10
- package/dist/starters/preact/design-system/components/Content/Icon/glyphs/close.tsx +0 -10
- package/dist/starters/preact/design-system/components/Content/Icon/glyphs/search.tsx +0 -10
- package/dist/starters/preact/design-system/components/Content/Image/Image.ads.fixture.ts +0 -9
- package/dist/starters/preact/design-system/components/Content/Image/Image.ads.scenario.tsx +0 -12
- package/dist/starters/preact/design-system/components/Content/Image/Image.tsx +0 -83
- package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.ads.scenario.tsx +0 -27
- package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx +0 -46
- package/dist/starters/preact/design-system/components/Content/PartnerLogo/PartnerLogo.ads.scenario.tsx +0 -17
- package/dist/starters/preact/design-system/components/Content/PartnerLogo/PartnerLogo.tsx +0 -41
- package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx +0 -20
- package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.tsx +0 -37
- package/dist/starters/preact/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -24
- package/dist/starters/preact/design-system/components/Forms/TextField/TextField.tsx +0 -173
- package/dist/starters/preact/design-system/components/Identity/Identity.ads.scenario.tsx +0 -13
- package/dist/starters/preact/design-system/components/Identity/Identity.tsx +0 -146
- package/dist/starters/preact/design-system/components/Overlays/Menu/Menu.ads.scenario.tsx +0 -27
- package/dist/starters/preact/design-system/components/Overlays/Menu/Menu.tsx +0 -194
- package/dist/starters/preact/design-system/components/Overlays/Popover/Popover.ads.scenario.tsx +0 -19
- package/dist/starters/preact/design-system/components/Overlays/Popover/Popover.tsx +0 -37
- package/dist/starters/preact/design-system/controllers/FormField/FormField.ads.behavior.ts +0 -70
- package/dist/starters/preact/design-system/controllers/FormField/FormField.behavior.spec.ts +0 -237
- package/dist/starters/preact/design-system/controllers/FormField/FormField.ts +0 -343
- package/dist/starters/preact/design-system/controllers/FormField/useFormField.ts +0 -70
- package/dist/starters/preact/design-system/controllers/Palette/Palette.ts +0 -165
- package/dist/starters/preact/design-system/foundation.ads.ts +0 -22
- package/dist/starters/preact/design-system/index.ts +0 -51
- package/dist/starters/preact/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.fixture.ts +0 -5
- package/dist/starters/preact/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.scenario.tsx +0 -22
- package/dist/starters/preact/design-system/mocks/Inspector/Inspector.ads.fixture.ts +0 -12
- package/dist/starters/preact/design-system/mocks/Inspector/Inspector.ads.scenario.tsx +0 -21
- package/dist/starters/preact/design-system/mocks/Workspace/Layouts.ads.scenario.tsx +0 -24
- package/dist/starters/preact/design-system/mocks/Workspace/Media.ads.scenario.tsx +0 -24
- package/dist/starters/preact/design-system/mocks/Workspace/Stress.ads.scenario.tsx +0 -36
- package/dist/starters/preact/design-system/mocks/Workspace/Workspace.ads.fixture.ts +0 -13
- package/dist/starters/preact/design-system/mocks/Workspace/Workspace.ads.scenario.tsx +0 -27
- package/dist/starters/preact/design-system/mocks/Workspace/media/ads.svg +0 -1
- package/dist/starters/preact/design-system/palette.generated.ts +0 -188
- package/dist/starters/preact/design-system/patterns/ArtworkCatalogue/ArtworkCatalogue/ArtworkCatalogue.tsx +0 -73
- package/dist/starters/preact/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.ads.scenario.tsx +0 -23
- package/dist/starters/preact/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.tsx +0 -94
- package/dist/starters/preact/design-system/patterns/Forms/InviteMember/InviteMember.ads.scenario.tsx +0 -21
- package/dist/starters/preact/design-system/patterns/Forms/InviteMember/InviteMember.tsx +0 -137
- package/dist/starters/preact/design-system/patterns/Inspector/Inspector/Inspector.ads.scenario.tsx +0 -22
- package/dist/starters/preact/design-system/patterns/Inspector/Inspector/Inspector.tsx +0 -248
- package/dist/starters/preact/design-system/patterns/Shell/Shell.ads.scenario.tsx +0 -26
- package/dist/starters/preact/design-system/patterns/Shell/Shell.tsx +0 -268
- package/dist/starters/preact/design-system/patterns/Workspace/Workspace/Workspace.ads.scenario.tsx +0 -28
- package/dist/starters/preact/design-system/patterns/Workspace/Workspace/Workspace.tsx +0 -105
- package/dist/starters/preact/design-system/patterns/Workspace/Workspace/WorkspacePanels.tsx +0 -179
- package/dist/starters/preact/design-system/profiles/Containers/containers.ads.ts +0 -67
- package/dist/starters/preact/design-system/profiles/Containers/frames.ads.ts +0 -32
- package/dist/starters/preact/design-system/profiles/Containers/geometry.ads.ts +0 -30
- package/dist/starters/preact/design-system/profiles/Containers/spacing.ads.ts +0 -26
- package/dist/starters/preact/design-system/profiles/Controls/controls.ads.ts +0 -157
- package/dist/starters/preact/design-system/profiles/Controls/frames.ads.ts +0 -50
- package/dist/starters/preact/design-system/profiles/Controls/spacing.ads.ts +0 -29
- package/dist/starters/preact/design-system/profiles/Focus/keyboard.ads.ts +0 -13
- package/dist/starters/preact/design-system/profiles/Identity/identity.ads.ts +0 -25
- package/dist/starters/preact/design-system/profiles/Identity/spacing.ads.ts +0 -22
- package/dist/starters/preact/design-system/profiles/Layout/grid.ads.ts +0 -69
- package/dist/starters/preact/design-system/profiles/Layout/inspector.ads.ts +0 -146
- package/dist/starters/preact/design-system/profiles/Layout/overlays.ads.ts +0 -94
- package/dist/starters/preact/design-system/profiles/Layout/regions.ads.ts +0 -296
- package/dist/starters/preact/design-system/profiles/Motion/feedback.ads.ts +0 -92
- package/dist/starters/preact/design-system/profiles/Surfaces/controls.ads.ts +0 -142
- package/dist/starters/preact/design-system/profiles/Surfaces/document.ads.ts +0 -2
- package/dist/starters/preact/design-system/profiles/Surfaces/materials.ads.ts +0 -18
- package/dist/starters/preact/design-system/profiles/Surfaces/surfaces.ads.ts +0 -48
- package/dist/starters/preact/design-system/profiles/Typography/details.ads.ts +0 -19
- package/dist/starters/preact/design-system/profiles/Typography/document.ads.ts +0 -2
- package/dist/starters/preact/design-system/profiles/Typography/headings.ads.ts +0 -15
- package/dist/starters/preact/design-system/profiles/Typography/text.ads.ts +0 -73
- package/dist/starters/preact/design-system/profiles/Visuals/artwork.ads.ts +0 -46
- package/dist/starters/preact/design-system/profiles/Visuals/charts.ads.ts +0 -31
- package/dist/starters/preact/design-system/profiles/Visuals/content.ads.ts +0 -52
- package/dist/starters/preact/design-system/profiles/Visuals/glyphs.ads.ts +0 -35
- package/dist/starters/preact/design-system/profiles/Visuals/identity.ads.ts +0 -24
- package/dist/starters/preact/design-system/tokens/Artwork/paint.ads.css +0 -7
- package/dist/starters/preact/design-system/tokens/Artwork/visual-size.ads.css +0 -12
- package/dist/starters/preact/design-system/tokens/Brand/paint.ads.css +0 -7
- package/dist/starters/preact/design-system/tokens/Charts/paint.ads.css +0 -19
- package/dist/starters/preact/design-system/tokens/Containers/border-width.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Containers/content-gap.ads.css +0 -5
- package/dist/starters/preact/design-system/tokens/Containers/frame-inset.ads.css +0 -6
- package/dist/starters/preact/design-system/tokens/Containers/frame-size.ads.css +0 -11
- package/dist/starters/preact/design-system/tokens/Containers/radius.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Controls/border-width.ads.css +0 -4
- package/dist/starters/preact/design-system/tokens/Controls/content-gap.ads.css +0 -6
- package/dist/starters/preact/design-system/tokens/Controls/control-min-size.ads.css +0 -17
- package/dist/starters/preact/design-system/tokens/Controls/frame-inset.ads.css +0 -21
- package/dist/starters/preact/design-system/tokens/Controls/radius.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Controls/target-min-size.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Controls/visual-size.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Focus/border-width.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Focus/focus-offset.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Foundation/spacing.ads.css +0 -20
- package/dist/starters/preact/design-system/tokens/Grid/grid-gutter.ads.css +0 -6
- package/dist/starters/preact/design-system/tokens/Grid/layer.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Grid/layout-size.ads.css +0 -15
- package/dist/starters/preact/design-system/tokens/Grid/spacing.ads.css +0 -12
- package/dist/starters/preact/design-system/tokens/Grid/track-count.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Identity/content-gap.ads.css +0 -6
- package/dist/starters/preact/design-system/tokens/Identity/visual-size.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Motion/duration.ads.css +0 -6
- package/dist/starters/preact/design-system/tokens/Motion/easing.ads.css +0 -5
- package/dist/starters/preact/design-system/tokens/Motion/motion-angle.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Motion/motion-distance.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Motion/motion-scale.ads.css +0 -9
- package/dist/starters/preact/design-system/tokens/Surfaces/blur.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Surfaces/gradient.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Surfaces/opacity.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Surfaces/paint.ads.css +0 -58
- package/dist/starters/preact/design-system/tokens/Surfaces/shadow.ads.css +0 -20
- package/dist/starters/preact/design-system/tokens/Typography/font-family.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/font-features.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/font-size.ads.css +0 -9
- package/dist/starters/preact/design-system/tokens/Typography/font-stretch.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/font-variations.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/font-weight.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/letter-spacing.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/line-height.ads.css +0 -11
- package/dist/starters/preact/design-system/tokens/Typography/word-spacing.ads.css +0 -1
- package/dist/starters/preact/starter.json +0 -11
- package/dist/starters/react/design-system/assets/avatars/avatar.ads.ts +0 -10
- package/dist/starters/react/design-system/assets/avatars/member.svg +0 -1
- package/dist/starters/react/design-system/assets/brand/emblem.ads.ts +0 -18
- package/dist/starters/react/design-system/assets/brand/emblem.svg +0 -4
- package/dist/starters/react/design-system/assets/brand/iris-emblem.ads.ts +0 -14
- package/dist/starters/react/design-system/assets/brand/iris-emblem.svg +0 -4
- package/dist/starters/react/design-system/assets/brand/mark.ads.ts +0 -14
- package/dist/starters/react/design-system/assets/brand/mark.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/arrow.ads.ts +0 -14
- package/dist/starters/react/design-system/assets/glyphs/arrow.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/chevron-20.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/chevron-24.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/chevron.ads.ts +0 -20
- package/dist/starters/react/design-system/assets/glyphs/close.ads.ts +0 -13
- package/dist/starters/react/design-system/assets/glyphs/close.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/favorite.ads.ts +0 -23
- package/dist/starters/react/design-system/assets/glyphs/favorite.normal.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/favorite.selected.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/search.ads.ts +0 -10
- package/dist/starters/react/design-system/assets/glyphs/search.svg +0 -1
- package/dist/starters/react/design-system/assets/illustrations/journey.ads.ts +0 -32
- package/dist/starters/react/design-system/assets/illustrations/journey.contrast.svg +0 -6
- package/dist/starters/react/design-system/assets/illustrations/journey.dark.svg +0 -13
- package/dist/starters/react/design-system/assets/illustrations/journey.light.svg +0 -13
- package/dist/starters/react/design-system/assets/logos/harbor-pay.ads.ts +0 -17
- package/dist/starters/react/design-system/assets/logos/harbor-pay.dark.svg +0 -10
- package/dist/starters/react/design-system/assets/logos/harbor-pay.light.svg +0 -10
- package/dist/starters/react/design-system/assets/logos/lumen-cloud.ads.ts +0 -15
- package/dist/starters/react/design-system/assets/logos/lumen-cloud.dark.svg +0 -9
- package/dist/starters/react/design-system/assets/logos/lumen-cloud.light.svg +0 -9
- package/dist/starters/react/design-system/assets/status/error.svg +0 -1
- package/dist/starters/react/design-system/assets/status/outcomes.ads.ts +0 -31
- package/dist/starters/react/design-system/assets/status/status.ads.ts +0 -16
- package/dist/starters/react/design-system/assets/status/success.svg +0 -1
- package/dist/starters/react/design-system/assets/status/sync-status.ads.ts +0 -14
- package/dist/starters/react/design-system/assets/status/sync-status.svg +0 -7
- package/dist/starters/react/design-system/assets/status/warning.svg +0 -1
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -12
- package/dist/starters/react/design-system/components/Actions/Button/Button.tsx +0 -198
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +0 -95
- package/dist/starters/react/design-system/components/Actions/ToggleTile/ToggleTile.ads.scenario.tsx +0 -22
- package/dist/starters/react/design-system/components/Actions/ToggleTile/ToggleTile.tsx +0 -60
- package/dist/starters/react/design-system/components/Containers/Disclosure/Disclosure.ads.scenario.tsx +0 -24
- package/dist/starters/react/design-system/components/Containers/Disclosure/Disclosure.tsx +0 -50
- package/dist/starters/react/design-system/components/Content/Artwork/Artwork.ads.scenario.tsx +0 -8
- package/dist/starters/react/design-system/components/Content/Artwork/Artwork.tsx +0 -110
- package/dist/starters/react/design-system/components/Content/BarChart/BarChart.ads.scenario.tsx +0 -25
- package/dist/starters/react/design-system/components/Content/BarChart/BarChart.tsx +0 -72
- package/dist/starters/react/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx +0 -8
- package/dist/starters/react/design-system/components/Content/GuideGrid/GuideGrid.tsx +0 -43
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.scenario.tsx +0 -21
- package/dist/starters/react/design-system/components/Content/Icon/Icon.tsx +0 -41
- package/dist/starters/react/design-system/components/Content/Icon/glyphs/arrow.tsx +0 -10
- package/dist/starters/react/design-system/components/Content/Icon/glyphs/close.tsx +0 -10
- package/dist/starters/react/design-system/components/Content/Icon/glyphs/search.tsx +0 -10
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.fixture.ts +0 -9
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.scenario.tsx +0 -12
- package/dist/starters/react/design-system/components/Content/Image/Image.tsx +0 -83
- package/dist/starters/react/design-system/components/Content/InspectedGlyph/InspectedGlyph.ads.scenario.tsx +0 -27
- package/dist/starters/react/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx +0 -46
- package/dist/starters/react/design-system/components/Content/PartnerLogo/PartnerLogo.ads.scenario.tsx +0 -17
- package/dist/starters/react/design-system/components/Content/PartnerLogo/PartnerLogo.tsx +0 -41
- package/dist/starters/react/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx +0 -20
- package/dist/starters/react/design-system/components/Content/StatusIcon/StatusIcon.tsx +0 -37
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -24
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.tsx +0 -173
- package/dist/starters/react/design-system/components/Identity/Identity.ads.scenario.tsx +0 -13
- package/dist/starters/react/design-system/components/Identity/Identity.tsx +0 -146
- package/dist/starters/react/design-system/components/Overlays/Menu/Menu.ads.scenario.tsx +0 -27
- package/dist/starters/react/design-system/components/Overlays/Menu/Menu.tsx +0 -194
- package/dist/starters/react/design-system/components/Overlays/Popover/Popover.ads.scenario.tsx +0 -19
- package/dist/starters/react/design-system/components/Overlays/Popover/Popover.tsx +0 -37
- package/dist/starters/react/design-system/controllers/FormField/FormField.ads.behavior.ts +0 -70
- package/dist/starters/react/design-system/controllers/FormField/FormField.behavior.spec.ts +0 -237
- package/dist/starters/react/design-system/controllers/FormField/FormField.ts +0 -343
- package/dist/starters/react/design-system/controllers/FormField/useFormField.ts +0 -70
- package/dist/starters/react/design-system/controllers/Palette/Palette.ts +0 -165
- package/dist/starters/react/design-system/foundation.ads.ts +0 -22
- package/dist/starters/react/design-system/index.ts +0 -51
- package/dist/starters/react/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.fixture.ts +0 -5
- package/dist/starters/react/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.scenario.tsx +0 -22
- package/dist/starters/react/design-system/mocks/Inspector/Inspector.ads.fixture.ts +0 -12
- package/dist/starters/react/design-system/mocks/Inspector/Inspector.ads.scenario.tsx +0 -21
- package/dist/starters/react/design-system/mocks/Workspace/Layouts.ads.scenario.tsx +0 -24
- package/dist/starters/react/design-system/mocks/Workspace/Media.ads.scenario.tsx +0 -24
- package/dist/starters/react/design-system/mocks/Workspace/Stress.ads.scenario.tsx +0 -36
- package/dist/starters/react/design-system/mocks/Workspace/Workspace.ads.fixture.ts +0 -13
- package/dist/starters/react/design-system/mocks/Workspace/Workspace.ads.scenario.tsx +0 -27
- package/dist/starters/react/design-system/mocks/Workspace/media/ads.svg +0 -1
- package/dist/starters/react/design-system/palette.generated.ts +0 -188
- package/dist/starters/react/design-system/patterns/ArtworkCatalogue/ArtworkCatalogue/ArtworkCatalogue.tsx +0 -73
- package/dist/starters/react/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.ads.scenario.tsx +0 -23
- package/dist/starters/react/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.tsx +0 -94
- package/dist/starters/react/design-system/patterns/Forms/InviteMember/InviteMember.ads.scenario.tsx +0 -21
- package/dist/starters/react/design-system/patterns/Forms/InviteMember/InviteMember.tsx +0 -137
- package/dist/starters/react/design-system/patterns/Inspector/Inspector/Inspector.ads.scenario.tsx +0 -22
- package/dist/starters/react/design-system/patterns/Inspector/Inspector/Inspector.tsx +0 -248
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.scenario.tsx +0 -26
- package/dist/starters/react/design-system/patterns/Shell/Shell.tsx +0 -268
- package/dist/starters/react/design-system/patterns/Workspace/Workspace/Workspace.ads.scenario.tsx +0 -28
- package/dist/starters/react/design-system/patterns/Workspace/Workspace/Workspace.tsx +0 -105
- package/dist/starters/react/design-system/patterns/Workspace/Workspace/WorkspacePanels.tsx +0 -179
- package/dist/starters/react/design-system/profiles/Containers/containers.ads.ts +0 -67
- package/dist/starters/react/design-system/profiles/Containers/frames.ads.ts +0 -32
- package/dist/starters/react/design-system/profiles/Containers/geometry.ads.ts +0 -30
- package/dist/starters/react/design-system/profiles/Containers/spacing.ads.ts +0 -26
- package/dist/starters/react/design-system/profiles/Controls/controls.ads.ts +0 -157
- package/dist/starters/react/design-system/profiles/Controls/frames.ads.ts +0 -50
- package/dist/starters/react/design-system/profiles/Controls/spacing.ads.ts +0 -29
- package/dist/starters/react/design-system/profiles/Focus/keyboard.ads.ts +0 -13
- package/dist/starters/react/design-system/profiles/Identity/identity.ads.ts +0 -25
- package/dist/starters/react/design-system/profiles/Identity/spacing.ads.ts +0 -22
- package/dist/starters/react/design-system/profiles/Layout/grid.ads.ts +0 -69
- package/dist/starters/react/design-system/profiles/Layout/inspector.ads.ts +0 -146
- package/dist/starters/react/design-system/profiles/Layout/overlays.ads.ts +0 -94
- package/dist/starters/react/design-system/profiles/Layout/regions.ads.ts +0 -296
- package/dist/starters/react/design-system/profiles/Motion/feedback.ads.ts +0 -92
- package/dist/starters/react/design-system/profiles/Surfaces/controls.ads.ts +0 -142
- package/dist/starters/react/design-system/profiles/Surfaces/document.ads.ts +0 -2
- package/dist/starters/react/design-system/profiles/Surfaces/materials.ads.ts +0 -18
- package/dist/starters/react/design-system/profiles/Surfaces/surfaces.ads.ts +0 -48
- package/dist/starters/react/design-system/profiles/Typography/details.ads.ts +0 -19
- package/dist/starters/react/design-system/profiles/Typography/document.ads.ts +0 -2
- package/dist/starters/react/design-system/profiles/Typography/headings.ads.ts +0 -15
- package/dist/starters/react/design-system/profiles/Typography/text.ads.ts +0 -73
- package/dist/starters/react/design-system/profiles/Visuals/artwork.ads.ts +0 -46
- package/dist/starters/react/design-system/profiles/Visuals/charts.ads.ts +0 -31
- package/dist/starters/react/design-system/profiles/Visuals/content.ads.ts +0 -52
- package/dist/starters/react/design-system/profiles/Visuals/glyphs.ads.ts +0 -35
- package/dist/starters/react/design-system/profiles/Visuals/identity.ads.ts +0 -24
- package/dist/starters/react/design-system/tokens/Artwork/paint.ads.css +0 -7
- package/dist/starters/react/design-system/tokens/Artwork/visual-size.ads.css +0 -12
- package/dist/starters/react/design-system/tokens/Brand/paint.ads.css +0 -7
- package/dist/starters/react/design-system/tokens/Charts/paint.ads.css +0 -19
- package/dist/starters/react/design-system/tokens/Containers/border-width.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Containers/content-gap.ads.css +0 -5
- package/dist/starters/react/design-system/tokens/Containers/frame-inset.ads.css +0 -6
- package/dist/starters/react/design-system/tokens/Containers/frame-size.ads.css +0 -11
- package/dist/starters/react/design-system/tokens/Containers/radius.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Controls/border-width.ads.css +0 -4
- package/dist/starters/react/design-system/tokens/Controls/content-gap.ads.css +0 -6
- package/dist/starters/react/design-system/tokens/Controls/control-min-size.ads.css +0 -17
- package/dist/starters/react/design-system/tokens/Controls/frame-inset.ads.css +0 -21
- package/dist/starters/react/design-system/tokens/Controls/radius.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Controls/target-min-size.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Controls/visual-size.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Focus/border-width.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Focus/focus-offset.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Foundation/spacing.ads.css +0 -20
- package/dist/starters/react/design-system/tokens/Grid/grid-gutter.ads.css +0 -6
- package/dist/starters/react/design-system/tokens/Grid/layer.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Grid/layout-size.ads.css +0 -15
- package/dist/starters/react/design-system/tokens/Grid/spacing.ads.css +0 -12
- package/dist/starters/react/design-system/tokens/Grid/track-count.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Identity/content-gap.ads.css +0 -6
- package/dist/starters/react/design-system/tokens/Identity/visual-size.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Motion/duration.ads.css +0 -6
- package/dist/starters/react/design-system/tokens/Motion/easing.ads.css +0 -5
- package/dist/starters/react/design-system/tokens/Motion/motion-angle.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Motion/motion-distance.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Motion/motion-scale.ads.css +0 -9
- package/dist/starters/react/design-system/tokens/Surfaces/blur.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Surfaces/gradient.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Surfaces/opacity.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Surfaces/paint.ads.css +0 -58
- package/dist/starters/react/design-system/tokens/Surfaces/shadow.ads.css +0 -20
- package/dist/starters/react/design-system/tokens/Typography/font-family.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/font-features.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/font-size.ads.css +0 -9
- package/dist/starters/react/design-system/tokens/Typography/font-stretch.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/font-variations.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/font-weight.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/letter-spacing.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/line-height.ads.css +0 -11
- package/dist/starters/react/design-system/tokens/Typography/word-spacing.ads.css +0 -1
- package/dist/starters/react/starter.json +0 -11
- package/docs/STARTER.md +0 -167
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ role-named sheets, and profiles and recipes are **compile-time macros**
|
|
|
27
27
|
```tsx
|
|
28
28
|
import { recipe } from "@reqvire-org/ads/recipe" with { type: "macro" };
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// A button, shortened: an inline row, the shared control
|
|
31
31
|
// profile, and one text part. No CSS, no values.
|
|
32
32
|
const anatomy = recipe({
|
|
33
33
|
layout: "inline",
|
|
@@ -100,12 +100,16 @@ You need [Bun](https://bun.sh) 1.4.1 or later. ADS brings everything else.
|
|
|
100
100
|
```sh
|
|
101
101
|
bunx @reqvire-org/ads init design --framework react --out ../src/ui
|
|
102
102
|
cd design && bun install
|
|
103
|
+
# author design-system/: foundation.ads.ts, index.ts, tokens, profiles, owners
|
|
103
104
|
bun run lint:ds # ads check
|
|
104
105
|
bun run emit:ds # ads emit → ../src/ui
|
|
105
106
|
```
|
|
106
107
|
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
`ads init` creates the design package (its configuration, dependencies and an
|
|
109
|
+
empty `design-system/` folder); it installs no design system. You author it,
|
|
110
|
+
by hand or with an agent and the [ads-designer skill](skills/README.md), and
|
|
111
|
+
`ads check` names what is missing until it holds. `ads emit` then writes it into
|
|
112
|
+
your application's source. Use `--framework preact` for Preact; leave out
|
|
109
113
|
`--out` for a design library several applications share. See
|
|
110
114
|
[setting up a design package](docs/GUIDE.md#set-up-a-design-package).
|
|
111
115
|
|
|
@@ -156,7 +160,7 @@ system is mostly the quality of its profile list: few, well named, reused.
|
|
|
156
160
|
|
|
157
161
|
**Composition is the main tool.** A profile builds on another with `with` and
|
|
158
162
|
states only what differs. One base decision then serves every use of it: at
|
|
159
|
-
rest, on rollover, while dragged. This is
|
|
163
|
+
rest, on rollover, while dragged. This is a card surface:
|
|
160
164
|
|
|
161
165
|
```ts
|
|
162
166
|
import { profile } from "@reqvire-org/ads/profile" with { type: "macro" };
|
|
@@ -252,7 +256,7 @@ Details: [which unit to use where](docs/TOKEN-ROLES.md#units) and
|
|
|
252
256
|
|
|
253
257
|
| Command | Use |
|
|
254
258
|
| --- | --- |
|
|
255
|
-
| `ads init` | Set up a design package
|
|
259
|
+
| `ads init` | Set up a design package: configuration, dependencies and an empty design-system folder |
|
|
256
260
|
| `ads check` | Check the design system; errors fail, review items are listed |
|
|
257
261
|
| `ads emit` | Check, then write the compiled design system (`--watch`) |
|
|
258
262
|
| `ads validate` | The full gate: check, your scripts, behavior tests and the render audit (`--changed` for what changed) |
|
|
@@ -271,7 +275,6 @@ Details: [which unit to use where](docs/TOKEN-ROLES.md#units) and
|
|
|
271
275
|
| Understand the model and why | [Architecture](docs/ARCHITECTURE.md) |
|
|
272
276
|
| Write design | [Language](docs/LANGUAGE.md) · [Profile kinds](docs/PROFILE-KINDS.md) · [Profiles](docs/PROFILES.md) · [Token roles](docs/TOKEN-ROLES.md) · [Motion](docs/MOTION.md) · [Assets](docs/ASSETS.md) |
|
|
273
277
|
| Look up a rule or error | [Every rule by group](docs/RULES.md) · [Contract](docs/ADS.md) |
|
|
274
|
-
| See what the starter contains | [Starter](docs/STARTER.md) |
|
|
275
278
|
| Upgrade from an earlier version | [ads-migrate](skills/ads-migrate/SKILL.md) · [Changelog](docs/CHANGELOG.md) |
|
|
276
279
|
|
|
277
280
|
## Contributing
|
package/dist/ads-errors.mjs
CHANGED
|
@@ -148,8 +148,8 @@ export const choiceErrors = {
|
|
|
148
148
|
group: "unanalyzable",
|
|
149
149
|
rule: "Design is selected from a finite set of choices ADS can enumerate, so every rendered combination can be checked.",
|
|
150
150
|
guides: [RECIPES, "ads://guides/atomic-styles"],
|
|
151
|
-
message: () => "A value that selects design does not come from a finite set of choices."
|
|
152
|
-
repair: "Type the selecting prop or variable as a literal union (or a const record key) so every choice can be enumerated."
|
|
151
|
+
message: (problem) => problem.falsy === void 0 ? "A value that selects design does not come from a finite set of choices." : `\`${problem.falsy}\` selects design by a test that is not a finite choice: its type admits a given value that is falsy (\`0\`, \`""\`, \`false\` or \`null\`). Test \`!== undefined\`.`,
|
|
152
|
+
repair: "Type the selecting prop or variable as a literal union (or a const record key) so every choice can be enumerated. An optional object, callback or node prop selects by whether it is given: test a node (or any type that admits text, a number or a boolean) with `!== undefined`, never by truthiness."
|
|
153
153
|
},
|
|
154
154
|
"work-limit": {
|
|
155
155
|
group: "unanalyzable",
|
|
@@ -362,6 +362,13 @@ export const choiceErrors = {
|
|
|
362
362
|
message: (failure) => `The owner writes styling through the DOM (\`${failure.member}\`).`,
|
|
363
363
|
repair: "Declare the value in the recipe's `measured` clause and write it with `recipe.measured.set(element, { \u2026 })`; any other styling belongs in the recipe."
|
|
364
364
|
},
|
|
365
|
+
"script-animation": {
|
|
366
|
+
group: "design-bypass",
|
|
367
|
+
rule: "An animation is defined in a recipe and controlled in script. Its keyframes, duration and easing are design: they come from tokens through a recipe construct (`transition`, `paintTransition`, `enter`, a `play` of a sequence, a measured value's `motion`) and are at rest under reduced motion. Script may control what the recipe declared (`getAnimations()`, then `finished`, `cancel()`, `pause()`, `play()`, `currentTime`, and the animation and transition events) and may set measured values. It may not define an animation: `element.animate(\u2026)`, `new Animation(\u2026)`, `new KeyframeEffect(\u2026)` and `setKeyframes(\u2026)` put raw design values in script, outside tokens and outside the reduced-motion policy.",
|
|
368
|
+
guides: [RECIPES, "ads://guides/accessibility"],
|
|
369
|
+
message: (failure) => `The module defines an animation in script (\`${failure.member}\`).`,
|
|
370
|
+
repair: "Declare the motion in the recipe: a state `transition` or `paintTransition`, an `enter`, a sequence played by `play` (once, looping or alternating), or `motion` on a measured value. Start and stop it with an owner state; wait for it, cancel it or seek it through `element.getAnimations()`."
|
|
371
|
+
},
|
|
365
372
|
"plain-stylesheet-import": {
|
|
366
373
|
group: "design-bypass",
|
|
367
374
|
rule: "Styling exists only in owners: a module that authors no recipe imports no stylesheet.",
|
|
@@ -579,12 +586,19 @@ export const choiceErrors = {
|
|
|
579
586
|
message: (problem) => `${framePlace(problem)} ${problem.frame} needs ${pixels(problem.inlinePx)} (its ${problem.field}), but has ${pixels(problem.regionPx)} ${problem.tier === "every tier" ? "in its tile at every tier" : `at the lower edge of ${problem.tier}`}${problem.condition === null ? "" : ` while ${problem.condition} holds`} under ${problem.context}.`,
|
|
580
587
|
repair: "Span the cell over more tracks at that tier (or widen the tile), give the frame a smaller fixed size or cap it to its region (`max-inline-size` of 100%, `min(100%, \u2026)`), reduce the insets around it, or place it where it fits."
|
|
581
588
|
},
|
|
589
|
+
"keyline-missed": {
|
|
590
|
+
group: "wrong-value",
|
|
591
|
+
rule: "In a grid, text starts on one keyline: the start inset of the spatial profile's `wide` gutter, which a grid takes when it names no gutter. A grid on another gutter mode (`narrow`, `condensed`) starts its cells nearer the column line, so a padded frame in such a cell (a card) puts its content back on the keyline: that gutter's start inset and the frame's inline padding add up to the wide gutter's start, within the profile's fine unit, in every theme and brand. Borders are not counted: a border is the frame's edge, its width may change with the theme, and no inset token may be derived from a border width, so text sits a border's width past the keyline. The rule applies to the cell's own container frame, or to the first padded container frame inside it. A control's inset is its own (a button, a tile), a frame without inline padding is flush by choice, and `gutter: \"none\"` grids (structural layouts such as an application shell) have no text keyline. A public component placed in such a cell is checked across owners (`component-keyline`).",
|
|
592
|
+
guides: [RECIPES, "ads://guides/layout"],
|
|
593
|
+
message: (problem) => `${framePlace(problem)} ${problem.frame} starts its content ${pixels(problem.insetPx)} from the column line (the ${problem.gutter} gutter's start and its inline padding; borders are not counted), but the text keyline of this grid is ${pixels(problem.keylinePx)} (the wide gutter's start) under ${problem.context}: its text is ${pixels(Math.abs(problem.insetPx - problem.keylinePx))} ${problem.insetPx > problem.keylinePx ? "past" : "short of"} the keyline, more than the profile's fine unit (${pixels(problem.tolerancePx)}).`,
|
|
594
|
+
repair: "Give the frame an inline padding that, with the gutter's start, comes within the fine unit of the wide gutter's start (a frame profile whose `paddingInline` token is the wide gutter's start), or place the frame in a wide-gutter grid, or remove its inline padding so its content is flush."
|
|
595
|
+
},
|
|
582
596
|
"form-state-colour-only": {
|
|
583
597
|
group: "accessibility-semantics",
|
|
584
598
|
rule: 'A field\'s error state (`[data-user-invalid]`, `[data-invalid]`, `[aria-invalid="true"]`) and its autofill state (`[data-autofill]`) are not shown by colour alone (WCAG 1.4.1): some element\'s treatment under the state adds a cue that is not a hue: an edge or ring (`boxShadow`), a pattern (`backgroundImage`) or a border that appears (`borderStyle: "solid"`).',
|
|
585
599
|
guides: [FORMS, RECIPES, "ads://guides/accessibility"],
|
|
586
600
|
message: (failure) => `The ${failure.state} state (${failure.condition}) changes only colours: nothing under it shows the state to someone who cannot tell the hues apart.`,
|
|
587
|
-
repair: "Give the state's surface a ring or edge (`boxShadow` with an inset ring token, such as
|
|
601
|
+
repair: "Give the state's surface a ring or edge (`boxShadow` with an inset ring token, such as `--shadow-invalid`) on the control, or another non-hue cue; colour changes may stay beside it."
|
|
588
602
|
},
|
|
589
603
|
"autofill-layout-shift": {
|
|
590
604
|
group: "wrong-value",
|
|
@@ -621,6 +635,13 @@ export const choiceErrors = {
|
|
|
621
635
|
message: (failure) => `Part "${failure.part}" clamps its text, but it is or is inside ${failure.element}, a control or its label.`,
|
|
622
636
|
repair: 'Let the control\'s text wrap (remove `lines` and `wrap: "truncate"`), shorten the text, or clamp a description outside the control.'
|
|
623
637
|
},
|
|
638
|
+
"resize-not-textarea": {
|
|
639
|
+
group: "structure-mismatch",
|
|
640
|
+
rule: "`normalize.resize` states how the user may resize a multi-line text field: it belongs on a part rendered as `<textarea>`. No other element has a resize handle in this language; a region's size comes from its recipe.",
|
|
641
|
+
guides: [RECIPES],
|
|
642
|
+
message: (failure) => `Part "${failure.part}" declares \`resize\` but is rendered as <${failure.element}>.`,
|
|
643
|
+
repair: "Declare `resize` on the part rendered as `<textarea>`, or remove it."
|
|
644
|
+
},
|
|
624
645
|
"pointer-transparent-interactive": {
|
|
625
646
|
group: "accessibility-semantics",
|
|
626
647
|
rule: '`pointerEvents: "none"` is for decorative overlays: never on a focusable element, and only on markup hidden from assistive technology (`aria-hidden`) or free of interactive content.',
|
|
@@ -775,6 +796,27 @@ export const choiceErrors = {
|
|
|
775
796
|
message: () => "The image of a visual part has no alt attribute.",
|
|
776
797
|
repair: 'Set `alt` to the text alternative, or `alt=""` when the image is decorative.'
|
|
777
798
|
},
|
|
799
|
+
"scheme-image-element": {
|
|
800
|
+
group: "structure-mismatch",
|
|
801
|
+
rule: "A part that declares `scheme` is one file of a content image's light and dark pair: it is rendered as an `<img>` without an artwork binding. Declared artwork has its own theme variants.",
|
|
802
|
+
guides: [RECIPES, "ads://guides/branding"],
|
|
803
|
+
message: (failure) => `Part "${failure.part}" declares \`scheme\` but is rendered as <${failure.element}>${failure.element === "img" ? " with an artwork binding" : ""}.`,
|
|
804
|
+
repair: "Render both scheme parts as plain `<img>` elements whose `src` the application supplies, or remove `scheme`."
|
|
805
|
+
},
|
|
806
|
+
"scheme-image-size-missing": {
|
|
807
|
+
group: "structure-mismatch",
|
|
808
|
+
rule: "Both images of a light and dark pair state `width` and `height`: each file's own pixel size, so the box is reserved before either loads and the page does not move when the theme changes.",
|
|
809
|
+
guides: [RECIPES],
|
|
810
|
+
message: (failure) => `The image of part "${failure.part}" has no ${failure.attribute} attribute.`,
|
|
811
|
+
repair: "Set `width` and `height` on both images from each file's own pixel size."
|
|
812
|
+
},
|
|
813
|
+
"scheme-image-not-lazy": {
|
|
814
|
+
group: "structure-mismatch",
|
|
815
|
+
rule: 'In a light and dark image pair, the image of the scheme the default theme (the first declared) does not have is `loading="lazy"` in every choice: a hidden lazy image is not downloaded, an eager one is. Only the default scheme\'s image may load eagerly.',
|
|
816
|
+
guides: [RECIPES],
|
|
817
|
+
message: (failure) => `The ${failure.scheme} image of part "${failure.part}" is not always loading="lazy"; the default theme is ${failure.defaultScheme}, so this file would be downloaded while hidden.`,
|
|
818
|
+
repair: 'Write `loading="lazy"` on that image as a literal and apply any priority (eager loading, `fetchPriority`) to the default scheme\'s image only.'
|
|
819
|
+
},
|
|
778
820
|
"image-alt-missing": {
|
|
779
821
|
group: "accessibility-semantics",
|
|
780
822
|
rule: "Every `<img>` an owner renders states its text alternative (WCAG 2.2 1.1.1): content media and any other image, as artwork images do; decorative images state it as empty.",
|
|
@@ -891,7 +933,7 @@ export const choiceErrors = {
|
|
|
891
933
|
},
|
|
892
934
|
"condition-unsupported": {
|
|
893
935
|
group: "wrong-value",
|
|
894
|
-
rule: "A `when` condition selects a state of the owner's root: `&` followed by interaction or form pseudo-classes (:hover, :active, :focus, :focus-visible, :focus-within, :disabled, :enabled, :checked, :indeterminate), `[aria-*]`, `[data-*]` or `[open]` attributes with an optional quoted value, each optionally inside :not(). Pseudo-elements, combinators, classes and other selectors are not states.",
|
|
936
|
+
rule: "A `when` condition selects a state of the owner's root: `&` followed by interaction or form pseudo-classes (:hover, :active, :focus, :focus-visible, :focus-within, :disabled, :enabled, :checked, :indeterminate), `[aria-*]`, `[data-*]` or `[open]` attributes with an optional quoted value, each optionally inside :not(). A state of one of the recipe's own direct parts is written `:has(> .part:state)` with :checked, :indeterminate, :focus-visible, :hover or :disabled (a checkbox's native input, a textarea's own hover). Pseudo-elements, combinators, classes and other selectors are not states.",
|
|
895
937
|
guides: [RECIPES],
|
|
896
938
|
message: (failure) => `${failure.construction} spec: condition ${failure.condition} at ${failure.path} ${conditionProblem(failure.problem)}.`,
|
|
897
939
|
repair: "Write the condition as owner states only. Style a pseudo-element with the part's `pseudo` treatment (for example `pseudo: { placeholder: { surface } }`), and a child through its own part."
|
|
@@ -927,6 +969,10 @@ function conditionProblem(problem) {
|
|
|
927
969
|
return `has ${problem.text} at offset ${problem.at}, which is not an owner state (a combinator, class, type, nested & or attribute operator)`;
|
|
928
970
|
case "state-repeated":
|
|
929
971
|
return `repeats ${problem.state}`;
|
|
972
|
+
case "part-state-unsupported":
|
|
973
|
+
return `has ${problem.text}; a part's state is written \`:has(> .part:state)\` with one of :checked, :indeterminate, :focus-visible, :hover or :disabled`;
|
|
974
|
+
case "part-unknown":
|
|
975
|
+
return `reads a state of ${problem.part}, which is not a direct part of this recipe`;
|
|
930
976
|
}
|
|
931
977
|
}
|
|
932
978
|
export const constructionErrors = {
|
|
@@ -951,6 +997,140 @@ export const constructionErrors = {
|
|
|
951
997
|
message: (failure) => `Profile ${failure.profile}.${failure.field} has unsupported value ${failure.value}.`,
|
|
952
998
|
repair: "Use a value this construction can lower."
|
|
953
999
|
},
|
|
1000
|
+
"surface-effect-misplaced": {
|
|
1001
|
+
group: "wrong-value",
|
|
1002
|
+
rule: "A shadow that follows an element's shape is declared where it belongs. `shapeShadow` is a visual part's (an image, artwork, a glyph), which has nothing inside it. `groupShadow` is a container's choice: everything inside it casts one shadow. A surface declares at most one of them. `boxShadow` remains the shadow of an element's box and suits any rectangular or rounded element. A `mask` fades a drawing (a visual part) or the edge of an element that scrolls; on any other container its text would fade where it stands, and that cannot be proven readable.",
|
|
1003
|
+
guides: [RECIPES, "ads://guides/tokens"],
|
|
1004
|
+
message: (failure) => {
|
|
1005
|
+
switch (failure.reason) {
|
|
1006
|
+
case "both":
|
|
1007
|
+
return `Surface ${failure.surface} declares both shapeShadow and groupShadow: an element casts one shadow that follows its shape.`;
|
|
1008
|
+
case "shape-on-container":
|
|
1009
|
+
return `Surface ${failure.surface} declares shapeShadow, but it is applied to a container: the shadow would follow everything inside it.`;
|
|
1010
|
+
case "group-on-visual":
|
|
1011
|
+
return `Surface ${failure.surface} declares groupShadow, but it is applied to a visual part, which has nothing inside it.`;
|
|
1012
|
+
case "mask-on-container":
|
|
1013
|
+
return `Surface ${failure.surface} declares mask, but it is applied to a container that does not scroll: its content, text included, would fade where it stands.`;
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
repair: "On a visual part use `shapeShadow`; on a container use `boxShadow` for the shadow of its box, or `groupShadow` when one shadow for everything inside it is what you want. Put a `mask` on a visual part, or on an element whose `overflow` scrolls. Give each element its own surface profile where they differ."
|
|
1017
|
+
},
|
|
1018
|
+
"surface-shadow-layer": {
|
|
1019
|
+
group: "wrong-value",
|
|
1020
|
+
rule: "A `shapeShadow` or `groupShadow` token is one shadow layer in every theme and brand: two offsets, an optional blur and a colour. `filter: drop-shadow()` takes no second layer, no spread and no `inset`, and `none` is not a shadow to cast; a shadow token with those is for `boxShadow`.",
|
|
1021
|
+
guides: ["ads://guides/tokens", RECIPES],
|
|
1022
|
+
message: (failure) => {
|
|
1023
|
+
const why = {
|
|
1024
|
+
none: "is `none`",
|
|
1025
|
+
"several-layers": "has more than one layer",
|
|
1026
|
+
inset: "is an `inset` shadow",
|
|
1027
|
+
spread: "has a spread (a fourth length)",
|
|
1028
|
+
unresolved: "does not resolve to a value"
|
|
1029
|
+
}[failure.problem];
|
|
1030
|
+
return `Surface ${failure.surface}'s ${failure.field === "shape-shadow" ? "shapeShadow" : "groupShadow"} ${failure.value} ${why} under ${failure.context}: a shadow that follows a shape is one layer of offsets, blur and colour.`;
|
|
1031
|
+
},
|
|
1032
|
+
repair: "Give the field its own shadow token with one layer and no spread, in every theme and brand, or use `boxShadow` for this shadow."
|
|
1033
|
+
},
|
|
1034
|
+
"prose-contrast-insufficient": {
|
|
1035
|
+
group: "accessibility-semantics",
|
|
1036
|
+
rule: "Text in prose reaches the contrast minimum (WCAG 2.2 1.4.3: 4.5:1, or 3:1 for provably large text) on every surface it can sit on, in every theme and brand: each declared element's colour on the prose root's background and on the background of each declared element that can contain it (a link in a quote, text in a table cell or a code block), in its base and state surfaces.",
|
|
1037
|
+
guides: ["ads://guides/accessibility", RECIPES],
|
|
1038
|
+
message: (failure) => `Prose element ${failure.element} draws ${failure.foreground} on ${failure.background} (${failure.on}) under ${failure.context}: ${failure.ratio.toFixed(2)}:1, below ${failure.minimum}:1.`,
|
|
1039
|
+
repair: "Change the element's colour or the surface it sits on until the pair passes in every theme and brand; give an element inside a tinted container (a quote, a code block) its own colour there by tinting the container's surface, not by a one-off value."
|
|
1040
|
+
},
|
|
1041
|
+
"condition-visual-unsupported": {
|
|
1042
|
+
group: "unsupported",
|
|
1043
|
+
rule: "A part's condition (`at`) may select another visual profile, so the drawing is another size in that range. The part is a visual part that draws registered artwork or contained application media, and both sizes select the same drawing: a condition is a media query and cannot swap the file.",
|
|
1044
|
+
guides: [RECIPES, "ads://guides/layout"],
|
|
1045
|
+
message: (failure) => {
|
|
1046
|
+
switch (failure.reason) {
|
|
1047
|
+
case "not-visual":
|
|
1048
|
+
return `Part ${failure.part} selects a visual profile under ${failure.condition}, but it is not a visual part.`;
|
|
1049
|
+
case "media":
|
|
1050
|
+
return `Part ${failure.part} selects a visual profile under ${failure.condition}, but its drawing (cropped or inspected media) is not sized by its profile.`;
|
|
1051
|
+
case "drawing-differs":
|
|
1052
|
+
return `Part ${failure.part} selects a visual profile under ${failure.condition} whose size selects another drawing of the asset: a condition cannot swap the file.`;
|
|
1053
|
+
}
|
|
1054
|
+
},
|
|
1055
|
+
repair: 'Put `at.<condition>.visual` on a `kind: "visual"` part that draws registered artwork or contained media, and choose sizes within one drawing\'s range (or declare one drawing for both sizes).'
|
|
1056
|
+
},
|
|
1057
|
+
"sequence-steps-invalid": {
|
|
1058
|
+
group: "wrong-value",
|
|
1059
|
+
rule: "A sequence profile has at least two steps, each at a distinct whole percentage of the run, from 0 to 100.",
|
|
1060
|
+
guides: [RECIPES],
|
|
1061
|
+
message: (failure) => `Sequence ${failure.profile}: ${failure.detail}.`,
|
|
1062
|
+
repair: "Give the sequence a step at 0 and a step at 100, and distinct whole percentages between them."
|
|
1063
|
+
},
|
|
1064
|
+
"sequence-not-seamless": {
|
|
1065
|
+
group: "wrong-value",
|
|
1066
|
+
rule: 'A looping sequence ends where it starts: its step at 100 states the same values as its step at 0, so the loop has no jump. A sequence that should run forward then backward declares `repeat: "alternate"`; one that plays one time declares `repeat: "once"`.',
|
|
1067
|
+
guides: [RECIPES],
|
|
1068
|
+
message: (failure) => `Sequence ${failure.profile} loops, but its last step differs from its first in ${failure.field}: the loop would jump.`,
|
|
1069
|
+
repair: 'Make the step at 100 state the values of the step at 0, or declare `repeat: "alternate"` or `repeat: "once"` in the profile.'
|
|
1070
|
+
},
|
|
1071
|
+
"sequence-step-field": {
|
|
1072
|
+
group: "wrong-value",
|
|
1073
|
+
rule: "A step of a sequence states what the part looks like there: `opacity`, travel (`translateInline`, `translateBlock`), one scale (`scale`, or `scaleInline` or `scaleBlock` for one axis) and `rotate`, each from a token of its role. A step states at least one, and one scale.",
|
|
1074
|
+
guides: [RECIPES],
|
|
1075
|
+
message: (failure) => failure.field === "" ? `Sequence ${failure.profile}: its step at ${failure.at} states nothing.` : `Sequence ${failure.profile}: its step at ${failure.at} cannot state ${failure.field}.`,
|
|
1076
|
+
repair: "State one of the step fields with a token of its role (opacity, motion-distance, motion-scale, motion-angle), and at most one scale per step."
|
|
1077
|
+
},
|
|
1078
|
+
"sequence-stagger-missing": {
|
|
1079
|
+
group: "wrong-value",
|
|
1080
|
+
rule: "A part's `order` starts it that many staggers after the first, so parts that share a sequence run in turn. The stagger is the sequence profile's `stagger` (role `duration`).",
|
|
1081
|
+
guides: [RECIPES],
|
|
1082
|
+
message: (failure) => `A part plays sequence ${failure.profile} with an order, but the profile states no stagger.`,
|
|
1083
|
+
repair: "Give the sequence profile a `stagger` token, or remove `order` from the part."
|
|
1084
|
+
},
|
|
1085
|
+
"state-text-field": {
|
|
1086
|
+
group: "wrong-value",
|
|
1087
|
+
rule: "A text profile selected under an owner state (`when: { state: { text } }`) changes the weight and the tracking only (`font-weight`, `letter-spacing`): the family, the size, the line height and every other text property stay the element's own, so the state moves neither the line nor the box's height.",
|
|
1088
|
+
guides: [RECIPES],
|
|
1089
|
+
message: (failure) => `${failure.element === "&" ? "The root" : `Part ${failure.element}`} takes text profile ${failure.profile} under a state, which changes ${failure.property}.`,
|
|
1090
|
+
repair: "Derive the state's text profile from the element's own (`extends`) and change only `weight` or `letterSpacing`; a different size or family is a different element or a recipe choice, not a state."
|
|
1091
|
+
},
|
|
1092
|
+
"outset-unsupported": {
|
|
1093
|
+
group: "structure-mismatch",
|
|
1094
|
+
rule: "`outset` draws a decorative backdrop past its parent's box (a glow behind a card): it belongs on a part of a `layered` parent that holds no parts and no text. The parent's box and the layout around it do not change.",
|
|
1095
|
+
guides: [RECIPES],
|
|
1096
|
+
message: (failure) => `Part ${failure.part} declares \`outset\` but is not a childless, non-text layer of a layered parent.`,
|
|
1097
|
+
repair: 'Make the parent `layout: "layered"` (root or a part\'s `recipe`) with the backdrop as its first part, and keep content in the other layers.'
|
|
1098
|
+
},
|
|
1099
|
+
"scheme-unsupported": {
|
|
1100
|
+
group: "structure-mismatch",
|
|
1101
|
+
rule: "`scheme` marks one file of a content image's light and dark pair: it belongs on a visual part rendered as an `<img>` without an artwork binding. Declared artwork selects its drawing by theme through its own variants.",
|
|
1102
|
+
guides: [RECIPES, "ads://guides/branding"],
|
|
1103
|
+
message: (failure) => `Part ${failure.part} declares \`scheme\` but is not a content image.`,
|
|
1104
|
+
repair: "Render the part as an `<img>` whose `src` the application supplies, or remove `scheme` and give the declared asset a variant for the other theme."
|
|
1105
|
+
},
|
|
1106
|
+
"state-text-unbound": {
|
|
1107
|
+
group: "unresolved-reference",
|
|
1108
|
+
rule: "A text profile selected under an owner state changes the element's own text: the element is a text part, a control, or a root or part that names a `text` profile.",
|
|
1109
|
+
guides: [RECIPES],
|
|
1110
|
+
message: (failure) => `${failure.element === "&" ? "The root" : `Part ${failure.element}`} takes text profile ${failure.profile} under a state but has no text profile of its own.`,
|
|
1111
|
+
repair: "Give the element its `text` profile, or move the state's `text` to the text part it should change."
|
|
1112
|
+
},
|
|
1113
|
+
"sequence-property-conflict": {
|
|
1114
|
+
group: "conflict",
|
|
1115
|
+
rule: "A property has one source of motion on an element. A property a part's sequence animates (`opacity`, `translate`, `scale`, `rotate`) is not also moved by the part's own `transition`, its paint transition's `opacity` channel or its `enter`.",
|
|
1116
|
+
guides: [RECIPES],
|
|
1117
|
+
message: (failure) => `Part ${failure.part} plays sequence ${failure.profile}, which animates ${failure.property}; the part already moves that property another way.`,
|
|
1118
|
+
repair: "Put the sequence on a wrapping part, or remove the other motion of that property from this part."
|
|
1119
|
+
},
|
|
1120
|
+
"enter-surface-unsupported": {
|
|
1121
|
+
group: "unsupported",
|
|
1122
|
+
rule: "An entrance's starting surface (`enter.from.surface`) states only `opacity` and `blur`, and at least one of them: each has an obvious resting value, opaque and sharp. A starting background, colour, border or shadow would be a second design for the element, which belongs to a state (`when`), not an entrance.",
|
|
1123
|
+
guides: [RECIPES],
|
|
1124
|
+
message: (failure) => failure.field === null ? `The entrance of ${failure.element} starts from surface ${failure.surface}, which states neither opacity nor blur.` : `The entrance of ${failure.element} starts from surface ${failure.surface}, which states ${failure.field}: a starting surface states only opacity and blur.`,
|
|
1125
|
+
repair: "Give the entrance its own surface profile with `opacity`, `blur` or both, and nothing else."
|
|
1126
|
+
},
|
|
1127
|
+
"enter-property-conflict": {
|
|
1128
|
+
group: "conflict",
|
|
1129
|
+
rule: "A property has one timing on an element. A property an entrance animates (`opacity`, `filter` for a starting blur, or its `translate`, `scale` or `rotate`) is not also transitioned by the element's `paintTransition` channels or its press.",
|
|
1130
|
+
guides: [RECIPES],
|
|
1131
|
+
message: (failure) => `The entrance of ${failure.element} animates ${failure.property}, which the element already transitions over another timing.`,
|
|
1132
|
+
repair: "Enter through another property, or put the entrance on a wrapping part and keep the transition on this element."
|
|
1133
|
+
},
|
|
954
1134
|
"content-missing": {
|
|
955
1135
|
group: "structure-mismatch",
|
|
956
1136
|
rule: "A control renders text or artwork in every reachable choice, so it is never empty.",
|
|
@@ -1030,10 +1210,10 @@ export const constructionErrors = {
|
|
|
1030
1210
|
},
|
|
1031
1211
|
"paint-transition-effect-unsupported": {
|
|
1032
1212
|
group: "unsupported",
|
|
1033
|
-
rule: "
|
|
1213
|
+
rule: "What changes between a transitioned element's surfaces interpolates. A gradient image never does, so such an element has none. A surface effect does through its own channel: `filter` for `blur`, `shapeShadow` and `groupShadow`, `backdrop-filter` for `backdropBlur` and `backdropSaturate`. An effect that changes between the surfaces without its channel listed would snap while the paints transition.",
|
|
1034
1214
|
guides: [RECIPES],
|
|
1035
|
-
message: (failure) => `The paint transition on ${failure.element} uses surface ${failure.surface}, whose ${failure.
|
|
1036
|
-
repair: "
|
|
1215
|
+
message: (failure) => failure.field === "background-image" ? `The paint transition on ${failure.element} uses surface ${failure.surface}, whose background image does not interpolate.` : `The paint transition on ${failure.element} does not list the channel of ${failure.field}, which surface ${failure.surface} changes: it would snap while the paints transition.`,
|
|
1216
|
+
repair: "Add `filter` or `backdrop-filter` to the transition's `channels` for an effect that changes, use surfaces without a gradient image on a transitioned element, or remove its paint transition."
|
|
1037
1217
|
},
|
|
1038
1218
|
"pseudo-surface-unsupported": {
|
|
1039
1219
|
group: "wrong-value",
|
|
@@ -1065,7 +1245,7 @@ export const constructionErrors = {
|
|
|
1065
1245
|
},
|
|
1066
1246
|
"state-contrast-insufficient": {
|
|
1067
1247
|
group: "accessibility-semantics",
|
|
1068
|
-
rule: `An element's owner states keep
|
|
1248
|
+
rule: `An element's owner states keep it readable (text 4.5:1 or 3:1 when large; a visual part's or a text-less control's artwork 3:1; artwork hidden from assistive technology has no minimum): where a state's colour meets a background from another surface profile (a colour-only state over the base fill, a state fill under the base colour), the pair has at least 4.5:1 contrast in every theme, brand and condition, or 3:1 where the element's text profile makes its text large there (at least 24px, or 18.66px at weight 700); a state that holds only while the element is inactive (:disabled, [aria-disabled="true"]) has no minimum (WCAG 2.2 1.4.3). Two states that cannot hold on one root together (two values of one attribute, a state and its :not(), :disabled and :enabled) are not paired.`,
|
|
1069
1249
|
guides: [RECIPES, "ads://guides/accessibility", "ads://guides/tokens"],
|
|
1070
1250
|
message: (failure) => `${failure.element === "&" ? "The root" : `Part "${failure.element}"`} pairs colour ${failure.foreground} (${failure.surfaces[0]}, state ${failure.states[0] ?? "base"}) with background ${failure.background} (${failure.surfaces[1]}, state ${failure.states[1] ?? "base"}) at ${failure.ratio}:1 under ${failure.context}; text needs ${failure.minimum}:1.`,
|
|
1071
1251
|
repair: "Treat the state with a surface that sets both its colour and background, or choose colour and background tokens that contrast in that context."
|
|
@@ -1080,6 +1260,13 @@ export const constructionErrors = {
|
|
|
1080
1260
|
].join(" and ")}; a pointer target needs ${pixels(failure.minimumPx)} \xD7 ${pixels(failure.minimumPx)}.`,
|
|
1081
1261
|
repair: "Raise the frame profile's min-block-size, padding-inline or the visual size in that context, or give the frame a min-target-inline-size / min-target-block-size hit area of at least 24px."
|
|
1082
1262
|
},
|
|
1263
|
+
"corner-overpaint": {
|
|
1264
|
+
group: "conflict",
|
|
1265
|
+
rule: "A rounded frame's corners stay rounded. A region root whose frame profile declares a `radius`, with visible overflow and no inset on a corner's edges, does not clip what it holds: a part that reaches that corner (the first or last part of a stack, a layer of a layered root) and paints a background of its own draws a square corner over the curve. ADS does not clip for the author, because clipping also cuts focus outlines, shadows and menus.",
|
|
1266
|
+
guides: [RECIPES],
|
|
1267
|
+
message: (failure) => `Part "${failure.part}" paints the background of surface ${failure.surface}${failure.state === null ? "" : ` (state ${failure.state})`} over the root's rounded ${failure.corners.join(", ")} corner${failure.corners.length === 1 ? "" : "s"}: the root has a radius, visible overflow and no inset there.`,
|
|
1268
|
+
repair: 'Choose one: clip the root (`overflow: "clip"`), inset it (padding in its frame profile), or round the part (a `frame: { profile }` whose frame profile has the matching radius). Name the rounded corners with `frame: { corners }` when only some are rounded.'
|
|
1269
|
+
},
|
|
1083
1270
|
"non-text-contrast-insufficient": {
|
|
1084
1271
|
group: "accessibility-semantics",
|
|
1085
1272
|
rule: "A control part inside a known surface keeps its boundary and focus visible (WCAG 2.2 1.4.11): where its own background does not reach 3:1 against the enclosing background, its border colour (base and each owner state) does; its focus outline colour reaches 3:1 against what it sits on (the enclosing background outside the box, its own inside), in every theme, brand and condition.",
|
|
@@ -1830,6 +2017,15 @@ export const runtimeErrors = {
|
|
|
1830
2017
|
repair: "Check the named elements by hand in the scenario's capture or showcase preview, and fix the owning style only if it actually fails the criterion.",
|
|
1831
2018
|
emitters: ["src/render-audit.mts"]
|
|
1832
2019
|
},
|
|
2020
|
+
"a11y-motion-endless": {
|
|
2021
|
+
group: "accessibility-semantics",
|
|
2022
|
+
severity: "info",
|
|
2023
|
+
rule: "A recipe root, a part or an artwork that plays a repeating sequence whenever it is rendered is noted: motion that starts by itself, runs longer than five seconds and is shown beside other content must be pausable, stoppable or hideable (WCAG 2.2 2.2.2), and the owner has no state to stop this one by. Reduced motion stops it only for users who set that preference.",
|
|
2024
|
+
guides: ["ads://guides/accessibility"],
|
|
2025
|
+
repair: "Play the sequence under an owner state the user can end, or render the part only while the work it stands for is in progress.",
|
|
2026
|
+
emitters: ["src/owner-analysis-check.mts"],
|
|
2027
|
+
situations: "an owner-analysis note with code review/motion-endless, at the `play` in its recipe (a root's, a region part's, a control artwork's or a standalone artwork's); a sequence whose profile declares `repeat: \"once\"` and a `play` inside a `when` entry are not noted."
|
|
2028
|
+
},
|
|
1833
2029
|
"a11y-keyboard": {
|
|
1834
2030
|
group: "accessibility-semantics",
|
|
1835
2031
|
severity: "review",
|
|
@@ -1938,6 +2134,15 @@ export const runtimeErrors = {
|
|
|
1938
2134
|
emitters: ["src/app-icon-checks.mts", "src/owner-analysis-check.mts"],
|
|
1939
2135
|
situations: "located at appIcon.maskable in foundation.ads.ts; the safe zone and the full bleed are read from the drawing rendered at 256 px."
|
|
1940
2136
|
},
|
|
2137
|
+
"source-unreached": {
|
|
2138
|
+
group: "project-files",
|
|
2139
|
+
severity: "review",
|
|
2140
|
+
rule: "A source file of a design system is reached from its public entry: an owner the barrel exports, or a module such an owner imports. ADS reads a design system through that import closure, so a script outside it is checked by nothing (no token, contrast, layout or accessibility rule runs on it) and is not emitted. It is reviewed, not refused: a file can be outside the entry on purpose for a while (a module only a behaviour contract or a test names, an owner being added or retired). Design declarations (`*.ads.ts`), scenarios, fixtures, tests and mocks have their own readers and are not concerned.",
|
|
2141
|
+
guides: ["ads://guides/layers", "ads://guides/contracts"],
|
|
2142
|
+
repair: "Export the file's owner from the public entry, import it from an owner that is exported, or delete the file. A component kept for later belongs on a branch, not in the design system.",
|
|
2143
|
+
emitters: ["src/owner-analysis-check.mts"],
|
|
2144
|
+
situations: "located at the file, line 1; reported only when every owner and plain module analyzed, because a failed owner's imports are unknown."
|
|
2145
|
+
},
|
|
1941
2146
|
"asset-unused": {
|
|
1942
2147
|
group: "project-files",
|
|
1943
2148
|
severity: "error",
|
|
@@ -2194,6 +2399,15 @@ export const runtimeErrors = {
|
|
|
2194
2399
|
emitters: ["src/owner-analysis-check.mts"],
|
|
2195
2400
|
situations: "located at the declaration's display field."
|
|
2196
2401
|
},
|
|
2402
|
+
"font-fallback": {
|
|
2403
|
+
group: "wrong-value",
|
|
2404
|
+
severity: "error",
|
|
2405
|
+
rule: 'A font() declaration with `fallback` makes ADS emit a system font matched to the family\'s measurements under the name "<family> Fallback". Every font-family token that names the family first names that fallback family right after it, in every theme and brand; otherwise the matched face is never drawn and text moves when the family loads.',
|
|
2406
|
+
guides: ["ads://guides/performance", "ads://guides/tokens"],
|
|
2407
|
+
repair: 'Write the token as "<family>", "<family> Fallback", then the generic families (for example "Karla", "Karla Fallback", system-ui, sans-serif), or remove `fallback` from the font declaration.',
|
|
2408
|
+
emitters: ["src/owner-analysis-check.mts"],
|
|
2409
|
+
situations: "located at the token's definition in its font-family sheet; the message names the token, the family and the contexts."
|
|
2410
|
+
},
|
|
2197
2411
|
"font-format": {
|
|
2198
2412
|
group: "wrong-value",
|
|
2199
2413
|
severity: "review",
|
|
@@ -2247,6 +2461,14 @@ export const runtimeErrors = {
|
|
|
2247
2461
|
repair: "Add height: auto so the declared attributes keep the proportions, or for a deliberate crop set object-fit in a box of its own with no aspect-ratio.",
|
|
2248
2462
|
emitters: ["src/render-audit.mts"]
|
|
2249
2463
|
},
|
|
2464
|
+
"corner-overpainted": {
|
|
2465
|
+
group: "rendered-check",
|
|
2466
|
+
severity: "error",
|
|
2467
|
+
rule: "A rendered rounded corner stays rounded: an element with a border radius and visible overflow whose corner a descendant (a child component's background, an image) paints over is reported. The static rule construction/corner-overpaint proves the same for a recipe's own parts; this measures what a recipe cannot see.",
|
|
2468
|
+
guides: [RECIPES],
|
|
2469
|
+
repair: 'Clip the rounded element (`overflow: "clip"` in its recipe), inset it (padding in its frame profile), or round what it holds to the same radius.',
|
|
2470
|
+
emitters: ["src/render-audit.mts"]
|
|
2471
|
+
},
|
|
2250
2472
|
"import-leaves-design-system": {
|
|
2251
2473
|
group: "boundary",
|
|
2252
2474
|
severity: "error",
|
|
@@ -2589,7 +2811,7 @@ export const runtimeErrors = {
|
|
|
2589
2811
|
severity: "error",
|
|
2590
2812
|
rule: "ds.config.json's dsDir names an existing directory holding the public barrel (index.ts) and foundation.ads.ts.",
|
|
2591
2813
|
guides: ["ads://guides/runtimes"],
|
|
2592
|
-
repair: "
|
|
2814
|
+
repair: "Author the public barrel (index.ts) and foundation.ads.ts in the design-system folder, or correct dsDir in ds.config.json.",
|
|
2593
2815
|
emitters: ["src/check.mts"],
|
|
2594
2816
|
situations: "render-stopping; stops the check before any other rule runs."
|
|
2595
2817
|
},
|
|
@@ -2823,9 +3045,9 @@ export const runtimeErrors = {
|
|
|
2823
3045
|
"surface-contrast": {
|
|
2824
3046
|
group: "accessibility-semantics",
|
|
2825
3047
|
severity: "error",
|
|
2826
|
-
rule: "A surface profile that sets both color and background meets WCAG 2.2 AA for text, 4.5:1, in every context (theme, brand, brand under theme and condition); its background-image gradient stops count as backgrounds.
|
|
3048
|
+
rule: "A surface profile that sets both color and background meets WCAG 2.2 AA for text, 4.5:1, in every context (theme, brand, brand under theme and condition); its background-image gradient stops count as backgrounds. The minimum follows what the colour paints where the profile is used: a pair below 4.5:1 is accepted when every use of the profile in the design system is artwork (a visual part, or a control that renders no text: 3:1, WCAG 1.4.11), large text (at least 24px, or 18.66px at weight 700: 3:1) or artwork hidden from assistive technology (decoration: no minimum). A profile nothing uses, one a slot supplies, the document surface, and one the recipe also names for a pseudo-element, a prose element, a backdrop or an entrance keep 4.5:1.",
|
|
2827
3049
|
guides: ["ads://guides/accessibility", "ads://guides/tokens"],
|
|
2828
|
-
repair: "Adjust the colour or background token's value in the named context (or point the profile at a pair that contrasts), keeping the pair at 4.5:1 or more.",
|
|
3050
|
+
repair: "Adjust the colour or background token's value in the named context (or point the profile at a pair that contrasts), keeping the pair at 4.5:1 or more; a colour meant for artwork at 3:1 belongs to a surface profile that only visual parts or text-less controls select.",
|
|
2829
3051
|
emitters: ["src/owner-analysis-check.mts"],
|
|
2830
3052
|
situations: "located at the profile's declaration; profiles with identical paints (a profile and those composing it unchanged) are one finding naming them all. Owner states that pair one profile's colour with another's background are checked by owner analysis (construction/state-contrast-insufficient)."
|
|
2831
3053
|
},
|
|
@@ -2836,7 +3058,16 @@ export const runtimeErrors = {
|
|
|
2836
3058
|
guides: ["ads://guides/accessibility", "ads://guides/tokens"],
|
|
2837
3059
|
repair: "Use an opaque background token (and no element opacity) for text surfaces, or check the rendered contrast by hand with in the named context.",
|
|
2838
3060
|
emitters: ["src/owner-analysis-check.mts"],
|
|
2839
|
-
situations: "located at the profile's declaration: a
|
|
3061
|
+
situations: "located at the profile's declaration: a partly transparent background (a fully transparent one is the note `surface-contrast-placed`), an opacity below 1, an image that is not a gradient, currentColor or a colour ADS does not resolve statically."
|
|
3062
|
+
},
|
|
3063
|
+
"surface-contrast-placed": {
|
|
3064
|
+
group: "unanalyzable",
|
|
3065
|
+
severity: "info",
|
|
3066
|
+
rule: "A surface profile whose background is fully transparent paints nothing itself: its text is drawn on whatever the element is placed on. Nothing about the profile can be judged, so this is a note, not a review. The pair is checked where the surface is used: by the cross-owner check (`component-contrast`) for placements inside the design system, and by the render audit for what scenarios show. A placement in application code is outside both.",
|
|
3067
|
+
guides: ["ads://guides/accessibility", "ads://guides/tokens"],
|
|
3068
|
+
repair: "Nothing to repair in the profile. Show the owner on each backdrop it is meant for in a scenario, so the render audit measures it.",
|
|
3069
|
+
emitters: ["src/owner-analysis-check.mts"],
|
|
3070
|
+
situations: "located at the profile's declaration, for the contexts in which its background resolves to full transparency; a partly transparent background is `surface-contrast-unresolved`."
|
|
2840
3071
|
},
|
|
2841
3072
|
"component-contrast": {
|
|
2842
3073
|
group: "accessibility-semantics",
|
|
@@ -2856,6 +3087,24 @@ export const runtimeErrors = {
|
|
|
2856
3087
|
emitters: ["src/composed-contrast.mts", "src/owner-analysis-check.mts"],
|
|
2857
3088
|
situations: "located at the element, surface or placement whose paint breaks the proof; one item per position and reason, at its first context."
|
|
2858
3089
|
},
|
|
3090
|
+
"component-keyline": {
|
|
3091
|
+
group: "wrong-value",
|
|
3092
|
+
severity: "error",
|
|
3093
|
+
rule: "A public component placed in a cell of a grid on a narrower gutter than `wide` puts its content on the grid's text keyline, like a frame of the grid's own owner (`source/keyline-missed`): that gutter's start inset and the inline padding of the component's root frame add up to the wide gutter's start, within the spatial profile's fine unit, in every theme and brand. Borders are not counted. The component's root is the outermost element of its markup; a component whose root is another component takes that one's root. It applies where the placement is the cell, or sits inside owned elements of the cell that do not pad; `gutter: \"none\"` grids, a component whose root is a control, and a root frame without inline padding are exempt.",
|
|
3094
|
+
guides: ["ads://guides/recipes", "ads://guides/layout"],
|
|
3095
|
+
repair: "Give the component a variant whose root frame's inline padding is the wide gutter's start token and select it where it is placed in such a cell, or place it in a wide-gutter grid, or wrap it in an owned element that takes the keyline padding itself.",
|
|
3096
|
+
emitters: ["src/composed-keyline.mts", "src/owner-analysis-check.mts"],
|
|
3097
|
+
situations: "located at the placement, in the owner whose grid it is; `related` names the component's root frame; one finding per placement and frame, at its first failing context."
|
|
3098
|
+
},
|
|
3099
|
+
"component-keyline-unresolved": {
|
|
3100
|
+
group: "unanalyzable",
|
|
3101
|
+
severity: "review",
|
|
3102
|
+
rule: "The keyline of a public component in a narrower-gutter grid cell is proven from its root frame. Where that root cannot be read (its markup cannot be followed to one root element, its root is a component ADS does not analyze, its choices exceed what is enumerated), the placement is reviewed, never passed.",
|
|
3103
|
+
guides: ["ads://guides/layout"],
|
|
3104
|
+
repair: "Give the component one owned root element with its frame, or check the rendered alignment by hand at the placement.",
|
|
3105
|
+
emitters: ["src/composed-keyline.mts", "src/owner-analysis-check.mts"],
|
|
3106
|
+
situations: "located at the placement; one item per placement."
|
|
3107
|
+
},
|
|
2859
3108
|
"theme-undefined": {
|
|
2860
3109
|
group: "project-files",
|
|
2861
3110
|
severity: "error",
|
|
@@ -3039,6 +3288,13 @@ export const runtimeErrors = {
|
|
|
3039
3288
|
message: (problem) => `The mock renders <${problem.tag}>, which is not imported from the design system.`,
|
|
3040
3289
|
repair: "Render public owners directly; an arrangement the screen needs belongs in a pattern."
|
|
3041
3290
|
},
|
|
3291
|
+
"prose-element-undeclared": {
|
|
3292
|
+
group: "design-bypass",
|
|
3293
|
+
rule: 'Plain flow markup inside a prose owner (a component whose recipe has `layout: "prose"`) is that owner\'s content. Each element used there is one the recipe declares in `elements`; an element it does not declare would be drawn without a design.',
|
|
3294
|
+
guides: ["ads://guides/scenarios", RECIPES],
|
|
3295
|
+
message: (problem) => `<${problem.tag}> is content of ${problem.owner}, whose prose recipe declares no such element.`,
|
|
3296
|
+
repair: "Declare the element in the owner's prose recipe (`elements`), or write the content with the elements it declares."
|
|
3297
|
+
},
|
|
3042
3298
|
"spread-props": {
|
|
3043
3299
|
group: "unanalyzable",
|
|
3044
3300
|
rule: "A mock passes explicit props: a spread could carry design ADS cannot see.",
|
|
@@ -3159,6 +3415,13 @@ export const runtimeErrors = {
|
|
|
3159
3415
|
message: (review) => `Whether the hit areas of parts "${review.elements[0]}" and "${review.elements[1]}" overlap cannot be proven under ${contextNames(review.contexts)}: ${review.reason}.`,
|
|
3160
3416
|
repair: "Widen the gap to cover the hit areas' full reach, or check the rendered spacing by hand."
|
|
3161
3417
|
},
|
|
3418
|
+
"motion-endless": {
|
|
3419
|
+
group: "accessibility-semantics",
|
|
3420
|
+
rule: "Motion that starts by itself, runs longer than five seconds and is shown beside other content can be paused, stopped or hidden by the user (WCAG 2.2 2.2.2). A repeating sequence a part plays whenever it is rendered has no owner state to stop it by; reduced motion stops it only for users who set that preference. A note, not a review: a short indicator shown only while something is working ends with that work.",
|
|
3421
|
+
guides: ["ads://guides/accessibility", RECIPES],
|
|
3422
|
+
message: (review) => `${review.part === "root" ? "The root" : `Part "${review.part}"`} plays the repeating sequence ${review.sequence} whenever it is rendered.`,
|
|
3423
|
+
repair: "If it can run for more than five seconds beside other content, play it under an owner state (`when: { '&[data-working=\"true\"]': { play } }`) and give the user a way to stop it; an indicator that is rendered only while work is in progress needs nothing."
|
|
3424
|
+
},
|
|
3162
3425
|
"click-without-keyboard": {
|
|
3163
3426
|
group: "accessibility-semantics",
|
|
3164
3427
|
rule: "An `onClick` on a non-interactive element (div, span, li, img and similar) without a role and `tabIndex` cannot be reached or used from the keyboard (WCAG 2.2 2.1.1), unless a delegated or wrapping control handles it. Items of composite widgets (option, menuitem, tab, row, gridcell, \u2026) and backdrops whose handler reads `currentTarget` are exempt.",
|
package/dist/ads-views.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export const adsViewIds = ["foundation", "tokens", "profiles", "assets"];
|
|
2
2
|
const definitions = {
|
|
3
|
-
foundation: { title: "
|
|
4
|
-
tokens: { title: "Tokens", facts: "tokens"
|
|
5
|
-
profiles: { title: "Profiles", facts: "profiles"
|
|
6
|
-
assets: { title: "Artwork", facts: "assets"
|
|
3
|
+
foundation: { title: "Spatial grids", facts: "grids" },
|
|
4
|
+
tokens: { title: "Tokens", facts: "tokens" },
|
|
5
|
+
profiles: { title: "Profiles", facts: "profiles" },
|
|
6
|
+
assets: { title: "Artwork", facts: "assets" }
|
|
7
7
|
};
|
|
8
8
|
export const adsViewDefinition = (id) => definitions[id], adsView = (id) => ({ id, kind: id, title: definitions[id].title, view: id, artifact: `.ds/scenarios/${id}/index.html` });
|
|
9
9
|
export function adsViews(options) {
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
isStringLiteral,
|
|
21
21
|
isVariableDeclaration
|
|
22
22
|
} from "typescript/ast";
|
|
23
|
+
import { isProseTag } from "../prose-model.mjs";
|
|
23
24
|
function walk(node, visit) {
|
|
24
25
|
visit(node);
|
|
25
26
|
node.forEachChild((child) => walk(child, visit));
|
|
@@ -88,7 +89,7 @@ function isMetadata(node) {
|
|
|
88
89
|
return !0;
|
|
89
90
|
return !node.attributes.properties.some((attribute) => isJsxAttribute(attribute) && attribute.name.getText() === "rel" && attribute.initializer !== void 0 && /stylesheet/.test(attribute.initializer.getText()));
|
|
90
91
|
}
|
|
91
|
-
export function designUsageProblems(source, { publicEntry, patterns }, allowance = {}) {
|
|
92
|
+
export function designUsageProblems(source, { publicEntry, patterns, prose = new Map }, allowance = {}) {
|
|
92
93
|
const problems = [], { names, namespaces } = designSystemImports(source, publicEntry), allowed = allowedImports(source, allowance.components ?? new Map), isAllowed = (node) => isIdentifier(node) && allowed.has(node.text) || allowance.metadata === !0 && isMetadata(node.parent), exportedName = (tag) => isIdentifier(tag) ? names.get(tag.text) : isPropertyAccessExpression(tag) && isIdentifier(tag.expression) && namespaces.has(tag.expression.text) ? tag.name.text : void 0, fromDesignSystem = (tag) => exportedName(tag) !== void 0, isPattern = (tag) => tag !== void 0 && patterns.has(exportedName(tag) ?? ""), insidePattern = (node) => {
|
|
93
94
|
for (let current = node.parent;current !== void 0; current = current.parent) {
|
|
94
95
|
if (isJsxElement(current) && current.openingElement === node)
|
|
@@ -97,6 +98,17 @@ export function designUsageProblems(source, { publicEntry, patterns }, allowance
|
|
|
97
98
|
return !0;
|
|
98
99
|
}
|
|
99
100
|
return !1;
|
|
101
|
+
}, proseOwner = (node) => {
|
|
102
|
+
for (let current = node.parent;current !== void 0; current = current.parent) {
|
|
103
|
+
if (!isJsxElement(current) || current.openingElement === node)
|
|
104
|
+
continue;
|
|
105
|
+
const tag = current.openingElement.tagName;
|
|
106
|
+
if (isIdentifier(tag) && isProseTag(tag.text))
|
|
107
|
+
continue;
|
|
108
|
+
const name = exportedName(tag), tags = name === void 0 ? void 0 : prose.get(name);
|
|
109
|
+
return name === void 0 || tags === void 0 ? void 0 : { name, tags };
|
|
110
|
+
}
|
|
111
|
+
return;
|
|
100
112
|
};
|
|
101
113
|
for (const statement of source.statements)
|
|
102
114
|
if (isImportDeclaration(statement) && isStringLiteral(statement.moduleSpecifier) && statement.importClause?.phaseModifier !== SyntaxKind.TypeKeyword && authorsDesign(statement.moduleSpecifier.text))
|
|
@@ -105,9 +117,13 @@ export function designUsageProblems(source, { publicEntry, patterns }, allowance
|
|
|
105
117
|
if (isJsxOpeningElement(node) || isJsxSelfClosingElement(node)) {
|
|
106
118
|
if (isAllowed(node.tagName))
|
|
107
119
|
;
|
|
108
|
-
else if (!fromDesignSystem(node.tagName))
|
|
109
|
-
|
|
110
|
-
|
|
120
|
+
else if (!fromDesignSystem(node.tagName)) {
|
|
121
|
+
const tag = node.tagName.getText(), owner = isIdentifier(node.tagName) && isProseTag(tag) ? proseOwner(node) : void 0;
|
|
122
|
+
if (owner === void 0)
|
|
123
|
+
problems.push({ node, problem: { kind: "local-markup", tag } });
|
|
124
|
+
else if (!owner.tags.has(tag))
|
|
125
|
+
problems.push({ node, problem: { kind: "prose-element-undeclared", tag, owner: owner.name } });
|
|
126
|
+
} else if (!isPattern(node.tagName) && !insidePattern(node) && inScreenFunction(node))
|
|
111
127
|
problems.push({ node, problem: { kind: "component-outside-pattern", name: exportedName(node.tagName) ?? node.tagName.getText() } });
|
|
112
128
|
for (const attribute of node.attributes.properties)
|
|
113
129
|
if (isJsxSpreadAttribute(attribute))
|