@reqvire-org/ads 0.5.0 → 0.5.2
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 +382 -34
- package/dist/ads-views.mjs +4 -4
- package/dist/analysis/composition-axes.mjs +48 -0
- package/dist/analysis/construction-memo.mjs +38 -0
- package/dist/analysis/context.mjs +19 -0
- package/dist/analysis/design-reads.mjs +177 -0
- package/dist/analysis/design-usage.mjs +20 -4
- package/dist/analysis/factored-classes.mjs +90 -0
- package/dist/analysis/helpers.mjs +5 -7
- package/dist/analysis/mock-check.mjs +5 -4
- package/dist/analysis/native-project.mjs +12 -0
- package/dist/analysis/owner-analysis-cache.mjs +86 -23
- package/dist/analysis/owner-analysis-key.mjs +42 -10
- package/dist/analysis/owner-choices.mjs +195 -43
- package/dist/analysis/owner-composition.mjs +152 -43
- package/dist/analysis/owner-controls.mjs +27 -0
- package/dist/analysis/owner-reuse.mjs +8 -6
- package/dist/analysis/owner-source.mjs +309 -83
- package/dist/analysis/prose-owners.mjs +57 -0
- package/dist/analysis/scenario-keys.mjs +10 -7
- package/dist/analysis/service.mjs +50 -3
- package/dist/analysis/standalone.mjs +7 -4
- package/dist/analysis/styling-ownership.mjs +22 -0
- package/dist/analysis/syntax.mjs +59 -1
- package/dist/analysis/worker-protocol.mjs +14 -2
- package/dist/analysis/worker.mjs +32 -10
- package/dist/architecture-report.mjs +26 -0
- package/dist/asset-view-facts.mjs +16 -2
- package/dist/boundaries.mjs +26 -10
- package/dist/bun-compiler.mjs +2 -2
- package/dist/check-service.mjs +29 -17
- package/dist/check.mjs +20 -7
- package/dist/cli-arguments.mjs +2 -2
- package/dist/cli.mjs +4 -4
- package/dist/composed-contrast.mjs +28 -8
- package/dist/composed-keyline.mjs +107 -0
- package/dist/config.mjs +2 -1
- package/dist/construction-output.mjs +149 -20
- package/dist/construction-spec.d.mts +320 -12
- package/dist/construction-spec.mjs +452 -69
- package/dist/corner-overpaint.mjs +65 -0
- package/dist/derived-states.mjs +182 -0
- package/dist/design-foundation.mjs +6 -1
- package/dist/design-inputs.mjs +18 -3
- package/dist/design-system-closure.mjs +12 -7
- package/dist/design-usage.mjs +8 -2
- package/dist/emit/contract.mjs +24 -5
- package/dist/emit/emission.mjs +14 -5
- package/dist/emit/font-emission.mjs +21 -1
- package/dist/emit/foundation-sheet.mjs +6 -5
- package/dist/emit/integrity.mjs +8 -2
- package/dist/emit/output-watch.mjs +120 -0
- package/dist/emit/owner-emission-cache.mjs +4 -4
- package/dist/emit/preview-emitter.mjs +4 -2
- package/dist/emit/preview-tree.mjs +1 -1
- package/dist/emit/service.mjs +8 -2
- package/dist/finding-rules.mjs +10 -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/form-states.mjs +8 -0
- package/dist/foundation-macro.d.mts +1 -1
- package/dist/frame-regions.mjs +92 -9
- package/dist/grid-facts.mjs +72 -16
- package/dist/grid-lowering.mjs +11 -5
- package/dist/hover-geometry.mjs +15 -0
- package/dist/init.mjs +14 -23
- package/dist/input-digests.mjs +17 -10
- package/dist/linaria/delivery.mjs +2 -0
- package/dist/lowering-enter.mjs +31 -0
- package/dist/lowering-properties.mjs +27 -1
- package/dist/lowering-region-layout.mjs +49 -10
- package/dist/lowering-sequence.mjs +89 -0
- package/dist/lowering-session.mjs +7 -0
- package/dist/lowering-transitions.mjs +22 -8
- package/dist/mcp/build-status.mjs +9 -1
- package/dist/mcp/compiler-channel.mjs +11 -4
- package/dist/mcp/mutations.mjs +1 -0
- package/dist/mcp/preview-http.bundle.js +2 -2
- package/dist/mcp/preview-watch.mjs +2 -1
- package/dist/mcp/preview-widget.bundle.js +5 -5
- package/dist/motion-model.mjs +3 -1
- package/dist/owner-analysis-check.mjs +86 -12
- package/dist/owner-errors.mjs +20 -2
- package/dist/owner-lowering.mjs +104 -25
- package/dist/owner-scenarios.mjs +29 -4
- package/dist/ownership-model.mjs +37 -4
- package/dist/paint-contrast.mjs +5 -0
- package/dist/placeholder-contrast.mjs +18 -1
- package/dist/platform-features.mjs +35 -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 +176 -15
- package/dist/recipe-model.mjs +35 -7
- package/dist/region-lowering.mjs +463 -65
- package/dist/render-audit/corner-overpaint.page.mjs +54 -0
- package/dist/render-audit/layout-shift.page.mjs +24 -0
- package/dist/render-audit/render-states.mjs +122 -1
- package/dist/render-audit/render-states.page.mjs +140 -0
- package/dist/render-audit/worker.mjs +23 -3
- package/dist/render-audit.mjs +139 -1
- package/dist/role-vocabulary.d.mts +43 -2
- package/dist/role-vocabulary.mjs +50 -4
- package/dist/scenario-kit.d.mts +6 -0
- package/dist/scenario-registry.mjs +1 -1
- package/dist/scenarios-compiler.mjs +20 -6
- 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 +136 -89
- 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 +9 -2
- package/dist/skills/ads-designer/references/atomic-styles.md +8 -1
- package/dist/skills/ads-designer/references/branding.md +20 -5
- package/dist/skills/ads-designer/references/cli.md +4 -4
- package/dist/skills/ads-designer/references/contracts.md +14 -4
- 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 +46 -3
- package/dist/skills/ads-designer/references/motion.md +45 -1
- package/dist/skills/ads-designer/references/performance.md +7 -1
- package/dist/skills/ads-designer/references/recipes.md +92 -7
- 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 +14 -4
- 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 +46 -3
- package/dist/skills/ads-import/references/recipes.md +92 -7
- 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 +3 -1
- package/dist/skills/ads-migrate/references/0.5.0-to-0.5.1.md +239 -0
- package/dist/skills/ads-migrate/references/0.5.1-to-0.5.2.md +185 -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 +14 -4
- 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 +46 -3
- package/dist/skills/ads-port/references/recipes.md +92 -7
- 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 +69 -10
- package/dist/surface-effects.mjs +100 -0
- package/dist/target-size.mjs +1 -1
- package/dist/task-cache.mjs +9 -19
- 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-checks.mjs +1 -1
- package/dist/validation.mjs +1 -1
- package/docs/ADS.md +36 -13
- package/docs/ARCHITECTURE.md +223 -23
- package/docs/ASSETS.md +81 -10
- package/docs/CACHING.md +152 -24
- package/docs/CHANGELOG.md +525 -23
- package/docs/DESIGN-REFERENCES.md +5 -5
- package/docs/GUIDE.md +286 -73
- package/docs/LANGUAGE.md +428 -24
- package/docs/LOWERING.md +13 -1
- package/docs/MOTION.md +241 -7
- package/docs/PROFILE-KINDS.md +176 -14
- package/docs/PROFILES.md +2 -2
- package/docs/RULES.md +63 -24
- package/docs/TOKEN-ROLES.md +15 -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/dist/region-lowering.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { compositeSlot } from "./role-vocabulary.mjs";
|
|
2
|
-
import { normalizedDeclarations } from "./construction-spec.mjs";
|
|
1
|
+
import { BORDER_STYLE, compositeSlot } from "./role-vocabulary.mjs";
|
|
2
|
+
import { PART_EFFECTS, normalizedDeclarations, scaleValue } from "./construction-spec.mjs";
|
|
3
3
|
import {
|
|
4
4
|
coverArtwork,
|
|
5
5
|
HIT_AREA_FIELDS,
|
|
@@ -19,13 +19,23 @@ import {
|
|
|
19
19
|
writeHitArea,
|
|
20
20
|
writePaintTransition,
|
|
21
21
|
writeRootPress,
|
|
22
|
-
writeTransitions
|
|
22
|
+
writeTransitions,
|
|
23
|
+
checkSurfaceEffects,
|
|
24
|
+
writeEnter,
|
|
25
|
+
writePlays,
|
|
26
|
+
writeStateText
|
|
23
27
|
} from "./construction-output.mjs";
|
|
24
|
-
import {
|
|
28
|
+
import { settled } from "./lowering-enter.mjs";
|
|
29
|
+
import { paintContrast } from "./paint-contrast.mjs";
|
|
30
|
+
import { PROSE_BLOCKS, PROSE_COMPONENT, PROSE_ELEMENTS, PROSE_ELEMENT_NAMES, PROSE_FIRST, proseContents, proseDefaults, proseSelector, proseState } from "./prose-model.mjs";
|
|
31
|
+
import { textMinimum } from "./surface-contrast.mjs";
|
|
32
|
+
import { tokenValueContexts } from "./design-foundation.mjs";
|
|
33
|
+
import { checkPlaceholderContrast, checkProgressContrast } from "./placeholder-contrast.mjs";
|
|
25
34
|
import { fixedLength, lowerLayer, openState, ownsPlacement } from "./lowering-layer.mjs";
|
|
26
35
|
import { RATIO_SUFFIX, focalPosition, intrinsicInlineSize, measuredFallback, measuredProperty, measuredWrites, positions } from "./measured-geometry.mjs";
|
|
27
36
|
import { paintProperty, paintTokens, paintWrites } from "./runtime-paint.mjs";
|
|
28
37
|
import { conditionBound, conditionQueries, geometryOf, tierBelowQuery } from "./spatial-reading.mjs";
|
|
38
|
+
import { FRAME_CORNERS } from "./construction-spec.mjs";
|
|
29
39
|
import {
|
|
30
40
|
LAYER,
|
|
31
41
|
MARKER_HIDDEN,
|
|
@@ -34,6 +44,7 @@ import {
|
|
|
34
44
|
conditionValues,
|
|
35
45
|
elementNormalization,
|
|
36
46
|
extentValues,
|
|
47
|
+
growsWithContent,
|
|
37
48
|
frameInsets,
|
|
38
49
|
frameRules,
|
|
39
50
|
layeredValues,
|
|
@@ -41,28 +52,37 @@ import {
|
|
|
41
52
|
snapValues,
|
|
42
53
|
textLayoutValues,
|
|
43
54
|
vectorStateValues,
|
|
44
|
-
vectorValues
|
|
55
|
+
vectorValues,
|
|
56
|
+
FRAME_INSET_FIELDS,
|
|
57
|
+
FRAME_SIDE_WIDTH_FIELDS,
|
|
58
|
+
sideWidth,
|
|
59
|
+
sidedBorder
|
|
45
60
|
} from "./lowering-region-layout.mjs";
|
|
46
61
|
import { attempt } from "./result.mjs";
|
|
62
|
+
import { schemeDisplay, schemeSwitch } from "./scheme-switch.mjs";
|
|
47
63
|
function slotsOf(profile, reference, select) {
|
|
48
64
|
if (reference === null)
|
|
49
65
|
return {};
|
|
50
66
|
const selected = profile.select(reference, select);
|
|
51
67
|
return selected.kind === "composite" ? Object.fromEntries(selected.fields) : { [`${selected.kind}-profile`]: reference };
|
|
52
68
|
}
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
const safely = (value, scrolled) => scrolled && (value === "center" || value === "end") ? `safe ${value}` : value;
|
|
70
|
+
function arrangementValues(arrangement, slots, profile, overflow = { kind: "visible" }) {
|
|
71
|
+
const values = {}, scrolls = (axis) => overflow.kind === "scroll" && (overflow.axis === axis || overflow.axis === "both"), { layout } = arrangement;
|
|
55
72
|
if (layout === "native")
|
|
56
73
|
return values;
|
|
74
|
+
if (layout === "prose")
|
|
75
|
+
return { display: "flow-root" };
|
|
57
76
|
if (layout === "layered")
|
|
58
77
|
return { ...layeredValues(arrangement.align, arrangement.justify) };
|
|
59
78
|
if (layout === "inline" || layout === "stack") {
|
|
60
79
|
values.display = layout === "inline" ? "inline-flex" : "flex";
|
|
61
80
|
if (layout === "stack")
|
|
62
81
|
values["flex-direction"] = "column";
|
|
63
|
-
|
|
82
|
+
const [cross, main] = layout === "inline" ? ["block", "inline"] : ["inline", "block"];
|
|
83
|
+
values["align-items"] = safely(arrangement.align ?? (layout === "inline" ? "center" : "stretch"), scrolls(cross));
|
|
64
84
|
if (arrangement.justify !== null)
|
|
65
|
-
values["justify-content"] = arrangement.justify;
|
|
85
|
+
values["justify-content"] = safely(arrangement.justify, scrolls(main));
|
|
66
86
|
if (arrangement.wrap)
|
|
67
87
|
values["flex-wrap"] = "wrap";
|
|
68
88
|
} else
|
|
@@ -70,28 +90,110 @@ function arrangementValues(arrangement, slots, profile) {
|
|
|
70
90
|
const spacingReference = slots["spacing-profile"];
|
|
71
91
|
if (spacingReference !== void 0) {
|
|
72
92
|
const spacing = profile.of(spacingReference, "spacing"), field = arrangement.gap === null ? "content-gap" : kebab(arrangement.gap.field);
|
|
73
|
-
|
|
93
|
+
if (arrangement.overlap === null)
|
|
94
|
+
values[layout === "flow" ? "row-gap" : "gap"] = profile.field(spacing, "spacing", field);
|
|
74
95
|
} else if (arrangement.gap !== null)
|
|
75
96
|
profile.field({}, "spacing-profile", kebab(arrangement.gap.field));
|
|
76
97
|
return values;
|
|
77
98
|
}
|
|
78
|
-
|
|
99
|
+
function overlapValue(arrangement, slots, profile) {
|
|
100
|
+
if (arrangement === null || arrangement.overlap === null)
|
|
101
|
+
return null;
|
|
102
|
+
return profile.field(profile.of(slots["spacing-profile"], "spacing", "overlap"), "spacing", kebab(arrangement.overlap.by.field));
|
|
103
|
+
}
|
|
104
|
+
const OVERLAPPED = "> * + *", overlapMargin = (arrangement) => arrangement.layout === "stack" ? "margin-block-start" : "margin-inline-start";
|
|
105
|
+
function geometryChannel(property) {
|
|
106
|
+
if (/^(?:min-|max-)?(?:inline|block)-size$/.test(property) || property === "grid-template-columns" || property === "grid-template-rows")
|
|
107
|
+
return "size";
|
|
108
|
+
if (property.startsWith("padding-"))
|
|
109
|
+
return "inset";
|
|
110
|
+
if (property === "gap" || property === "row-gap")
|
|
111
|
+
return "gap";
|
|
112
|
+
if (property.includes("radius"))
|
|
113
|
+
return "radius";
|
|
114
|
+
if (/^border-.*width$/.test(property))
|
|
115
|
+
return "border-width";
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
const collapsedValues = (collapsed, axis) => ({
|
|
119
|
+
[`${axis}-size`]: collapsed ? "0" : "auto",
|
|
120
|
+
opacity: collapsed ? "0" : "1",
|
|
121
|
+
visibility: collapsed ? "hidden" : "visible"
|
|
122
|
+
}), collapsibleValues = (axis) => ({ "flex-grow": "0", "flex-shrink": "0", "flex-basis": "auto", [`min-${axis}-size`]: "0", overflow: "clip", "interpolate-size": "allow-keywords" });
|
|
123
|
+
function writeStateGeometry(path, element, rest, states, transition, frameOf, context) {
|
|
124
|
+
const { out, profile, slots, reject } = context, unsupported = (reason, detail) => reject({ kind: "state-geometry-unsupported", element, reason, detail }), changed = new Set, overlapStates = new Map, gaps = [], restOverlap = overlapValue(rest.arrangement, slots, profile), differing = (base, state) => Object.fromEntries(Object.entries(state).filter(([property, value]) => base[property] !== value));
|
|
125
|
+
for (const state of states) {
|
|
126
|
+
const values = {};
|
|
127
|
+
if (state.frame !== null) {
|
|
128
|
+
if (rest.frame === null)
|
|
129
|
+
return unsupported("frame-missing", state.frame);
|
|
130
|
+
const framed = frameOf(state.frame), dropped = Object.keys(rest.frame).find((property) => framed[property] === void 0);
|
|
131
|
+
if (dropped !== void 0)
|
|
132
|
+
return unsupported("field-dropped", dropped);
|
|
133
|
+
Object.assign(values, differing(rest.frame, framed));
|
|
134
|
+
}
|
|
135
|
+
if (state.spacing !== null && rest.arrangement !== null) {
|
|
136
|
+
const stated = { ...slots, "spacing-profile": state.spacing };
|
|
137
|
+
Object.assign(values, differing(rest.arranged, arrangementValues(rest.arrangement, stated, profile)));
|
|
138
|
+
const overlap = overlapValue(rest.arrangement, stated, profile);
|
|
139
|
+
if (overlap !== null && overlap !== restOverlap) {
|
|
140
|
+
out.rule(`${under(state.condition, path)} ${OVERLAPPED}`, { [overlapMargin(rest.arrangement)]: `calc(-1 * ${overlap})` });
|
|
141
|
+
overlapStates.set(state.condition, `calc(-1 * ${overlap})`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (state.collapsed !== null && rest.collapsed !== null && rest.axis !== null && state.collapsed !== rest.collapsed)
|
|
145
|
+
Object.assign(values, collapsedValues(state.collapsed, rest.axis));
|
|
146
|
+
for (const property of Object.keys(values))
|
|
147
|
+
changed.add(property);
|
|
148
|
+
if (values.gap !== void 0)
|
|
149
|
+
gaps.push(values.gap);
|
|
150
|
+
if (Object.keys(values).length > 0)
|
|
151
|
+
out.rule(under(state.condition, path), values);
|
|
152
|
+
if (state.condition.includes(":hover")) {
|
|
153
|
+
const same = (other) => other.frame === state.frame && other.spacing === state.spacing && other.collapsed === state.collapsed;
|
|
154
|
+
if (!states.some((other) => other !== state && same(other) && !other.condition.includes(":hover") && /:focus|\[/.test(other.condition)))
|
|
155
|
+
return unsupported("hover-only", state.condition);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const overlapChanges = overlapStates.size > 0, parentOverlap = (group) => restOverlap === null || rest.arrangement === null ? null : { property: overlapMargin(rest.arrangement), base: `calc(-1 * ${restOverlap})`, states: overlapStates, group };
|
|
159
|
+
if (transition === null)
|
|
160
|
+
return { group: null, overlap: parentOverlap(null), gaps };
|
|
161
|
+
const timing = transitionTiming(motionFields(transition.motion, slots, profile), profile, reject), channelOf = (property) => geometryChannel(property);
|
|
162
|
+
for (const channel of transition.channels) {
|
|
163
|
+
if (channel === "overlap")
|
|
164
|
+
continue;
|
|
165
|
+
if (!([...changed].some((property) => channelOf(property) === channel) || channel === "gap" && overlapChanges))
|
|
166
|
+
return unsupported("channel-unused", channel);
|
|
167
|
+
}
|
|
168
|
+
const listed = (property) => {
|
|
169
|
+
const channel = channelOf(property);
|
|
170
|
+
return channel !== null && transition.channels.includes(channel);
|
|
171
|
+
}, fading = [...changed].filter((property) => (property === "opacity" || property === "visibility") && transition.channels.includes("size")), placed = transition.channels.includes("overlap") ? ["margin-inline-start", "margin-block-start"] : [], properties = [...[...changed].filter(listed), ...fading, ...placed];
|
|
172
|
+
return {
|
|
173
|
+
group: properties.length === 0 ? null : { properties, timing },
|
|
174
|
+
overlap: parentOverlap(overlapChanges && transition.channels.includes("gap") && rest.arrangement !== null ? { properties: [overlapMargin(rest.arrangement)], timing } : null),
|
|
175
|
+
gaps
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
const FRAME_FIELDS = [...FRAME_INSET_FIELDS, ...FRAME_SIDE_WIDTH_FIELDS, BORDER_STYLE, "border-width", "radius", "min-block-size", "block-size", "max-block-size", "inline-size", "min-inline-size", "max-inline-size", ...HIT_AREA_FIELDS], isHitAreaField = (field) => HIT_AREA_FIELDS.some((name) => name === field);
|
|
79
179
|
export function frameValues(frame, profile, reject, sides = { kind: "profile" }) {
|
|
80
180
|
profile.only(frame, "frame", FRAME_FIELDS);
|
|
81
181
|
const insets = frameInsets(frame);
|
|
82
182
|
if (insets.kind === "err")
|
|
83
183
|
return reject(insets.error);
|
|
84
|
-
const values = { ...insets.value };
|
|
184
|
+
const sided = sides.kind === "rules" ? null : sidedBorder(frame), values = { ...insets.value, ...sided };
|
|
85
185
|
for (const [property, value] of Object.entries(frame)) {
|
|
86
|
-
if (property
|
|
186
|
+
if (FRAME_INSET_FIELDS.includes(property) || FRAME_SIDE_WIDTH_FIELDS.includes(property) || isHitAreaField(property))
|
|
87
187
|
continue;
|
|
88
188
|
if (property === "border-width") {
|
|
89
|
-
if (sides.kind === "rules")
|
|
189
|
+
if (sides.kind === "rules" || sided !== null)
|
|
90
190
|
continue;
|
|
91
191
|
Object.assign(values, border(value));
|
|
92
192
|
for (const side of ["top", "right", "bottom", "left"])
|
|
93
|
-
values[`border-${side}-style`] = "solid";
|
|
94
|
-
} else if (property ===
|
|
193
|
+
values[`border-${side}-style`] = frame[BORDER_STYLE] ?? "solid";
|
|
194
|
+
} else if (property === BORDER_STYLE)
|
|
195
|
+
continue;
|
|
196
|
+
else if (property === "radius")
|
|
95
197
|
values["border-radius"] = value;
|
|
96
198
|
else
|
|
97
199
|
values[property] = value;
|
|
@@ -120,11 +222,17 @@ function regionFrameValues(frame, slots, surface, profile, reject) {
|
|
|
120
222
|
}
|
|
121
223
|
Object.assign(values, frameValues(fields, profile, reject, frame.border));
|
|
122
224
|
if (frame.border.kind === "rules") {
|
|
123
|
-
const
|
|
225
|
+
const paints = surface === null ? {} : profile.of(surface, "surface"), rules = frameRules(frame.border, (side) => sideWidth(fields, side), { surface, color: (side) => paints[`border-${side}-color`] ?? paints["border-color"] }, frameReference ?? null, fields[BORDER_STYLE]);
|
|
124
226
|
if (rules.kind === "err")
|
|
125
227
|
return reject(rules.error);
|
|
126
228
|
Object.assign(values, rules.value);
|
|
127
229
|
}
|
|
230
|
+
if (frame.corners !== null) {
|
|
231
|
+
const radius = values["border-radius"] ?? reject({ kind: "profile-field-missing", profile: frameReference ?? "frame", field: "radius" });
|
|
232
|
+
delete values["border-radius"];
|
|
233
|
+
for (const corner of FRAME_CORNERS)
|
|
234
|
+
values[`border-${corner}-radius`] = frame.corners.includes(corner) ? radius : "0";
|
|
235
|
+
}
|
|
128
236
|
if (frame.container) {
|
|
129
237
|
values["container-type"] = "inline-size";
|
|
130
238
|
values["container-name"] = "ads-region";
|
|
@@ -155,10 +263,153 @@ function textOf(binding, slots, profile) {
|
|
|
155
263
|
return profile.of(slot === null ? void 0 : slots[slot], "text", `${binding.slot}-profile`);
|
|
156
264
|
}
|
|
157
265
|
const under = (condition, path) => `${condition}${path.slice(1)}`;
|
|
158
|
-
function stateRules(out, path, when, profile) {
|
|
266
|
+
function stateRules(out, path, when, profile, blurred = !1) {
|
|
159
267
|
for (const [condition, surface] of when)
|
|
160
|
-
out.rule(under(condition, path), { ...profile.of(surface, "surface") });
|
|
268
|
+
out.rule(under(condition, path), { ...settled(profile.of(surface, "surface"), blurred) });
|
|
269
|
+
}
|
|
270
|
+
function stickyValues(sticky, { profile, slots }) {
|
|
271
|
+
if (sticky === null)
|
|
272
|
+
return {};
|
|
273
|
+
const layer = sticky.clear || slots["layer-profile"] !== void 0 ? profile.of(slots["layer-profile"], "layer", "sticky") : {};
|
|
274
|
+
return {
|
|
275
|
+
position: "sticky",
|
|
276
|
+
[`inset-${sticky.edge}`]: sticky.clear ? profile.field(layer, "layer", "clear-block-start") : "0",
|
|
277
|
+
...layer["sticky-layer"] === void 0 ? {} : { "z-index": layer["sticky-layer"] }
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
function anchorClearValues(binding, { profile, slots }) {
|
|
281
|
+
if (binding === null)
|
|
282
|
+
return {};
|
|
283
|
+
return { "scroll-margin-block-start": binding.slot === "layer" ? profile.field(profile.of(slots["layer-profile"], "layer", "anchorClear"), "layer", "clear-block-start") : profile.field(profile.of(slots["spacing-profile"], "spacing", "anchorClear"), "spacing", "anchor-gap") };
|
|
161
284
|
}
|
|
285
|
+
function lowerProse(prose, root, context) {
|
|
286
|
+
const { out, profile, slots, foundation, reject } = context, spacing = (binding) => profile.field(profile.of(slots["spacing-profile"], "spacing", "prose"), "spacing", kebab(binding.field)), rhythm = prose.rhythm === null ? null : spacing(prose.rhythm), declared = new Map(prose.elements.map((element) => [element.name, element])), componentBefore = prose.component?.spaceBefore == null ? null : spacing(prose.component.spaceBefore), componentAfter = prose.component?.spaceAfter == null ? null : spacing(prose.component.spaceAfter), following = (level) => ":not(:first-child)".repeat(level), paints = new Map;
|
|
287
|
+
for (const name of PROSE_ELEMENT_NAMES) {
|
|
288
|
+
const element = declared.get(name), block = PROSE_BLOCKS.includes(name);
|
|
289
|
+
if (element === void 0 && (!block || rhythm === null) && Object.keys(proseDefaults(name)).length === 0)
|
|
290
|
+
continue;
|
|
291
|
+
const text = element?.text == null ? {} : profile.of(element.text, "text"), surface = element?.surface == null ? {} : profile.of(element.surface, "surface"), states = (element?.when ?? []).map(([condition, state]) => [condition, profile.of(state, "surface")]);
|
|
292
|
+
if (element !== void 0)
|
|
293
|
+
checkSurfaceEffects(foundation, profile, [element.surface, ...element.when.map(([, state]) => state)], name === "media" ? "visual" : name === "pre" ? "scroller" : "container", reject);
|
|
294
|
+
const frame = element?.frame == null ? {} : frameValues(profile.of(element.frame, "frame"), profile, reject), before = element?.spaceBefore == null ? rhythm : spacing(element.spaceBefore), values = {
|
|
295
|
+
...proseDefaults(name),
|
|
296
|
+
...block && (before !== null || element !== void 0) ? { "margin-block-start": before ?? "0", "margin-block-end": "0" } : {},
|
|
297
|
+
...element?.indent == null ? {} : { "padding-inline-start": spacing(element.indent) },
|
|
298
|
+
...anchorClearValues(element?.anchorClear ?? null, context),
|
|
299
|
+
...text,
|
|
300
|
+
...frame,
|
|
301
|
+
...surface
|
|
302
|
+
};
|
|
303
|
+
for (const tag of PROSE_ELEMENTS[name]) {
|
|
304
|
+
const selector = proseSelector(tag);
|
|
305
|
+
if (Object.keys(values).length > 0)
|
|
306
|
+
out.rule(selector, { ...values });
|
|
307
|
+
for (const [condition, fields] of states)
|
|
308
|
+
out.rule(proseState(selector, condition), { ...fields });
|
|
309
|
+
if (element?.marker != null) {
|
|
310
|
+
const fields = profile.of(element.marker, "surface"), other = Object.keys(fields).find((field) => field !== "color");
|
|
311
|
+
if (other !== void 0 || fields.color === void 0)
|
|
312
|
+
return reject({ kind: "profile-field-unsupported", profile: element.marker, field: other ?? "color", value: other === void 0 ? "" : fields[other] ?? "" });
|
|
313
|
+
out.rule(`${selector}::marker`, { color: fields.color });
|
|
314
|
+
}
|
|
315
|
+
if (element?.markerText != null)
|
|
316
|
+
out.rule(`${selector}::marker`, { "font-weight": profile.field(profile.of(element.markerText, "text"), "text", "font-weight") });
|
|
317
|
+
if (element?.spaceAfter != null) {
|
|
318
|
+
const after = spacing(element.spaceAfter);
|
|
319
|
+
out.rule(`${selector} + :not([class])`, { "margin-block-start": after });
|
|
320
|
+
out.rule(`${selector} + [class]${following(1)}`, { "margin-block-start": componentBefore === null ? after : `max(${after}, ${componentBefore})` });
|
|
321
|
+
for (const next of prose.elements)
|
|
322
|
+
if (next.spaceBefore !== null)
|
|
323
|
+
for (const nextTag of PROSE_ELEMENTS[next.name])
|
|
324
|
+
out.rule(`${selector} + ${nextTag}:not([class])`, { "margin-block-start": `max(${after}, ${spacing(next.spaceBefore)})` });
|
|
325
|
+
}
|
|
326
|
+
if (tag === "ul")
|
|
327
|
+
(element?.markers ?? []).forEach((shape, depth) => out.rule(`& ${"ul:not([class]) ".repeat(depth)}ul:not([class])`, { "list-style-type": shape }));
|
|
328
|
+
}
|
|
329
|
+
if (element !== void 0)
|
|
330
|
+
paints.set(name, { paints: [surface, ...states.map(([, fields]) => fields)].map((fields) => ({ color: fields.color ?? null, background: fields.background ?? null })), text });
|
|
331
|
+
}
|
|
332
|
+
if (rhythm !== null || prose.elements.some((element) => element.spaceBefore !== null))
|
|
333
|
+
for (const selector of PROSE_FIRST)
|
|
334
|
+
out.rule(selector, { "margin-block-start": "0" });
|
|
335
|
+
if (componentBefore !== null || rhythm !== null)
|
|
336
|
+
out.rule(PROSE_COMPONENT, { "margin-block-start": componentBefore ?? rhythm ?? "0" });
|
|
337
|
+
if (componentAfter !== null) {
|
|
338
|
+
out.rule(`& > [class] + :not([class])${following(2)}`, { "margin-block-start": componentAfter });
|
|
339
|
+
out.rule(`& > [class] + [class]${following(3)}`, { "margin-block-start": componentBefore === null ? componentAfter : `max(${componentAfter}, ${componentBefore})` });
|
|
340
|
+
for (const next of prose.elements)
|
|
341
|
+
if (next.spaceBefore !== null)
|
|
342
|
+
for (const tag of PROSE_ELEMENTS[next.name])
|
|
343
|
+
out.rule(`& > [class] + ${tag}:not([class])${following(2)}`, { "margin-block-start": `max(${componentAfter}, ${spacing(next.spaceBefore)})` });
|
|
344
|
+
}
|
|
345
|
+
const base = { color: root.color ?? null, background: root.background ?? null }, colored = [...paints].filter(([, entry]) => entry.paints.some((paint) => paint.color !== null || paint.background !== null));
|
|
346
|
+
if (colored.length === 0)
|
|
347
|
+
return;
|
|
348
|
+
const contexts = tokenValueContexts(foundation), prove = (name, text, foreground, background, on) => {
|
|
349
|
+
if (foreground === null || background === null)
|
|
350
|
+
return;
|
|
351
|
+
for (const tokens of contexts) {
|
|
352
|
+
const minimum = textMinimum({ fontSize: text["font-size"] ?? null, fontWeight: text["font-weight"] ?? null }, tokens), outcome = paintContrast(tokens, { foreground, background }, minimum);
|
|
353
|
+
if (outcome.kind === "insufficient")
|
|
354
|
+
return reject({ kind: "prose-contrast-insufficient", element: name, on, foreground, background, ratio: outcome.ratio, minimum: outcome.minimum, context: tokens.label });
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
for (const [name, entry] of colored) {
|
|
358
|
+
if (name === "rule" || name === "media")
|
|
359
|
+
continue;
|
|
360
|
+
for (const paint of entry.paints)
|
|
361
|
+
prove(name, entry.text, paint.color ?? base.color, paint.background ?? base.background, "the prose root");
|
|
362
|
+
}
|
|
363
|
+
for (const [container, outer] of colored) {
|
|
364
|
+
const [around] = outer.paints;
|
|
365
|
+
if (around === void 0)
|
|
366
|
+
continue;
|
|
367
|
+
for (const inner of proseContents(container)) {
|
|
368
|
+
const entry = paints.get(inner);
|
|
369
|
+
if (entry === void 0 || inner === "rule" || inner === "media")
|
|
370
|
+
continue;
|
|
371
|
+
for (const paint of entry.paints)
|
|
372
|
+
prove(inner, entry.text, paint.color ?? around.color ?? base.color, paint.background ?? around.background ?? base.background, `inside ${container}`);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
function partMotion(path, effects, { out, profile, slots, reject }) {
|
|
377
|
+
if (effects === null)
|
|
378
|
+
return null;
|
|
379
|
+
const motion = motionFields(effects.motion, slots, profile), timing = transitionTiming(motion, profile, reject), channels = new Set(effects.when.flatMap(([, names]) => names.map((name) => PART_EFFECTS[name].channel)));
|
|
380
|
+
out.rule(path, { ...channels.has("translate") ? { translate: "0px" } : {}, ...channels.has("scale") ? { scale: "1" } : {}, ...channels.has("rotate") ? { rotate: "0deg" } : {} });
|
|
381
|
+
const distance = () => profile.field(motion, "motion", "distance");
|
|
382
|
+
for (const [condition, names] of effects.when) {
|
|
383
|
+
const selector = under(condition, path), inline = names.includes("translateInline"), block = names.includes("translateBlock"), travel = (sign) => block ? `${inline ? sign : "0px"} ${distance()}` : sign, values = {};
|
|
384
|
+
if (inline || block)
|
|
385
|
+
values.translate = travel(distance());
|
|
386
|
+
const scaled = names.find((name) => PART_EFFECTS[name].channel === "scale");
|
|
387
|
+
if (scaled === "scale" || scaled === "scaleInline" || scaled === "scaleBlock")
|
|
388
|
+
values.scale = scaleValue(scaled, profile.field(motion, "motion", "scale"));
|
|
389
|
+
if (names.includes("rotate"))
|
|
390
|
+
values.rotate = profile.field(motion, "motion", "angle");
|
|
391
|
+
out.rule(selector, values);
|
|
392
|
+
const mirrored = under(`${condition}:dir(rtl)`, path);
|
|
393
|
+
if (inline)
|
|
394
|
+
out.rule(mirrored, { translate: travel(`calc(${distance()} * -1)`) });
|
|
395
|
+
const rest = { ...values.translate === void 0 ? {} : { translate: "0px" }, ...values.scale === void 0 ? {} : { scale: "1" } };
|
|
396
|
+
out.rule(selector, rest, REDUCED_MOTION_QUERY);
|
|
397
|
+
if (inline)
|
|
398
|
+
out.rule(mirrored, { translate: "0px" }, REDUCED_MOTION_QUERY);
|
|
399
|
+
}
|
|
400
|
+
return effects.transition.length === 0 ? null : { properties: effects.transition, timing };
|
|
401
|
+
}
|
|
402
|
+
const REDUCED_MOTION_QUERY = ["media", "(prefers-reduced-motion: reduce)"];
|
|
403
|
+
function measuredMotion(measured, profile, reject) {
|
|
404
|
+
const groups = new Map;
|
|
405
|
+
for (const value of measured) {
|
|
406
|
+
if (value.type === "position" || value.type === "intrinsic-size" || value.motion === null)
|
|
407
|
+
continue;
|
|
408
|
+
groups.set(value.motion, [...groups.get(value.motion) ?? [], value.property]);
|
|
409
|
+
}
|
|
410
|
+
return [...groups].map(([name, properties]) => ({ properties: [...new Set(properties)], timing: transitionTiming(profile.of(name, "motion"), profile, reject) }));
|
|
411
|
+
}
|
|
412
|
+
const stateSurfaces = (path, when, profile) => when.map(([condition, surface]) => ({ selector: under(condition, path), fields: profile.of(surface, "surface") })), transitioned = (transition, groups) => [...transition?.channels ?? [], ...groups.flatMap((group) => group.properties)];
|
|
162
413
|
function transitionRules(path, transition, base, when, { out, profile, slots, reject }, also = []) {
|
|
163
414
|
if (transition === null)
|
|
164
415
|
return writeTransitions(out, path, also);
|
|
@@ -172,22 +423,41 @@ function pseudoColor(treatment, surface, profile, reject) {
|
|
|
172
423
|
return fields.color ?? reject({ kind: "pseudo-surface-unsupported", pseudo: treatment.pseudo, surface, field: null });
|
|
173
424
|
}
|
|
174
425
|
function pseudoRules(part, path, context) {
|
|
175
|
-
const { out, profile, reject, foundation } = context;
|
|
176
|
-
for (const treatment of part.pseudo)
|
|
177
|
-
const suffix = `::${treatment.pseudo}`, base = pseudoColor(treatment, treatment.surface, profile, reject), states = treatment.when.map(([condition, surface]) => ({ condition, value: pseudoColor(treatment, surface, profile, reject) }));
|
|
178
|
-
out.rule(`${path}${suffix}`, { color: base, opacity: "1" });
|
|
179
|
-
for (const { condition, value } of states)
|
|
180
|
-
out.rule(`${under(condition, path)}${suffix}`, { color: value });
|
|
181
|
-
const colors = [{ condition: null, value: base }, ...states];
|
|
426
|
+
const { out, profile, reject, foundation } = context, background = (surface) => surface === null ? null : profile.of(surface, "surface").background ?? null, fills = [{ condition: null, value: background(part.surface) }, ...part.when.map(([condition, surface]) => ({ condition, value: background(surface) }))];
|
|
427
|
+
for (const treatment of part.pseudo)
|
|
182
428
|
switch (treatment.pseudo) {
|
|
183
429
|
case "placeholder": {
|
|
184
|
-
const
|
|
430
|
+
const suffix = "::placeholder", base = pseudoColor(treatment, treatment.surface, profile, reject), states = treatment.when.map(([condition, surface]) => ({ condition, value: pseudoColor(treatment, surface, profile, reject) }));
|
|
431
|
+
out.rule(`${path}${suffix}`, { color: base, opacity: "1" });
|
|
432
|
+
for (const { condition, value } of states)
|
|
433
|
+
out.rule(`${under(condition, path)}${suffix}`, { color: value });
|
|
434
|
+
const checked = checkPlaceholderContrast(foundation, part.name, [{ condition: null, value: base }, ...states], fills);
|
|
435
|
+
if (checked.kind === "err")
|
|
436
|
+
return reject(checked.error);
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
case "progressValue": {
|
|
440
|
+
const base = pseudoFill(treatment, treatment.surface, profile, reject), states = treatment.when.map(([condition, surface]) => ({ condition, value: pseudoFill(treatment, surface, profile, reject) }));
|
|
441
|
+
out.rule(path, { appearance: "none", "-webkit-appearance": "none", ...part.box === null ? { "border-style": "none" } : {} });
|
|
442
|
+
out.rule(`${path}::-webkit-progress-bar`, { background: "transparent" });
|
|
443
|
+
for (const suffix of PROGRESS_FILLS) {
|
|
444
|
+
out.rule(`${path}${suffix}`, { background: base, "border-radius": "inherit" });
|
|
445
|
+
for (const { condition, value } of states)
|
|
446
|
+
out.rule(`${under(condition, path)}${suffix}`, { background: value });
|
|
447
|
+
}
|
|
448
|
+
const checked = checkProgressContrast(foundation, part.name, [{ condition: null, value: base }, ...states], fills);
|
|
185
449
|
if (checked.kind === "err")
|
|
186
450
|
return reject(checked.error);
|
|
187
451
|
break;
|
|
188
452
|
}
|
|
189
453
|
}
|
|
190
|
-
|
|
454
|
+
}
|
|
455
|
+
const PROGRESS_FILLS = ["::-webkit-progress-value", "::-moz-progress-bar"];
|
|
456
|
+
function pseudoFill(treatment, surface, profile, reject) {
|
|
457
|
+
const fields = profile.of(surface, "surface"), other = Object.keys(fields).find((field) => field !== "background");
|
|
458
|
+
if (other !== void 0)
|
|
459
|
+
return reject({ kind: "pseudo-surface-unsupported", pseudo: treatment.pseudo, surface, field: other });
|
|
460
|
+
return fields.background ?? reject({ kind: "pseudo-surface-unsupported", pseudo: treatment.pseudo, surface, field: null });
|
|
191
461
|
}
|
|
192
462
|
const covers = (visual) => visual.fit === "cover", COVER_FILL = { display: "block", "inline-size": "100%", "block-size": "100%", "min-block-size": "0", "object-fit": "cover" };
|
|
193
463
|
function normalizeElement(spec, name, path, values, provided, context) {
|
|
@@ -226,8 +496,20 @@ function lowerVector(part, stroke, path, context) {
|
|
|
226
496
|
out.rule(under(condition, path), { ...checked(vectorStateValues(part.name, surface, profile.of(surface, "surface")), reject) });
|
|
227
497
|
writeConditioned(part, path, {}, context);
|
|
228
498
|
}
|
|
229
|
-
function lowerParts(parts, parent, layout, gap, context) {
|
|
230
|
-
const
|
|
499
|
+
function lowerParts(parts, parent, layout, gap, context, parentGrows = !1, overlapping = null, stateGaps = []) {
|
|
500
|
+
for (const part of parts) {
|
|
501
|
+
const source = part.focusOf === null ? void 0 : parts.find((other) => other.name === part.focusOf);
|
|
502
|
+
if (source === void 0)
|
|
503
|
+
continue;
|
|
504
|
+
const focus = context.profile.of(context.slots["focus-profile"], "focus", part.name);
|
|
505
|
+
context.out.rule(`${parent}:has(> ${source.selector}:focus-visible) > ${part.selector}`, {
|
|
506
|
+
"outline-width": context.profile.field(focus, "focus", "width"),
|
|
507
|
+
"outline-color": context.profile.field(focus, "focus", "color"),
|
|
508
|
+
"outline-offset": context.profile.field(focus, "focus", "offset"),
|
|
509
|
+
"outline-style": "solid"
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
const lowered = parts.map((part) => lowerPart(part, parent, layout, context, parentGrows, overlapping));
|
|
231
513
|
if (layout !== "inline" && layout !== "stack")
|
|
232
514
|
return;
|
|
233
515
|
const axes = layout === "inline" ? ["inline"] : ["block"];
|
|
@@ -235,47 +517,90 @@ function lowerParts(parts, parent, layout, gap, context) {
|
|
|
235
517
|
const second = lowered[index + 1];
|
|
236
518
|
if (first === null || second === null || second === void 0)
|
|
237
519
|
return;
|
|
520
|
+
if (overlapping !== null)
|
|
521
|
+
return context.reject({ kind: "state-geometry-unsupported", element: parent === "&" ? "&" : parent, reason: "targets-overlap", detail: `${first.element} and ${second.element}` });
|
|
238
522
|
for (const axis of axes)
|
|
239
|
-
|
|
523
|
+
for (const between of [gap ?? "0px", ...stateGaps])
|
|
524
|
+
context.neighbours.push({ axis, gap: between, first, second });
|
|
240
525
|
});
|
|
241
526
|
}
|
|
242
|
-
function lowerPart(part, parent, parentLayout, context) {
|
|
527
|
+
function lowerPart(part, parent, parentLayout, context, parentGrows, overlapping = null) {
|
|
243
528
|
const { out, profile, slots, reject } = context, path = `${parent} > ${part.selector}`;
|
|
244
529
|
if (part.content.kind === "vector") {
|
|
245
530
|
lowerVector(part, part.content.stroke, path, context);
|
|
246
531
|
return null;
|
|
247
532
|
}
|
|
248
|
-
|
|
249
|
-
|
|
533
|
+
const partSurface = part.surface === null ? {} : profile.of(part.surface, "surface"), moving = partMotion(path, part.effects, context), collapsible = part.collapsed || part.geometryWhen.some((state) => state.collapsed !== null), axis = parentLayout === "inline" ? "inline" : parentLayout === "stack" ? "block" : null;
|
|
534
|
+
if (collapsible) {
|
|
535
|
+
if (axis === null)
|
|
536
|
+
return reject({ kind: "state-geometry-unsupported", element: part.name, reason: "collapsed-parent", detail: parentLayout });
|
|
537
|
+
const own = part.box !== null || part.frame !== null ? "a frame" : part.arrangement !== null ? "an arrangement" : part.overflow.kind !== "visible" ? "an overflow" : part.extent.kind === "fill" ? "a filling extent" : null;
|
|
538
|
+
if (own !== null)
|
|
539
|
+
return reject({ kind: "state-geometry-unsupported", element: part.name, reason: "collapsed-box", detail: own });
|
|
540
|
+
}
|
|
541
|
+
const restBox = part.box === null ? null : frameValues(profile.of(part.box, "frame"), profile, reject), partGeometry = writeStateGeometry(path, part.name, {
|
|
542
|
+
frame: restBox,
|
|
543
|
+
arrangement: part.arrangement,
|
|
544
|
+
arranged: part.arrangement === null ? {} : arrangementValues(part.arrangement, slots, profile, part.overflow),
|
|
545
|
+
collapsed: collapsible ? part.collapsed : null,
|
|
546
|
+
axis
|
|
547
|
+
}, part.geometryWhen, part.geometryTransition, (name) => frameValues(profile.of(name, "frame"), profile, reject), context);
|
|
548
|
+
if (partGeometry.overlap !== null)
|
|
549
|
+
out.rule(`${path} ${OVERLAPPED}`, { [partGeometry.overlap.property]: partGeometry.overlap.base });
|
|
550
|
+
if (collapsible && overlapping !== null) {
|
|
551
|
+
const own = `${path}:not(:first-child)`;
|
|
552
|
+
if (part.collapsed)
|
|
553
|
+
out.rule(own, { [overlapping.property]: "0px" });
|
|
554
|
+
for (const state of part.geometryWhen) {
|
|
555
|
+
if (state.collapsed === null)
|
|
556
|
+
continue;
|
|
557
|
+
out.rule(under(state.condition, own), { [overlapping.property]: state.collapsed ? "0px" : overlapping.states.get(state.condition) ?? overlapping.base });
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
const partGroups = [
|
|
561
|
+
...moving === null ? [] : [moving],
|
|
562
|
+
...measuredMotion(part.measured, profile, reject),
|
|
563
|
+
...partGeometry.group === null ? [] : [partGeometry.group],
|
|
564
|
+
...overlapping === null || overlapping.group === null || partGeometry.group?.properties.includes(overlapping.property) === !0 ? [] : [overlapping.group]
|
|
565
|
+
], moved = part.effects === null ? [] : [...new Set(part.effects.when.flatMap(([, names]) => names.map((name) => PART_EFFECTS[name].channel)))], entering = writeEnter(out, profile, path, part.enter, partSurface, stateSurfaces(path, part.when, profile), slots, [...transitioned(part.paintTransition, partGroups), ...moved], reject);
|
|
566
|
+
transitionRules(path, part.paintTransition, part.surface === null ? null : { name: part.surface, fields: partSurface }, part.when, context, entering === null ? partGroups : [...partGroups, entering.group]);
|
|
567
|
+
writePlays(out, profile, context.foundation, part.name, part.plays, path, [...transitioned(part.paintTransition, entering === null ? [] : [entering.group]), ...moved], reject);
|
|
568
|
+
const values = part.arrangement === null ? {} : { "box-sizing": "border-box", "min-inline-size": "0", ...arrangementValues(part.arrangement, slots, profile, part.overflow) };
|
|
569
|
+
if (collapsible && axis !== null)
|
|
570
|
+
Object.assign(values, collapsibleValues(axis), collapsedValues(part.collapsed, axis));
|
|
250
571
|
if (part.arrangement?.layout === "layered")
|
|
251
572
|
checked(checkLayers(part.name, part.parts.length), reject);
|
|
252
573
|
const text = part.text !== null ? textOf(part.text, slots, profile) : part.content.kind === "text" && slots["text-profile"] !== void 0 ? profile.of(slots["text-profile"], "text") : {};
|
|
253
574
|
Object.assign(values, text);
|
|
575
|
+
writeStateText(out, profile, part.name, text, part.textWhen, (condition) => under(condition, path), reject);
|
|
254
576
|
if (part.textEdge.length > 0)
|
|
255
577
|
Object.assign(values, { "text-box-trim": "trim-both", "text-box-edge": part.textEdge.join(" ") });
|
|
578
|
+
checkSurfaceEffects(context.foundation, profile, [part.surface, ...part.when.map(([, name]) => name)], part.content.kind === "visual" ? "visual" : part.overflow.kind === "scroll" ? "scroller" : "container", reject);
|
|
256
579
|
if (part.surface !== null)
|
|
257
|
-
Object.assign(values,
|
|
580
|
+
Object.assign(values, settled(partSurface, entering?.blurred ?? !1));
|
|
581
|
+
Object.assign(values, stickyValues(part.sticky, context), anchorClearValues(part.anchorClear, context));
|
|
582
|
+
const boxFields = part.box === null ? {} : frameValues(profile.of(part.box, "frame"), profile, reject);
|
|
583
|
+
if (part.box !== null)
|
|
584
|
+
Object.assign(values, { "box-sizing": "border-box" }, boxFields);
|
|
258
585
|
let target = null, frameFields = {};
|
|
259
586
|
if (part.frame !== null) {
|
|
260
|
-
const lineHeight = profile.field(text, "text", "line-height"), frame = profile.of(slots["frame-profile"], "frame", "control"), box = controlBox(frame, LINE_BOX, profile.field);
|
|
587
|
+
const lineHeight = profile.field(text, "text", "line-height"), frame = profile.of(slots["frame-profile"], "frame", "control"), box = controlBox(frame, LINE_BOX, profile.field, reject);
|
|
261
588
|
frameFields = controlBoxValues(box);
|
|
262
589
|
if (part.frame.border.kind === "rules") {
|
|
263
|
-
const paint = part.surface === null ? void 0 : profile.of(part.surface, "surface")["border-color"], rules = checked(frameRules(part.frame.border, frame["border-width"], { surface: part.surface, color: paint }, slots["frame-profile"] ?? null), reject);
|
|
590
|
+
const paint = part.surface === null ? void 0 : profile.of(part.surface, "surface")["border-color"], rules = checked(frameRules(part.frame.border, frame["border-width"], { surface: part.surface, color: paint }, slots["frame-profile"] ?? null, frame[BORDER_STYLE]), reject);
|
|
264
591
|
for (const side of ["top", "right", "bottom", "left"])
|
|
265
592
|
delete frameFields[`border-${side}-width`];
|
|
266
593
|
Object.assign(frameFields, rules);
|
|
267
594
|
for (const side of ["block-start", "block-end", "inline-start", "inline-end"])
|
|
268
|
-
if (!part.frame.border.sides.includes(side))
|
|
269
|
-
|
|
270
|
-
frameFields[`padding-${side}`] = `calc(${inset} + ${box.border})`;
|
|
271
|
-
}
|
|
595
|
+
if (!part.frame.border.sides.includes(side))
|
|
596
|
+
frameFields[`padding-${side}`] = `calc(${frameFields[`padding-${side}`]} + ${box.border})`;
|
|
272
597
|
}
|
|
273
598
|
Object.assign(values, { "box-sizing": "border-box", "min-inline-size": "0" }, frameFields);
|
|
274
599
|
const hitArea = hitAreaOf(frame);
|
|
275
600
|
writeHitArea(out, path, hitArea);
|
|
276
601
|
target = {
|
|
277
602
|
element: part.name,
|
|
278
|
-
frame: frameTarget(frame, profile.field),
|
|
603
|
+
frame: frameTarget(frame, box, profile.field),
|
|
279
604
|
hitArea,
|
|
280
605
|
content: { kind: "field", line: { lineHeight, fontSize: text["font-size"] ?? null } },
|
|
281
606
|
measured: measuredBounds(part.measured, values)
|
|
@@ -295,47 +620,78 @@ function lowerPart(part, parent, parentLayout, context) {
|
|
|
295
620
|
const partSnap = part.arrangement?.snap ?? null, snapped = partSnap === null ? null : checked(snapValues(partSnap, part.overflow, part.name), reject);
|
|
296
621
|
if (snapped !== null)
|
|
297
622
|
add(snapped.container, "snap");
|
|
298
|
-
add(checked(extentValues(part.extent, parentLayout, part.name), reject), "extent");
|
|
623
|
+
add(checked(extentValues(part.extent, parentLayout, part.name, parentGrows), reject), "extent");
|
|
299
624
|
if (parentLayout === "layered")
|
|
300
625
|
add(LAYER, "layer");
|
|
626
|
+
if (part.outset !== null) {
|
|
627
|
+
if (parentLayout !== "layered" || part.parts.length > 0 || part.content.kind === "text")
|
|
628
|
+
return reject({ kind: "outset-unsupported", part: part.name });
|
|
629
|
+
const spacing = (binding) => binding === null ? null : profile.field(profile.of(slots["spacing-profile"], "spacing", "outset"), "spacing", kebab(binding.field)), [block, inline] = [spacing(part.outset.block), spacing(part.outset.inline)], share = (value) => context.foundation.tokens.get(/^var\(\s*(--[\w-]+)\s*\)$/.exec(value)?.[1] ?? "")?.role === "box-share", outset = (axis, value) => value === null ? {} : axis === "block" && share(value) ? { "block-size": `calc(100% + 2 * ${value})`, "align-self": "center" } : { [`margin-${axis}`]: `calc(-1 * ${value})` };
|
|
630
|
+
add({ ...outset("block", block), ...outset("inline", inline) }, "outset");
|
|
631
|
+
}
|
|
301
632
|
normalizeElement(part, part.name, path, values, provided, context);
|
|
302
633
|
const twice = part.normalize.find(([property]) => context.rootNormalized.get(path)?.includes(property));
|
|
303
634
|
if (twice !== void 0)
|
|
304
635
|
return reject({ kind: "extent-conflict", element: part.name, property: twice[0], providers: ["recipe.normalize.when", "normalize"] });
|
|
305
636
|
add(normalizedDeclarations(part.normalize), "normalize");
|
|
306
|
-
const media = part.measured.some((value) => value.type === "position" || value.type === "intrinsic-size") && part.content.kind === "visual" && context.input.
|
|
637
|
+
const media = part.measured.some((value) => value.type === "position" || value.type === "intrinsic-size") && part.content.kind === "visual" && visualOf(context.input, part.name)?.kind === "content-media" ? covers(profile.of(slots["visual-profile"], "visual", "visual")) ? "cover" : "contain" : null;
|
|
307
638
|
Object.assign(values, checked(measuredWrites(context.input.scope, part.measured, part.name, values, part.frame !== null ? supplied(slots, frameFields) : null, media), reject));
|
|
308
639
|
Object.assign(values, paintValues(part.name, part.paints, "box", [part.surface], part.when, context));
|
|
309
640
|
writeConditioned(part, path, values, context);
|
|
641
|
+
const conditioned = conditionedVisual(part, context);
|
|
642
|
+
if (part.scheme !== null && visualOf(context.input, part.name)?.kind !== "content-media")
|
|
643
|
+
return reject({ kind: "scheme-unsupported", part: part.name });
|
|
310
644
|
if (part.content.kind === "visual")
|
|
311
|
-
lowerVisual(path, context, part.measured.find((value) => value.type === "intrinsic-size") ?? null);
|
|
645
|
+
lowerVisual(path, context, part.measured.find((value) => value.type === "intrinsic-size") ?? null, conditioned, part.scheme, boxFields, part.name);
|
|
312
646
|
if (snapped !== null)
|
|
313
647
|
out.rule(`${path} > *`, { ...snapped.children });
|
|
314
|
-
stateRules(out, path, part.when, profile);
|
|
648
|
+
stateRules(out, path, part.when, profile, entering?.blurred ?? !1);
|
|
315
649
|
for (const [condition, normalized] of part.normalizeWhen)
|
|
316
650
|
out.rule(under(condition, path), normalizedDeclarations(normalized));
|
|
317
651
|
pseudoRules(part, path, context);
|
|
318
|
-
lowerParts(part.parts, path, part.arrangement?.layout ?? "native", values.gap, context);
|
|
652
|
+
lowerParts(part.parts, path, part.arrangement?.layout ?? "native", values.gap, context, growsWithContent(values), partGeometry.overlap, partGeometry.gaps);
|
|
319
653
|
return target;
|
|
320
654
|
}
|
|
321
|
-
|
|
322
|
-
|
|
655
|
+
const visualOf = (input, part) => input.visuals?.get(part) ?? input.visual;
|
|
656
|
+
function conditionedVisual(part, context) {
|
|
657
|
+
const { profile, slots, foundation, reject } = context, [condition] = part.at;
|
|
658
|
+
if (condition === void 0 || condition.visual === null)
|
|
659
|
+
return null;
|
|
660
|
+
if (part.content.kind !== "visual")
|
|
661
|
+
return reject({ kind: "condition-visual-unsupported", part: part.name, condition: condition.condition, reason: "not-visual" });
|
|
662
|
+
const spatial = slots["spatial-profile"], bound = spatial === void 0 ? null : conditionBound(foundation, spatial, condition.condition, profile, reject);
|
|
663
|
+
if (bound === null)
|
|
664
|
+
return reject({ kind: "condition-unknown", part: part.name, condition: condition.condition, spatial: spatial ?? null });
|
|
665
|
+
return { part: part.name, condition: condition.condition, profile: condition.visual, query: ["media", conditionQueries(bound).inside] };
|
|
666
|
+
}
|
|
667
|
+
function lowerVisual(path, context, intrinsic, conditioned = null, scheme = null, box = {}, partName = null) {
|
|
668
|
+
const { out, profile, slots, input, reject } = context, inBox = (part) => Object.fromEntries(Object.entries(part).filter(([property]) => !((property === "inline-size" || property === "block-size") && box[property] !== void 0))), visual = partName === null ? input.visual : visualOf(input, partName);
|
|
323
669
|
if (visual === null)
|
|
324
670
|
return reject({ kind: "artwork-binding-missing" });
|
|
325
|
-
|
|
671
|
+
if (scheme !== null)
|
|
672
|
+
out.own(schemeSwitch(scheme));
|
|
673
|
+
const display = scheme === null ? "block" : schemeDisplay(scheme, "block"), inCondition = conditioned === null ? null : profile.of(conditioned.profile, "visual", "visual"), unsupported = (reason) => reject({ kind: "condition-visual-unsupported", part: conditioned?.part ?? "", condition: conditioned?.condition ?? "", reason }), visualProfile = profile.of(visual.kind === "asset" ? visual.visualProfile ?? slots["visual-profile"] : slots["visual-profile"], "visual", "visual");
|
|
326
674
|
switch (visual.kind) {
|
|
327
675
|
case "content-media": {
|
|
328
676
|
if (covers(visualProfile)) {
|
|
329
677
|
if (!context.coverBox || path.split(" > ").length !== 2)
|
|
330
678
|
return reject({ kind: "cover-box-missing" });
|
|
331
|
-
out.rule(path, { ...COVER_FILL });
|
|
679
|
+
out.rule(path, { ...COVER_FILL, display });
|
|
332
680
|
return;
|
|
333
681
|
}
|
|
334
682
|
const size = profile.field(visualProfile, "visual", "size"), inline = intrinsic === null ? "auto" : intrinsicInlineSize(context.input.scope, intrinsic, size);
|
|
335
|
-
out.rule(path, { display
|
|
683
|
+
out.rule(path, { display, "max-inline-size": "100%", "max-block-size": size, "inline-size": inline, "block-size": "auto", "object-fit": "contain" });
|
|
684
|
+
if (conditioned !== null && inCondition !== null) {
|
|
685
|
+
if (covers(inCondition))
|
|
686
|
+
return unsupported("media");
|
|
687
|
+
const narrow = profile.field(inCondition, "visual", "size");
|
|
688
|
+
out.rule(path, { "max-block-size": narrow, ...intrinsic === null ? {} : { "inline-size": intrinsicInlineSize(context.input.scope, intrinsic, narrow) } }, conditioned.query);
|
|
689
|
+
}
|
|
336
690
|
return;
|
|
337
691
|
}
|
|
338
692
|
case "inspected-svg": {
|
|
693
|
+
if (conditioned !== null)
|
|
694
|
+
return unsupported("media");
|
|
339
695
|
const size = profile.field(visualProfile, "visual", "size");
|
|
340
696
|
out.rule(path, { display: "flex", "align-items": "center", "justify-content": "center", "min-inline-size": "0", "max-inline-size": "100%" });
|
|
341
697
|
out.rule(`${path} > svg`, { display: "block", "flex-shrink": "0", "max-inline-size": "100%", "max-block-size": size });
|
|
@@ -344,6 +700,8 @@ function lowerVisual(path, context, intrinsic) {
|
|
|
344
700
|
case "asset":
|
|
345
701
|
break;
|
|
346
702
|
}
|
|
703
|
+
if (conditioned !== null && (covers(visualProfile) || inCondition !== null && covers(inCondition)))
|
|
704
|
+
return unsupported("media");
|
|
347
705
|
if (covers(visualProfile)) {
|
|
348
706
|
if (visual.asset.paint !== "intrinsic")
|
|
349
707
|
return reject({ kind: "cover-asset-unsupported", asset: visual.asset.name, paint: visual.asset.paint });
|
|
@@ -353,14 +711,25 @@ function lowerVisual(path, context, intrinsic) {
|
|
|
353
711
|
out.rule(path, { display: "block", "inline-size": "100%", "block-size": "100%", "min-block-size": "0" });
|
|
354
712
|
out.rule(`${path} > ${artwork.element}`, { ...COVER_FILL, "object-position": focalPosition(artwork.drawing.center) });
|
|
355
713
|
context.placedArtwork.push(artwork);
|
|
714
|
+
if (partName !== null)
|
|
715
|
+
context.placedByPart.set(partName, artwork);
|
|
356
716
|
return;
|
|
357
717
|
}
|
|
358
718
|
const geometry = visualPart(visual.asset, visualProfile, visual.state, visual.theme, reject);
|
|
359
|
-
out.rule(path, geometry.part);
|
|
719
|
+
out.rule(path, inBox(geometry.part));
|
|
360
720
|
out.rule(`${path} > ${geometry.element}`, geometry.media);
|
|
721
|
+
if (conditioned !== null && inCondition !== null) {
|
|
722
|
+
const other = visualPart(visual.asset, inCondition, visual.state, visual.theme, reject);
|
|
723
|
+
if (other.source !== geometry.source || other.element !== geometry.element)
|
|
724
|
+
return unsupported("drawing-differs");
|
|
725
|
+
out.rule(path, inBox(other.part), conditioned.query);
|
|
726
|
+
out.rule(`${path} > ${other.element}`, other.media, conditioned.query);
|
|
727
|
+
}
|
|
361
728
|
if (visual.asset.paint === "slots")
|
|
362
729
|
out.paint(path.replace(/^& > /, ""), [...visual.asset.slots].map(([slot, value]) => ({ slot, paint: value === "currentColor" ? { kind: "current-color" } : { kind: "token", name: value } })));
|
|
363
730
|
context.placedArtwork.push(placed(geometry));
|
|
731
|
+
if (partName !== null)
|
|
732
|
+
context.placedByPart.set(partName, placed(geometry));
|
|
364
733
|
}
|
|
365
734
|
function layerInput(layer, spec, root, slots, profile, foundation, reject) {
|
|
366
735
|
if ((slots["surface-profile"] ?? spec.surface) === null)
|
|
@@ -433,8 +802,27 @@ export function lowerRegion(spec, foundation, input) {
|
|
|
433
802
|
out.own(paintProperty(input.scope, paint.name));
|
|
434
803
|
for (const token of paintTokens(paints))
|
|
435
804
|
out.use(`var(${token})`);
|
|
436
|
-
const placedArtwork = [], targets = [], neighbours = [], rootNormalized = new Map(spec.normalizeWhen.map(([selector, normalized]) => [selector, normalized.map(([property]) => property)])), coverBox = spec.frame !== null && (spec.frame.kind === "fields" && spec.frame.ratio !== null || slots["frame-profile"] !== void 0 && profile.of(slots["frame-profile"], "frame")["block-size"] !== void 0), context = { out, profile, slots, input, reject, placedArtwork, foundation, targets, neighbours, rootNormalized, coverBox }, surface = slots["surface-profile"] ?? spec.surface
|
|
437
|
-
|
|
805
|
+
const placedArtwork = [], placedByPart = new Map, targets = [], neighbours = [], rootNormalized = new Map(spec.normalizeWhen.map(([selector, normalized]) => [selector, normalized.map(([property]) => property)])), coverBox = spec.frame !== null && (spec.frame.kind === "fields" && spec.frame.ratio !== null || slots["frame-profile"] !== void 0 && profile.of(slots["frame-profile"], "frame")["block-size"] !== void 0), context = { out, profile, slots, input, reject, placedArtwork, placedByPart, foundation, targets, neighbours, rootNormalized, coverBox }, surface = slots["surface-profile"] ?? spec.surface;
|
|
806
|
+
checkSurfaceEffects(foundation, profile, [slots["surface-profile"], spec.surface, ...spec.when.map(([, name]) => name)], spec.overflow.kind === "scroll" ? "scroller" : "container", reject);
|
|
807
|
+
const press = spec.press.when.length === 0 ? null : writeRootPress(out, spec.press, profile.of(slots["motion-profile"], "motion", spec.profile ?? "recipe"), profile, reject), rootSurface = surface === null ? {} : profile.of(surface, "surface"), restFramed = spec.frame === null || spec.frameAt === null || spec.frameAt.corners === null ? spec.frame : { ...spec.frame, corners: spec.frame.corners ?? FRAME_CORNERS }, rootGeometry = writeStateGeometry("&", "&", {
|
|
808
|
+
frame: restFramed === null ? null : regionFrameValues(restFramed, slots, surface, profile, reject).values,
|
|
809
|
+
arrangement: spec.arrangement,
|
|
810
|
+
arranged: spec.arrangement.layout === "native" ? {} : arrangementValues(spec.arrangement, slots, profile, spec.overflow),
|
|
811
|
+
collapsed: null,
|
|
812
|
+
axis: null
|
|
813
|
+
}, spec.geometryWhen, spec.geometryTransition, (name) => {
|
|
814
|
+
if (restFramed === null)
|
|
815
|
+
return {};
|
|
816
|
+
const stated = regionFrameValues(restFramed, { ...slots, "frame-profile": name }, surface, profile, reject);
|
|
817
|
+
if (JSON.stringify(stated.hitArea) !== JSON.stringify(regionFrameValues(restFramed, slots, surface, profile, reject).hitArea))
|
|
818
|
+
return reject({ kind: "state-geometry-unsupported", element: "&", reason: "hit-area", detail: name });
|
|
819
|
+
return stated.values;
|
|
820
|
+
}, { out, profile, slots, reject });
|
|
821
|
+
if (rootGeometry.overlap !== null)
|
|
822
|
+
out.rule(`& ${OVERLAPPED}`, { [rootGeometry.overlap.property]: rootGeometry.overlap.base });
|
|
823
|
+
const rootGroups = [...press === null ? [] : [press], ...measuredMotion(spec.measured, profile, reject), ...rootGeometry.group === null ? [] : [rootGeometry.group]], entering = writeEnter(out, profile, "&", spec.enter, rootSurface, stateSurfaces("&", spec.when, profile), slots, transitioned(spec.paintTransition, rootGroups), reject);
|
|
824
|
+
transitionRules("&", spec.paintTransition, surface === null ? null : { name: surface, fields: rootSurface }, spec.when, context, entering === null ? rootGroups : [...rootGroups, entering.group]);
|
|
825
|
+
writePlays(out, profile, foundation, "&", spec.plays, "&", transitioned(spec.paintTransition, entering === null ? rootGroups : [...rootGroups, entering.group]), reject);
|
|
438
826
|
const { arrangement } = spec, values = arrangement.layout !== "native" || spec.frame !== null ? { "box-sizing": "border-box", "min-inline-size": "0" } : {};
|
|
439
827
|
let exposed = null;
|
|
440
828
|
if (spec.exposeRows.length > 0) {
|
|
@@ -446,14 +834,22 @@ export function lowerRegion(spec, foundation, input) {
|
|
|
446
834
|
values["row-gap"] = gap;
|
|
447
835
|
exposed = { rows: spec.exposeRows, gap: gap ?? null };
|
|
448
836
|
} else
|
|
449
|
-
Object.assign(values, arrangementValues(arrangement, slots, profile));
|
|
837
|
+
Object.assign(values, arrangementValues(arrangement, slots, profile, spec.overflow));
|
|
450
838
|
if (arrangement.layout === "layered")
|
|
451
839
|
checked(checkLayers("&", spec.parts.length), reject);
|
|
452
840
|
if (slots["surface-profile"] !== void 0)
|
|
453
841
|
Object.assign(values, profile.of(slots["surface-profile"], "surface"));
|
|
454
|
-
const
|
|
842
|
+
const framed = spec.frame === null || spec.frameAt === null || spec.frameAt.corners === null ? spec.frame : { ...spec.frame, corners: spec.frame.corners ?? FRAME_CORNERS }, rootFrame = framed === null ? null : regionFrameValues(framed, slots, surface, profile, reject);
|
|
455
843
|
if (rootFrame !== null)
|
|
456
844
|
Object.assign(values, rootFrame.values);
|
|
845
|
+
if (framed !== null && rootFrame !== null && spec.frameAt !== null) {
|
|
846
|
+
const { condition, border, corners } = spec.frameAt, spatial = slots["spatial-profile"], bound = spatial === void 0 ? null : conditionBound(foundation, spatial, condition, profile, reject);
|
|
847
|
+
if (bound === null)
|
|
848
|
+
return reject({ kind: "condition-unknown", part: "&", condition, spatial: spatial ?? null });
|
|
849
|
+
const held = regionFrameValues({ ...framed, border: border ?? framed.border, corners: corners ?? framed.corners }, slots, surface, profile, reject).values, changed = Object.fromEntries(Object.entries(held).filter(([property, value]) => rootFrame.values[property] !== value));
|
|
850
|
+
if (Object.keys(changed).length > 0)
|
|
851
|
+
out.rule("&", changed, ["media", conditionQueries(bound).inside]);
|
|
852
|
+
}
|
|
457
853
|
if (arrangement.layout === "inline" && spec.layer === null) {
|
|
458
854
|
const fixed = values["inline-size"] !== void 0;
|
|
459
855
|
if (spec.extent === "container") {
|
|
@@ -472,7 +868,9 @@ export function lowerRegion(spec, foundation, input) {
|
|
|
472
868
|
const rootHitArea = rootFrame?.hitArea ?? { inline: null, block: null }, hitField = rootHitArea.inline !== null ? "min-target-inline-size" : rootHitArea.block !== null ? "min-target-block-size" : null;
|
|
473
869
|
if (spec.layer !== null && hitField !== null)
|
|
474
870
|
return reject({ kind: "profile-field-unsupported", profile: slots["frame-profile"] ?? "frame", field: hitField, value: rootHitArea.inline ?? rootHitArea.block ?? "" });
|
|
475
|
-
|
|
871
|
+
const rootText = textOf(spec.text, slots, profile);
|
|
872
|
+
Object.assign(values, treatment(slots, "surface", spec.surface, profile, reject), rootText);
|
|
873
|
+
writeStateText(out, profile, "&", rootText, spec.textWhen, (condition) => condition, reject);
|
|
476
874
|
const provided = new Map;
|
|
477
875
|
if (spec.textAlign !== null)
|
|
478
876
|
checked(compose(values, provided, { "text-align": spec.textAlign }, "text layout", "&", "extent"), reject);
|
|
@@ -502,9 +900,9 @@ export function lowerRegion(spec, foundation, input) {
|
|
|
502
900
|
if (Object.keys(measured).length > 0)
|
|
503
901
|
out.rule(openState(layer.kind), measured);
|
|
504
902
|
} else {
|
|
505
|
-
Object.assign(values, checked(measuredWrites(input.scope, spec.measured, "&", values, frameSupplied), reject), rootPaints);
|
|
903
|
+
Object.assign(values, stickyValues(spec.sticky, context), anchorClearValues(spec.anchorClear, context), checked(measuredWrites(input.scope, spec.measured, "&", values, frameSupplied), reject), rootPaints);
|
|
506
904
|
if (Object.keys(values).length > 0)
|
|
507
|
-
out.rule("&", values);
|
|
905
|
+
out.rule("&", { ...settled(values, entering?.blurred ?? !1) });
|
|
508
906
|
if (spec.normalize.length > 0)
|
|
509
907
|
out.rule("&", normalizedDeclarations(spec.normalize));
|
|
510
908
|
writeHitArea(out, "&", rootHitArea);
|
|
@@ -513,11 +911,11 @@ export function lowerRegion(spec, foundation, input) {
|
|
|
513
911
|
out.rule("& > *", { ...rootSnap.children });
|
|
514
912
|
for (const [selector, normalized] of spec.normalizeWhen)
|
|
515
913
|
out.rule(selector, normalizedDeclarations(normalized));
|
|
516
|
-
stateRules(out, "&", spec.when, profile);
|
|
914
|
+
stateRules(out, "&", spec.when, profile, entering?.blurred ?? !1);
|
|
915
|
+
if (spec.prose !== null)
|
|
916
|
+
lowerProse(spec.prose, rootSurface, context);
|
|
517
917
|
const partLayout = spec.exposeRows.length > 0 ? "grid" : arrangement.layout;
|
|
518
|
-
lowerParts(spec.parts, "&", partLayout, values.gap, context);
|
|
519
|
-
|
|
520
|
-
return reject({ kind: "parts-visual-repeated" });
|
|
521
|
-
return out.finish({ kind: "region", artwork: placedArtwork[0] ?? null, exposed, targets: { elements: targets, neighbours } }, input.hidden);
|
|
918
|
+
lowerParts(spec.parts, "&", partLayout, values.gap, context, growsWithContent(values), rootGeometry.overlap, rootGeometry.gaps);
|
|
919
|
+
return out.finish({ kind: "region", artwork: placedArtwork[0] ?? null, artworks: placedByPart, exposed, targets: { elements: targets, neighbours } }, input.hidden);
|
|
522
920
|
});
|
|
523
921
|
}
|