af-motion 0.0.0-stage → 1.0.0
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/CHANGELOG.md +33 -0
- package/LICENSE +201 -0
- package/README.md +203 -3
- package/RELEASE_NOTES.md +115 -0
- package/bin/af-motion.js +16 -0
- package/bin/mcp-server.js +21 -0
- package/dist/3d/adapter.d.ts +29 -0
- package/dist/3d/assets/cache.d.ts +71 -0
- package/dist/3d/assets/index.d.ts +10 -0
- package/dist/3d/assets/inspection.d.ts +19 -0
- package/dist/3d/assets/loaders.d.ts +30 -0
- package/dist/3d/assets/manager.d.ts +69 -0
- package/dist/3d/assets/scene-integration.d.ts +23 -0
- package/dist/3d/assets/types.d.ts +80 -0
- package/dist/3d/assets/validation.d.ts +12 -0
- package/dist/3d/camera/index.d.ts +7 -0
- package/dist/3d/camera/presets.d.ts +8 -0
- package/dist/3d/camera/transitions.d.ts +19 -0
- package/dist/3d/camera/types.d.ts +37 -0
- package/dist/3d/camera/validation.d.ts +9 -0
- package/dist/3d/capabilities.d.ts +11 -0
- package/dist/3d/composition/fallback.d.ts +20 -0
- package/dist/3d/composition/generation.d.ts +24 -0
- package/dist/3d/composition/index.d.ts +12 -0
- package/dist/3d/composition/quality.d.ts +35 -0
- package/dist/3d/composition/recipes.d.ts +34 -0
- package/dist/3d/composition/types.d.ts +88 -0
- package/dist/3d/composition/unified.d.ts +18 -0
- package/dist/3d/environment/index.d.ts +6 -0
- package/dist/3d/environment/presets.d.ts +8 -0
- package/dist/3d/environment/types.d.ts +36 -0
- package/dist/3d/environment/validation.d.ts +9 -0
- package/dist/3d/geometry/cache.d.ts +37 -0
- package/dist/3d/geometry/generators.d.ts +24 -0
- package/dist/3d/geometry/hash.d.ts +10 -0
- package/dist/3d/geometry/index.d.ts +9 -0
- package/dist/3d/geometry/three-adapter.d.ts +15 -0
- package/dist/3d/geometry/types.d.ts +120 -0
- package/dist/3d/geometry/validation.d.ts +6 -0
- package/dist/3d/index.d.ts +32 -0
- package/dist/3d/interaction/camera-controls.d.ts +58 -0
- package/dist/3d/interaction/index.d.ts +8 -0
- package/dist/3d/interaction/manager.d.ts +61 -0
- package/dist/3d/interaction/presets.d.ts +9 -0
- package/dist/3d/interaction/raycaster.d.ts +20 -0
- package/dist/3d/interaction/types.d.ts +78 -0
- package/dist/3d/lighting/index.d.ts +6 -0
- package/dist/3d/lighting/presets.d.ts +8 -0
- package/dist/3d/lighting/types.d.ts +31 -0
- package/dist/3d/lighting/validation.d.ts +17 -0
- package/dist/3d/materials/bridge.d.ts +11 -0
- package/dist/3d/materials/index.d.ts +7 -0
- package/dist/3d/materials/presets.d.ts +9 -0
- package/dist/3d/materials/types.d.ts +43 -0
- package/dist/3d/materials/validation.d.ts +9 -0
- package/dist/3d/morphing/animator.d.ts +19 -0
- package/dist/3d/morphing/correspondence.d.ts +32 -0
- package/dist/3d/morphing/geometry.d.ts +28 -0
- package/dist/3d/morphing/index.d.ts +16 -0
- package/dist/3d/morphing/interpolation.d.ts +45 -0
- package/dist/3d/morphing/morph.d.ts +18 -0
- package/dist/3d/morphing/presets.d.ts +31 -0
- package/dist/3d/morphing/react.d.ts +29 -0
- package/dist/3d/morphing/topology.d.ts +34 -0
- package/dist/3d/morphing/types.d.ts +138 -0
- package/dist/3d/morphing/validation.d.ts +19 -0
- package/dist/3d/optimization/analysis.d.ts +14 -0
- package/dist/3d/optimization/colliders.d.ts +16 -0
- package/dist/3d/optimization/geometry.d.ts +22 -0
- package/dist/3d/optimization/hierarchy.d.ts +14 -0
- package/dist/3d/optimization/index.d.ts +33 -0
- package/dist/3d/optimization/lod.d.ts +13 -0
- package/dist/3d/optimization/materials.d.ts +12 -0
- package/dist/3d/optimization/recommendations.d.ts +13 -0
- package/dist/3d/optimization/skeleton.d.ts +20 -0
- package/dist/3d/optimization/types.d.ts +252 -0
- package/dist/3d/physics/benchmark.d.ts +76 -0
- package/dist/3d/physics/body/inertia.d.ts +61 -0
- package/dist/3d/physics/collision/ccd.d.ts +26 -0
- package/dist/3d/physics/collision/narrowphase.d.ts +15 -0
- package/dist/3d/physics/collision/shapes.d.ts +45 -0
- package/dist/3d/physics/constraints/advanced.d.ts +40 -0
- package/dist/3d/physics/constraints/solver.d.ts +34 -0
- package/dist/3d/physics/constraints/types.d.ts +106 -0
- package/dist/3d/physics/events.d.ts +34 -0
- package/dist/3d/physics/index.d.ts +29 -0
- package/dist/3d/physics/material.d.ts +27 -0
- package/dist/3d/physics/math.d.ts +79 -0
- package/dist/3d/physics/soft/cloth.d.ts +12 -0
- package/dist/3d/physics/soft/collision.d.ts +12 -0
- package/dist/3d/physics/soft/gpu.d.ts +19 -0
- package/dist/3d/physics/soft/pbd.d.ts +20 -0
- package/dist/3d/physics/soft/rope.d.ts +16 -0
- package/dist/3d/physics/soft/soft-body.d.ts +12 -0
- package/dist/3d/physics/soft/types.d.ts +212 -0
- package/dist/3d/physics/solver/integrators.d.ts +25 -0
- package/dist/3d/physics/solver/types.d.ts +28 -0
- package/dist/3d/physics/spatial/spatial-hash.d.ts +51 -0
- package/dist/3d/physics/types.d.ts +579 -0
- package/dist/3d/physics/world.d.ts +106 -0
- package/dist/3d/r3f.d.ts +34 -0
- package/dist/3d/scene.d.ts +8 -0
- package/dist/3d/schema.d.ts +739 -0
- package/dist/3d/schemas/ai-integration.d.ts +201 -0
- package/dist/3d/schemas/correction.d.ts +11 -0
- package/dist/3d/schemas/index.d.ts +12 -0
- package/dist/3d/schemas/schemas.d.ts +361 -0
- package/dist/3d/schemas/serialization.d.ts +22 -0
- package/dist/3d/schemas/types.d.ts +199 -0
- package/dist/3d/schemas/validation.d.ts +33 -0
- package/dist/3d/scroll/controller.d.ts +32 -0
- package/dist/3d/scroll/index.d.ts +6 -0
- package/dist/3d/scroll/presets.d.ts +9 -0
- package/dist/3d/scroll/types.d.ts +53 -0
- package/dist/3d/terrain/biomes.d.ts +18 -0
- package/dist/3d/terrain/chunks.d.ts +20 -0
- package/dist/3d/terrain/erosion.d.ts +15 -0
- package/dist/3d/terrain/heightmap.d.ts +27 -0
- package/dist/3d/terrain/index.d.ts +18 -0
- package/dist/3d/terrain/materials.d.ts +20 -0
- package/dist/3d/terrain/noise.d.ts +25 -0
- package/dist/3d/terrain/physics.d.ts +34 -0
- package/dist/3d/terrain/terrain.d.ts +12 -0
- package/dist/3d/terrain/types.d.ts +235 -0
- package/dist/3d/terrain/vegetation.d.ts +14 -0
- package/dist/3d/types.d.ts +176 -0
- package/dist/3d/world/hydrology.d.ts +12 -0
- package/dist/3d/world/index.d.ts +15 -0
- package/dist/3d/world/lighting.d.ts +16 -0
- package/dist/3d/world/pipeline.d.ts +20 -0
- package/dist/3d/world/population.d.ts +12 -0
- package/dist/3d/world/presets.d.ts +11 -0
- package/dist/3d/world/streaming.d.ts +13 -0
- package/dist/3d/world/types.d.ts +272 -0
- package/dist/3d/world/world.d.ts +64 -0
- package/dist/backgrounds/advanced-gradient.d.ts +32 -0
- package/dist/backgrounds/atmospheric-backgrounds.d.ts +79 -0
- package/dist/backgrounds/aurora.d.ts +24 -0
- package/dist/backgrounds/cosmic-background.d.ts +31 -0
- package/dist/backgrounds/energy-effects.d.ts +78 -0
- package/dist/backgrounds/floating-orbs.d.ts +26 -0
- package/dist/backgrounds/fluid-backgrounds.d.ts +72 -0
- package/dist/backgrounds/geometric-backgrounds.d.ts +78 -0
- package/dist/backgrounds/gradient.d.ts +20 -0
- package/dist/backgrounds/grid.d.ts +22 -0
- package/dist/backgrounds/internal/canvas-lifecycle.d.ts +29 -0
- package/dist/backgrounds/noise.d.ts +20 -0
- package/dist/backgrounds/particle-background.d.ts +37 -0
- package/dist/backgrounds/particle-field.d.ts +22 -0
- package/dist/backgrounds/spotlight.d.ts +20 -0
- package/dist/backgrounds/wave.d.ts +22 -0
- package/dist/catalogue.d.ts +227 -0
- package/dist/catalogue.js +4 -0
- package/dist/chunks/catalogue-ZmbeEdRo.js +59850 -0
- package/dist/chunks/core-animation-CeiI_TEe.js +1394 -0
- package/dist/chunks/motion-choreography-DC6LWvDk.js +4089 -0
- package/dist/chunks/pointer-capture-lrnKAl2I.js +158 -0
- package/dist/chunks/safe-json-D5j34GEB.js +62 -0
- package/dist/chunks/scroll-velocity-BNUHaS0-.js +904 -0
- package/dist/cli/commands/doctor.d.ts +9 -0
- package/dist/cli/commands/example.d.ts +9 -0
- package/dist/cli/commands/info.d.ts +8 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/presets.d.ts +10 -0
- package/dist/cli/commands/validate.d.ts +9 -0
- package/dist/cli/index.d.ts +22 -0
- package/dist/cli/types.d.ts +115 -0
- package/dist/cli/utils/safety.d.ts +11 -0
- package/dist/cli/utils/templates.d.ts +16 -0
- package/dist/cli/utils/terminal.d.ts +29 -0
- package/dist/cli.js +825 -0
- package/dist/core/adaptive-motion.d.ts +100 -0
- package/dist/core/adaptive-quality/controller.d.ts +61 -0
- package/dist/core/adaptive-quality/index.d.ts +13 -0
- package/dist/core/adaptive-quality/metrics.d.ts +33 -0
- package/dist/core/adaptive-quality/policies.d.ts +40 -0
- package/dist/core/adaptive-quality/profile.d.ts +58 -0
- package/dist/core/adaptive-quality/react.d.ts +57 -0
- package/dist/core/adaptive-quality/recommendation.d.ts +12 -0
- package/dist/core/adaptive-quality/resolution.d.ts +22 -0
- package/dist/core/adaptive-quality/types.d.ts +362 -0
- package/dist/core/advanced-motion/adapters.d.ts +20 -0
- package/dist/core/advanced-motion/controller.d.ts +52 -0
- package/dist/core/advanced-motion/index.d.ts +12 -0
- package/dist/core/advanced-motion/recipes.d.ts +16 -0
- package/dist/core/advanced-motion/timeline.d.ts +35 -0
- package/dist/core/advanced-motion/types.d.ts +174 -0
- package/dist/core/advanced-motion/validation.d.ts +11 -0
- package/dist/core/agent-workflows/agent-registry.d.ts +21 -0
- package/dist/core/agent-workflows/agents/accessibility-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/composition-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/design-to-motion-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/index.d.ts +13 -0
- package/dist/core/agent-workflows/agents/motion-intelligence-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/performance-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/scene-generation-agent.d.ts +9 -0
- package/dist/core/agent-workflows/collaboration-planner.d.ts +38 -0
- package/dist/core/agent-workflows/collaboration-workflows.d.ts +83 -0
- package/dist/core/agent-workflows/communication.d.ts +29 -0
- package/dist/core/agent-workflows/conflict-resolver.d.ts +25 -0
- package/dist/core/agent-workflows/context.d.ts +36 -0
- package/dist/core/agent-workflows/execution-engine.d.ts +30 -0
- package/dist/core/agent-workflows/index.d.ts +20 -0
- package/dist/core/agent-workflows/orchestration-types.d.ts +144 -0
- package/dist/core/agent-workflows/orchestrator.d.ts +29 -0
- package/dist/core/agent-workflows/react.d.ts +71 -0
- package/dist/core/agent-workflows/shared-context.d.ts +36 -0
- package/dist/core/agent-workflows/task-planner.d.ts +42 -0
- package/dist/core/agent-workflows/templates.d.ts +14 -0
- package/dist/core/agent-workflows/tool-registry.d.ts +24 -0
- package/dist/core/agent-workflows/types.d.ts +167 -0
- package/dist/core/ai-ecosystem/capability-registry.d.ts +23 -0
- package/dist/core/ai-ecosystem/index.d.ts +13 -0
- package/dist/core/ai-ecosystem/pipeline.d.ts +19 -0
- package/dist/core/ai-ecosystem/provider.d.ts +19 -0
- package/dist/core/ai-ecosystem/types.d.ts +69 -0
- package/dist/core/ai-motion-intelligence/engine.d.ts +51 -0
- package/dist/core/ai-motion-intelligence/explanation-engine.d.ts +8 -0
- package/dist/core/ai-motion-intelligence/index.d.ts +15 -0
- package/dist/core/ai-motion-intelligence/intent-classifier.d.ts +14 -0
- package/dist/core/ai-motion-intelligence/knowledge-base.d.ts +12 -0
- package/dist/core/ai-motion-intelligence/provider.d.ts +31 -0
- package/dist/core/ai-motion-intelligence/quality-evaluator.d.ts +9 -0
- package/dist/core/ai-motion-intelligence/react.d.ts +14 -0
- package/dist/core/ai-motion-intelligence/recommendation-engine.d.ts +16 -0
- package/dist/core/ai-motion-intelligence/types.d.ts +134 -0
- package/dist/core/ai-motion-registry.d.ts +201 -0
- package/dist/core/animate.d.ts +57 -0
- package/dist/core/animation-intelligence/engine.d.ts +42 -0
- package/dist/core/animation-intelligence/index.d.ts +11 -0
- package/dist/core/animation-intelligence/intent.d.ts +15 -0
- package/dist/core/animation-intelligence/schema.d.ts +42 -0
- package/dist/core/animation-intelligence/scoring.d.ts +15 -0
- package/dist/core/animation-intelligence/types.d.ts +91 -0
- package/dist/core/animation-parallel.d.ts +37 -0
- package/dist/core/animation-presets.d.ts +56 -0
- package/dist/core/animation-sequence.d.ts +37 -0
- package/dist/core/animation-timeline.d.ts +46 -0
- package/dist/core/animation.d.ts +48 -0
- package/dist/core/built-in-palettes.d.ts +331 -0
- package/dist/core/choreography-intelligence/bridge.d.ts +43 -0
- package/dist/core/choreography-intelligence/generator.d.ts +11 -0
- package/dist/core/choreography-intelligence/index.d.ts +11 -0
- package/dist/core/choreography-intelligence/intent.d.ts +11 -0
- package/dist/core/choreography-intelligence/schema.d.ts +76 -0
- package/dist/core/choreography-intelligence/types.d.ts +87 -0
- package/dist/core/composition.d.ts +170 -0
- package/dist/core/configuration-corrector.d.ts +85 -0
- package/dist/core/design-intelligence.d.ts +199 -0
- package/dist/core/design-system.d.ts +206 -0
- package/dist/core/design-to-motion/design-analyzer.d.ts +13 -0
- package/dist/core/design-to-motion/engine.d.ts +34 -0
- package/dist/core/design-to-motion/generator.d.ts +16 -0
- package/dist/core/design-to-motion/index.d.ts +15 -0
- package/dist/core/design-to-motion/input-parser.d.ts +17 -0
- package/dist/core/design-to-motion/motion-planner.d.ts +11 -0
- package/dist/core/design-to-motion/presets.d.ts +11 -0
- package/dist/core/design-to-motion/react.d.ts +13 -0
- package/dist/core/design-to-motion/types.d.ts +221 -0
- package/dist/core/design-to-motion/validator.d.ts +13 -0
- package/dist/core/device-capabilities/classification.d.ts +25 -0
- package/dist/core/device-capabilities/detection.d.ts +27 -0
- package/dist/core/device-capabilities/graphics.d.ts +22 -0
- package/dist/core/device-capabilities/hardware.d.ts +27 -0
- package/dist/core/device-capabilities/index.d.ts +14 -0
- package/dist/core/device-capabilities/monitor.d.ts +19 -0
- package/dist/core/device-capabilities/react.d.ts +24 -0
- package/dist/core/device-capabilities/runtime.d.ts +11 -0
- package/dist/core/device-capabilities/scoring.d.ts +18 -0
- package/dist/core/device-capabilities/types.d.ts +171 -0
- package/dist/core/effect-composer.d.ts +41 -0
- package/dist/core/generation-pipeline.d.ts +135 -0
- package/dist/core/inertia.d.ts +30 -0
- package/dist/core/interactions/cursor-controller.d.ts +9 -0
- package/dist/core/interactions/custom-gestures.d.ts +28 -0
- package/dist/core/interactions/device-capabilities.d.ts +12 -0
- package/dist/core/interactions/drag-controller.d.ts +60 -0
- package/dist/core/interactions/errors.d.ts +13 -0
- package/dist/core/interactions/gesture-classifier.d.ts +43 -0
- package/dist/core/interactions/gesture-intelligence-controller.d.ts +9 -0
- package/dist/core/interactions/gesture-recognizers.d.ts +160 -0
- package/dist/core/interactions/gesture-sequence.d.ts +9 -0
- package/dist/core/interactions/index.d.ts +27 -0
- package/dist/core/interactions/input-normalizer.d.ts +8 -0
- package/dist/core/interactions/interaction-manager.d.ts +43 -0
- package/dist/core/interactions/keyboard-manager.d.ts +16 -0
- package/dist/core/interactions/magnetic-controller.d.ts +9 -0
- package/dist/core/interactions/magnetic-group.d.ts +11 -0
- package/dist/core/interactions/multitouch-controller.d.ts +62 -0
- package/dist/core/interactions/pointer-controller.d.ts +34 -0
- package/dist/core/interactions/pointer-tracker.d.ts +32 -0
- package/dist/core/interactions/prioritizer.d.ts +17 -0
- package/dist/core/interactions/touch-controller.d.ts +35 -0
- package/dist/core/interactions/types.d.ts +710 -0
- package/dist/core/layout/controller.d.ts +56 -0
- package/dist/core/layout/flip.d.ts +21 -0
- package/dist/core/layout/group.d.ts +46 -0
- package/dist/core/layout/index.d.ts +12 -0
- package/dist/core/layout/measure.d.ts +30 -0
- package/dist/core/layout/presets.d.ts +24 -0
- package/dist/core/layout/types.d.ts +189 -0
- package/dist/core/microinteractions/generator.d.ts +11 -0
- package/dist/core/microinteractions/index.d.ts +11 -0
- package/dist/core/microinteractions/intent.d.ts +11 -0
- package/dist/core/microinteractions/runtime.d.ts +25 -0
- package/dist/core/microinteractions/schema.d.ts +82 -0
- package/dist/core/microinteractions/types.d.ts +79 -0
- package/dist/core/motion-choreography.d.ts +163 -0
- package/dist/core/motion-dna.d.ts +129 -0
- package/dist/core/motion-path/animator.d.ts +13 -0
- package/dist/core/motion-path/engine.d.ts +27 -0
- package/dist/core/motion-path/follower.d.ts +8 -0
- package/dist/core/motion-path/index.d.ts +15 -0
- package/dist/core/motion-path/lut.d.ts +33 -0
- package/dist/core/motion-path/parser.d.ts +26 -0
- package/dist/core/motion-path/segments.d.ts +16 -0
- package/dist/core/motion-path/types.d.ts +178 -0
- package/dist/core/motion-path/vector3.d.ts +49 -0
- package/dist/core/motion-recipe.d.ts +171 -0
- package/dist/core/motion-states.d.ts +43 -0
- package/dist/core/motion-validation/consistency.d.ts +11 -0
- package/dist/core/motion-validation/index.d.ts +11 -0
- package/dist/core/motion-validation/optimizer.d.ts +11 -0
- package/dist/core/motion-validation/schema.d.ts +81 -0
- package/dist/core/motion-validation/types.d.ts +53 -0
- package/dist/core/motion-validation/validator.d.ts +11 -0
- package/dist/core/motion.d.ts +7 -0
- package/dist/core/natural-motion.d.ts +110 -0
- package/dist/core/palette-colors.d.ts +16 -0
- package/dist/core/palette-styles.d.ts +12 -0
- package/dist/core/palettes.d.ts +59 -0
- package/dist/core/performance-intelligence/conflicts.d.ts +21 -0
- package/dist/core/performance-intelligence/context.d.ts +48 -0
- package/dist/core/performance-intelligence/coordinator.d.ts +84 -0
- package/dist/core/performance-intelligence/decisions.d.ts +17 -0
- package/dist/core/performance-intelligence/history.d.ts +44 -0
- package/dist/core/performance-intelligence/index.d.ts +15 -0
- package/dist/core/performance-intelligence/policies.d.ts +59 -0
- package/dist/core/performance-intelligence/react.d.ts +78 -0
- package/dist/core/performance-intelligence/report.d.ts +16 -0
- package/dist/core/performance-intelligence/scoring.d.ts +16 -0
- package/dist/core/performance-intelligence/types.d.ts +203 -0
- package/dist/core/performance-optimizer/bottlenecks.d.ts +9 -0
- package/dist/core/performance-optimizer/index.d.ts +13 -0
- package/dist/core/performance-optimizer/optimizer.d.ts +43 -0
- package/dist/core/performance-optimizer/profiler.d.ts +38 -0
- package/dist/core/performance-optimizer/react.d.ts +55 -0
- package/dist/core/performance-optimizer/strategies.d.ts +22 -0
- package/dist/core/performance-optimizer/types.d.ts +227 -0
- package/dist/core/performance-optimizer/workers.d.ts +27 -0
- package/dist/core/physics/collision-constraints.d.ts +15 -0
- package/dist/core/physics/collision-detection.d.ts +93 -0
- package/dist/core/physics/collision-response.d.ts +24 -0
- package/dist/core/physics/collision-types.d.ts +381 -0
- package/dist/core/physics/collision-world.d.ts +11 -0
- package/dist/core/physics/composition-behaviors.d.ts +97 -0
- package/dist/core/physics/composition-choreography.d.ts +14 -0
- package/dist/core/physics/composition-engine.d.ts +25 -0
- package/dist/core/physics/composition-recipes.d.ts +46 -0
- package/dist/core/physics/composition-types.d.ts +265 -0
- package/dist/core/physics/composition-validation.d.ts +33 -0
- package/dist/core/physics/index.d.ts +37 -0
- package/dist/core/physics/inertia-animation.d.ts +11 -0
- package/dist/core/physics/inertia-math.d.ts +56 -0
- package/dist/core/physics/inertia-presets.d.ts +25 -0
- package/dist/core/physics/inertia-simulation.d.ts +11 -0
- package/dist/core/physics/inertia-types.d.ts +355 -0
- package/dist/core/physics/inertia-validation.d.ts +22 -0
- package/dist/core/physics/math.d.ts +99 -0
- package/dist/core/physics/presets.d.ts +28 -0
- package/dist/core/physics/simulation.d.ts +11 -0
- package/dist/core/physics/spring-animation.d.ts +11 -0
- package/dist/core/physics/spring-math.d.ts +47 -0
- package/dist/core/physics/spring-presets.d.ts +29 -0
- package/dist/core/physics/spring-simulation.d.ts +11 -0
- package/dist/core/physics/spring-types.d.ts +350 -0
- package/dist/core/physics/spring-validation.d.ts +22 -0
- package/dist/core/physics/stepper.d.ts +24 -0
- package/dist/core/physics/types.d.ts +280 -0
- package/dist/core/physics/validation.d.ts +62 -0
- package/dist/core/pointer-capture.d.ts +7 -0
- package/dist/core/reference-analysis/index.d.ts +10 -0
- package/dist/core/reference-analysis/interpreter.d.ts +12 -0
- package/dist/core/reference-analysis/planner.d.ts +15 -0
- package/dist/core/reference-analysis/specification.d.ts +14 -0
- package/dist/core/reference-analysis/types.d.ts +244 -0
- package/dist/core/resource-intelligence/cache.d.ts +43 -0
- package/dist/core/resource-intelligence/gpu.d.ts +19 -0
- package/dist/core/resource-intelligence/index.d.ts +16 -0
- package/dist/core/resource-intelligence/leaks.d.ts +13 -0
- package/dist/core/resource-intelligence/memory.d.ts +27 -0
- package/dist/core/resource-intelligence/pooling.d.ts +32 -0
- package/dist/core/resource-intelligence/pressure.d.ts +32 -0
- package/dist/core/resource-intelligence/react.d.ts +63 -0
- package/dist/core/resource-intelligence/registry.d.ts +33 -0
- package/dist/core/resource-intelligence/reports.d.ts +14 -0
- package/dist/core/resource-intelligence/types.d.ts +232 -0
- package/dist/core/scene-generation/engine.d.ts +31 -0
- package/dist/core/scene-generation/generator.d.ts +14 -0
- package/dist/core/scene-generation/index.d.ts +14 -0
- package/dist/core/scene-generation/input-parser.d.ts +24 -0
- package/dist/core/scene-generation/presets.d.ts +10 -0
- package/dist/core/scene-generation/react.d.ts +13 -0
- package/dist/core/scene-generation/scene-analyzer.d.ts +9 -0
- package/dist/core/scene-generation/scene-planner.d.ts +12 -0
- package/dist/core/scene-generation/types.d.ts +236 -0
- package/dist/core/scene-generation/validator.d.ts +18 -0
- package/dist/core/schema.d.ts +185 -0
- package/dist/core/scroll-intelligence/generator.d.ts +11 -0
- package/dist/core/scroll-intelligence/index.d.ts +11 -0
- package/dist/core/scroll-intelligence/intent.d.ts +11 -0
- package/dist/core/scroll-intelligence/runtime.d.ts +21 -0
- package/dist/core/scroll-intelligence/schema.d.ts +78 -0
- package/dist/core/scroll-intelligence/types.d.ts +85 -0
- package/dist/core/spring.d.ts +38 -0
- package/dist/core/svg-morph/animator.d.ts +10 -0
- package/dist/core/svg-morph/arc-to-cubic.d.ts +11 -0
- package/dist/core/svg-morph/index.d.ts +10 -0
- package/dist/core/svg-morph/interpolate.d.ts +23 -0
- package/dist/core/svg-morph/normalize.d.ts +34 -0
- package/dist/core/svg-morph/parser.d.ts +13 -0
- package/dist/core/svg-morph/shapes.d.ts +32 -0
- package/dist/core/svg-morph/types.d.ts +144 -0
- package/dist/core/transform.d.ts +27 -0
- package/dist/core/transitions/controller.d.ts +45 -0
- package/dist/core/transitions/engine.d.ts +26 -0
- package/dist/core/transitions/group-transition.d.ts +30 -0
- package/dist/core/transitions/index.d.ts +15 -0
- package/dist/core/transitions/presets.d.ts +16 -0
- package/dist/core/transitions/schema.d.ts +71 -0
- package/dist/core/transitions/shared-element-transition.d.ts +88 -0
- package/dist/core/transitions/shared-element.d.ts +84 -0
- package/dist/core/transitions/types.d.ts +185 -0
- package/dist/core/transitions/view-transition.d.ts +25 -0
- package/dist/core/typography/engine.d.ts +19 -0
- package/dist/core/typography/index.d.ts +15 -0
- package/dist/core/typography/path-motion.d.ts +24 -0
- package/dist/core/typography/presets.d.ts +14 -0
- package/dist/core/typography/properties.d.ts +19 -0
- package/dist/core/typography/segmenter.d.ts +32 -0
- package/dist/core/typography/stagger.d.ts +15 -0
- package/dist/core/typography/transitions.d.ts +11 -0
- package/dist/core/typography/types.d.ts +154 -0
- package/dist/core/utils/safe-json.d.ts +50 -0
- package/dist/core/visual-style-registry.d.ts +659 -0
- package/dist/easing/easings.d.ts +44 -0
- package/dist/effects/border-beam.d.ts +28 -0
- package/dist/effects/count-up.d.ts +30 -0
- package/dist/effects/cursor-trail.d.ts +23 -0
- package/dist/effects/drag.d.ts +41 -0
- package/dist/effects/draw-svg.d.ts +19 -0
- package/dist/effects/follow-pointer.d.ts +19 -0
- package/dist/effects/glow.d.ts +25 -0
- package/dist/effects/gradient-text.d.ts +22 -0
- package/dist/effects/hover-motion.d.ts +32 -0
- package/dist/effects/in-view.d.ts +14 -0
- package/dist/effects/magnetic.d.ts +40 -0
- package/dist/effects/morph-svg.d.ts +15 -0
- package/dist/effects/parallax.d.ts +42 -0
- package/dist/effects/pinch.d.ts +27 -0
- package/dist/effects/reveal.d.ts +33 -0
- package/dist/effects/ripple.d.ts +21 -0
- package/dist/effects/scroll-animate.d.ts +23 -0
- package/dist/effects/scroll-direction.d.ts +19 -0
- package/dist/effects/scroll-progress.d.ts +29 -0
- package/dist/effects/scroll-trigger.d.ts +22 -0
- package/dist/effects/scroll-velocity.d.ts +29 -0
- package/dist/effects/shine.d.ts +23 -0
- package/dist/effects/split-text.d.ts +17 -0
- package/dist/effects/spotlight.d.ts +24 -0
- package/dist/effects/stagger.d.ts +46 -0
- package/dist/effects/swipe.d.ts +27 -0
- package/dist/effects/text-highlight.d.ts +25 -0
- package/dist/effects/text-mask.d.ts +25 -0
- package/dist/effects/text-reveal.d.ts +28 -0
- package/dist/effects/text-scramble.d.ts +18 -0
- package/dist/effects/tilt.d.ts +42 -0
- package/dist/effects/typewriter.d.ts +26 -0
- package/dist/graphics/capabilities.d.ts +12 -0
- package/dist/graphics/composition/engine.d.ts +14 -0
- package/dist/graphics/composition/fallback.d.ts +13 -0
- package/dist/graphics/composition/index.d.ts +10 -0
- package/dist/graphics/composition/ordering.d.ts +29 -0
- package/dist/graphics/composition/quality.d.ts +24 -0
- package/dist/graphics/composition/schema.d.ts +156 -0
- package/dist/graphics/composition/types.d.ts +81 -0
- package/dist/graphics/composition/unified.d.ts +23 -0
- package/dist/graphics/effects/advanced/engine.d.ts +9 -0
- package/dist/graphics/effects/advanced/index.d.ts +1 -0
- package/dist/graphics/effects/composer.d.ts +9 -0
- package/dist/graphics/effects/distortion/engine.d.ts +9 -0
- package/dist/graphics/effects/distortion/index.d.ts +1 -0
- package/dist/graphics/effects/fluid/engine.d.ts +9 -0
- package/dist/graphics/effects/fluid/index.d.ts +1 -0
- package/dist/graphics/effects/index.d.ts +10 -0
- package/dist/graphics/effects/particles/engine.d.ts +9 -0
- package/dist/graphics/effects/particles/index.d.ts +2 -0
- package/dist/graphics/effects/particles/pool.d.ts +17 -0
- package/dist/graphics/effects/schema.d.ts +312 -0
- package/dist/graphics/effects/types.d.ts +85 -0
- package/dist/graphics/engine.d.ts +5 -0
- package/dist/graphics/environment/clouds.d.ts +28 -0
- package/dist/graphics/environment/environment.d.ts +50 -0
- package/dist/graphics/environment/fire-smoke.d.ts +32 -0
- package/dist/graphics/environment/fog.d.ts +28 -0
- package/dist/graphics/environment/index.d.ts +18 -0
- package/dist/graphics/environment/lightning.d.ts +33 -0
- package/dist/graphics/environment/rain.d.ts +33 -0
- package/dist/graphics/environment/snow.d.ts +30 -0
- package/dist/graphics/environment/types.d.ts +184 -0
- package/dist/graphics/environment/weather.d.ts +19 -0
- package/dist/graphics/environment/wind.d.ts +23 -0
- package/dist/graphics/fluid/flow-field.d.ts +74 -0
- package/dist/graphics/fluid/grid.d.ts +43 -0
- package/dist/graphics/fluid/index.d.ts +13 -0
- package/dist/graphics/fluid/interactions.d.ts +39 -0
- package/dist/graphics/fluid/rendering.d.ts +32 -0
- package/dist/graphics/fluid/simulation.d.ts +50 -0
- package/dist/graphics/fluid/solver.d.ts +19 -0
- package/dist/graphics/fluid/types.d.ts +186 -0
- package/dist/graphics/gpu-simulation/backends/backend.d.ts +24 -0
- package/dist/graphics/gpu-simulation/backends/cpu.d.ts +21 -0
- package/dist/graphics/gpu-simulation/backends/selection.d.ts +15 -0
- package/dist/graphics/gpu-simulation/backends/webgl2.d.ts +28 -0
- package/dist/graphics/gpu-simulation/backends/webgpu.d.ts +23 -0
- package/dist/graphics/gpu-simulation/capabilities.d.ts +14 -0
- package/dist/graphics/gpu-simulation/device.d.ts +17 -0
- package/dist/graphics/gpu-simulation/engine.d.ts +8 -0
- package/dist/graphics/gpu-simulation/index.d.ts +22 -0
- package/dist/graphics/gpu-simulation/ping-pong.d.ts +23 -0
- package/dist/graphics/gpu-simulation/pipeline.d.ts +18 -0
- package/dist/graphics/gpu-simulation/resource-manager.d.ts +8 -0
- package/dist/graphics/gpu-simulation/shaders.d.ts +50 -0
- package/dist/graphics/gpu-simulation/types.d.ts +288 -0
- package/dist/graphics/index.d.ts +23 -0
- package/dist/graphics/materials/glass.d.ts +22 -0
- package/dist/graphics/materials/index.d.ts +9 -0
- package/dist/graphics/materials/lighting.d.ts +22 -0
- package/dist/graphics/materials/presets.d.ts +28 -0
- package/dist/graphics/materials/schema.d.ts +574 -0
- package/dist/graphics/materials/surface.d.ts +13 -0
- package/dist/graphics/materials/types.d.ts +150 -0
- package/dist/graphics/particle-fields/composition.d.ts +32 -0
- package/dist/graphics/particle-fields/forces.d.ts +103 -0
- package/dist/graphics/particle-fields/index.d.ts +12 -0
- package/dist/graphics/particle-fields/interaction.d.ts +32 -0
- package/dist/graphics/particle-fields/spatial-index.d.ts +20 -0
- package/dist/graphics/particle-fields/system.d.ts +52 -0
- package/dist/graphics/particle-fields/types.d.ts +138 -0
- package/dist/graphics/particles/behaviors.d.ts +11 -0
- package/dist/graphics/particles/controller.d.ts +82 -0
- package/dist/graphics/particles/data-layout.d.ts +51 -0
- package/dist/graphics/particles/emitters.d.ts +24 -0
- package/dist/graphics/particles/index.d.ts +15 -0
- package/dist/graphics/particles/random.d.ts +25 -0
- package/dist/graphics/particles/rendering.d.ts +16 -0
- package/dist/graphics/particles/simulation.d.ts +23 -0
- package/dist/graphics/particles/types.d.ts +282 -0
- package/dist/graphics/renderer.d.ts +66 -0
- package/dist/graphics/resource-manager.d.ts +6 -0
- package/dist/graphics/schema.d.ts +177 -0
- package/dist/graphics/simulation/adapters.d.ts +36 -0
- package/dist/graphics/simulation/coordinator.d.ts +64 -0
- package/dist/graphics/simulation/index.d.ts +11 -0
- package/dist/graphics/simulation/optimizer.d.ts +101 -0
- package/dist/graphics/simulation/resource-manager.d.ts +40 -0
- package/dist/graphics/simulation/types.d.ts +126 -0
- package/dist/graphics/textures/cache.d.ts +29 -0
- package/dist/graphics/textures/canvas-utils.d.ts +31 -0
- package/dist/graphics/textures/engine.d.ts +34 -0
- package/dist/graphics/textures/generators.d.ts +29 -0
- package/dist/graphics/textures/index.d.ts +11 -0
- package/dist/graphics/textures/material-integration.d.ts +20 -0
- package/dist/graphics/textures/prng.d.ts +27 -0
- package/dist/graphics/textures/schema.d.ts +219 -0
- package/dist/graphics/textures/types.d.ts +80 -0
- package/dist/graphics/types.d.ts +152 -0
- package/dist/graphics/viewport.d.ts +32 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +4921 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/prompts.d.ts +9 -0
- package/dist/mcp/resources.d.ts +9 -0
- package/dist/mcp/server.d.ts +29 -0
- package/dist/mcp/tools.d.ts +9 -0
- package/dist/mcp/transport.d.ts +33 -0
- package/dist/mcp/types.d.ts +96 -0
- package/dist/presets.d.ts +176 -0
- package/dist/presets.js +3 -0
- package/dist/react.d.ts +5358 -0
- package/dist/react.js +7557 -0
- package/package.json +112 -6
|
@@ -0,0 +1,4089 @@
|
|
|
1
|
+
import { C as e, D as t, N as n, l as r, rt as i, t as a } from "./core-animation-CeiI_TEe.js";
|
|
2
|
+
// src/core/animation-sequence.ts
|
|
3
|
+
function o() {
|
|
4
|
+
let e = /* @__PURE__ */ Error("Animation sequence was cancelled");
|
|
5
|
+
return e.name = "AbortError", e;
|
|
6
|
+
}
|
|
7
|
+
function s(e, t = {}) {
|
|
8
|
+
if (!Array.isArray(e)) throw TypeError("steps must be an array");
|
|
9
|
+
if (typeof t != "object" || !t) throw TypeError("options must be an object");
|
|
10
|
+
if (t.onComplete !== void 0 && typeof t.onComplete != "function") throw TypeError("onComplete must be a function");
|
|
11
|
+
if (t.onStart !== void 0 && typeof t.onStart != "function") throw TypeError("onStart must be a function");
|
|
12
|
+
if (t.onCancel !== void 0 && typeof t.onCancel != "function") throw TypeError("onCancel must be a function");
|
|
13
|
+
let n = () => void 0, r = () => void 0, i = new Promise((e, t) => {
|
|
14
|
+
n = e, r = t;
|
|
15
|
+
}), s = null, l = 0, u = !1, d = !1, f = !1, p = null, m = !1, h = (e) => {
|
|
16
|
+
u || (u = !0, s = null, r(e));
|
|
17
|
+
}, g = () => {
|
|
18
|
+
if (d || u) return;
|
|
19
|
+
if (l >= e.length) {
|
|
20
|
+
try {
|
|
21
|
+
if (t.onComplete?.(), d || u) return;
|
|
22
|
+
u = !0, n();
|
|
23
|
+
} catch (e) {
|
|
24
|
+
h(e);
|
|
25
|
+
}
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
let r = e[l++];
|
|
29
|
+
if (!r || typeof r != "object") h(/* @__PURE__ */ TypeError(`Animation sequence step ${l - 1} must be an object`));
|
|
30
|
+
else try {
|
|
31
|
+
s = a(r.target, r.properties, {
|
|
32
|
+
...r.options,
|
|
33
|
+
...p === null ? {} : { playbackRate: p },
|
|
34
|
+
onStart: () => {
|
|
35
|
+
try {
|
|
36
|
+
m || (m = !0, t.onStart?.()), r.options?.onStart?.();
|
|
37
|
+
} catch (e) {
|
|
38
|
+
throw h(e), e;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
onUpdate: (e) => {
|
|
42
|
+
try {
|
|
43
|
+
r.options?.onUpdate?.(e);
|
|
44
|
+
} catch (e) {
|
|
45
|
+
throw h(e), e;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
onComplete: () => {
|
|
49
|
+
s = null;
|
|
50
|
+
try {
|
|
51
|
+
r.options?.onComplete?.(), !d && !u && g();
|
|
52
|
+
} catch (e) {
|
|
53
|
+
h(e);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}), f && s.pause();
|
|
57
|
+
} catch (e) {
|
|
58
|
+
h(e);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
return g(), {
|
|
62
|
+
finished: i,
|
|
63
|
+
pause: () => {
|
|
64
|
+
u || f || (f = !0, s?.pause());
|
|
65
|
+
},
|
|
66
|
+
resume: () => {
|
|
67
|
+
!u && f && (f = !1, s?.resume());
|
|
68
|
+
},
|
|
69
|
+
reverse: () => {
|
|
70
|
+
u || s?.reverse();
|
|
71
|
+
},
|
|
72
|
+
setPlaybackRate: (e) => {
|
|
73
|
+
c(e), p = e, s?.setPlaybackRate(e);
|
|
74
|
+
},
|
|
75
|
+
getPlaybackRate: () => s?.getPlaybackRate() ?? p ?? 1,
|
|
76
|
+
cancel: () => {
|
|
77
|
+
if (u || d) return;
|
|
78
|
+
d = !0;
|
|
79
|
+
let e = s;
|
|
80
|
+
h(o());
|
|
81
|
+
try {
|
|
82
|
+
e?.cancel();
|
|
83
|
+
} finally {
|
|
84
|
+
s = null, t.onCancel?.();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function c(e) {
|
|
90
|
+
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw RangeError(`playbackRate must be a finite number > 0, received ${String(e)}`);
|
|
91
|
+
}
|
|
92
|
+
// src/core/effect-composer.ts
|
|
93
|
+
function l(e) {
|
|
94
|
+
if (typeof e != "object" || !e) return !1;
|
|
95
|
+
let t = e;
|
|
96
|
+
return typeof t.destroy == "function" || typeof t.cancel == "function";
|
|
97
|
+
}
|
|
98
|
+
function u(e) {
|
|
99
|
+
"destroy" in e ? e.destroy() : e.cancel();
|
|
100
|
+
}
|
|
101
|
+
function d(t) {
|
|
102
|
+
if (!Array.isArray(t)) throw TypeError("Effect composition entries must be an array");
|
|
103
|
+
let n = [], i = !1, a = !1, o = (e) => {
|
|
104
|
+
if (i || (e === "pause" ? a : !a)) return;
|
|
105
|
+
a = e === "pause";
|
|
106
|
+
let t = [];
|
|
107
|
+
for (let r of n) try {
|
|
108
|
+
r[e]?.();
|
|
109
|
+
} catch (e) {
|
|
110
|
+
t.push(e);
|
|
111
|
+
}
|
|
112
|
+
if (t.length > 0) throw AggregateError(t, `One or more composed effects failed to ${e}`);
|
|
113
|
+
}, s = () => {
|
|
114
|
+
if (i) return;
|
|
115
|
+
i = !0;
|
|
116
|
+
let e = [];
|
|
117
|
+
for (let t of [...n].reverse()) try {
|
|
118
|
+
u(t);
|
|
119
|
+
} catch (t) {
|
|
120
|
+
e.push(t);
|
|
121
|
+
}
|
|
122
|
+
if (n.length = 0, e.length > 0) throw AggregateError(e, "One or more composed effects failed to clean up");
|
|
123
|
+
}, c = [];
|
|
124
|
+
try {
|
|
125
|
+
for (let [i, a] of t.entries()) {
|
|
126
|
+
if (a === null || typeof a != "object" && typeof a != "function") throw TypeError(`Effect composition entry ${i} must provide a start function or controls`);
|
|
127
|
+
let t, o = !1;
|
|
128
|
+
if (typeof a == "function") t = a(), o = !0;
|
|
129
|
+
else if ("start" in a && typeof a.start == "function") {
|
|
130
|
+
if ("motionDNA" in a && a.motionDNA !== void 0) {
|
|
131
|
+
let n = e(a.motionDNA.name, a.motionDNA.overrides), i = a.adaptive ? r(n, typeof a.adaptive == "object" ? a.adaptive : void 0) : n;
|
|
132
|
+
t = a.start(i);
|
|
133
|
+
} else t = a.start();
|
|
134
|
+
o = !0;
|
|
135
|
+
} else if (l(a)) t = a;
|
|
136
|
+
else throw TypeError(`Effect composition entry ${i} must provide a start function or controls`);
|
|
137
|
+
if (!l(t)) throw TypeError(`Effect composition entry ${i} must return destroy() or cancel() controls`);
|
|
138
|
+
o && c.push(t), n.push(t);
|
|
139
|
+
}
|
|
140
|
+
} catch (e) {
|
|
141
|
+
let t = [];
|
|
142
|
+
for (let e of [...c].reverse()) try {
|
|
143
|
+
u(e);
|
|
144
|
+
} catch (e) {
|
|
145
|
+
t.push(e);
|
|
146
|
+
}
|
|
147
|
+
throw n.length = 0, c.length = 0, t.length > 0 ? AggregateError([e, ...t], "Effect composition failed to start and clean up") : e;
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
destroy: s,
|
|
151
|
+
cancel: s,
|
|
152
|
+
pause: () => o("pause"),
|
|
153
|
+
resume: () => o("resume"),
|
|
154
|
+
get effects() {
|
|
155
|
+
return [...n];
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
// src/core/built-in-palettes.ts
|
|
160
|
+
var f = [
|
|
161
|
+
{
|
|
162
|
+
name: "Cobalt Classic",
|
|
163
|
+
primary: "#111111",
|
|
164
|
+
secondary: "#FFFFFF",
|
|
165
|
+
accent: "#0047AB",
|
|
166
|
+
colorNames: {
|
|
167
|
+
primary: "Black",
|
|
168
|
+
secondary: "White",
|
|
169
|
+
accent: "Cobalt Blue"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "Burnt Chocolate",
|
|
174
|
+
primary: "#6F3B22",
|
|
175
|
+
secondary: "#FFF1D6",
|
|
176
|
+
accent: "#CC5500",
|
|
177
|
+
colorNames: {
|
|
178
|
+
primary: "Chocolate Brown",
|
|
179
|
+
secondary: "Cream",
|
|
180
|
+
accent: "Burnt Orange"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "Dusty Romance",
|
|
185
|
+
primary: "#800020",
|
|
186
|
+
secondary: "#FFF1D6",
|
|
187
|
+
accent: "#D8A7A7",
|
|
188
|
+
colorNames: {
|
|
189
|
+
primary: "Burgundy",
|
|
190
|
+
secondary: "Cream",
|
|
191
|
+
accent: "Dusty Pink"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "Cosmic Mocha",
|
|
196
|
+
primary: "#FFF8E7",
|
|
197
|
+
secondary: "#DCC7AA",
|
|
198
|
+
accent: "#4A102A",
|
|
199
|
+
colorNames: {
|
|
200
|
+
primary: "Cosmic Latte",
|
|
201
|
+
secondary: "Mocha Cream",
|
|
202
|
+
accent: "Deep Burgundy"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "Earth & Amber",
|
|
207
|
+
primary: "#A3B18A",
|
|
208
|
+
secondary: "#969A98",
|
|
209
|
+
accent: "#C87924",
|
|
210
|
+
colorNames: {
|
|
211
|
+
primary: "Sage Green",
|
|
212
|
+
secondary: "Concrete Grey",
|
|
213
|
+
accent: "Burnt Amber"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "Primary Pop",
|
|
218
|
+
primary: "#A7D8F0",
|
|
219
|
+
secondary: "#E32636",
|
|
220
|
+
accent: "#FFD93D",
|
|
221
|
+
colorNames: {
|
|
222
|
+
primary: "Baby Blue",
|
|
223
|
+
secondary: "Red",
|
|
224
|
+
accent: "Sunshine Yellow"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: "Midnight Voltage",
|
|
229
|
+
primary: "#101B3F",
|
|
230
|
+
secondary: "#0047AB",
|
|
231
|
+
accent: "#F02D3A",
|
|
232
|
+
colorNames: {
|
|
233
|
+
primary: "Midnight Navy",
|
|
234
|
+
secondary: "Cobalt Blue",
|
|
235
|
+
accent: "Bright Red"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "Earthbound",
|
|
240
|
+
primary: "#242424",
|
|
241
|
+
secondary: "#795548",
|
|
242
|
+
accent: "#C87924",
|
|
243
|
+
colorNames: {
|
|
244
|
+
primary: "Charcoal Black",
|
|
245
|
+
secondary: "Earth Brown",
|
|
246
|
+
accent: "Burnt Amber"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "Electric Teal",
|
|
251
|
+
primary: "#101418",
|
|
252
|
+
secondary: "#F5EBDD",
|
|
253
|
+
accent: "#00D6C9",
|
|
254
|
+
colorNames: {
|
|
255
|
+
primary: "Ink Black",
|
|
256
|
+
secondary: "Warm Ivory",
|
|
257
|
+
accent: "Electric Teal"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: "Crimson Midnight",
|
|
262
|
+
primary: "#111A33",
|
|
263
|
+
secondary: "#A7A29A",
|
|
264
|
+
accent: "#DC143C",
|
|
265
|
+
colorNames: {
|
|
266
|
+
primary: "Midnight Navy",
|
|
267
|
+
secondary: "Warm Stone Grey",
|
|
268
|
+
accent: "Crimson Red"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "Neon Abyss",
|
|
273
|
+
primary: "#08080C",
|
|
274
|
+
secondary: "#FF2442",
|
|
275
|
+
accent: "#4B0082",
|
|
276
|
+
colorNames: {
|
|
277
|
+
primary: "Deep Black",
|
|
278
|
+
secondary: "Neon Red",
|
|
279
|
+
accent: "Indigo"
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: "Royal Atlas",
|
|
284
|
+
primary: "#FFFFF0",
|
|
285
|
+
secondary: "#D4AF37",
|
|
286
|
+
accent: "#102A43",
|
|
287
|
+
colorNames: {
|
|
288
|
+
primary: "Ivory",
|
|
289
|
+
secondary: "Gold",
|
|
290
|
+
accent: "Deep Atlas Navy"
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: "Ember Editorial",
|
|
295
|
+
primary: "#CC5500",
|
|
296
|
+
secondary: "#F5EBDD",
|
|
297
|
+
accent: "#202124",
|
|
298
|
+
colorNames: {
|
|
299
|
+
primary: "Burnt Orange",
|
|
300
|
+
secondary: "Warm Ivory",
|
|
301
|
+
accent: "Soft Black"
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
name: "Editorial Heat",
|
|
306
|
+
primary: "#F5EBDD",
|
|
307
|
+
secondary: "#153E75",
|
|
308
|
+
accent: "#FF765E",
|
|
309
|
+
colorNames: {
|
|
310
|
+
primary: "Warm Ivory",
|
|
311
|
+
secondary: "Deep Editorial Blue",
|
|
312
|
+
accent: "Coral Orange"
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
name: "Strawberry Riot",
|
|
317
|
+
primary: "#F6B7C8",
|
|
318
|
+
secondary: "#D7193F",
|
|
319
|
+
accent: "#A8E10C",
|
|
320
|
+
colorNames: {
|
|
321
|
+
primary: "Soft Strawberry Pink",
|
|
322
|
+
secondary: "Vibrant Crimson Red",
|
|
323
|
+
accent: "Lime Green"
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: "Sage & Olive",
|
|
328
|
+
primary: "#F8F8F2",
|
|
329
|
+
secondary: "#A3B18A",
|
|
330
|
+
accent: "#414833",
|
|
331
|
+
colorNames: {
|
|
332
|
+
primary: "Soft White",
|
|
333
|
+
secondary: "Sage Green",
|
|
334
|
+
accent: "Deep Olive"
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: "Solar Cobalt",
|
|
339
|
+
primary: "#D8C3A5",
|
|
340
|
+
secondary: "#0047AB",
|
|
341
|
+
accent: "#FFD447",
|
|
342
|
+
colorNames: {
|
|
343
|
+
primary: "Warm Beige",
|
|
344
|
+
secondary: "Cobalt Blue",
|
|
345
|
+
accent: "Sun Yellow"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: "Electric Eclipse",
|
|
350
|
+
primary: "#090A0F",
|
|
351
|
+
secondary: "#8F00FF",
|
|
352
|
+
accent: "#FFD447",
|
|
353
|
+
colorNames: {
|
|
354
|
+
primary: "Midnight Black",
|
|
355
|
+
secondary: "Electric Violet",
|
|
356
|
+
accent: "Sun Yellow"
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: "Silver Signal",
|
|
361
|
+
primary: "#343A40",
|
|
362
|
+
secondary: "#C7CDD4",
|
|
363
|
+
accent: "#E51B23",
|
|
364
|
+
colorNames: {
|
|
365
|
+
primary: "Charcoal Grey",
|
|
366
|
+
secondary: "Moonlit Silver",
|
|
367
|
+
accent: "Signal Red"
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
name: "Amethyst Circuit",
|
|
372
|
+
primary: "#0A0A0A",
|
|
373
|
+
secondary: "#7851A9",
|
|
374
|
+
accent: "#00E5FF",
|
|
375
|
+
colorNames: {
|
|
376
|
+
primary: "Jet Black",
|
|
377
|
+
secondary: "Royal Amethyst",
|
|
378
|
+
accent: "Electric Cyan"
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
name: "Woodland Glow",
|
|
383
|
+
primary: "#A3B18A",
|
|
384
|
+
secondary: "#5D4037",
|
|
385
|
+
accent: "#FFB000",
|
|
386
|
+
colorNames: {
|
|
387
|
+
primary: "Sage Green",
|
|
388
|
+
secondary: "Walnut Brown",
|
|
389
|
+
accent: "Amber Glow"
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
name: "Peach Voltage",
|
|
394
|
+
primary: "#F7C6A3",
|
|
395
|
+
secondary: "#A8E10C",
|
|
396
|
+
accent: "#DC143C",
|
|
397
|
+
colorNames: {
|
|
398
|
+
primary: "Soft Peach",
|
|
399
|
+
secondary: "Lime Green",
|
|
400
|
+
accent: "Crimson"
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
name: "Forest Lavender",
|
|
405
|
+
primary: "#E7DDC8",
|
|
406
|
+
secondary: "#1F5B45",
|
|
407
|
+
accent: "#C8B6E2",
|
|
408
|
+
colorNames: {
|
|
409
|
+
primary: "Oatmeal",
|
|
410
|
+
secondary: "Pine Green",
|
|
411
|
+
accent: "Soft Lilac"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: "Mauve Terracotta",
|
|
416
|
+
primary: "#B7849A",
|
|
417
|
+
secondary: "#4B203A",
|
|
418
|
+
accent: "#C66B4E",
|
|
419
|
+
colorNames: {
|
|
420
|
+
primary: "Dusty Mauve",
|
|
421
|
+
secondary: "Deep Plum",
|
|
422
|
+
accent: "Terracotta"
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: "Chromatic Riot",
|
|
427
|
+
primary: "#B9A7E8",
|
|
428
|
+
secondary: "#C7E000",
|
|
429
|
+
accent: "#F04438",
|
|
430
|
+
colorNames: {
|
|
431
|
+
primary: "Lavender",
|
|
432
|
+
secondary: "Chartreuse",
|
|
433
|
+
accent: "Tomato Red"
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
name: "Neon Rebellion",
|
|
438
|
+
primary: "#0A0A0A",
|
|
439
|
+
secondary: "#FF2D95",
|
|
440
|
+
accent: "#C7E000",
|
|
441
|
+
colorNames: {
|
|
442
|
+
primary: "Jet Black",
|
|
443
|
+
secondary: "Hot Pink",
|
|
444
|
+
accent: "Chartreuse"
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
name: "Emerald Vermilion",
|
|
449
|
+
primary: "#F5EBDD",
|
|
450
|
+
secondary: "#087F5B",
|
|
451
|
+
accent: "#E34234",
|
|
452
|
+
colorNames: {
|
|
453
|
+
primary: "Warm Ivory",
|
|
454
|
+
secondary: "Emerald Green",
|
|
455
|
+
accent: "Vermilion"
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "Forest Crimson",
|
|
460
|
+
primary: "#242424",
|
|
461
|
+
secondary: "#1B4332",
|
|
462
|
+
accent: "#DC143C",
|
|
463
|
+
colorNames: {
|
|
464
|
+
primary: "Charcoal Black",
|
|
465
|
+
secondary: "Forest Green",
|
|
466
|
+
accent: "Crimson Red"
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: "Lemon Afterdark",
|
|
471
|
+
primary: "#FFF44F",
|
|
472
|
+
secondary: "#242424",
|
|
473
|
+
accent: "#B65CFF",
|
|
474
|
+
colorNames: {
|
|
475
|
+
primary: "Lemon",
|
|
476
|
+
secondary: "Charcoal Black",
|
|
477
|
+
accent: "Electric Lavender"
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
name: "Mocha Gold",
|
|
482
|
+
primary: "#6F4E37",
|
|
483
|
+
secondary: "#F1D6A8",
|
|
484
|
+
accent: "#C87924",
|
|
485
|
+
colorNames: {
|
|
486
|
+
primary: "Mocha Brown",
|
|
487
|
+
secondary: "Champagne Gold",
|
|
488
|
+
accent: "Burnt Amber"
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
name: "Cerulean Rose",
|
|
493
|
+
primary: "#0A0A0A",
|
|
494
|
+
secondary: "#007BA7",
|
|
495
|
+
accent: "#FF3CAC",
|
|
496
|
+
colorNames: {
|
|
497
|
+
primary: "Jet Black",
|
|
498
|
+
secondary: "Cerulean Blue",
|
|
499
|
+
accent: "Neon Rose"
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
name: "Amber Frost",
|
|
504
|
+
primary: "#DDE6ED",
|
|
505
|
+
secondary: "#3D1635",
|
|
506
|
+
accent: "#EAA221",
|
|
507
|
+
colorNames: {
|
|
508
|
+
primary: "Ice Silver",
|
|
509
|
+
secondary: "Deep Ambergine",
|
|
510
|
+
accent: "Marigold"
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
name: "Platinum Mocha",
|
|
515
|
+
primary: "#6F4E37",
|
|
516
|
+
secondary: "#D5D8DC",
|
|
517
|
+
accent: "#DCD0FF",
|
|
518
|
+
colorNames: {
|
|
519
|
+
primary: "Mocha Brown",
|
|
520
|
+
secondary: "Platinum Silver",
|
|
521
|
+
accent: "Pale Lavender"
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
], p = [
|
|
525
|
+
"primary",
|
|
526
|
+
"secondary",
|
|
527
|
+
"accent",
|
|
528
|
+
"background",
|
|
529
|
+
"surface",
|
|
530
|
+
"text",
|
|
531
|
+
"muted",
|
|
532
|
+
"border",
|
|
533
|
+
"success",
|
|
534
|
+
"warning",
|
|
535
|
+
"error",
|
|
536
|
+
"info"
|
|
537
|
+
], m = /^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i, h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), _;
|
|
538
|
+
function v(e) {
|
|
539
|
+
if (typeof e != "string" || e.trim() === "" || e !== e.trim()) throw TypeError("Palette name must be a non-empty string without surrounding whitespace");
|
|
540
|
+
}
|
|
541
|
+
function y(e, t) {
|
|
542
|
+
if (typeof e != "string" || !m.test(e)) throw TypeError(`Palette token "${t}" must be a valid HEX color`);
|
|
543
|
+
}
|
|
544
|
+
function b(e) {
|
|
545
|
+
for (let t of Object.keys(e)) if (!p.includes(t)) throw TypeError(`Unknown semantic color token "${t}"`);
|
|
546
|
+
}
|
|
547
|
+
function x(e) {
|
|
548
|
+
if (e === void 0) return;
|
|
549
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Palette color names must be an object");
|
|
550
|
+
let t = Object.keys(e);
|
|
551
|
+
for (let e of t) if (e !== "primary" && e !== "secondary" && e !== "accent") throw TypeError(`Unknown palette color name key "${e}"`);
|
|
552
|
+
let n = e;
|
|
553
|
+
for (let e of [
|
|
554
|
+
"primary",
|
|
555
|
+
"secondary",
|
|
556
|
+
"accent"
|
|
557
|
+
]) if (typeof n[e] != "string" || n[e].trim() === "") throw TypeError(`Palette color name "${e}" must be a non-empty string`);
|
|
558
|
+
return Object.freeze({
|
|
559
|
+
primary: n.primary,
|
|
560
|
+
secondary: n.secondary,
|
|
561
|
+
accent: n.accent
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
function S(e) {
|
|
565
|
+
return [
|
|
566
|
+
"primary",
|
|
567
|
+
"secondary",
|
|
568
|
+
"accent"
|
|
569
|
+
].some((t) => Object.prototype.hasOwnProperty.call(e, t));
|
|
570
|
+
}
|
|
571
|
+
function C(e) {
|
|
572
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Palette must be an object");
|
|
573
|
+
v(e.name);
|
|
574
|
+
let t = x(e.colorNames), n;
|
|
575
|
+
if (S(e)) {
|
|
576
|
+
let t = e, r = {
|
|
577
|
+
primary: t.primary,
|
|
578
|
+
secondary: t.secondary,
|
|
579
|
+
accent: t.accent
|
|
580
|
+
};
|
|
581
|
+
for (let e of [
|
|
582
|
+
"primary",
|
|
583
|
+
"secondary",
|
|
584
|
+
"accent"
|
|
585
|
+
]) y(r[e], e);
|
|
586
|
+
let i = t.overrides === void 0 ? {} : t.overrides;
|
|
587
|
+
if (typeof i != "object" || !i || Array.isArray(i)) throw TypeError("Palette semantic token overrides must be an object");
|
|
588
|
+
b(i), n = {
|
|
589
|
+
...r,
|
|
590
|
+
background: t.secondary,
|
|
591
|
+
surface: t.secondary,
|
|
592
|
+
text: t.primary,
|
|
593
|
+
muted: t.secondary,
|
|
594
|
+
border: t.secondary,
|
|
595
|
+
success: t.accent,
|
|
596
|
+
warning: t.accent,
|
|
597
|
+
error: t.accent,
|
|
598
|
+
info: t.accent,
|
|
599
|
+
...i
|
|
600
|
+
};
|
|
601
|
+
} else {
|
|
602
|
+
let t = e;
|
|
603
|
+
if (t.tokens === null || typeof t.tokens != "object" || Array.isArray(t.tokens)) throw TypeError("Palette tokens must be an object");
|
|
604
|
+
b(t.tokens), n = t.tokens;
|
|
605
|
+
}
|
|
606
|
+
let r = {};
|
|
607
|
+
for (let e of p) {
|
|
608
|
+
if (!Object.prototype.hasOwnProperty.call(n, e)) throw TypeError(`Palette is missing required semantic color token "${e}"`);
|
|
609
|
+
let t = n[e];
|
|
610
|
+
y(t, e), r[e] = t;
|
|
611
|
+
}
|
|
612
|
+
return Object.freeze({
|
|
613
|
+
name: e.name,
|
|
614
|
+
tokens: Object.freeze(r),
|
|
615
|
+
...t ? { colorNames: t } : {}
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
function w(e) {
|
|
619
|
+
let t = {};
|
|
620
|
+
for (let n of p) t[n] = e.tokens[n];
|
|
621
|
+
return Object.freeze({
|
|
622
|
+
name: e.name,
|
|
623
|
+
tokens: Object.freeze(t),
|
|
624
|
+
...e.colorNames ? { colorNames: Object.freeze({ ...e.colorNames }) } : {}
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
var T = new Map(f.map((e) => {
|
|
628
|
+
let t = C(e);
|
|
629
|
+
return [t.name, t];
|
|
630
|
+
}));
|
|
631
|
+
function ee(e) {
|
|
632
|
+
let t = C(e);
|
|
633
|
+
if (T.has(t.name)) throw TypeError(`Cannot replace built-in palette "${t.name}"`);
|
|
634
|
+
if (h.has(t.name)) throw TypeError(`Palette "${t.name}" is already registered`);
|
|
635
|
+
h.set(t.name, t);
|
|
636
|
+
}
|
|
637
|
+
function E(e) {
|
|
638
|
+
v(e);
|
|
639
|
+
let t = T.get(e) ?? h.get(e);
|
|
640
|
+
return t ? w(t) : void 0;
|
|
641
|
+
}
|
|
642
|
+
function te() {
|
|
643
|
+
return Object.freeze([...T.keys(), ...h.keys()]);
|
|
644
|
+
}
|
|
645
|
+
function ne() {
|
|
646
|
+
let e = O();
|
|
647
|
+
for (let t of [...g]) t(e);
|
|
648
|
+
}
|
|
649
|
+
function D(e) {
|
|
650
|
+
if (v(e), !T.has(e) && !h.has(e)) throw TypeError(`Unknown palette "${e}"`);
|
|
651
|
+
_ !== e && (_ = e, ne());
|
|
652
|
+
}
|
|
653
|
+
function O() {
|
|
654
|
+
return _ === void 0 ? void 0 : E(_);
|
|
655
|
+
}
|
|
656
|
+
function re(e) {
|
|
657
|
+
if (typeof e != "function") throw TypeError("Palette change listener must be a function");
|
|
658
|
+
return g.add(e), () => {
|
|
659
|
+
g.delete(e);
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
function ie(e) {
|
|
663
|
+
if (v(e), T.has(e)) return !1;
|
|
664
|
+
let t = h.delete(e);
|
|
665
|
+
return t && _ === e && (_ = void 0, ne()), t;
|
|
666
|
+
}
|
|
667
|
+
var ae = Object.freeze({
|
|
668
|
+
activate: D,
|
|
669
|
+
getActive: O,
|
|
670
|
+
get: E,
|
|
671
|
+
list: te,
|
|
672
|
+
register: ee,
|
|
673
|
+
remove: ie,
|
|
674
|
+
subscribe: re
|
|
675
|
+
}), oe = "1.0.0";
|
|
676
|
+
function se(e) {
|
|
677
|
+
if (typeof e != "object" || !e || Object.isFrozen(e)) return e;
|
|
678
|
+
for (let t of Object.keys(e)) {
|
|
679
|
+
let n = e[t];
|
|
680
|
+
typeof n == "object" && n && se(n);
|
|
681
|
+
}
|
|
682
|
+
return Object.freeze(e);
|
|
683
|
+
}
|
|
684
|
+
function ce(e) {
|
|
685
|
+
if (typeof e != "string" || e.trim() === "" || e !== e.trim()) throw TypeError("Design system name must be a non-empty string without surrounding whitespace");
|
|
686
|
+
}
|
|
687
|
+
function le(e) {
|
|
688
|
+
if (e) {
|
|
689
|
+
if (typeof e == "string") return E(e);
|
|
690
|
+
if ("tokens" in e) return e;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
function ue(e) {
|
|
694
|
+
if (e) return typeof e == "string" ? t(e) : e;
|
|
695
|
+
}
|
|
696
|
+
function de(e) {
|
|
697
|
+
let n = [];
|
|
698
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return {
|
|
699
|
+
valid: !1,
|
|
700
|
+
errors: [{ message: "Design system must be a non-null object" }]
|
|
701
|
+
};
|
|
702
|
+
let r = e;
|
|
703
|
+
if ((typeof r.id != "string" || r.id.trim() === "") && n.push({
|
|
704
|
+
parameter: "id",
|
|
705
|
+
message: "id must be a non-empty string"
|
|
706
|
+
}), (typeof r.name != "string" || r.name.trim() === "") && n.push({
|
|
707
|
+
parameter: "name",
|
|
708
|
+
message: "name must be a non-empty string"
|
|
709
|
+
}), r.palette !== void 0 && (typeof r.palette == "string" ? r.palette.trim() === "" ? n.push({
|
|
710
|
+
parameter: "palette",
|
|
711
|
+
message: "palette name must be a non-empty string"
|
|
712
|
+
}) : E(r.palette) || n.push({
|
|
713
|
+
parameter: "palette",
|
|
714
|
+
message: `Unknown color palette "${r.palette}"`
|
|
715
|
+
}) : (typeof r.palette != "object" || r.palette === null) && n.push({
|
|
716
|
+
parameter: "palette",
|
|
717
|
+
message: "palette must be a string name or ColorPalette object"
|
|
718
|
+
})), r.motionDNA !== void 0 && (typeof r.motionDNA == "string" ? r.motionDNA.trim() === "" ? n.push({
|
|
719
|
+
parameter: "motionDNA",
|
|
720
|
+
message: "motionDNA name must be a non-empty string"
|
|
721
|
+
}) : t(r.motionDNA) || n.push({
|
|
722
|
+
parameter: "motionDNA",
|
|
723
|
+
message: `Unknown Motion DNA profile "${r.motionDNA}"`
|
|
724
|
+
}) : (typeof r.motionDNA != "object" || r.motionDNA === null) && n.push({
|
|
725
|
+
parameter: "motionDNA",
|
|
726
|
+
message: "motionDNA must be a string name or MotionDNA object"
|
|
727
|
+
})), r.intensity !== void 0 && (typeof r.intensity != "number" || !Number.isFinite(r.intensity) || r.intensity <= 0 || r.intensity > 3) && n.push({
|
|
728
|
+
parameter: "intensity",
|
|
729
|
+
message: "intensity must be a finite number > 0 and <= 3"
|
|
730
|
+
}), r.timing !== void 0) {
|
|
731
|
+
if (typeof r.timing != "object" || r.timing === null || Array.isArray(r.timing)) n.push({
|
|
732
|
+
parameter: "timing",
|
|
733
|
+
message: "timing must be an object"
|
|
734
|
+
});
|
|
735
|
+
else for (let [e, t] of Object.entries(r.timing)) (typeof t != "number" || !Number.isFinite(t) || t < 0) && n.push({
|
|
736
|
+
parameter: `timing.${e}`,
|
|
737
|
+
message: `timing.${e} must be a number >= 0`
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
if (r.spacing !== void 0 && (typeof r.spacing != "object" || r.spacing === null || Array.isArray(r.spacing) ? n.push({
|
|
741
|
+
parameter: "spacing",
|
|
742
|
+
message: "spacing must be an object"
|
|
743
|
+
}) : r.spacing.baseUnit !== void 0 && (typeof r.spacing.baseUnit != "number" || r.spacing.baseUnit <= 0) && n.push({
|
|
744
|
+
parameter: "spacing.baseUnit",
|
|
745
|
+
message: "baseUnit must be a number > 0"
|
|
746
|
+
})), r.easings !== void 0) {
|
|
747
|
+
if (typeof r.easings != "object" || r.easings === null || Array.isArray(r.easings)) n.push({
|
|
748
|
+
parameter: "easings",
|
|
749
|
+
message: "easings must be an object"
|
|
750
|
+
});
|
|
751
|
+
else for (let [e, t] of Object.entries(r.easings)) if (typeof t == "string") try {
|
|
752
|
+
i(t);
|
|
753
|
+
} catch {
|
|
754
|
+
n.push({
|
|
755
|
+
parameter: `easings.${e}`,
|
|
756
|
+
message: `Unknown easing "${t}"`
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
else typeof t != "function" && n.push({
|
|
760
|
+
parameter: `easings.${e}`,
|
|
761
|
+
message: `easings.${e} must be a registered easing name or function`
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
return {
|
|
765
|
+
valid: n.length === 0,
|
|
766
|
+
errors: n
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
function k(e) {
|
|
770
|
+
let t = de(e);
|
|
771
|
+
if (!t.valid) throw TypeError(`Invalid design system definition: ${t.errors.map((e) => e.message).join(", ")}`);
|
|
772
|
+
let n = le(e.palette), r = ue(e.motionDNA);
|
|
773
|
+
return se({
|
|
774
|
+
...e,
|
|
775
|
+
resolvedPalette: n,
|
|
776
|
+
resolvedMotionDNA: r
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
var A = [
|
|
780
|
+
k({
|
|
781
|
+
id: "ds-default",
|
|
782
|
+
name: "default",
|
|
783
|
+
description: "Balanced, neutral modern design system with standard scales and harmonious pacing.",
|
|
784
|
+
palette: "Cobalt Classic",
|
|
785
|
+
motionDNA: "snappy",
|
|
786
|
+
spacing: {
|
|
787
|
+
baseUnit: 8,
|
|
788
|
+
space: {
|
|
789
|
+
none: 0,
|
|
790
|
+
xs: 4,
|
|
791
|
+
sm: 8,
|
|
792
|
+
md: 16,
|
|
793
|
+
lg: 24,
|
|
794
|
+
xl: 32,
|
|
795
|
+
"2xl": 48
|
|
796
|
+
},
|
|
797
|
+
distance: {
|
|
798
|
+
subtle: 8,
|
|
799
|
+
moderate: 16,
|
|
800
|
+
pronounced: 32,
|
|
801
|
+
dramatic: 64
|
|
802
|
+
}
|
|
803
|
+
},
|
|
804
|
+
timing: {
|
|
805
|
+
instant: 0,
|
|
806
|
+
fastest: 100,
|
|
807
|
+
fast: 200,
|
|
808
|
+
normal: 300,
|
|
809
|
+
slow: 500,
|
|
810
|
+
deliberate: 750
|
|
811
|
+
},
|
|
812
|
+
easings: {
|
|
813
|
+
standard: "easeOutQuad",
|
|
814
|
+
entrance: "easeOutQuad",
|
|
815
|
+
exit: "easeInQuad",
|
|
816
|
+
expressive: "easeOutCubic",
|
|
817
|
+
snappy: "easeOutQuad"
|
|
818
|
+
},
|
|
819
|
+
interaction: {
|
|
820
|
+
hoverScale: 1.04,
|
|
821
|
+
pressScale: .96,
|
|
822
|
+
focusRingWidth: 2,
|
|
823
|
+
elevationDistance: 4,
|
|
824
|
+
transitionDuration: 180
|
|
825
|
+
},
|
|
826
|
+
intensity: 1,
|
|
827
|
+
metadata: {
|
|
828
|
+
tags: [
|
|
829
|
+
"default",
|
|
830
|
+
"neutral",
|
|
831
|
+
"modern",
|
|
832
|
+
"general-purpose"
|
|
833
|
+
],
|
|
834
|
+
description: "Default baseline design system for AF Motion components."
|
|
835
|
+
}
|
|
836
|
+
}),
|
|
837
|
+
k({
|
|
838
|
+
id: "ds-minimal",
|
|
839
|
+
name: "minimal",
|
|
840
|
+
description: "Functional, low-latency enterprise identity with subtle movements and high information density.",
|
|
841
|
+
palette: "Silver Signal",
|
|
842
|
+
motionDNA: "minimal",
|
|
843
|
+
spacing: {
|
|
844
|
+
baseUnit: 4,
|
|
845
|
+
space: {
|
|
846
|
+
none: 0,
|
|
847
|
+
xs: 2,
|
|
848
|
+
sm: 4,
|
|
849
|
+
md: 8,
|
|
850
|
+
lg: 16,
|
|
851
|
+
xl: 24,
|
|
852
|
+
"2xl": 32
|
|
853
|
+
},
|
|
854
|
+
distance: {
|
|
855
|
+
subtle: 4,
|
|
856
|
+
moderate: 8,
|
|
857
|
+
pronounced: 16,
|
|
858
|
+
dramatic: 32
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
timing: {
|
|
862
|
+
instant: 0,
|
|
863
|
+
fastest: 80,
|
|
864
|
+
fast: 150,
|
|
865
|
+
normal: 220,
|
|
866
|
+
slow: 350,
|
|
867
|
+
deliberate: 500
|
|
868
|
+
},
|
|
869
|
+
easings: {
|
|
870
|
+
standard: "easeOutQuad",
|
|
871
|
+
entrance: "easeOutQuad",
|
|
872
|
+
exit: "easeInQuad",
|
|
873
|
+
expressive: "easeOutQuad",
|
|
874
|
+
snappy: "linear"
|
|
875
|
+
},
|
|
876
|
+
interaction: {
|
|
877
|
+
hoverScale: 1.02,
|
|
878
|
+
pressScale: .98,
|
|
879
|
+
focusRingWidth: 2,
|
|
880
|
+
elevationDistance: 2,
|
|
881
|
+
transitionDuration: 120
|
|
882
|
+
},
|
|
883
|
+
intensity: 1,
|
|
884
|
+
metadata: { tags: [
|
|
885
|
+
"minimal",
|
|
886
|
+
"enterprise",
|
|
887
|
+
"compact",
|
|
888
|
+
"developer-tools",
|
|
889
|
+
"data-dense"
|
|
890
|
+
] }
|
|
891
|
+
}),
|
|
892
|
+
k({
|
|
893
|
+
id: "ds-expressive",
|
|
894
|
+
name: "expressive",
|
|
895
|
+
description: "Dynamic, punchy consumer brand identity with lively spring physics and pronounced spacing.",
|
|
896
|
+
palette: "Electric Teal",
|
|
897
|
+
motionDNA: "energetic",
|
|
898
|
+
spacing: {
|
|
899
|
+
baseUnit: 8,
|
|
900
|
+
space: {
|
|
901
|
+
none: 0,
|
|
902
|
+
xs: 4,
|
|
903
|
+
sm: 8,
|
|
904
|
+
md: 16,
|
|
905
|
+
lg: 24,
|
|
906
|
+
xl: 32,
|
|
907
|
+
"2xl": 48
|
|
908
|
+
},
|
|
909
|
+
distance: {
|
|
910
|
+
subtle: 12,
|
|
911
|
+
moderate: 24,
|
|
912
|
+
pronounced: 48,
|
|
913
|
+
dramatic: 80
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
timing: {
|
|
917
|
+
instant: 0,
|
|
918
|
+
fastest: 120,
|
|
919
|
+
fast: 220,
|
|
920
|
+
normal: 360,
|
|
921
|
+
slow: 550,
|
|
922
|
+
deliberate: 850
|
|
923
|
+
},
|
|
924
|
+
easings: {
|
|
925
|
+
standard: "easeOutCubic",
|
|
926
|
+
entrance: "easeOutBack",
|
|
927
|
+
exit: "easeInCubic",
|
|
928
|
+
expressive: "easeOutBack",
|
|
929
|
+
snappy: "easeOutQuad",
|
|
930
|
+
bounce: "easeOutBack"
|
|
931
|
+
},
|
|
932
|
+
interaction: {
|
|
933
|
+
hoverScale: 1.06,
|
|
934
|
+
pressScale: .94,
|
|
935
|
+
focusRingWidth: 3,
|
|
936
|
+
elevationDistance: 8,
|
|
937
|
+
transitionDuration: 220
|
|
938
|
+
},
|
|
939
|
+
intensity: 1.2,
|
|
940
|
+
metadata: { tags: [
|
|
941
|
+
"expressive",
|
|
942
|
+
"marketing",
|
|
943
|
+
"delight",
|
|
944
|
+
"onboarding",
|
|
945
|
+
"bold"
|
|
946
|
+
] }
|
|
947
|
+
})
|
|
948
|
+
], fe = /* @__PURE__ */ new Map(), pe = /* @__PURE__ */ new Map();
|
|
949
|
+
for (let e of A) fe.set(e.id, e), pe.set(e.name, e);
|
|
950
|
+
var me = new Set(A.map((e) => e.name)), he = new Set(A.map((e) => e.id)), j = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Set(), M = "default";
|
|
951
|
+
function _e(e, t) {
|
|
952
|
+
if (ce(e), me.has(e) || he.has(e)) throw TypeError(`Cannot overwrite built-in design system "${e}"`);
|
|
953
|
+
let n = k(t);
|
|
954
|
+
j.set(e, n), n.id && j.set(n.id, n), M === e && P();
|
|
955
|
+
}
|
|
956
|
+
function N(e) {
|
|
957
|
+
return ce(e), pe.get(e) ?? fe.get(e) ?? j.get(e);
|
|
958
|
+
}
|
|
959
|
+
function ve() {
|
|
960
|
+
let e = Array.from(new Set(j.values()));
|
|
961
|
+
return Object.freeze([...A, ...e]);
|
|
962
|
+
}
|
|
963
|
+
function ye(e) {
|
|
964
|
+
if (!e || typeof e != "string") return [];
|
|
965
|
+
let t = e.trim().toLowerCase();
|
|
966
|
+
if (t.length === 0) return [];
|
|
967
|
+
let n = ve();
|
|
968
|
+
return Object.freeze(n.filter((e) => {
|
|
969
|
+
let n = e.id.toLowerCase(), r = e.name.toLowerCase(), i = e.description?.toLowerCase() ?? "", a = e.metadata?.tags ?? [];
|
|
970
|
+
return n.includes(t) || r.includes(t) || i.includes(t) || a.some((e) => e.toLowerCase().includes(t));
|
|
971
|
+
}));
|
|
972
|
+
}
|
|
973
|
+
function be(e, t = {}) {
|
|
974
|
+
let n = typeof e == "string" ? N(e) : e;
|
|
975
|
+
if (!n) throw TypeError(`Unknown design system "${String(e)}"`);
|
|
976
|
+
return k({
|
|
977
|
+
...n,
|
|
978
|
+
...t,
|
|
979
|
+
typography: {
|
|
980
|
+
...n.typography,
|
|
981
|
+
...t.typography ?? {},
|
|
982
|
+
fontFamilies: {
|
|
983
|
+
...n.typography?.fontFamilies ?? {},
|
|
984
|
+
...t.typography?.fontFamilies ?? {}
|
|
985
|
+
},
|
|
986
|
+
fontSizes: {
|
|
987
|
+
...n.typography?.fontSizes ?? {},
|
|
988
|
+
...t.typography?.fontSizes ?? {}
|
|
989
|
+
}
|
|
990
|
+
},
|
|
991
|
+
spacing: {
|
|
992
|
+
...n.spacing,
|
|
993
|
+
...t.spacing ?? {},
|
|
994
|
+
space: {
|
|
995
|
+
...n.spacing?.space ?? {},
|
|
996
|
+
...t.spacing?.space ?? {}
|
|
997
|
+
},
|
|
998
|
+
distance: {
|
|
999
|
+
...n.spacing?.distance ?? {},
|
|
1000
|
+
...t.spacing?.distance ?? {}
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
1003
|
+
timing: {
|
|
1004
|
+
...n.timing,
|
|
1005
|
+
...t.timing ?? {}
|
|
1006
|
+
},
|
|
1007
|
+
easings: {
|
|
1008
|
+
...n.easings,
|
|
1009
|
+
...t.easings ?? {}
|
|
1010
|
+
},
|
|
1011
|
+
interaction: {
|
|
1012
|
+
...n.interaction,
|
|
1013
|
+
...t.interaction ?? {}
|
|
1014
|
+
},
|
|
1015
|
+
metadata: {
|
|
1016
|
+
...n.metadata,
|
|
1017
|
+
...t.metadata ?? {}
|
|
1018
|
+
}
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
function xe(e) {
|
|
1022
|
+
if (ce(e), me.has(e) || he.has(e)) throw TypeError(`Cannot remove built-in design system "${e}"`);
|
|
1023
|
+
let t = j.get(e);
|
|
1024
|
+
t && t.id && j.delete(t.id);
|
|
1025
|
+
let n = j.delete(e);
|
|
1026
|
+
return n && M === e && (M = "default", P()), n;
|
|
1027
|
+
}
|
|
1028
|
+
function Se(e, t) {
|
|
1029
|
+
if (typeof e == "string") {
|
|
1030
|
+
let n = N(e);
|
|
1031
|
+
if (!n) throw TypeError(`Unknown design system "${e}"`);
|
|
1032
|
+
return t ? be(n, t) : n;
|
|
1033
|
+
}
|
|
1034
|
+
return t ? be(e, t) : se(e);
|
|
1035
|
+
}
|
|
1036
|
+
function Ce(e, t, n) {
|
|
1037
|
+
if (!t || typeof t != "string") return n;
|
|
1038
|
+
let r = t.split("."), i = e;
|
|
1039
|
+
for (let e of r) {
|
|
1040
|
+
if (typeof i != "object" || !i) return n;
|
|
1041
|
+
i = i[e];
|
|
1042
|
+
}
|
|
1043
|
+
return i === void 0 ? n : i;
|
|
1044
|
+
}
|
|
1045
|
+
function we(e, t, n) {
|
|
1046
|
+
return e.timing && e.timing[t] !== void 0 ? e.timing[t] : n === void 0 ? e.resolvedMotionDNA?.duration === void 0 ? 300 : e.resolvedMotionDNA.duration : n;
|
|
1047
|
+
}
|
|
1048
|
+
function Te(e, t, n = 16) {
|
|
1049
|
+
return e.spacing?.distance && e.spacing.distance[t] !== void 0 ? e.spacing.distance[t] : n;
|
|
1050
|
+
}
|
|
1051
|
+
function P() {
|
|
1052
|
+
let e = Ee();
|
|
1053
|
+
for (let t of [...ge]) try {
|
|
1054
|
+
t(e);
|
|
1055
|
+
} catch {}
|
|
1056
|
+
}
|
|
1057
|
+
function Ee() {
|
|
1058
|
+
return M ? N(M) : void 0;
|
|
1059
|
+
}
|
|
1060
|
+
function De(e) {
|
|
1061
|
+
if (e === void 0) {
|
|
1062
|
+
M = void 0, P();
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
let t = typeof e == "string" ? N(e) : e;
|
|
1066
|
+
if (!t) throw TypeError(`Unknown design system "${String(e)}"`);
|
|
1067
|
+
if (M !== t.name) {
|
|
1068
|
+
if (M = t.name, typeof t.palette == "string") try {
|
|
1069
|
+
D(t.palette);
|
|
1070
|
+
} catch {}
|
|
1071
|
+
P();
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
function Oe(e) {
|
|
1075
|
+
if (typeof e != "function") throw TypeError("Design system listener must be a function");
|
|
1076
|
+
return ge.add(e), () => {
|
|
1077
|
+
ge.delete(e);
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
function ke() {
|
|
1081
|
+
j.clear(), M = "default";
|
|
1082
|
+
}
|
|
1083
|
+
function Ae(e, t = !0) {
|
|
1084
|
+
return JSON.stringify(e, null, t ? 2 : void 0);
|
|
1085
|
+
}
|
|
1086
|
+
function je() {
|
|
1087
|
+
let e = ve();
|
|
1088
|
+
return {
|
|
1089
|
+
$schema: "https://af-motion.dev/schemas/design-systems-v1.json",
|
|
1090
|
+
version: oe,
|
|
1091
|
+
totalDesignSystems: e.length,
|
|
1092
|
+
designSystems: e
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
function Me(e) {
|
|
1096
|
+
if (typeof e != "string" || e.trim() === "") throw TypeError("Design system JSON must be a non-empty string");
|
|
1097
|
+
let t;
|
|
1098
|
+
try {
|
|
1099
|
+
t = JSON.parse(e, (e, t) => e === "__proto__" || e === "constructor" || e === "prototype" ? void 0 : t);
|
|
1100
|
+
} catch (e) {
|
|
1101
|
+
throw TypeError(`Invalid design system JSON: ${e.message}`);
|
|
1102
|
+
}
|
|
1103
|
+
return k(t);
|
|
1104
|
+
}
|
|
1105
|
+
// src/core/animation-parallel.ts
|
|
1106
|
+
function Ne() {
|
|
1107
|
+
let e = /* @__PURE__ */ Error("Parallel animations were cancelled");
|
|
1108
|
+
return e.name = "AbortError", e;
|
|
1109
|
+
}
|
|
1110
|
+
function F(e, t = {}) {
|
|
1111
|
+
if (!Array.isArray(e)) throw TypeError("steps must be an array");
|
|
1112
|
+
if (typeof t != "object" || !t) throw TypeError("options must be an object");
|
|
1113
|
+
if (t.onComplete !== void 0 && typeof t.onComplete != "function") throw TypeError("onComplete must be a function");
|
|
1114
|
+
if (t.onStart !== void 0 && typeof t.onStart != "function") throw TypeError("onStart must be a function");
|
|
1115
|
+
if (t.onCancel !== void 0 && typeof t.onCancel != "function") throw TypeError("onCancel must be a function");
|
|
1116
|
+
let n = () => void 0, r = () => void 0, i = new Promise((e, t) => {
|
|
1117
|
+
n = e, r = t;
|
|
1118
|
+
}), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), c = !1, l = !1, u = !1, d = null, f = !1, p = () => {
|
|
1119
|
+
let e, t = !1;
|
|
1120
|
+
for (let n of o) try {
|
|
1121
|
+
n.cancel();
|
|
1122
|
+
} catch (n) {
|
|
1123
|
+
t || (e = n), t = !0;
|
|
1124
|
+
}
|
|
1125
|
+
if (o.clear(), t) throw e;
|
|
1126
|
+
}, m = (e) => {
|
|
1127
|
+
if (!c) {
|
|
1128
|
+
c = !0;
|
|
1129
|
+
try {
|
|
1130
|
+
p();
|
|
1131
|
+
} finally {
|
|
1132
|
+
r(e);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}, h = () => {
|
|
1136
|
+
if (!(c || s.size !== e.length)) try {
|
|
1137
|
+
if (t.onComplete?.(), l || c) return;
|
|
1138
|
+
c = !0, n();
|
|
1139
|
+
} catch (e) {
|
|
1140
|
+
m(e);
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
return e.length === 0 ? h() : e.forEach((e, n) => {
|
|
1144
|
+
if (c || l) return;
|
|
1145
|
+
if (!e || typeof e != "object") {
|
|
1146
|
+
m(/* @__PURE__ */ TypeError(`Animation parallel step ${n} must be an object`));
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
let r;
|
|
1150
|
+
try {
|
|
1151
|
+
r = a(e.target, e.properties, {
|
|
1152
|
+
...e.options,
|
|
1153
|
+
...d === null ? {} : { playbackRate: d },
|
|
1154
|
+
onStart: () => {
|
|
1155
|
+
try {
|
|
1156
|
+
f || (f = !0, t.onStart?.()), e.options?.onStart?.();
|
|
1157
|
+
} catch (e) {
|
|
1158
|
+
throw m(e), e;
|
|
1159
|
+
}
|
|
1160
|
+
},
|
|
1161
|
+
onUpdate: (t) => {
|
|
1162
|
+
try {
|
|
1163
|
+
e.options?.onUpdate?.(t);
|
|
1164
|
+
} catch (e) {
|
|
1165
|
+
throw m(e), e;
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
onComplete: () => {
|
|
1169
|
+
if (!(c || l || s.has(n))) try {
|
|
1170
|
+
e.options?.onComplete?.(), s.add(n), o.delete(r), h();
|
|
1171
|
+
} catch (e) {
|
|
1172
|
+
m(e);
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1176
|
+
} catch (e) {
|
|
1177
|
+
m(e);
|
|
1178
|
+
return;
|
|
1179
|
+
}
|
|
1180
|
+
o.add(r), u && r.pause();
|
|
1181
|
+
}), {
|
|
1182
|
+
finished: i,
|
|
1183
|
+
pause: () => {
|
|
1184
|
+
if (!(c || u)) {
|
|
1185
|
+
u = !0;
|
|
1186
|
+
for (let e of o) e.pause();
|
|
1187
|
+
}
|
|
1188
|
+
},
|
|
1189
|
+
resume: () => {
|
|
1190
|
+
if (!c && u) {
|
|
1191
|
+
u = !1;
|
|
1192
|
+
for (let e of o) e.resume();
|
|
1193
|
+
}
|
|
1194
|
+
},
|
|
1195
|
+
reverse: () => {
|
|
1196
|
+
if (!c) for (let e of o) e.reverse();
|
|
1197
|
+
},
|
|
1198
|
+
setPlaybackRate: (e) => {
|
|
1199
|
+
Pe(e), d = e;
|
|
1200
|
+
for (let t of o) t.setPlaybackRate(e);
|
|
1201
|
+
},
|
|
1202
|
+
getPlaybackRate: () => o.values().next().value?.getPlaybackRate() ?? d ?? 1,
|
|
1203
|
+
cancel: () => {
|
|
1204
|
+
if (!(c || l)) {
|
|
1205
|
+
l = !0;
|
|
1206
|
+
try {
|
|
1207
|
+
m(Ne());
|
|
1208
|
+
} finally {
|
|
1209
|
+
t.onCancel?.();
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
function Pe(e) {
|
|
1216
|
+
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw RangeError(`playbackRate must be a finite number > 0, received ${String(e)}`);
|
|
1217
|
+
}
|
|
1218
|
+
// src/core/motion-recipe.ts
|
|
1219
|
+
var Fe;
|
|
1220
|
+
function Ie(e) {
|
|
1221
|
+
Fe = e;
|
|
1222
|
+
}
|
|
1223
|
+
var Le = "1.0.0";
|
|
1224
|
+
function I(e) {
|
|
1225
|
+
if (typeof e != "object" || !e || Object.isFrozen(e)) return e;
|
|
1226
|
+
for (let t of Object.keys(e)) {
|
|
1227
|
+
let n = e[t];
|
|
1228
|
+
typeof n == "object" && n && I(n);
|
|
1229
|
+
}
|
|
1230
|
+
return Object.freeze(e);
|
|
1231
|
+
}
|
|
1232
|
+
function Re() {
|
|
1233
|
+
let e = /* @__PURE__ */ Error("Motion recipe was cancelled");
|
|
1234
|
+
return e.name = "AbortError", e;
|
|
1235
|
+
}
|
|
1236
|
+
var L = [
|
|
1237
|
+
{
|
|
1238
|
+
id: "recipe-hero-stagger",
|
|
1239
|
+
name: "heroStagger",
|
|
1240
|
+
description: "Coordinated hero section entrance with sequential presentation of badge, headline, paragraph, and CTA buttons.",
|
|
1241
|
+
category: "hero",
|
|
1242
|
+
tags: [
|
|
1243
|
+
"hero",
|
|
1244
|
+
"landing",
|
|
1245
|
+
"stagger",
|
|
1246
|
+
"entrance"
|
|
1247
|
+
],
|
|
1248
|
+
requiredTargets: [
|
|
1249
|
+
"container",
|
|
1250
|
+
"badge",
|
|
1251
|
+
"title",
|
|
1252
|
+
"body",
|
|
1253
|
+
"cta"
|
|
1254
|
+
],
|
|
1255
|
+
defaultOptions: { duration: 450 },
|
|
1256
|
+
structure: "sequence",
|
|
1257
|
+
steps: [
|
|
1258
|
+
{
|
|
1259
|
+
preset: "fadeIn",
|
|
1260
|
+
target: "$container",
|
|
1261
|
+
duration: 300,
|
|
1262
|
+
label: "containerFade"
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
preset: "scaleIn",
|
|
1266
|
+
target: "$badge",
|
|
1267
|
+
duration: 350,
|
|
1268
|
+
label: "badgePop"
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
preset: "slideUp",
|
|
1272
|
+
target: "$title",
|
|
1273
|
+
duration: 500,
|
|
1274
|
+
label: "titleRise"
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
preset: "textRise",
|
|
1278
|
+
target: "$body",
|
|
1279
|
+
duration: 450,
|
|
1280
|
+
label: "bodyRise"
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
preset: "bounceIn",
|
|
1284
|
+
target: "$cta",
|
|
1285
|
+
duration: 500,
|
|
1286
|
+
label: "ctaBounce"
|
|
1287
|
+
}
|
|
1288
|
+
]
|
|
1289
|
+
},
|
|
1290
|
+
{
|
|
1291
|
+
id: "recipe-modal-dialog",
|
|
1292
|
+
name: "modalDialog",
|
|
1293
|
+
description: "Modal dialog entrance with backdrop fade in parallel with dialog zoom, followed by form field focus.",
|
|
1294
|
+
category: "dialog",
|
|
1295
|
+
tags: [
|
|
1296
|
+
"modal",
|
|
1297
|
+
"dialog",
|
|
1298
|
+
"presentation",
|
|
1299
|
+
"entrance"
|
|
1300
|
+
],
|
|
1301
|
+
requiredTargets: [
|
|
1302
|
+
"backdrop",
|
|
1303
|
+
"dialog",
|
|
1304
|
+
"content"
|
|
1305
|
+
],
|
|
1306
|
+
structure: "sequence",
|
|
1307
|
+
steps: [{
|
|
1308
|
+
type: "parallel",
|
|
1309
|
+
label: "entranceParallel",
|
|
1310
|
+
steps: [{
|
|
1311
|
+
preset: "fadeIn",
|
|
1312
|
+
target: "$backdrop",
|
|
1313
|
+
duration: 300,
|
|
1314
|
+
label: "backdropFade"
|
|
1315
|
+
}, {
|
|
1316
|
+
preset: "zoomIn",
|
|
1317
|
+
target: "$dialog",
|
|
1318
|
+
duration: 350,
|
|
1319
|
+
label: "dialogZoom"
|
|
1320
|
+
}]
|
|
1321
|
+
}, {
|
|
1322
|
+
preset: "textFocus",
|
|
1323
|
+
target: "$content",
|
|
1324
|
+
duration: 400,
|
|
1325
|
+
label: "contentFocus"
|
|
1326
|
+
}]
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
id: "recipe-card-reveal",
|
|
1330
|
+
name: "cardReveal",
|
|
1331
|
+
description: "Interactive card presentation sliding into view with subsequent subtle glow illumination.",
|
|
1332
|
+
category: "cards",
|
|
1333
|
+
tags: [
|
|
1334
|
+
"card",
|
|
1335
|
+
"reveal",
|
|
1336
|
+
"glow",
|
|
1337
|
+
"showcase"
|
|
1338
|
+
],
|
|
1339
|
+
requiredTargets: ["card"],
|
|
1340
|
+
structure: "sequence",
|
|
1341
|
+
steps: [{
|
|
1342
|
+
preset: "slideUp",
|
|
1343
|
+
target: "$card",
|
|
1344
|
+
duration: 450,
|
|
1345
|
+
label: "cardSlide"
|
|
1346
|
+
}, {
|
|
1347
|
+
preset: "hoverGlow",
|
|
1348
|
+
target: "$card",
|
|
1349
|
+
duration: 300,
|
|
1350
|
+
label: "cardGlow"
|
|
1351
|
+
}]
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
id: "recipe-form-error-feedback",
|
|
1355
|
+
name: "formErrorFeedback",
|
|
1356
|
+
description: "Form validation error feedback shaking the erroneous input field and flashing an alert banner.",
|
|
1357
|
+
category: "feedback",
|
|
1358
|
+
tags: [
|
|
1359
|
+
"form",
|
|
1360
|
+
"error",
|
|
1361
|
+
"shake",
|
|
1362
|
+
"feedback"
|
|
1363
|
+
],
|
|
1364
|
+
requiredTargets: ["input", "banner"],
|
|
1365
|
+
structure: "sequence",
|
|
1366
|
+
steps: [{
|
|
1367
|
+
preset: "shakeError",
|
|
1368
|
+
target: "$input",
|
|
1369
|
+
duration: 100,
|
|
1370
|
+
label: "inputShake"
|
|
1371
|
+
}, {
|
|
1372
|
+
preset: "flashHighlight",
|
|
1373
|
+
target: "$banner",
|
|
1374
|
+
duration: 200,
|
|
1375
|
+
label: "bannerFlash"
|
|
1376
|
+
}]
|
|
1377
|
+
},
|
|
1378
|
+
{
|
|
1379
|
+
id: "recipe-attention-callout",
|
|
1380
|
+
name: "attentionCallout",
|
|
1381
|
+
description: "Noticeable notification callout pulsing an icon and breathing ambient glow.",
|
|
1382
|
+
category: "feedback",
|
|
1383
|
+
tags: [
|
|
1384
|
+
"attention",
|
|
1385
|
+
"alert",
|
|
1386
|
+
"pulse",
|
|
1387
|
+
"notification"
|
|
1388
|
+
],
|
|
1389
|
+
requiredTargets: ["icon", "badge"],
|
|
1390
|
+
structure: "sequence",
|
|
1391
|
+
steps: [{
|
|
1392
|
+
type: "parallel",
|
|
1393
|
+
label: "pulseParallel",
|
|
1394
|
+
steps: [{
|
|
1395
|
+
preset: "pulseAttention",
|
|
1396
|
+
target: "$icon",
|
|
1397
|
+
duration: 350,
|
|
1398
|
+
label: "iconPulse"
|
|
1399
|
+
}, {
|
|
1400
|
+
preset: "pulseAmbient",
|
|
1401
|
+
target: "$badge",
|
|
1402
|
+
duration: 400,
|
|
1403
|
+
label: "badgeGlow"
|
|
1404
|
+
}]
|
|
1405
|
+
}]
|
|
1406
|
+
}
|
|
1407
|
+
];
|
|
1408
|
+
for (let e of L) I(e);
|
|
1409
|
+
var ze = /* @__PURE__ */ new Map(), Be = /* @__PURE__ */ new Map();
|
|
1410
|
+
for (let e of L) ze.set(e.id, e), Be.set(e.name, e);
|
|
1411
|
+
var Ve = new Set(L.map((e) => e.id)), He = new Set(L.map((e) => e.name)), R = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map();
|
|
1412
|
+
function Ue() {
|
|
1413
|
+
let e = Array.from(R.values());
|
|
1414
|
+
return Object.freeze([...L, ...e]);
|
|
1415
|
+
}
|
|
1416
|
+
function B(e) {
|
|
1417
|
+
if (typeof e != "string" || e.trim() === "") return;
|
|
1418
|
+
let t = e.trim();
|
|
1419
|
+
return ze.get(t) ?? Be.get(t) ?? R.get(t) ?? z.get(t);
|
|
1420
|
+
}
|
|
1421
|
+
function We(e) {
|
|
1422
|
+
if (!e || typeof e != "string") return [];
|
|
1423
|
+
let t = e.trim().toLowerCase();
|
|
1424
|
+
if (t.length === 0) return [];
|
|
1425
|
+
let n = Ue();
|
|
1426
|
+
return Object.freeze(n.filter((e) => e.id.toLowerCase().includes(t) || e.name.toLowerCase().includes(t) || e.category && e.category.toLowerCase().includes(t) || e.description.toLowerCase().includes(t) || e.tags && e.tags.some((e) => e.toLowerCase().includes(t))));
|
|
1427
|
+
}
|
|
1428
|
+
function Ge(e) {
|
|
1429
|
+
let t = V(e);
|
|
1430
|
+
if (!t.valid) throw TypeError(`Cannot register invalid recipe: ${t.errors.map((e) => e.message).join(", ")}`);
|
|
1431
|
+
if (Ve.has(e.id) || He.has(e.name)) throw TypeError(`Cannot overwrite built-in recipe "${e.id}" ("${e.name}")`);
|
|
1432
|
+
let n = I({ ...e });
|
|
1433
|
+
R.set(n.id, n), z.set(n.name, n);
|
|
1434
|
+
}
|
|
1435
|
+
function Ke(e) {
|
|
1436
|
+
if (typeof e != "string" || e.trim() === "") return !1;
|
|
1437
|
+
let t = e.trim();
|
|
1438
|
+
if (Ve.has(t) || He.has(t)) return !1;
|
|
1439
|
+
let n = R.get(t) ?? z.get(t);
|
|
1440
|
+
return n ? (R.delete(n.id), z.delete(n.name), !0) : !1;
|
|
1441
|
+
}
|
|
1442
|
+
function V(e, t = /* @__PURE__ */ new Set()) {
|
|
1443
|
+
let n = [];
|
|
1444
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return {
|
|
1445
|
+
valid: !1,
|
|
1446
|
+
errors: [{ message: "Recipe must be a non-null object" }]
|
|
1447
|
+
};
|
|
1448
|
+
let r = e;
|
|
1449
|
+
if (typeof r.id != "string" || r.id.trim() === "") n.push({
|
|
1450
|
+
parameter: "id",
|
|
1451
|
+
message: "Recipe id must be a non-empty string"
|
|
1452
|
+
});
|
|
1453
|
+
else {
|
|
1454
|
+
if (t.has(r.id)) return {
|
|
1455
|
+
valid: !1,
|
|
1456
|
+
errors: [{
|
|
1457
|
+
parameter: "id",
|
|
1458
|
+
message: `Circular recipe reference detected involving "${r.id}"`
|
|
1459
|
+
}]
|
|
1460
|
+
};
|
|
1461
|
+
t.add(r.id);
|
|
1462
|
+
}
|
|
1463
|
+
if ((typeof r.name != "string" || r.name.trim() === "") && n.push({
|
|
1464
|
+
parameter: "name",
|
|
1465
|
+
message: "Recipe name must be a non-empty string"
|
|
1466
|
+
}), (typeof r.description != "string" || r.description.trim().length < 5) && n.push({
|
|
1467
|
+
parameter: "description",
|
|
1468
|
+
message: "Recipe description must be at least 5 characters"
|
|
1469
|
+
}), !Array.isArray(r.steps) || r.steps.length === 0) n.push({
|
|
1470
|
+
parameter: "steps",
|
|
1471
|
+
message: "Recipe steps must be a non-empty array"
|
|
1472
|
+
});
|
|
1473
|
+
else {
|
|
1474
|
+
let e = /* @__PURE__ */ new Set();
|
|
1475
|
+
function i(r, a) {
|
|
1476
|
+
for (let [o, s] of r.entries()) {
|
|
1477
|
+
let r = `${a}[${o}]`;
|
|
1478
|
+
if (typeof s != "object" || !s || Array.isArray(s)) n.push({
|
|
1479
|
+
parameter: r,
|
|
1480
|
+
message: "Step must be an object"
|
|
1481
|
+
});
|
|
1482
|
+
else if (s.label && (e.has(s.label) && n.push({
|
|
1483
|
+
parameter: `${r}.label`,
|
|
1484
|
+
message: `Duplicate step label "${s.label}"`
|
|
1485
|
+
}), e.add(s.label)), s.delay !== void 0 && (typeof s.delay != "number" || s.delay < 0) && n.push({
|
|
1486
|
+
parameter: `${r}.delay`,
|
|
1487
|
+
message: "Step delay must be a number >= 0"
|
|
1488
|
+
}), s.type === "parallel" || s.type === "sequence") {
|
|
1489
|
+
let e = s;
|
|
1490
|
+
!Array.isArray(e.steps) || e.steps.length === 0 ? n.push({
|
|
1491
|
+
parameter: `${r}.steps`,
|
|
1492
|
+
message: `${s.type} step must contain a non-empty array of steps`
|
|
1493
|
+
}) : i(e.steps, `${r}.steps`);
|
|
1494
|
+
} else if (s.type === "recipe") {
|
|
1495
|
+
let e = s;
|
|
1496
|
+
if (!e.recipe) n.push({
|
|
1497
|
+
parameter: `${r}.recipe`,
|
|
1498
|
+
message: "Nested recipe step must specify a recipe"
|
|
1499
|
+
});
|
|
1500
|
+
else if (typeof e.recipe == "string") {
|
|
1501
|
+
let i = B(e.recipe);
|
|
1502
|
+
if (!i) n.push({
|
|
1503
|
+
parameter: `${r}.recipe`,
|
|
1504
|
+
message: `Unknown nested recipe "${e.recipe}"`
|
|
1505
|
+
});
|
|
1506
|
+
else {
|
|
1507
|
+
let e = V(i, new Set(t));
|
|
1508
|
+
e.valid || n.push(...e.errors.map((e) => ({
|
|
1509
|
+
parameter: `${r}.${e.parameter ?? "nested"}`,
|
|
1510
|
+
message: e.message
|
|
1511
|
+
})));
|
|
1512
|
+
}
|
|
1513
|
+
} else {
|
|
1514
|
+
let i = V(e.recipe, new Set(t));
|
|
1515
|
+
i.valid || n.push(...i.errors.map((e) => ({
|
|
1516
|
+
parameter: `${r}.${e.parameter ?? "nested"}`,
|
|
1517
|
+
message: e.message
|
|
1518
|
+
})));
|
|
1519
|
+
}
|
|
1520
|
+
} else {
|
|
1521
|
+
let e = s;
|
|
1522
|
+
typeof e.preset != "string" || e.preset.trim() === "" ? n.push({
|
|
1523
|
+
parameter: `${r}.preset`,
|
|
1524
|
+
message: "Preset step must specify a preset name or id"
|
|
1525
|
+
}) : gt(e.preset) || n.push({
|
|
1526
|
+
parameter: `${r}.preset`,
|
|
1527
|
+
message: `Unknown preset "${e.preset}"`
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
i(r.steps, "steps");
|
|
1533
|
+
}
|
|
1534
|
+
return {
|
|
1535
|
+
valid: n.length === 0,
|
|
1536
|
+
errors: n
|
|
1537
|
+
};
|
|
1538
|
+
}
|
|
1539
|
+
function qe(e, t) {
|
|
1540
|
+
let n = [], r = typeof e == "string" ? B(e) : e;
|
|
1541
|
+
if (!r) return {
|
|
1542
|
+
valid: !1,
|
|
1543
|
+
errors: [{ message: `Unknown recipe "${String(e)}"` }]
|
|
1544
|
+
};
|
|
1545
|
+
if (t == null) return r.requiredTargets && r.requiredTargets.length > 0 ? {
|
|
1546
|
+
valid: !1,
|
|
1547
|
+
errors: [{
|
|
1548
|
+
parameter: "targets",
|
|
1549
|
+
message: `Missing required targets: ${r.requiredTargets.join(", ")}`
|
|
1550
|
+
}]
|
|
1551
|
+
} : {
|
|
1552
|
+
valid: !0,
|
|
1553
|
+
errors: []
|
|
1554
|
+
};
|
|
1555
|
+
if (typeof t != "object" || Array.isArray(t)) return {
|
|
1556
|
+
valid: !1,
|
|
1557
|
+
errors: [{ message: "Recipe run options must be an object" }]
|
|
1558
|
+
};
|
|
1559
|
+
let i = t;
|
|
1560
|
+
if (r.requiredTargets && r.requiredTargets.length > 0) {
|
|
1561
|
+
if (!i.targets) n.push({
|
|
1562
|
+
parameter: "targets",
|
|
1563
|
+
message: `Missing required targets: ${r.requiredTargets.join(", ")}`
|
|
1564
|
+
});
|
|
1565
|
+
else if (H(i.targets)) {
|
|
1566
|
+
let e = i.targets;
|
|
1567
|
+
for (let t of r.requiredTargets) {
|
|
1568
|
+
let r = t.startsWith("$") ? t.slice(1) : t;
|
|
1569
|
+
e[r] === void 0 && e[`$${r}`] === void 0 && n.push({
|
|
1570
|
+
parameter: `targets.${r}`,
|
|
1571
|
+
message: `Missing binding for required target slot "${r}"`
|
|
1572
|
+
});
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
return i.overrides && (i.overrides.duration !== void 0 && (typeof i.overrides.duration != "number" || i.overrides.duration < 0) && n.push({
|
|
1577
|
+
parameter: "overrides.duration",
|
|
1578
|
+
message: "duration must be a number >= 0"
|
|
1579
|
+
}), i.overrides.delay !== void 0 && (typeof i.overrides.delay != "number" || i.overrides.delay < 0) && n.push({
|
|
1580
|
+
parameter: "overrides.delay",
|
|
1581
|
+
message: "delay must be a number >= 0"
|
|
1582
|
+
}), i.overrides.playbackRate !== void 0 && (typeof i.overrides.playbackRate != "number" || i.overrides.playbackRate <= 0) && n.push({
|
|
1583
|
+
parameter: "overrides.playbackRate",
|
|
1584
|
+
message: "playbackRate must be a number > 0"
|
|
1585
|
+
})), {
|
|
1586
|
+
valid: n.length === 0,
|
|
1587
|
+
errors: n
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1590
|
+
function H(e) {
|
|
1591
|
+
return !(typeof e != "object" || !e || "nodeType" in e || "style" in e || typeof e.addEventListener == "function");
|
|
1592
|
+
}
|
|
1593
|
+
function Je(e, t, n) {
|
|
1594
|
+
if (typeof e == "string") {
|
|
1595
|
+
let r = e.startsWith("$") ? e.slice(1) : e;
|
|
1596
|
+
if (t && H(t)) {
|
|
1597
|
+
if (t[r] !== void 0) return t[r];
|
|
1598
|
+
if (t[`$${r}`] !== void 0) return t[`$${r}`];
|
|
1599
|
+
}
|
|
1600
|
+
if (e.startsWith("$") || n && n.includes(r)) throw TypeError(`Missing target binding for slot "${e}"`);
|
|
1601
|
+
return e;
|
|
1602
|
+
}
|
|
1603
|
+
if (e !== void 0) return e;
|
|
1604
|
+
if (t) {
|
|
1605
|
+
if (!H(t) || typeof t == "string") return t;
|
|
1606
|
+
if (t.default !== void 0) return t.default;
|
|
1607
|
+
if (t.container !== void 0) return t.container;
|
|
1608
|
+
if (t.root !== void 0) return t.root;
|
|
1609
|
+
}
|
|
1610
|
+
throw TypeError("Recipe step does not define a target and no default target was provided");
|
|
1611
|
+
}
|
|
1612
|
+
function Ye(e) {
|
|
1613
|
+
for (let t of e) if (t.type === "parallel" || t.type === "sequence" || t.type === "recipe") return !1;
|
|
1614
|
+
return !0;
|
|
1615
|
+
}
|
|
1616
|
+
function Xe(e) {
|
|
1617
|
+
for (let t of e) if (t.type === "parallel" || t.type === "sequence" || t.type === "recipe") return !1;
|
|
1618
|
+
return !0;
|
|
1619
|
+
}
|
|
1620
|
+
function Ze(e, t, n, r, i, a, o) {
|
|
1621
|
+
return {
|
|
1622
|
+
...e,
|
|
1623
|
+
...t === void 0 ? {} : { duration: t },
|
|
1624
|
+
...n === void 0 ? {} : { delay: n },
|
|
1625
|
+
...r === void 0 ? {} : { easing: r },
|
|
1626
|
+
...i,
|
|
1627
|
+
...a,
|
|
1628
|
+
...o
|
|
1629
|
+
};
|
|
1630
|
+
}
|
|
1631
|
+
function U(e, t = {}) {
|
|
1632
|
+
let n = typeof e == "string" ? B(e) : e;
|
|
1633
|
+
if (!n) throw TypeError(`Unknown motion recipe "${String(e)}"`);
|
|
1634
|
+
let r = n, i = qe(r, t);
|
|
1635
|
+
if (!i.valid) throw TypeError(`Invalid recipe options: ${i.errors.map((e) => e.message).join(", ")}`);
|
|
1636
|
+
let a = t.targets, o = t.overrides ?? {}, c = t.stepOverrides ?? {};
|
|
1637
|
+
if (r.structure !== "parallel" && Ye(r.steps)) {
|
|
1638
|
+
let e = s(r.steps.map((e, t) => {
|
|
1639
|
+
let n = e, i = Je(n.target, a, r.requiredTargets), s = n.label ?? String(t), l = c[s] ?? c[String(t)] ?? {}, u = Ze(r.defaultOptions, n.duration, n.delay, n.easing, n.overrides, o, l), { properties: d, options: f } = J(n.preset, u);
|
|
1640
|
+
return {
|
|
1641
|
+
target: i,
|
|
1642
|
+
properties: d,
|
|
1643
|
+
options: f
|
|
1644
|
+
};
|
|
1645
|
+
}));
|
|
1646
|
+
return {
|
|
1647
|
+
finished: e.finished,
|
|
1648
|
+
pause: () => e.pause(),
|
|
1649
|
+
resume: () => e.resume(),
|
|
1650
|
+
reverse: () => e.reverse(),
|
|
1651
|
+
cancel: () => e.cancel(),
|
|
1652
|
+
destroy: () => e.cancel()
|
|
1653
|
+
};
|
|
1654
|
+
}
|
|
1655
|
+
if (r.structure === "parallel" && Xe(r.steps)) {
|
|
1656
|
+
let e = F(r.steps.map((e, t) => {
|
|
1657
|
+
let n = e, i = Je(n.target, a, r.requiredTargets), s = n.label ?? String(t), l = c[s] ?? c[String(t)] ?? {}, u = Ze(r.defaultOptions, n.duration, n.delay, n.easing, n.overrides, o, l), { properties: d, options: f } = J(n.preset, u);
|
|
1658
|
+
return {
|
|
1659
|
+
target: i,
|
|
1660
|
+
properties: d,
|
|
1661
|
+
options: f
|
|
1662
|
+
};
|
|
1663
|
+
}));
|
|
1664
|
+
return {
|
|
1665
|
+
finished: e.finished,
|
|
1666
|
+
pause: () => e.pause(),
|
|
1667
|
+
resume: () => e.resume(),
|
|
1668
|
+
cancel: () => e.cancel(),
|
|
1669
|
+
destroy: () => e.cancel()
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
let l = null, u = !1, d = !1, f = () => void 0, p = () => void 0, m = new Promise((e, t) => {
|
|
1673
|
+
f = e, p = t;
|
|
1674
|
+
});
|
|
1675
|
+
function h(e, t) {
|
|
1676
|
+
let n = Je(e.target, a, r?.requiredTargets), i = e.label ?? String(t), s = c[i] ?? c[String(t)] ?? {}, l = Ze(r?.defaultOptions, e.duration, e.delay, e.easing, e.overrides, o, s), { properties: u, options: d } = J(e.preset, l);
|
|
1677
|
+
return {
|
|
1678
|
+
target: n,
|
|
1679
|
+
properties: u,
|
|
1680
|
+
options: d
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1683
|
+
async function g(e) {
|
|
1684
|
+
let t = typeof e.recipe == "string" ? B(e.recipe) : e.recipe;
|
|
1685
|
+
if (!t) throw TypeError(`Unknown nested recipe "${String(e.recipe)}"`);
|
|
1686
|
+
let n = U(t, {
|
|
1687
|
+
targets: H(a) ? {
|
|
1688
|
+
...a,
|
|
1689
|
+
...e.targets
|
|
1690
|
+
} : e.targets ?? a,
|
|
1691
|
+
overrides: {
|
|
1692
|
+
...o,
|
|
1693
|
+
...e.overrides
|
|
1694
|
+
},
|
|
1695
|
+
stepOverrides: c
|
|
1696
|
+
});
|
|
1697
|
+
l = n, u && n.pause(), n.finished && await n.finished;
|
|
1698
|
+
}
|
|
1699
|
+
async function _(e, t) {
|
|
1700
|
+
if (e.type === "parallel") {
|
|
1701
|
+
let t = e;
|
|
1702
|
+
if (t.steps.every((e) => !e.type || e.type === "preset")) {
|
|
1703
|
+
let e = F(t.steps.map((e, t) => h(e, t)));
|
|
1704
|
+
l = e, u && e.pause(), await e.finished;
|
|
1705
|
+
} else {
|
|
1706
|
+
let e = [];
|
|
1707
|
+
l = {
|
|
1708
|
+
pause: () => e.forEach((e) => e.pause()),
|
|
1709
|
+
resume: () => e.forEach((e) => e.resume()),
|
|
1710
|
+
cancel: () => e.forEach((e) => e.cancel())
|
|
1711
|
+
}, await Promise.all(t.steps.map(async (t, n) => {
|
|
1712
|
+
if (t.type === "sequence") {
|
|
1713
|
+
let e = t;
|
|
1714
|
+
for (let t = 0; t < e.steps.length; t++) {
|
|
1715
|
+
if (d) return;
|
|
1716
|
+
await _(e.steps[t], t);
|
|
1717
|
+
}
|
|
1718
|
+
} else if (t.type === "recipe") await g(t);
|
|
1719
|
+
else {
|
|
1720
|
+
let r = F([h(t, n)]);
|
|
1721
|
+
e.push(r), u && r.pause(), await r.finished;
|
|
1722
|
+
}
|
|
1723
|
+
}));
|
|
1724
|
+
}
|
|
1725
|
+
} else if (e.type === "sequence") {
|
|
1726
|
+
let t = e;
|
|
1727
|
+
for (let e = 0; e < t.steps.length; e++) {
|
|
1728
|
+
if (d) return;
|
|
1729
|
+
await _(t.steps[e], e);
|
|
1730
|
+
}
|
|
1731
|
+
} else if (e.type === "recipe") await g(e);
|
|
1732
|
+
else {
|
|
1733
|
+
let n = F([h(e, t)]);
|
|
1734
|
+
l = n, u && n.pause(), await n.finished;
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
async function v() {
|
|
1738
|
+
try {
|
|
1739
|
+
let e = r;
|
|
1740
|
+
for (let [t, n] of e.steps.entries()) {
|
|
1741
|
+
if (d) return;
|
|
1742
|
+
await _(n, t);
|
|
1743
|
+
}
|
|
1744
|
+
d || f();
|
|
1745
|
+
} catch (e) {
|
|
1746
|
+
d || p(e);
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
return v(), {
|
|
1750
|
+
finished: m,
|
|
1751
|
+
pause: () => {
|
|
1752
|
+
d || (u = !0, l?.pause());
|
|
1753
|
+
},
|
|
1754
|
+
resume: () => {
|
|
1755
|
+
d || (u = !1, l?.resume());
|
|
1756
|
+
},
|
|
1757
|
+
cancel: () => {
|
|
1758
|
+
d || (d = !0, l?.cancel(), p(Re()));
|
|
1759
|
+
},
|
|
1760
|
+
destroy: () => {
|
|
1761
|
+
d || (d = !0, l?.cancel(), p(Re()));
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
function Qe(e) {
|
|
1766
|
+
let t = V(e);
|
|
1767
|
+
if (!t.valid) throw TypeError(`Cannot compose invalid recipe: ${t.errors.map((e) => e.message).join(", ")}`);
|
|
1768
|
+
return I({ ...e });
|
|
1769
|
+
}
|
|
1770
|
+
function $e(e, t = !0) {
|
|
1771
|
+
let n = typeof e == "string" ? B(e) : e;
|
|
1772
|
+
if (!n) throw TypeError(`Unknown motion recipe "${String(e)}"`);
|
|
1773
|
+
return JSON.stringify(n, null, t ? 2 : 0);
|
|
1774
|
+
}
|
|
1775
|
+
function et() {
|
|
1776
|
+
let e = Ue();
|
|
1777
|
+
return {
|
|
1778
|
+
$schema: "https://af-motion.dev/schemas/recipes-v1.json",
|
|
1779
|
+
version: Le,
|
|
1780
|
+
totalRecipes: e.length,
|
|
1781
|
+
recipes: e
|
|
1782
|
+
};
|
|
1783
|
+
}
|
|
1784
|
+
function tt(e) {
|
|
1785
|
+
if (typeof e != "string" || e.trim() === "") throw TypeError("Recipe JSON must be a non-empty string");
|
|
1786
|
+
let t = JSON.parse(e), n = V(t);
|
|
1787
|
+
if (!n.valid) throw TypeError(`Invalid recipe JSON: ${n.errors.map((e) => e.message).join(", ")}`);
|
|
1788
|
+
return I(t);
|
|
1789
|
+
}
|
|
1790
|
+
function nt(e) {
|
|
1791
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Motion recipe definition must be an object");
|
|
1792
|
+
if (e.effects !== void 0 && typeof e.effects != "function") throw TypeError("Motion recipe effects must be a function");
|
|
1793
|
+
if (e.choreography !== void 0 && typeof e.choreography != "function") throw TypeError("Motion recipe choreography must be a function");
|
|
1794
|
+
if (e.effects === void 0 && e.choreography === void 0) throw TypeError("Motion recipe must define effects or choreography");
|
|
1795
|
+
if (e.motionDNA !== void 0 && !Array.isArray(e.motionDNA)) throw TypeError("Motion recipe motionDNA must be an array of names");
|
|
1796
|
+
let t = /* @__PURE__ */ new Set();
|
|
1797
|
+
for (let n of e.motionDNA ?? []) {
|
|
1798
|
+
if (typeof n != "string" || n.trim() === "" || n !== n.trim()) throw TypeError("Motion recipe DNA names must be non-empty strings without surrounding whitespace");
|
|
1799
|
+
if (t.has(n)) throw TypeError(`Motion recipe declares duplicate DNA "${n}"`);
|
|
1800
|
+
t.add(n);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
function rt(e) {
|
|
1804
|
+
return Object.freeze({
|
|
1805
|
+
...e.motionDNA ? { motionDNA: Object.freeze([...e.motionDNA]) } : {},
|
|
1806
|
+
...e.effects ? { effects: e.effects } : {},
|
|
1807
|
+
...e.choreography ? { choreography: e.choreography } : {}
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1810
|
+
function it(e) {
|
|
1811
|
+
return e && Array.isArray(e.steps) ? Qe(e) : (nt(e), Object.freeze({ definition: rt(e) }));
|
|
1812
|
+
}
|
|
1813
|
+
function at(t, n = {}) {
|
|
1814
|
+
if (typeof t == "string" || t && Array.isArray(t.steps)) return U(t, n);
|
|
1815
|
+
if (typeof t != "object" || !t || t.definition === void 0) throw TypeError("recipe must be created with createMotionRecipe()");
|
|
1816
|
+
if (typeof n != "object" || !n || Array.isArray(n)) throw TypeError("Motion recipe parameters must be an object");
|
|
1817
|
+
let r = t.definition;
|
|
1818
|
+
if (Array.isArray(r.steps)) return U(r, n);
|
|
1819
|
+
let i = new Set(r.motionDNA ?? []), a = Object.freeze({ motionDNA: (t, n = {}) => {
|
|
1820
|
+
if (!i.has(t)) throw TypeError(`Motion DNA "${t}" is not declared by this recipe`);
|
|
1821
|
+
return e(t, n);
|
|
1822
|
+
} }), o = Object.freeze({ ...n }), s = null, c = null, l = !1;
|
|
1823
|
+
try {
|
|
1824
|
+
let e = r.effects?.(o, a);
|
|
1825
|
+
e !== void 0 && (s = d(e));
|
|
1826
|
+
let t = r.choreography?.(o, a);
|
|
1827
|
+
if (t !== void 0) {
|
|
1828
|
+
if (!Fe) throw Error("Motion choreography engine is not registered");
|
|
1829
|
+
c = Fe(t);
|
|
1830
|
+
}
|
|
1831
|
+
} catch (e) {
|
|
1832
|
+
try {
|
|
1833
|
+
s?.destroy();
|
|
1834
|
+
} catch (t) {
|
|
1835
|
+
throw AggregateError([e, t], "Motion recipe failed to start and clean up");
|
|
1836
|
+
}
|
|
1837
|
+
throw e;
|
|
1838
|
+
}
|
|
1839
|
+
let u = () => {
|
|
1840
|
+
if (l) return;
|
|
1841
|
+
l = !0;
|
|
1842
|
+
let e = [];
|
|
1843
|
+
try {
|
|
1844
|
+
c?.cancel();
|
|
1845
|
+
} catch (t) {
|
|
1846
|
+
e.push(t);
|
|
1847
|
+
}
|
|
1848
|
+
try {
|
|
1849
|
+
s?.destroy();
|
|
1850
|
+
} catch (t) {
|
|
1851
|
+
e.push(t);
|
|
1852
|
+
}
|
|
1853
|
+
if (e.length > 0) throw AggregateError(e, "Motion recipe cleanup failed");
|
|
1854
|
+
}, f = () => {
|
|
1855
|
+
if (l) return;
|
|
1856
|
+
let e = [];
|
|
1857
|
+
try {
|
|
1858
|
+
c?.pause();
|
|
1859
|
+
} catch (t) {
|
|
1860
|
+
e.push(t);
|
|
1861
|
+
}
|
|
1862
|
+
try {
|
|
1863
|
+
s?.pause();
|
|
1864
|
+
} catch (t) {
|
|
1865
|
+
e.push(t);
|
|
1866
|
+
}
|
|
1867
|
+
if (e.length > 0) throw AggregateError(e, "Motion recipe pause failed");
|
|
1868
|
+
}, p = () => {
|
|
1869
|
+
if (l) return;
|
|
1870
|
+
let e = [];
|
|
1871
|
+
try {
|
|
1872
|
+
c?.resume();
|
|
1873
|
+
} catch (t) {
|
|
1874
|
+
e.push(t);
|
|
1875
|
+
}
|
|
1876
|
+
try {
|
|
1877
|
+
s?.resume();
|
|
1878
|
+
} catch (t) {
|
|
1879
|
+
e.push(t);
|
|
1880
|
+
}
|
|
1881
|
+
if (e.length > 0) throw AggregateError(e, "Motion recipe resume failed");
|
|
1882
|
+
}, m = c ? c.finished.catch((e) => {
|
|
1883
|
+
try {
|
|
1884
|
+
s?.destroy();
|
|
1885
|
+
} catch (t) {
|
|
1886
|
+
throw AggregateError([e, t], "Motion recipe choreography failed to clean up");
|
|
1887
|
+
}
|
|
1888
|
+
throw e;
|
|
1889
|
+
}) : void 0;
|
|
1890
|
+
return {
|
|
1891
|
+
...m ? { finished: m } : {},
|
|
1892
|
+
pause: f,
|
|
1893
|
+
resume: p,
|
|
1894
|
+
destroy: u,
|
|
1895
|
+
cancel: u
|
|
1896
|
+
};
|
|
1897
|
+
}
|
|
1898
|
+
// src/presets.ts
|
|
1899
|
+
var ot = "1.0.0", W = [
|
|
1900
|
+
"entrance",
|
|
1901
|
+
"exit",
|
|
1902
|
+
"hover",
|
|
1903
|
+
"click-interaction",
|
|
1904
|
+
"text",
|
|
1905
|
+
"scroll",
|
|
1906
|
+
"background",
|
|
1907
|
+
"page-transition",
|
|
1908
|
+
"choreography"
|
|
1909
|
+
], G = [
|
|
1910
|
+
{
|
|
1911
|
+
name: "duration",
|
|
1912
|
+
type: "number",
|
|
1913
|
+
description: "Animation duration in milliseconds.",
|
|
1914
|
+
range: { min: 0 }
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
name: "delay",
|
|
1918
|
+
type: "number",
|
|
1919
|
+
description: "Delay in milliseconds before starting.",
|
|
1920
|
+
range: { min: 0 }
|
|
1921
|
+
},
|
|
1922
|
+
{
|
|
1923
|
+
name: "easing",
|
|
1924
|
+
type: "EasingOption",
|
|
1925
|
+
description: "Easing function or registered easing name."
|
|
1926
|
+
},
|
|
1927
|
+
{
|
|
1928
|
+
name: "repeat",
|
|
1929
|
+
type: "number",
|
|
1930
|
+
description: "Repeat iterations.",
|
|
1931
|
+
range: { min: 0 }
|
|
1932
|
+
},
|
|
1933
|
+
{
|
|
1934
|
+
name: "yoyo",
|
|
1935
|
+
type: "boolean",
|
|
1936
|
+
description: "Alternate direction on repeats."
|
|
1937
|
+
},
|
|
1938
|
+
{
|
|
1939
|
+
name: "playbackRate",
|
|
1940
|
+
type: "number",
|
|
1941
|
+
description: "Speed multiplier.",
|
|
1942
|
+
range: { min: 0 }
|
|
1943
|
+
}
|
|
1944
|
+
];
|
|
1945
|
+
function st(e) {
|
|
1946
|
+
if (typeof e != "object" || !e || Object.isFrozen(e)) return e;
|
|
1947
|
+
for (let t of Object.keys(e)) {
|
|
1948
|
+
let n = e[t];
|
|
1949
|
+
typeof n == "object" && n && st(n);
|
|
1950
|
+
}
|
|
1951
|
+
return Object.freeze(e);
|
|
1952
|
+
}
|
|
1953
|
+
var K = [
|
|
1954
|
+
{
|
|
1955
|
+
id: "preset-fade-in",
|
|
1956
|
+
name: "fadeIn",
|
|
1957
|
+
category: "entrance",
|
|
1958
|
+
description: "Smooth linear/quadratic opacity entrance from 0 to 1.",
|
|
1959
|
+
supportedTargets: [
|
|
1960
|
+
"HTMLElement",
|
|
1961
|
+
"SVGElement",
|
|
1962
|
+
"AnimateTarget"
|
|
1963
|
+
],
|
|
1964
|
+
reducedMotion: "skips-to-endpoint",
|
|
1965
|
+
tags: [
|
|
1966
|
+
"fade",
|
|
1967
|
+
"entrance",
|
|
1968
|
+
"opacity",
|
|
1969
|
+
"appear"
|
|
1970
|
+
],
|
|
1971
|
+
signature: {
|
|
1972
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
1973
|
+
invocation: "applyPreset(target, \"fadeIn\", overrides?)",
|
|
1974
|
+
exampleCode: "applyPreset(\".card\", \"fadeIn\", { duration: 400 });"
|
|
1975
|
+
},
|
|
1976
|
+
configurableParameters: G,
|
|
1977
|
+
animation: {
|
|
1978
|
+
properties: { opacity: [0, 1] },
|
|
1979
|
+
duration: 400,
|
|
1980
|
+
easing: "easeOutQuad"
|
|
1981
|
+
}
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
id: "preset-slide-up",
|
|
1985
|
+
name: "slideUp",
|
|
1986
|
+
category: "entrance",
|
|
1987
|
+
description: "Fade in while translating up 24px into natural position.",
|
|
1988
|
+
supportedTargets: [
|
|
1989
|
+
"HTMLElement",
|
|
1990
|
+
"SVGElement",
|
|
1991
|
+
"AnimateTarget"
|
|
1992
|
+
],
|
|
1993
|
+
reducedMotion: "skips-to-endpoint",
|
|
1994
|
+
tags: [
|
|
1995
|
+
"slide",
|
|
1996
|
+
"entrance",
|
|
1997
|
+
"up",
|
|
1998
|
+
"rise"
|
|
1999
|
+
],
|
|
2000
|
+
signature: {
|
|
2001
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2002
|
+
invocation: "applyPreset(target, \"slideUp\", overrides?)",
|
|
2003
|
+
exampleCode: "applyPreset(\".hero-title\", \"slideUp\", { duration: 500 });"
|
|
2004
|
+
},
|
|
2005
|
+
configurableParameters: G,
|
|
2006
|
+
animation: {
|
|
2007
|
+
properties: {
|
|
2008
|
+
opacity: [0, 1],
|
|
2009
|
+
transform: ["translateY(24px)", "translateY(0px)"]
|
|
2010
|
+
},
|
|
2011
|
+
duration: 500,
|
|
2012
|
+
easing: "easeOutCubic"
|
|
2013
|
+
}
|
|
2014
|
+
},
|
|
2015
|
+
{
|
|
2016
|
+
id: "preset-slide-down",
|
|
2017
|
+
name: "slideDown",
|
|
2018
|
+
category: "entrance",
|
|
2019
|
+
description: "Fade in while translating down -24px into natural position.",
|
|
2020
|
+
supportedTargets: [
|
|
2021
|
+
"HTMLElement",
|
|
2022
|
+
"SVGElement",
|
|
2023
|
+
"AnimateTarget"
|
|
2024
|
+
],
|
|
2025
|
+
reducedMotion: "skips-to-endpoint",
|
|
2026
|
+
tags: [
|
|
2027
|
+
"slide",
|
|
2028
|
+
"entrance",
|
|
2029
|
+
"down",
|
|
2030
|
+
"dropdown"
|
|
2031
|
+
],
|
|
2032
|
+
signature: {
|
|
2033
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2034
|
+
invocation: "applyPreset(target, \"slideDown\", overrides?)",
|
|
2035
|
+
exampleCode: "applyPreset(\".dropdown-menu\", \"slideDown\", { duration: 350 });"
|
|
2036
|
+
},
|
|
2037
|
+
configurableParameters: G,
|
|
2038
|
+
animation: {
|
|
2039
|
+
properties: {
|
|
2040
|
+
opacity: [0, 1],
|
|
2041
|
+
transform: ["translateY(-24px)", "translateY(0px)"]
|
|
2042
|
+
},
|
|
2043
|
+
duration: 500,
|
|
2044
|
+
easing: "easeOutCubic"
|
|
2045
|
+
}
|
|
2046
|
+
},
|
|
2047
|
+
{
|
|
2048
|
+
id: "preset-slide-in-left",
|
|
2049
|
+
name: "slideInLeft",
|
|
2050
|
+
category: "entrance",
|
|
2051
|
+
description: "Fade in while translating horizontally from left -32px to 0px.",
|
|
2052
|
+
supportedTargets: [
|
|
2053
|
+
"HTMLElement",
|
|
2054
|
+
"SVGElement",
|
|
2055
|
+
"AnimateTarget"
|
|
2056
|
+
],
|
|
2057
|
+
reducedMotion: "skips-to-endpoint",
|
|
2058
|
+
tags: [
|
|
2059
|
+
"slide",
|
|
2060
|
+
"entrance",
|
|
2061
|
+
"left",
|
|
2062
|
+
"horizontal"
|
|
2063
|
+
],
|
|
2064
|
+
signature: {
|
|
2065
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2066
|
+
invocation: "applyPreset(target, \"slideInLeft\", overrides?)",
|
|
2067
|
+
exampleCode: "applyPreset(\".sidebar\", \"slideInLeft\", { duration: 450 });"
|
|
2068
|
+
},
|
|
2069
|
+
configurableParameters: G,
|
|
2070
|
+
animation: {
|
|
2071
|
+
properties: {
|
|
2072
|
+
opacity: [0, 1],
|
|
2073
|
+
transform: ["translateX(-32px)", "translateX(0px)"]
|
|
2074
|
+
},
|
|
2075
|
+
duration: 500,
|
|
2076
|
+
easing: "easeOutCubic"
|
|
2077
|
+
}
|
|
2078
|
+
},
|
|
2079
|
+
{
|
|
2080
|
+
id: "preset-slide-in-right",
|
|
2081
|
+
name: "slideInRight",
|
|
2082
|
+
category: "entrance",
|
|
2083
|
+
description: "Fade in while translating horizontally from right 32px to 0px.",
|
|
2084
|
+
supportedTargets: [
|
|
2085
|
+
"HTMLElement",
|
|
2086
|
+
"SVGElement",
|
|
2087
|
+
"AnimateTarget"
|
|
2088
|
+
],
|
|
2089
|
+
reducedMotion: "skips-to-endpoint",
|
|
2090
|
+
tags: [
|
|
2091
|
+
"slide",
|
|
2092
|
+
"entrance",
|
|
2093
|
+
"right",
|
|
2094
|
+
"horizontal"
|
|
2095
|
+
],
|
|
2096
|
+
signature: {
|
|
2097
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2098
|
+
invocation: "applyPreset(target, \"slideInRight\", overrides?)",
|
|
2099
|
+
exampleCode: "applyPreset(\".notification\", \"slideInRight\", { duration: 400 });"
|
|
2100
|
+
},
|
|
2101
|
+
configurableParameters: G,
|
|
2102
|
+
animation: {
|
|
2103
|
+
properties: {
|
|
2104
|
+
opacity: [0, 1],
|
|
2105
|
+
transform: ["translateX(32px)", "translateX(0px)"]
|
|
2106
|
+
},
|
|
2107
|
+
duration: 500,
|
|
2108
|
+
easing: "easeOutCubic"
|
|
2109
|
+
}
|
|
2110
|
+
},
|
|
2111
|
+
{
|
|
2112
|
+
id: "preset-scale-in",
|
|
2113
|
+
name: "scaleIn",
|
|
2114
|
+
category: "entrance",
|
|
2115
|
+
description: "Fade in with subtle scaling from 0.9 to 1.",
|
|
2116
|
+
supportedTargets: [
|
|
2117
|
+
"HTMLElement",
|
|
2118
|
+
"SVGElement",
|
|
2119
|
+
"AnimateTarget"
|
|
2120
|
+
],
|
|
2121
|
+
reducedMotion: "skips-to-endpoint",
|
|
2122
|
+
tags: [
|
|
2123
|
+
"scale",
|
|
2124
|
+
"entrance",
|
|
2125
|
+
"zoom",
|
|
2126
|
+
"pop"
|
|
2127
|
+
],
|
|
2128
|
+
signature: {
|
|
2129
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2130
|
+
invocation: "applyPreset(target, \"scaleIn\", overrides?)",
|
|
2131
|
+
exampleCode: "applyPreset(\".dialog-box\", \"scaleIn\", { duration: 400 });"
|
|
2132
|
+
},
|
|
2133
|
+
configurableParameters: G,
|
|
2134
|
+
animation: {
|
|
2135
|
+
properties: {
|
|
2136
|
+
opacity: [0, 1],
|
|
2137
|
+
transform: ["scale(0.9)", "scale(1)"]
|
|
2138
|
+
},
|
|
2139
|
+
duration: 400,
|
|
2140
|
+
easing: "easeOutCubic"
|
|
2141
|
+
}
|
|
2142
|
+
},
|
|
2143
|
+
{
|
|
2144
|
+
id: "preset-zoom-in",
|
|
2145
|
+
name: "zoomIn",
|
|
2146
|
+
category: "entrance",
|
|
2147
|
+
description: "Dramatic zoom entrance scaling from 0.7 to 1.",
|
|
2148
|
+
supportedTargets: [
|
|
2149
|
+
"HTMLElement",
|
|
2150
|
+
"SVGElement",
|
|
2151
|
+
"AnimateTarget"
|
|
2152
|
+
],
|
|
2153
|
+
reducedMotion: "skips-to-endpoint",
|
|
2154
|
+
tags: [
|
|
2155
|
+
"zoom",
|
|
2156
|
+
"entrance",
|
|
2157
|
+
"pop",
|
|
2158
|
+
"modal"
|
|
2159
|
+
],
|
|
2160
|
+
signature: {
|
|
2161
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2162
|
+
invocation: "applyPreset(target, \"zoomIn\", overrides?)",
|
|
2163
|
+
exampleCode: "applyPreset(\".badge\", \"zoomIn\", { duration: 350 });"
|
|
2164
|
+
},
|
|
2165
|
+
configurableParameters: G,
|
|
2166
|
+
animation: {
|
|
2167
|
+
properties: {
|
|
2168
|
+
opacity: [0, 1],
|
|
2169
|
+
transform: ["scale(0.7)", "scale(1)"]
|
|
2170
|
+
},
|
|
2171
|
+
duration: 450,
|
|
2172
|
+
easing: "easeOutCubic"
|
|
2173
|
+
}
|
|
2174
|
+
},
|
|
2175
|
+
{
|
|
2176
|
+
id: "preset-flip-in-x",
|
|
2177
|
+
name: "flipInX",
|
|
2178
|
+
category: "entrance",
|
|
2179
|
+
description: "3D perspective flip along X axis from 90deg to 0deg.",
|
|
2180
|
+
supportedTargets: [
|
|
2181
|
+
"HTMLElement",
|
|
2182
|
+
"SVGElement",
|
|
2183
|
+
"AnimateTarget"
|
|
2184
|
+
],
|
|
2185
|
+
reducedMotion: "disables-animation",
|
|
2186
|
+
tags: [
|
|
2187
|
+
"flip",
|
|
2188
|
+
"3d",
|
|
2189
|
+
"entrance",
|
|
2190
|
+
"rotate"
|
|
2191
|
+
],
|
|
2192
|
+
signature: {
|
|
2193
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2194
|
+
invocation: "applyPreset(target, \"flipInX\", overrides?)",
|
|
2195
|
+
exampleCode: "applyPreset(\".card-face\", \"flipInX\", { duration: 600 });"
|
|
2196
|
+
},
|
|
2197
|
+
configurableParameters: G,
|
|
2198
|
+
animation: {
|
|
2199
|
+
properties: {
|
|
2200
|
+
opacity: [0, 1],
|
|
2201
|
+
transform: ["perspective(400px) rotateX(90deg)", "perspective(400px) rotateX(0deg)"]
|
|
2202
|
+
},
|
|
2203
|
+
duration: 600,
|
|
2204
|
+
easing: "easeOutCubic"
|
|
2205
|
+
}
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
id: "preset-bounce-in",
|
|
2209
|
+
name: "bounceIn",
|
|
2210
|
+
category: "entrance",
|
|
2211
|
+
description: "Elastic pop entrance scaling from 0.4 to 1.",
|
|
2212
|
+
supportedTargets: [
|
|
2213
|
+
"HTMLElement",
|
|
2214
|
+
"SVGElement",
|
|
2215
|
+
"AnimateTarget"
|
|
2216
|
+
],
|
|
2217
|
+
reducedMotion: "skips-to-endpoint",
|
|
2218
|
+
tags: [
|
|
2219
|
+
"bounce",
|
|
2220
|
+
"elastic",
|
|
2221
|
+
"entrance",
|
|
2222
|
+
"pop"
|
|
2223
|
+
],
|
|
2224
|
+
signature: {
|
|
2225
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2226
|
+
invocation: "applyPreset(target, \"bounceIn\", overrides?)",
|
|
2227
|
+
exampleCode: "applyPreset(\".avatar\", \"bounceIn\", { duration: 550 });"
|
|
2228
|
+
},
|
|
2229
|
+
configurableParameters: G,
|
|
2230
|
+
animation: {
|
|
2231
|
+
properties: {
|
|
2232
|
+
opacity: [0, 1],
|
|
2233
|
+
transform: ["scale(0.4)", "scale(1)"]
|
|
2234
|
+
},
|
|
2235
|
+
duration: 550,
|
|
2236
|
+
easing: "easeOutBack"
|
|
2237
|
+
}
|
|
2238
|
+
},
|
|
2239
|
+
{
|
|
2240
|
+
id: "preset-fade-out",
|
|
2241
|
+
name: "fadeOut",
|
|
2242
|
+
category: "exit",
|
|
2243
|
+
description: "Smooth linear/quadratic opacity exit from 1 to 0.",
|
|
2244
|
+
supportedTargets: [
|
|
2245
|
+
"HTMLElement",
|
|
2246
|
+
"SVGElement",
|
|
2247
|
+
"AnimateTarget"
|
|
2248
|
+
],
|
|
2249
|
+
reducedMotion: "skips-to-endpoint",
|
|
2250
|
+
tags: [
|
|
2251
|
+
"fade",
|
|
2252
|
+
"exit",
|
|
2253
|
+
"disappear",
|
|
2254
|
+
"opacity"
|
|
2255
|
+
],
|
|
2256
|
+
signature: {
|
|
2257
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2258
|
+
invocation: "applyPreset(target, \"fadeOut\", overrides?)",
|
|
2259
|
+
exampleCode: "applyPreset(\".tooltip\", \"fadeOut\", { duration: 250 });"
|
|
2260
|
+
},
|
|
2261
|
+
configurableParameters: G,
|
|
2262
|
+
animation: {
|
|
2263
|
+
properties: { opacity: [1, 0] },
|
|
2264
|
+
duration: 300,
|
|
2265
|
+
easing: "easeOutQuad"
|
|
2266
|
+
}
|
|
2267
|
+
},
|
|
2268
|
+
{
|
|
2269
|
+
id: "preset-slide-out-up",
|
|
2270
|
+
name: "slideOutUp",
|
|
2271
|
+
category: "exit",
|
|
2272
|
+
description: "Fade out while translating up from 0px to -24px.",
|
|
2273
|
+
supportedTargets: [
|
|
2274
|
+
"HTMLElement",
|
|
2275
|
+
"SVGElement",
|
|
2276
|
+
"AnimateTarget"
|
|
2277
|
+
],
|
|
2278
|
+
reducedMotion: "skips-to-endpoint",
|
|
2279
|
+
tags: [
|
|
2280
|
+
"slide",
|
|
2281
|
+
"exit",
|
|
2282
|
+
"up",
|
|
2283
|
+
"dismiss"
|
|
2284
|
+
],
|
|
2285
|
+
signature: {
|
|
2286
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2287
|
+
invocation: "applyPreset(target, \"slideOutUp\", overrides?)",
|
|
2288
|
+
exampleCode: "applyPreset(\".banner\", \"slideOutUp\", { duration: 350 });"
|
|
2289
|
+
},
|
|
2290
|
+
configurableParameters: G,
|
|
2291
|
+
animation: {
|
|
2292
|
+
properties: {
|
|
2293
|
+
opacity: [1, 0],
|
|
2294
|
+
transform: ["translateY(0px)", "translateY(-24px)"]
|
|
2295
|
+
},
|
|
2296
|
+
duration: 400,
|
|
2297
|
+
easing: "easeInCubic"
|
|
2298
|
+
}
|
|
2299
|
+
},
|
|
2300
|
+
{
|
|
2301
|
+
id: "preset-slide-out-down",
|
|
2302
|
+
name: "slideOutDown",
|
|
2303
|
+
category: "exit",
|
|
2304
|
+
description: "Fade out while translating down from 0px to 24px.",
|
|
2305
|
+
supportedTargets: [
|
|
2306
|
+
"HTMLElement",
|
|
2307
|
+
"SVGElement",
|
|
2308
|
+
"AnimateTarget"
|
|
2309
|
+
],
|
|
2310
|
+
reducedMotion: "skips-to-endpoint",
|
|
2311
|
+
tags: [
|
|
2312
|
+
"slide",
|
|
2313
|
+
"exit",
|
|
2314
|
+
"down",
|
|
2315
|
+
"dismiss"
|
|
2316
|
+
],
|
|
2317
|
+
signature: {
|
|
2318
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2319
|
+
invocation: "applyPreset(target, \"slideOutDown\", overrides?)",
|
|
2320
|
+
exampleCode: "applyPreset(\".bottom-sheet\", \"slideOutDown\", { duration: 400 });"
|
|
2321
|
+
},
|
|
2322
|
+
configurableParameters: G,
|
|
2323
|
+
animation: {
|
|
2324
|
+
properties: {
|
|
2325
|
+
opacity: [1, 0],
|
|
2326
|
+
transform: ["translateY(0px)", "translateY(24px)"]
|
|
2327
|
+
},
|
|
2328
|
+
duration: 400,
|
|
2329
|
+
easing: "easeInCubic"
|
|
2330
|
+
}
|
|
2331
|
+
},
|
|
2332
|
+
{
|
|
2333
|
+
id: "preset-slide-out-left",
|
|
2334
|
+
name: "slideOutLeft",
|
|
2335
|
+
category: "exit",
|
|
2336
|
+
description: "Fade out while translating left from 0px to -32px.",
|
|
2337
|
+
supportedTargets: [
|
|
2338
|
+
"HTMLElement",
|
|
2339
|
+
"SVGElement",
|
|
2340
|
+
"AnimateTarget"
|
|
2341
|
+
],
|
|
2342
|
+
reducedMotion: "skips-to-endpoint",
|
|
2343
|
+
tags: [
|
|
2344
|
+
"slide",
|
|
2345
|
+
"exit",
|
|
2346
|
+
"left",
|
|
2347
|
+
"swipe"
|
|
2348
|
+
],
|
|
2349
|
+
signature: {
|
|
2350
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2351
|
+
invocation: "applyPreset(target, \"slideOutLeft\", overrides?)",
|
|
2352
|
+
exampleCode: "applyPreset(\".toast\", \"slideOutLeft\", { duration: 300 });"
|
|
2353
|
+
},
|
|
2354
|
+
configurableParameters: G,
|
|
2355
|
+
animation: {
|
|
2356
|
+
properties: {
|
|
2357
|
+
opacity: [1, 0],
|
|
2358
|
+
transform: ["translateX(0px)", "translateX(-32px)"]
|
|
2359
|
+
},
|
|
2360
|
+
duration: 400,
|
|
2361
|
+
easing: "easeInCubic"
|
|
2362
|
+
}
|
|
2363
|
+
},
|
|
2364
|
+
{
|
|
2365
|
+
id: "preset-slide-out-right",
|
|
2366
|
+
name: "slideOutRight",
|
|
2367
|
+
category: "exit",
|
|
2368
|
+
description: "Fade out while translating right from 0px to 32px.",
|
|
2369
|
+
supportedTargets: [
|
|
2370
|
+
"HTMLElement",
|
|
2371
|
+
"SVGElement",
|
|
2372
|
+
"AnimateTarget"
|
|
2373
|
+
],
|
|
2374
|
+
reducedMotion: "skips-to-endpoint",
|
|
2375
|
+
tags: [
|
|
2376
|
+
"slide",
|
|
2377
|
+
"exit",
|
|
2378
|
+
"right",
|
|
2379
|
+
"swipe"
|
|
2380
|
+
],
|
|
2381
|
+
signature: {
|
|
2382
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2383
|
+
invocation: "applyPreset(target, \"slideOutRight\", overrides?)",
|
|
2384
|
+
exampleCode: "applyPreset(\".item\", \"slideOutRight\", { duration: 350 });"
|
|
2385
|
+
},
|
|
2386
|
+
configurableParameters: G,
|
|
2387
|
+
animation: {
|
|
2388
|
+
properties: {
|
|
2389
|
+
opacity: [1, 0],
|
|
2390
|
+
transform: ["translateX(0px)", "translateX(32px)"]
|
|
2391
|
+
},
|
|
2392
|
+
duration: 400,
|
|
2393
|
+
easing: "easeInCubic"
|
|
2394
|
+
}
|
|
2395
|
+
},
|
|
2396
|
+
{
|
|
2397
|
+
id: "preset-scale-out",
|
|
2398
|
+
name: "scaleOut",
|
|
2399
|
+
category: "exit",
|
|
2400
|
+
description: "Fade out while scaling down from 1 to 0.9.",
|
|
2401
|
+
supportedTargets: [
|
|
2402
|
+
"HTMLElement",
|
|
2403
|
+
"SVGElement",
|
|
2404
|
+
"AnimateTarget"
|
|
2405
|
+
],
|
|
2406
|
+
reducedMotion: "skips-to-endpoint",
|
|
2407
|
+
tags: [
|
|
2408
|
+
"scale",
|
|
2409
|
+
"exit",
|
|
2410
|
+
"shrink",
|
|
2411
|
+
"dismiss"
|
|
2412
|
+
],
|
|
2413
|
+
signature: {
|
|
2414
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2415
|
+
invocation: "applyPreset(target, \"scaleOut\", overrides?)",
|
|
2416
|
+
exampleCode: "applyPreset(\".modal\", \"scaleOut\", { duration: 300 });"
|
|
2417
|
+
},
|
|
2418
|
+
configurableParameters: G,
|
|
2419
|
+
animation: {
|
|
2420
|
+
properties: {
|
|
2421
|
+
opacity: [1, 0],
|
|
2422
|
+
transform: ["scale(1)", "scale(0.9)"]
|
|
2423
|
+
},
|
|
2424
|
+
duration: 300,
|
|
2425
|
+
easing: "easeOutQuad"
|
|
2426
|
+
}
|
|
2427
|
+
},
|
|
2428
|
+
{
|
|
2429
|
+
id: "preset-zoom-out",
|
|
2430
|
+
name: "zoomOut",
|
|
2431
|
+
category: "exit",
|
|
2432
|
+
description: "Fade out while shrinking dramatically from 1 to 0.7.",
|
|
2433
|
+
supportedTargets: [
|
|
2434
|
+
"HTMLElement",
|
|
2435
|
+
"SVGElement",
|
|
2436
|
+
"AnimateTarget"
|
|
2437
|
+
],
|
|
2438
|
+
reducedMotion: "skips-to-endpoint",
|
|
2439
|
+
tags: [
|
|
2440
|
+
"zoom",
|
|
2441
|
+
"exit",
|
|
2442
|
+
"shrink",
|
|
2443
|
+
"collapse"
|
|
2444
|
+
],
|
|
2445
|
+
signature: {
|
|
2446
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2447
|
+
invocation: "applyPreset(target, \"zoomOut\", overrides?)",
|
|
2448
|
+
exampleCode: "applyPreset(\".popup\", \"zoomOut\", { duration: 300 });"
|
|
2449
|
+
},
|
|
2450
|
+
configurableParameters: G,
|
|
2451
|
+
animation: {
|
|
2452
|
+
properties: {
|
|
2453
|
+
opacity: [1, 0],
|
|
2454
|
+
transform: ["scale(1)", "scale(0.7)"]
|
|
2455
|
+
},
|
|
2456
|
+
duration: 350,
|
|
2457
|
+
easing: "easeInCubic"
|
|
2458
|
+
}
|
|
2459
|
+
},
|
|
2460
|
+
{
|
|
2461
|
+
id: "preset-hover-lift",
|
|
2462
|
+
name: "hoverLift",
|
|
2463
|
+
category: "hover",
|
|
2464
|
+
description: "Subtle elevation lift translating up -4px on pointer hover.",
|
|
2465
|
+
supportedTargets: [
|
|
2466
|
+
"HTMLElement",
|
|
2467
|
+
"SVGElement",
|
|
2468
|
+
"AnimateTarget"
|
|
2469
|
+
],
|
|
2470
|
+
reducedMotion: "disables-animation",
|
|
2471
|
+
tags: [
|
|
2472
|
+
"hover",
|
|
2473
|
+
"lift",
|
|
2474
|
+
"elevation",
|
|
2475
|
+
"card"
|
|
2476
|
+
],
|
|
2477
|
+
signature: {
|
|
2478
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2479
|
+
invocation: "applyPreset(target, \"hoverLift\", overrides?)",
|
|
2480
|
+
exampleCode: "applyPreset(\".product-card\", \"hoverLift\", { duration: 200 });"
|
|
2481
|
+
},
|
|
2482
|
+
configurableParameters: G,
|
|
2483
|
+
animation: {
|
|
2484
|
+
properties: { transform: ["translateY(0px)", "translateY(-4px)"] },
|
|
2485
|
+
duration: 200,
|
|
2486
|
+
easing: "easeOutQuad"
|
|
2487
|
+
}
|
|
2488
|
+
},
|
|
2489
|
+
{
|
|
2490
|
+
id: "preset-hover-scale",
|
|
2491
|
+
name: "hoverScale",
|
|
2492
|
+
category: "hover",
|
|
2493
|
+
description: "Crisp magnification scaling element up to 1.05.",
|
|
2494
|
+
supportedTargets: [
|
|
2495
|
+
"HTMLElement",
|
|
2496
|
+
"SVGElement",
|
|
2497
|
+
"AnimateTarget"
|
|
2498
|
+
],
|
|
2499
|
+
reducedMotion: "disables-animation",
|
|
2500
|
+
tags: [
|
|
2501
|
+
"hover",
|
|
2502
|
+
"scale",
|
|
2503
|
+
"zoom",
|
|
2504
|
+
"button"
|
|
2505
|
+
],
|
|
2506
|
+
signature: {
|
|
2507
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2508
|
+
invocation: "applyPreset(target, \"hoverScale\", overrides?)",
|
|
2509
|
+
exampleCode: "applyPreset(\".cta-button\", \"hoverScale\", { duration: 180 });"
|
|
2510
|
+
},
|
|
2511
|
+
configurableParameters: G,
|
|
2512
|
+
animation: {
|
|
2513
|
+
properties: { transform: ["scale(1)", "scale(1.05)"] },
|
|
2514
|
+
duration: 200,
|
|
2515
|
+
easing: "easeOutQuad"
|
|
2516
|
+
}
|
|
2517
|
+
},
|
|
2518
|
+
{
|
|
2519
|
+
id: "preset-hover-glow",
|
|
2520
|
+
name: "hoverGlow",
|
|
2521
|
+
category: "hover",
|
|
2522
|
+
description: "Luminescent drop-shadow halo expansion on hover.",
|
|
2523
|
+
supportedTargets: [
|
|
2524
|
+
"HTMLElement",
|
|
2525
|
+
"SVGElement",
|
|
2526
|
+
"AnimateTarget"
|
|
2527
|
+
],
|
|
2528
|
+
reducedMotion: "static-fallback",
|
|
2529
|
+
tags: [
|
|
2530
|
+
"hover",
|
|
2531
|
+
"glow",
|
|
2532
|
+
"shadow",
|
|
2533
|
+
"neon"
|
|
2534
|
+
],
|
|
2535
|
+
signature: {
|
|
2536
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2537
|
+
invocation: "applyPreset(target, \"hoverGlow\", overrides?)",
|
|
2538
|
+
exampleCode: "applyPreset(\".icon-box\", \"hoverGlow\", { duration: 250 });"
|
|
2539
|
+
},
|
|
2540
|
+
configurableParameters: G,
|
|
2541
|
+
animation: {
|
|
2542
|
+
properties: { filter: ["drop-shadow(0 0 0px rgba(99,102,241,0))", "drop-shadow(0 0 8px rgba(99,102,241,0.5))"] },
|
|
2543
|
+
duration: 250,
|
|
2544
|
+
easing: "easeOutQuad"
|
|
2545
|
+
}
|
|
2546
|
+
},
|
|
2547
|
+
{
|
|
2548
|
+
id: "preset-hover-tilt-subtle",
|
|
2549
|
+
name: "hoverTiltSubtle",
|
|
2550
|
+
category: "hover",
|
|
2551
|
+
description: "Subtle 3D perspective orientation shift on hover.",
|
|
2552
|
+
supportedTargets: [
|
|
2553
|
+
"HTMLElement",
|
|
2554
|
+
"SVGElement",
|
|
2555
|
+
"AnimateTarget"
|
|
2556
|
+
],
|
|
2557
|
+
reducedMotion: "disables-animation",
|
|
2558
|
+
tags: [
|
|
2559
|
+
"hover",
|
|
2560
|
+
"tilt",
|
|
2561
|
+
"3d",
|
|
2562
|
+
"perspective"
|
|
2563
|
+
],
|
|
2564
|
+
signature: {
|
|
2565
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2566
|
+
invocation: "applyPreset(target, \"hoverTiltSubtle\", overrides?)",
|
|
2567
|
+
exampleCode: "applyPreset(\".showcase-card\", \"hoverTiltSubtle\", { duration: 250 });"
|
|
2568
|
+
},
|
|
2569
|
+
configurableParameters: G,
|
|
2570
|
+
animation: {
|
|
2571
|
+
properties: { transform: ["perspective(600px) rotateX(0deg) rotateY(0deg)", "perspective(600px) rotateX(4deg) rotateY(-4deg)"] },
|
|
2572
|
+
duration: 250,
|
|
2573
|
+
easing: "easeOutQuad"
|
|
2574
|
+
}
|
|
2575
|
+
},
|
|
2576
|
+
{
|
|
2577
|
+
id: "preset-click-press",
|
|
2578
|
+
name: "clickPress",
|
|
2579
|
+
category: "click-interaction",
|
|
2580
|
+
description: "Tactile button compression squishing scale to 0.95.",
|
|
2581
|
+
supportedTargets: [
|
|
2582
|
+
"HTMLElement",
|
|
2583
|
+
"SVGElement",
|
|
2584
|
+
"AnimateTarget"
|
|
2585
|
+
],
|
|
2586
|
+
reducedMotion: "disables-animation",
|
|
2587
|
+
tags: [
|
|
2588
|
+
"click",
|
|
2589
|
+
"press",
|
|
2590
|
+
"squish",
|
|
2591
|
+
"feedback"
|
|
2592
|
+
],
|
|
2593
|
+
signature: {
|
|
2594
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2595
|
+
invocation: "applyPreset(target, \"clickPress\", overrides?)",
|
|
2596
|
+
exampleCode: "applyPreset(\".primary-btn\", \"clickPress\", { duration: 120 });"
|
|
2597
|
+
},
|
|
2598
|
+
configurableParameters: G,
|
|
2599
|
+
animation: {
|
|
2600
|
+
properties: { transform: ["scale(1)", "scale(0.95)"] },
|
|
2601
|
+
duration: 120,
|
|
2602
|
+
easing: "easeOutQuad"
|
|
2603
|
+
}
|
|
2604
|
+
},
|
|
2605
|
+
{
|
|
2606
|
+
id: "preset-click-bounce",
|
|
2607
|
+
name: "clickBounce",
|
|
2608
|
+
category: "click-interaction",
|
|
2609
|
+
description: "Depression and springy snap-back rebound on tap/click.",
|
|
2610
|
+
supportedTargets: [
|
|
2611
|
+
"HTMLElement",
|
|
2612
|
+
"SVGElement",
|
|
2613
|
+
"AnimateTarget"
|
|
2614
|
+
],
|
|
2615
|
+
reducedMotion: "disables-animation",
|
|
2616
|
+
tags: [
|
|
2617
|
+
"click",
|
|
2618
|
+
"bounce",
|
|
2619
|
+
"rebound",
|
|
2620
|
+
"haptic"
|
|
2621
|
+
],
|
|
2622
|
+
signature: {
|
|
2623
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2624
|
+
invocation: "applyPreset(target, \"clickBounce\", overrides?)",
|
|
2625
|
+
exampleCode: "applyPreset(\".action-chip\", \"clickBounce\", { duration: 150 });"
|
|
2626
|
+
},
|
|
2627
|
+
configurableParameters: G,
|
|
2628
|
+
animation: {
|
|
2629
|
+
properties: { transform: ["scale(1)", "scale(0.92)"] },
|
|
2630
|
+
duration: 150,
|
|
2631
|
+
repeat: 1,
|
|
2632
|
+
yoyo: !0,
|
|
2633
|
+
easing: "easeOutQuad"
|
|
2634
|
+
}
|
|
2635
|
+
},
|
|
2636
|
+
{
|
|
2637
|
+
id: "preset-pulse-attention",
|
|
2638
|
+
name: "pulseAttention",
|
|
2639
|
+
category: "click-interaction",
|
|
2640
|
+
description: "Noticeable pulsating heartbeat animation to attract user focus.",
|
|
2641
|
+
supportedTargets: [
|
|
2642
|
+
"HTMLElement",
|
|
2643
|
+
"SVGElement",
|
|
2644
|
+
"AnimateTarget"
|
|
2645
|
+
],
|
|
2646
|
+
reducedMotion: "disables-animation",
|
|
2647
|
+
tags: [
|
|
2648
|
+
"pulse",
|
|
2649
|
+
"attention",
|
|
2650
|
+
"alert",
|
|
2651
|
+
"heartbeat"
|
|
2652
|
+
],
|
|
2653
|
+
signature: {
|
|
2654
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2655
|
+
invocation: "applyPreset(target, \"pulseAttention\", overrides?)",
|
|
2656
|
+
exampleCode: "applyPreset(\".notification-bell\", \"pulseAttention\", { duration: 300 });"
|
|
2657
|
+
},
|
|
2658
|
+
configurableParameters: G,
|
|
2659
|
+
animation: {
|
|
2660
|
+
properties: { transform: ["scale(1)", "scale(1.08)"] },
|
|
2661
|
+
duration: 300,
|
|
2662
|
+
repeat: 1,
|
|
2663
|
+
yoyo: !0,
|
|
2664
|
+
easing: "easeInOutQuad"
|
|
2665
|
+
}
|
|
2666
|
+
},
|
|
2667
|
+
{
|
|
2668
|
+
id: "preset-shake-error",
|
|
2669
|
+
name: "shakeError",
|
|
2670
|
+
category: "click-interaction",
|
|
2671
|
+
description: "Horizontal high-frequency shake indicating validation failure.",
|
|
2672
|
+
supportedTargets: [
|
|
2673
|
+
"HTMLElement",
|
|
2674
|
+
"SVGElement",
|
|
2675
|
+
"AnimateTarget"
|
|
2676
|
+
],
|
|
2677
|
+
reducedMotion: "static-fallback",
|
|
2678
|
+
tags: [
|
|
2679
|
+
"shake",
|
|
2680
|
+
"error",
|
|
2681
|
+
"validation",
|
|
2682
|
+
"invalid"
|
|
2683
|
+
],
|
|
2684
|
+
signature: {
|
|
2685
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2686
|
+
invocation: "applyPreset(target, \"shakeError\", overrides?)",
|
|
2687
|
+
exampleCode: "applyPreset(\".password-input\", \"shakeError\", { duration: 80 });"
|
|
2688
|
+
},
|
|
2689
|
+
configurableParameters: G,
|
|
2690
|
+
animation: {
|
|
2691
|
+
properties: { transform: ["translateX(0px)", "translateX(-8px)"] },
|
|
2692
|
+
duration: 80,
|
|
2693
|
+
repeat: 3,
|
|
2694
|
+
yoyo: !0,
|
|
2695
|
+
easing: "easeInOutQuad"
|
|
2696
|
+
}
|
|
2697
|
+
},
|
|
2698
|
+
{
|
|
2699
|
+
id: "preset-flash-highlight",
|
|
2700
|
+
name: "flashHighlight",
|
|
2701
|
+
category: "click-interaction",
|
|
2702
|
+
description: "Brief opacity flash alerting user to updated content.",
|
|
2703
|
+
supportedTargets: [
|
|
2704
|
+
"HTMLElement",
|
|
2705
|
+
"SVGElement",
|
|
2706
|
+
"AnimateTarget"
|
|
2707
|
+
],
|
|
2708
|
+
reducedMotion: "disables-animation",
|
|
2709
|
+
tags: [
|
|
2710
|
+
"flash",
|
|
2711
|
+
"highlight",
|
|
2712
|
+
"update",
|
|
2713
|
+
"notice"
|
|
2714
|
+
],
|
|
2715
|
+
signature: {
|
|
2716
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2717
|
+
invocation: "applyPreset(target, \"flashHighlight\", overrides?)",
|
|
2718
|
+
exampleCode: "applyPreset(\".updated-row\", \"flashHighlight\", { duration: 150 });"
|
|
2719
|
+
},
|
|
2720
|
+
configurableParameters: G,
|
|
2721
|
+
animation: {
|
|
2722
|
+
properties: { opacity: [1, .4] },
|
|
2723
|
+
duration: 150,
|
|
2724
|
+
repeat: 1,
|
|
2725
|
+
yoyo: !0,
|
|
2726
|
+
easing: "easeInOutQuad"
|
|
2727
|
+
}
|
|
2728
|
+
},
|
|
2729
|
+
{
|
|
2730
|
+
id: "preset-text-focus",
|
|
2731
|
+
name: "textFocus",
|
|
2732
|
+
category: "text",
|
|
2733
|
+
description: "Cinematic typographic unblur and opacity reveal.",
|
|
2734
|
+
supportedTargets: [
|
|
2735
|
+
"HTMLElement",
|
|
2736
|
+
"SVGElement",
|
|
2737
|
+
"AnimateTarget"
|
|
2738
|
+
],
|
|
2739
|
+
reducedMotion: "skips-to-endpoint",
|
|
2740
|
+
tags: [
|
|
2741
|
+
"text",
|
|
2742
|
+
"focus",
|
|
2743
|
+
"blur",
|
|
2744
|
+
"cinematic"
|
|
2745
|
+
],
|
|
2746
|
+
signature: {
|
|
2747
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2748
|
+
invocation: "applyPreset(target, \"textFocus\", overrides?)",
|
|
2749
|
+
exampleCode: "applyPreset(\".headline\", \"textFocus\", { duration: 600 });"
|
|
2750
|
+
},
|
|
2751
|
+
configurableParameters: G,
|
|
2752
|
+
animation: {
|
|
2753
|
+
properties: {
|
|
2754
|
+
opacity: [0, 1],
|
|
2755
|
+
filter: ["blur(8px)", "blur(0px)"]
|
|
2756
|
+
},
|
|
2757
|
+
duration: 600,
|
|
2758
|
+
easing: "easeOutCubic"
|
|
2759
|
+
}
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
id: "preset-text-rise",
|
|
2763
|
+
name: "textRise",
|
|
2764
|
+
category: "text",
|
|
2765
|
+
description: "Typographic lift entrance translating upward 12px with fade.",
|
|
2766
|
+
supportedTargets: [
|
|
2767
|
+
"HTMLElement",
|
|
2768
|
+
"SVGElement",
|
|
2769
|
+
"AnimateTarget"
|
|
2770
|
+
],
|
|
2771
|
+
reducedMotion: "skips-to-endpoint",
|
|
2772
|
+
tags: [
|
|
2773
|
+
"text",
|
|
2774
|
+
"rise",
|
|
2775
|
+
"entrance",
|
|
2776
|
+
"subtitle"
|
|
2777
|
+
],
|
|
2778
|
+
signature: {
|
|
2779
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2780
|
+
invocation: "applyPreset(target, \"textRise\", overrides?)",
|
|
2781
|
+
exampleCode: "applyPreset(\".lead-paragraph\", \"textRise\", { duration: 450 });"
|
|
2782
|
+
},
|
|
2783
|
+
configurableParameters: G,
|
|
2784
|
+
animation: {
|
|
2785
|
+
properties: {
|
|
2786
|
+
opacity: [0, 1],
|
|
2787
|
+
transform: ["translateY(12px)", "translateY(0px)"]
|
|
2788
|
+
},
|
|
2789
|
+
duration: 450,
|
|
2790
|
+
easing: "easeOutCubic"
|
|
2791
|
+
}
|
|
2792
|
+
},
|
|
2793
|
+
{
|
|
2794
|
+
id: "preset-text-glow",
|
|
2795
|
+
name: "textGlow",
|
|
2796
|
+
category: "text",
|
|
2797
|
+
description: "Radiant text bloom illumination drop-shadow effect.",
|
|
2798
|
+
supportedTargets: [
|
|
2799
|
+
"HTMLElement",
|
|
2800
|
+
"SVGElement",
|
|
2801
|
+
"AnimateTarget"
|
|
2802
|
+
],
|
|
2803
|
+
reducedMotion: "static-fallback",
|
|
2804
|
+
tags: [
|
|
2805
|
+
"text",
|
|
2806
|
+
"glow",
|
|
2807
|
+
"bloom",
|
|
2808
|
+
"highlight"
|
|
2809
|
+
],
|
|
2810
|
+
signature: {
|
|
2811
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2812
|
+
invocation: "applyPreset(target, \"textGlow\", overrides?)",
|
|
2813
|
+
exampleCode: "applyPreset(\".key-phrase\", \"textGlow\", { duration: 500 });"
|
|
2814
|
+
},
|
|
2815
|
+
configurableParameters: G,
|
|
2816
|
+
animation: {
|
|
2817
|
+
properties: { filter: ["drop-shadow(0 0 0px rgba(255,255,255,0))", "drop-shadow(0 0 10px rgba(99,102,241,0.7))"] },
|
|
2818
|
+
duration: 500,
|
|
2819
|
+
repeat: 1,
|
|
2820
|
+
yoyo: !0,
|
|
2821
|
+
easing: "easeInOutQuad"
|
|
2822
|
+
}
|
|
2823
|
+
},
|
|
2824
|
+
{
|
|
2825
|
+
id: "preset-scroll-reveal-rise",
|
|
2826
|
+
name: "scrollRevealRise",
|
|
2827
|
+
category: "scroll",
|
|
2828
|
+
description: "Smooth viewport entrance translating up 36px with opacity fade.",
|
|
2829
|
+
supportedTargets: [
|
|
2830
|
+
"HTMLElement",
|
|
2831
|
+
"SVGElement",
|
|
2832
|
+
"AnimateTarget"
|
|
2833
|
+
],
|
|
2834
|
+
reducedMotion: "skips-to-endpoint",
|
|
2835
|
+
tags: [
|
|
2836
|
+
"scroll",
|
|
2837
|
+
"reveal",
|
|
2838
|
+
"rise",
|
|
2839
|
+
"viewport"
|
|
2840
|
+
],
|
|
2841
|
+
signature: {
|
|
2842
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2843
|
+
invocation: "applyPreset(target, \"scrollRevealRise\", overrides?)",
|
|
2844
|
+
exampleCode: "applyPreset(\".feature-section\", \"scrollRevealRise\", { duration: 700 });"
|
|
2845
|
+
},
|
|
2846
|
+
configurableParameters: G,
|
|
2847
|
+
animation: {
|
|
2848
|
+
properties: {
|
|
2849
|
+
opacity: [0, 1],
|
|
2850
|
+
transform: ["translateY(36px)", "translateY(0px)"]
|
|
2851
|
+
},
|
|
2852
|
+
duration: 700,
|
|
2853
|
+
easing: "easeOutCubic"
|
|
2854
|
+
}
|
|
2855
|
+
},
|
|
2856
|
+
{
|
|
2857
|
+
id: "preset-scroll-parallax-slow",
|
|
2858
|
+
name: "scrollParallaxSlow",
|
|
2859
|
+
category: "scroll",
|
|
2860
|
+
description: "Gentle vertical parallax translation of -40px.",
|
|
2861
|
+
supportedTargets: [
|
|
2862
|
+
"HTMLElement",
|
|
2863
|
+
"SVGElement",
|
|
2864
|
+
"AnimateTarget"
|
|
2865
|
+
],
|
|
2866
|
+
reducedMotion: "disables-animation",
|
|
2867
|
+
tags: [
|
|
2868
|
+
"scroll",
|
|
2869
|
+
"parallax",
|
|
2870
|
+
"background",
|
|
2871
|
+
"depth"
|
|
2872
|
+
],
|
|
2873
|
+
signature: {
|
|
2874
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2875
|
+
invocation: "applyPreset(target, \"scrollParallaxSlow\", overrides?)",
|
|
2876
|
+
exampleCode: "applyPreset(\".bg-graphic\", \"scrollParallaxSlow\", { duration: 1000 });"
|
|
2877
|
+
},
|
|
2878
|
+
configurableParameters: G,
|
|
2879
|
+
animation: {
|
|
2880
|
+
properties: { transform: ["translateY(0px)", "translateY(-40px)"] },
|
|
2881
|
+
duration: 1e3,
|
|
2882
|
+
easing: "linear"
|
|
2883
|
+
}
|
|
2884
|
+
},
|
|
2885
|
+
{
|
|
2886
|
+
id: "preset-scroll-scale-in",
|
|
2887
|
+
name: "scrollScaleIn",
|
|
2888
|
+
category: "scroll",
|
|
2889
|
+
description: "Viewport scroll entrance scaling from 0.85 to 1.",
|
|
2890
|
+
supportedTargets: [
|
|
2891
|
+
"HTMLElement",
|
|
2892
|
+
"SVGElement",
|
|
2893
|
+
"AnimateTarget"
|
|
2894
|
+
],
|
|
2895
|
+
reducedMotion: "skips-to-endpoint",
|
|
2896
|
+
tags: [
|
|
2897
|
+
"scroll",
|
|
2898
|
+
"scale",
|
|
2899
|
+
"zoom",
|
|
2900
|
+
"entrance"
|
|
2901
|
+
],
|
|
2902
|
+
signature: {
|
|
2903
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2904
|
+
invocation: "applyPreset(target, \"scrollScaleIn\", overrides?)",
|
|
2905
|
+
exampleCode: "applyPreset(\".media-player\", \"scrollScaleIn\", { duration: 800 });"
|
|
2906
|
+
},
|
|
2907
|
+
configurableParameters: G,
|
|
2908
|
+
animation: {
|
|
2909
|
+
properties: {
|
|
2910
|
+
opacity: [.2, 1],
|
|
2911
|
+
transform: ["scale(0.85)", "scale(1)"]
|
|
2912
|
+
},
|
|
2913
|
+
duration: 800,
|
|
2914
|
+
easing: "easeOutCubic"
|
|
2915
|
+
}
|
|
2916
|
+
},
|
|
2917
|
+
{
|
|
2918
|
+
id: "preset-ambient-float",
|
|
2919
|
+
name: "ambientFloat",
|
|
2920
|
+
category: "background",
|
|
2921
|
+
description: "Continuous subtle vertical floating drift for badges and illustrations.",
|
|
2922
|
+
supportedTargets: [
|
|
2923
|
+
"HTMLElement",
|
|
2924
|
+
"SVGElement",
|
|
2925
|
+
"AnimateTarget"
|
|
2926
|
+
],
|
|
2927
|
+
reducedMotion: "disables-animation",
|
|
2928
|
+
tags: [
|
|
2929
|
+
"ambient",
|
|
2930
|
+
"float",
|
|
2931
|
+
"drift",
|
|
2932
|
+
"continuous"
|
|
2933
|
+
],
|
|
2934
|
+
signature: {
|
|
2935
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2936
|
+
invocation: "applyPreset(target, \"ambientFloat\", overrides?)",
|
|
2937
|
+
exampleCode: "applyPreset(\".floating-orb\", \"ambientFloat\", { duration: 2500 });"
|
|
2938
|
+
},
|
|
2939
|
+
configurableParameters: G,
|
|
2940
|
+
animation: {
|
|
2941
|
+
properties: { transform: ["translateY(0px)", "translateY(-8px)"] },
|
|
2942
|
+
duration: 2500,
|
|
2943
|
+
repeat: Infinity,
|
|
2944
|
+
yoyo: !0,
|
|
2945
|
+
easing: "easeInOutQuad"
|
|
2946
|
+
}
|
|
2947
|
+
},
|
|
2948
|
+
{
|
|
2949
|
+
id: "preset-pulse-ambient",
|
|
2950
|
+
name: "pulseAmbient",
|
|
2951
|
+
category: "background",
|
|
2952
|
+
description: "Gentle breathing scale and opacity fluctuation for glowing backdrops.",
|
|
2953
|
+
supportedTargets: [
|
|
2954
|
+
"HTMLElement",
|
|
2955
|
+
"SVGElement",
|
|
2956
|
+
"AnimateTarget"
|
|
2957
|
+
],
|
|
2958
|
+
reducedMotion: "disables-animation",
|
|
2959
|
+
tags: [
|
|
2960
|
+
"ambient",
|
|
2961
|
+
"pulse",
|
|
2962
|
+
"glow",
|
|
2963
|
+
"breathing"
|
|
2964
|
+
],
|
|
2965
|
+
signature: {
|
|
2966
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
2967
|
+
invocation: "applyPreset(target, \"pulseAmbient\", overrides?)",
|
|
2968
|
+
exampleCode: "applyPreset(\".ambient-light\", \"pulseAmbient\", { duration: 3500 });"
|
|
2969
|
+
},
|
|
2970
|
+
configurableParameters: G,
|
|
2971
|
+
animation: {
|
|
2972
|
+
properties: {
|
|
2973
|
+
opacity: [.6, 1],
|
|
2974
|
+
transform: ["scale(0.95)", "scale(1.05)"]
|
|
2975
|
+
},
|
|
2976
|
+
duration: 3500,
|
|
2977
|
+
repeat: Infinity,
|
|
2978
|
+
yoyo: !0,
|
|
2979
|
+
easing: "easeInOutQuad"
|
|
2980
|
+
}
|
|
2981
|
+
},
|
|
2982
|
+
{
|
|
2983
|
+
id: "preset-page-fade",
|
|
2984
|
+
name: "pageFade",
|
|
2985
|
+
category: "page-transition",
|
|
2986
|
+
description: "Seamless opacity crossfade for view and route transitions.",
|
|
2987
|
+
supportedTargets: [
|
|
2988
|
+
"HTMLElement",
|
|
2989
|
+
"SVGElement",
|
|
2990
|
+
"AnimateTarget"
|
|
2991
|
+
],
|
|
2992
|
+
reducedMotion: "skips-to-endpoint",
|
|
2993
|
+
tags: [
|
|
2994
|
+
"page",
|
|
2995
|
+
"route",
|
|
2996
|
+
"transition",
|
|
2997
|
+
"fade"
|
|
2998
|
+
],
|
|
2999
|
+
signature: {
|
|
3000
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
3001
|
+
invocation: "applyPreset(target, \"pageFade\", overrides?)",
|
|
3002
|
+
exampleCode: "applyPreset(\".page-container\", \"pageFade\", { duration: 350 });"
|
|
3003
|
+
},
|
|
3004
|
+
configurableParameters: G,
|
|
3005
|
+
animation: {
|
|
3006
|
+
properties: { opacity: [0, 1] },
|
|
3007
|
+
duration: 350,
|
|
3008
|
+
easing: "easeInOutQuad"
|
|
3009
|
+
}
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
id: "preset-page-slide-left",
|
|
3013
|
+
name: "pageSlideLeft",
|
|
3014
|
+
category: "page-transition",
|
|
3015
|
+
description: "Next page entrance sliding smoothly from right 100% to 0%.",
|
|
3016
|
+
supportedTargets: [
|
|
3017
|
+
"HTMLElement",
|
|
3018
|
+
"SVGElement",
|
|
3019
|
+
"AnimateTarget"
|
|
3020
|
+
],
|
|
3021
|
+
reducedMotion: "skips-to-endpoint",
|
|
3022
|
+
tags: [
|
|
3023
|
+
"page",
|
|
3024
|
+
"slide",
|
|
3025
|
+
"forward",
|
|
3026
|
+
"navigation"
|
|
3027
|
+
],
|
|
3028
|
+
signature: {
|
|
3029
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
3030
|
+
invocation: "applyPreset(target, \"pageSlideLeft\", overrides?)",
|
|
3031
|
+
exampleCode: "applyPreset(\".next-page\", \"pageSlideLeft\", { duration: 400 });"
|
|
3032
|
+
},
|
|
3033
|
+
configurableParameters: G,
|
|
3034
|
+
animation: {
|
|
3035
|
+
properties: { transform: ["translateX(100%)", "translateX(0%)"] },
|
|
3036
|
+
duration: 400,
|
|
3037
|
+
easing: "easeOutCubic"
|
|
3038
|
+
}
|
|
3039
|
+
},
|
|
3040
|
+
{
|
|
3041
|
+
id: "preset-page-slide-right",
|
|
3042
|
+
name: "pageSlideRight",
|
|
3043
|
+
category: "page-transition",
|
|
3044
|
+
description: "Back navigation slide entering from left -100% to 0%.",
|
|
3045
|
+
supportedTargets: [
|
|
3046
|
+
"HTMLElement",
|
|
3047
|
+
"SVGElement",
|
|
3048
|
+
"AnimateTarget"
|
|
3049
|
+
],
|
|
3050
|
+
reducedMotion: "skips-to-endpoint",
|
|
3051
|
+
tags: [
|
|
3052
|
+
"page",
|
|
3053
|
+
"slide",
|
|
3054
|
+
"back",
|
|
3055
|
+
"navigation"
|
|
3056
|
+
],
|
|
3057
|
+
signature: {
|
|
3058
|
+
importStatement: "import { applyPreset } from \"af-motion/presets\";",
|
|
3059
|
+
invocation: "applyPreset(target, \"pageSlideRight\", overrides?)",
|
|
3060
|
+
exampleCode: "applyPreset(\".prev-page\", \"pageSlideRight\", { duration: 400 });"
|
|
3061
|
+
},
|
|
3062
|
+
configurableParameters: G,
|
|
3063
|
+
animation: {
|
|
3064
|
+
properties: { transform: ["translateX(-100%)", "translateX(0%)"] },
|
|
3065
|
+
duration: 400,
|
|
3066
|
+
easing: "easeOutCubic"
|
|
3067
|
+
}
|
|
3068
|
+
},
|
|
3069
|
+
{
|
|
3070
|
+
id: "preset-hero-sequence",
|
|
3071
|
+
name: "heroSequence",
|
|
3072
|
+
category: "choreography",
|
|
3073
|
+
description: "Coordinated hero section choreography: heading rise, body fade, CTA pop.",
|
|
3074
|
+
supportedTargets: [
|
|
3075
|
+
"HTMLElement",
|
|
3076
|
+
"SVGElement",
|
|
3077
|
+
"AnimateTarget"
|
|
3078
|
+
],
|
|
3079
|
+
reducedMotion: "skips-to-endpoint",
|
|
3080
|
+
tags: [
|
|
3081
|
+
"choreography",
|
|
3082
|
+
"hero",
|
|
3083
|
+
"sequence",
|
|
3084
|
+
"landing"
|
|
3085
|
+
],
|
|
3086
|
+
signature: {
|
|
3087
|
+
importStatement: "import { composePresetSequence } from \"af-motion/presets\";",
|
|
3088
|
+
invocation: "composePresetSequence(target, [\"slideUp\", \"fadeIn\", \"scaleIn\"])",
|
|
3089
|
+
exampleCode: "composePresetSequence(\".hero-container\", [\"slideUp\", \"fadeIn\", \"scaleIn\"]);"
|
|
3090
|
+
},
|
|
3091
|
+
configurableParameters: [{
|
|
3092
|
+
name: "steps",
|
|
3093
|
+
type: "readonly (string | { preset: string; overrides?: MotionPresetOverrides })[]",
|
|
3094
|
+
description: "Sequence steps or preset names."
|
|
3095
|
+
}],
|
|
3096
|
+
choreography: {
|
|
3097
|
+
mode: "sequence",
|
|
3098
|
+
steps: [
|
|
3099
|
+
{
|
|
3100
|
+
preset: "slideUp",
|
|
3101
|
+
duration: 500
|
|
3102
|
+
},
|
|
3103
|
+
{
|
|
3104
|
+
preset: "fadeIn",
|
|
3105
|
+
duration: 400
|
|
3106
|
+
},
|
|
3107
|
+
{
|
|
3108
|
+
preset: "scaleIn",
|
|
3109
|
+
duration: 350
|
|
3110
|
+
}
|
|
3111
|
+
]
|
|
3112
|
+
}
|
|
3113
|
+
},
|
|
3114
|
+
{
|
|
3115
|
+
id: "preset-modal-presentation",
|
|
3116
|
+
name: "modalPresentation",
|
|
3117
|
+
category: "choreography",
|
|
3118
|
+
description: "Coordinated dialog entrance: backdrop fade and dialog zoom.",
|
|
3119
|
+
supportedTargets: [
|
|
3120
|
+
"HTMLElement",
|
|
3121
|
+
"SVGElement",
|
|
3122
|
+
"AnimateTarget"
|
|
3123
|
+
],
|
|
3124
|
+
reducedMotion: "skips-to-endpoint",
|
|
3125
|
+
tags: [
|
|
3126
|
+
"choreography",
|
|
3127
|
+
"modal",
|
|
3128
|
+
"dialog",
|
|
3129
|
+
"presentation"
|
|
3130
|
+
],
|
|
3131
|
+
signature: {
|
|
3132
|
+
importStatement: "import { composePresetSequence } from \"af-motion/presets\";",
|
|
3133
|
+
invocation: "composePresetSequence(target, [\"fadeIn\", \"zoomIn\"])",
|
|
3134
|
+
exampleCode: "composePresetSequence(\".modal-root\", [\"fadeIn\", \"zoomIn\"]);"
|
|
3135
|
+
},
|
|
3136
|
+
configurableParameters: [{
|
|
3137
|
+
name: "steps",
|
|
3138
|
+
type: "readonly (string | { preset: string; overrides?: MotionPresetOverrides })[]",
|
|
3139
|
+
description: "Modal entrance steps."
|
|
3140
|
+
}],
|
|
3141
|
+
choreography: {
|
|
3142
|
+
mode: "sequence",
|
|
3143
|
+
steps: [{
|
|
3144
|
+
preset: "fadeIn",
|
|
3145
|
+
duration: 250
|
|
3146
|
+
}, {
|
|
3147
|
+
preset: "zoomIn",
|
|
3148
|
+
duration: 350
|
|
3149
|
+
}]
|
|
3150
|
+
}
|
|
3151
|
+
},
|
|
3152
|
+
{
|
|
3153
|
+
id: "preset-card-deck-stagger",
|
|
3154
|
+
name: "cardDeckStagger",
|
|
3155
|
+
category: "choreography",
|
|
3156
|
+
description: "Sequential list or grid card entrance.",
|
|
3157
|
+
supportedTargets: [
|
|
3158
|
+
"HTMLElement",
|
|
3159
|
+
"SVGElement",
|
|
3160
|
+
"AnimateTarget"
|
|
3161
|
+
],
|
|
3162
|
+
reducedMotion: "skips-to-endpoint",
|
|
3163
|
+
tags: [
|
|
3164
|
+
"choreography",
|
|
3165
|
+
"cards",
|
|
3166
|
+
"stagger",
|
|
3167
|
+
"list"
|
|
3168
|
+
],
|
|
3169
|
+
signature: {
|
|
3170
|
+
importStatement: "import { composePresetSequence } from \"af-motion/presets\";",
|
|
3171
|
+
invocation: "composePresetSequence(target, [\"slideUp\", \"fadeIn\"])",
|
|
3172
|
+
exampleCode: "composePresetSequence(\".card-deck\", [\"slideUp\", \"fadeIn\"]);"
|
|
3173
|
+
},
|
|
3174
|
+
configurableParameters: [{
|
|
3175
|
+
name: "steps",
|
|
3176
|
+
type: "readonly (string | { preset: string; overrides?: MotionPresetOverrides })[]",
|
|
3177
|
+
description: "Stagger steps."
|
|
3178
|
+
}],
|
|
3179
|
+
choreography: {
|
|
3180
|
+
mode: "sequence",
|
|
3181
|
+
steps: [{
|
|
3182
|
+
preset: "slideUp",
|
|
3183
|
+
duration: 400
|
|
3184
|
+
}, {
|
|
3185
|
+
preset: "fadeIn",
|
|
3186
|
+
duration: 300
|
|
3187
|
+
}]
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
];
|
|
3191
|
+
for (let e of K) st(e);
|
|
3192
|
+
var ct = /* @__PURE__ */ new Map(), lt = /* @__PURE__ */ new Map(), ut = /* @__PURE__ */ new Map();
|
|
3193
|
+
for (let e of W) ut.set(e, []);
|
|
3194
|
+
for (let e of K) ct.set(e.id, e), lt.set(e.name, e), ut.get(e.category)?.push(e);
|
|
3195
|
+
var dt = new Set(K.map((e) => e.id)), ft = new Set(K.map((e) => e.name)), q = /* @__PURE__ */ new Map(), pt = /* @__PURE__ */ new Map();
|
|
3196
|
+
function mt() {
|
|
3197
|
+
let e = Array.from(q.values());
|
|
3198
|
+
return Object.freeze([...K, ...e]);
|
|
3199
|
+
}
|
|
3200
|
+
function ht() {
|
|
3201
|
+
return W;
|
|
3202
|
+
}
|
|
3203
|
+
function gt(e) {
|
|
3204
|
+
if (typeof e != "string" || e.trim() === "") return;
|
|
3205
|
+
let t = e.trim();
|
|
3206
|
+
return ct.get(t) ?? lt.get(t) ?? q.get(t) ?? pt.get(t);
|
|
3207
|
+
}
|
|
3208
|
+
function _t(e) {
|
|
3209
|
+
let t = ut.get(e) ?? [], n = Array.from(q.values()).filter((t) => t.category === e);
|
|
3210
|
+
return Object.freeze([...t, ...n]);
|
|
3211
|
+
}
|
|
3212
|
+
function vt(e) {
|
|
3213
|
+
if (!e || typeof e != "string") return [];
|
|
3214
|
+
let t = e.trim().toLowerCase();
|
|
3215
|
+
if (t.length === 0) return [];
|
|
3216
|
+
let n = mt();
|
|
3217
|
+
return Object.freeze(n.filter((e) => e.id.toLowerCase().includes(t) || e.name.toLowerCase().includes(t) || e.category.toLowerCase().includes(t) || e.description.toLowerCase().includes(t) || e.tags.some((e) => e.toLowerCase().includes(t))));
|
|
3218
|
+
}
|
|
3219
|
+
function yt(e) {
|
|
3220
|
+
let t = xt(e);
|
|
3221
|
+
if (!t.valid) throw TypeError(`Cannot register invalid preset: ${t.errors.map((e) => e.message).join(", ")}`);
|
|
3222
|
+
if (dt.has(e.id) || ft.has(e.name)) throw TypeError(`Cannot overwrite built-in preset "${e.id}" ("${e.name}")`);
|
|
3223
|
+
let n = st({ ...e });
|
|
3224
|
+
q.set(n.id, n), pt.set(n.name, n);
|
|
3225
|
+
}
|
|
3226
|
+
function bt(e) {
|
|
3227
|
+
if (typeof e != "string" || e.trim() === "") return !1;
|
|
3228
|
+
let t = e.trim();
|
|
3229
|
+
if (dt.has(t) || ft.has(t)) return !1;
|
|
3230
|
+
let n = q.get(t) ?? pt.get(t);
|
|
3231
|
+
return n ? (q.delete(n.id), pt.delete(n.name), !0) : !1;
|
|
3232
|
+
}
|
|
3233
|
+
function xt(e) {
|
|
3234
|
+
let t = [];
|
|
3235
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return {
|
|
3236
|
+
valid: !1,
|
|
3237
|
+
errors: [{ message: "Preset must be a non-null object" }]
|
|
3238
|
+
};
|
|
3239
|
+
let n = e;
|
|
3240
|
+
if ((typeof n.id != "string" || n.id.trim() === "") && t.push({
|
|
3241
|
+
parameter: "id",
|
|
3242
|
+
message: "Preset id must be a non-empty string"
|
|
3243
|
+
}), (typeof n.name != "string" || n.name.trim() === "") && t.push({
|
|
3244
|
+
parameter: "name",
|
|
3245
|
+
message: "Preset name must be a non-empty string"
|
|
3246
|
+
}), n.category && W.includes(n.category) || t.push({
|
|
3247
|
+
parameter: "category",
|
|
3248
|
+
message: `Preset category must be one of: ${W.join(", ")}`
|
|
3249
|
+
}), (typeof n.description != "string" || n.description.trim().length < 5) && t.push({
|
|
3250
|
+
parameter: "description",
|
|
3251
|
+
message: "Preset description must be at least 5 characters"
|
|
3252
|
+
}), Array.isArray(n.supportedTargets) && n.supportedTargets.length !== 0 || t.push({
|
|
3253
|
+
parameter: "supportedTargets",
|
|
3254
|
+
message: "Preset supportedTargets must be a non-empty array"
|
|
3255
|
+
}), !n.animation && !n.choreography && t.push({
|
|
3256
|
+
parameter: "animation",
|
|
3257
|
+
message: "Preset must define either 'animation' or 'choreography'"
|
|
3258
|
+
}), n.animation) {
|
|
3259
|
+
if (!n.animation.properties || typeof n.animation.properties != "object" || Object.keys(n.animation.properties).length === 0) t.push({
|
|
3260
|
+
parameter: "animation.properties",
|
|
3261
|
+
message: "Animation properties must be a non-empty object"
|
|
3262
|
+
});
|
|
3263
|
+
else for (let [e, r] of Object.entries(n.animation.properties)) (!Array.isArray(r) || r.length < 2) && t.push({
|
|
3264
|
+
parameter: `animation.properties.${e}`,
|
|
3265
|
+
message: `Keyframe property "${e}" must be a [from, to, ...] array with at least 2 values`
|
|
3266
|
+
});
|
|
3267
|
+
}
|
|
3268
|
+
return {
|
|
3269
|
+
valid: t.length === 0,
|
|
3270
|
+
errors: t
|
|
3271
|
+
};
|
|
3272
|
+
}
|
|
3273
|
+
function St(e, t) {
|
|
3274
|
+
let n = [];
|
|
3275
|
+
if (!gt(e)) return {
|
|
3276
|
+
valid: !1,
|
|
3277
|
+
errors: [{ message: `Unknown preset "${e}"` }]
|
|
3278
|
+
};
|
|
3279
|
+
if (t == null) return {
|
|
3280
|
+
valid: !0,
|
|
3281
|
+
errors: []
|
|
3282
|
+
};
|
|
3283
|
+
if (typeof t != "object" || Array.isArray(t)) return {
|
|
3284
|
+
valid: !1,
|
|
3285
|
+
errors: [{ message: "Overrides must be an object" }]
|
|
3286
|
+
};
|
|
3287
|
+
let r = t;
|
|
3288
|
+
return r.designSystem !== void 0 && typeof r.designSystem != "string" && (typeof r.designSystem != "object" || r.designSystem === null) && n.push({
|
|
3289
|
+
parameter: "designSystem",
|
|
3290
|
+
message: "designSystem must be a string name or DesignSystem object"
|
|
3291
|
+
}), r.adaptive !== void 0 && typeof r.adaptive != "boolean" && (typeof r.adaptive != "object" || r.adaptive === null) && n.push({
|
|
3292
|
+
parameter: "adaptive",
|
|
3293
|
+
message: "adaptive must be a boolean or AdaptiveMotionConditions object"
|
|
3294
|
+
}), r.motionDNA !== void 0 && typeof r.motionDNA != "string" && (typeof r.motionDNA != "object" || r.motionDNA === null) && n.push({
|
|
3295
|
+
parameter: "motionDNA",
|
|
3296
|
+
message: "motionDNA must be a string name or MotionDNA object"
|
|
3297
|
+
}), r.duration !== void 0 && (typeof r.duration != "number" || !Number.isFinite(r.duration) || r.duration < 0) && n.push({
|
|
3298
|
+
parameter: "duration",
|
|
3299
|
+
message: "duration must be a finite number >= 0"
|
|
3300
|
+
}), r.delay !== void 0 && (typeof r.delay != "number" || !Number.isFinite(r.delay) || r.delay < 0) && n.push({
|
|
3301
|
+
parameter: "delay",
|
|
3302
|
+
message: "delay must be a finite number >= 0"
|
|
3303
|
+
}), r.repeat !== void 0 && (typeof r.repeat != "number" || r.repeat < 0) && n.push({
|
|
3304
|
+
parameter: "repeat",
|
|
3305
|
+
message: "repeat must be a number >= 0"
|
|
3306
|
+
}), r.playbackRate !== void 0 && (typeof r.playbackRate != "number" || !Number.isFinite(r.playbackRate) || r.playbackRate <= 0) && n.push({
|
|
3307
|
+
parameter: "playbackRate",
|
|
3308
|
+
message: "playbackRate must be a finite number > 0"
|
|
3309
|
+
}), {
|
|
3310
|
+
valid: n.length === 0,
|
|
3311
|
+
errors: n
|
|
3312
|
+
};
|
|
3313
|
+
}
|
|
3314
|
+
function J(e, t) {
|
|
3315
|
+
let i = gt(e);
|
|
3316
|
+
if (!i) throw TypeError(`Unknown motion preset "${e}"`);
|
|
3317
|
+
if (!i.animation) throw TypeError(`Preset "${e}" is a choreography preset and does not have direct animation properties`);
|
|
3318
|
+
let a = St(e, t);
|
|
3319
|
+
if (!a.valid) throw TypeError(`Invalid preset overrides: ${a.errors.map((e) => e.message).join(", ")}`);
|
|
3320
|
+
let o = {};
|
|
3321
|
+
for (let [e, t] of Object.entries(i.animation.properties)) o[e] = [...t];
|
|
3322
|
+
let s = t?.designSystem ? Se(t.designSystem) : void 0, c = t?.motionDNA ? n(t.motionDNA) : s?.resolvedMotionDNA, l = c?.easing;
|
|
3323
|
+
i.category === "entrance" && c?.characteristics?.entranceEasing ? l = c.characteristics.entranceEasing : i.category === "exit" && c?.characteristics?.exitEasing ? l = c.characteristics.exitEasing : (i.category === "hover" || i.category === "click-interaction") && c?.characteristics?.interactionEasing && (l = c.characteristics.interactionEasing);
|
|
3324
|
+
let u = s?.easings?.standard;
|
|
3325
|
+
i.category === "entrance" && s?.easings?.entrance ? u = s.easings.entrance : i.category === "exit" && s?.easings?.exit && (u = s.easings.exit);
|
|
3326
|
+
let d = c?.duration;
|
|
3327
|
+
d !== void 0 && c?.characteristics && (i.category === "exit" && c.characteristics.exitDurationMultiplier ? d = Math.round(d * c.characteristics.exitDurationMultiplier) : i.category === "hover" && c.characteristics.hoverDurationMultiplier ? d = Math.round(d * c.characteristics.hoverDurationMultiplier) : i.category === "click-interaction" && c.characteristics.pressDurationMultiplier && (d = Math.round(d * c.characteristics.pressDurationMultiplier)));
|
|
3328
|
+
let f;
|
|
3329
|
+
s?.timing && (i.category === "exit" && s.timing.fast !== void 0 ? f = s.timing.fast : (i.category === "hover" || i.category === "click-interaction") && s.timing.fastest !== void 0 ? f = s.timing.fastest : s.timing.normal === void 0 ? s.timing.standard !== void 0 && (f = s.timing.standard) : f = s.timing.normal);
|
|
3330
|
+
let p = {
|
|
3331
|
+
duration: t?.duration ?? f ?? d ?? i.animation.duration,
|
|
3332
|
+
easing: t?.easing ?? u ?? l ?? i.animation.easing,
|
|
3333
|
+
delay: t?.delay ?? c?.delay ?? i.animation.delay,
|
|
3334
|
+
repeat: t?.repeat ?? i.animation.repeat,
|
|
3335
|
+
yoyo: t?.yoyo ?? i.animation.yoyo,
|
|
3336
|
+
playbackRate: t?.playbackRate ?? c?.playbackRate ?? i.animation.playbackRate,
|
|
3337
|
+
respectReducedMotion: t?.respectReducedMotion === void 0 || t.respectReducedMotion,
|
|
3338
|
+
...t?.propertyEasing ? { propertyEasing: t.propertyEasing } : {},
|
|
3339
|
+
...t?.propertyKeyframeOffsets ? { propertyKeyframeOffsets: t.propertyKeyframeOffsets } : {},
|
|
3340
|
+
...t?.fill ? { fill: t.fill } : {}
|
|
3341
|
+
}, m = p;
|
|
3342
|
+
if (t?.adaptive) {
|
|
3343
|
+
let e = typeof t.adaptive == "object" ? t.adaptive : void 0;
|
|
3344
|
+
m = r(p, e);
|
|
3345
|
+
}
|
|
3346
|
+
return {
|
|
3347
|
+
properties: o,
|
|
3348
|
+
options: m
|
|
3349
|
+
};
|
|
3350
|
+
}
|
|
3351
|
+
function Ct(e, t, n, r) {
|
|
3352
|
+
return wt(e, t, {
|
|
3353
|
+
...r,
|
|
3354
|
+
adaptive: n ?? !0
|
|
3355
|
+
});
|
|
3356
|
+
}
|
|
3357
|
+
function wt(e, t, n) {
|
|
3358
|
+
let { properties: r, options: i } = J(t, n);
|
|
3359
|
+
return a(e, r, i);
|
|
3360
|
+
}
|
|
3361
|
+
function Tt(e, t, n) {
|
|
3362
|
+
let { properties: r, options: i } = J(t, n);
|
|
3363
|
+
return {
|
|
3364
|
+
target: e,
|
|
3365
|
+
properties: r,
|
|
3366
|
+
options: i
|
|
3367
|
+
};
|
|
3368
|
+
}
|
|
3369
|
+
function Et(e, t, n) {
|
|
3370
|
+
let { properties: r, options: i } = J(t, n);
|
|
3371
|
+
return {
|
|
3372
|
+
target: e,
|
|
3373
|
+
properties: r,
|
|
3374
|
+
options: i
|
|
3375
|
+
};
|
|
3376
|
+
}
|
|
3377
|
+
function Dt(e, t, n) {
|
|
3378
|
+
if (!Array.isArray(t) || t.length === 0) throw TypeError("composePresetSequence requires a non-empty array of steps");
|
|
3379
|
+
return s(t.map((t) => typeof t == "string" ? Tt(e, t) : Tt(e, t.preset, t.overrides)), n);
|
|
3380
|
+
}
|
|
3381
|
+
function Ot(e, t) {
|
|
3382
|
+
if (!Array.isArray(e) || e.length === 0) throw TypeError("composePresetParallel requires a non-empty array of steps");
|
|
3383
|
+
return F(e.map((e) => Et(e.target, e.preset, e.overrides)), t);
|
|
3384
|
+
}
|
|
3385
|
+
function kt(e = !0) {
|
|
3386
|
+
return JSON.stringify(mt(), null, e ? 2 : 0);
|
|
3387
|
+
}
|
|
3388
|
+
function At() {
|
|
3389
|
+
let e = mt();
|
|
3390
|
+
return {
|
|
3391
|
+
$schema: "https://af-motion.dev/schemas/presets-v1.json",
|
|
3392
|
+
version: ot,
|
|
3393
|
+
totalPresets: e.length,
|
|
3394
|
+
categories: W,
|
|
3395
|
+
presets: e
|
|
3396
|
+
};
|
|
3397
|
+
}
|
|
3398
|
+
// src/core/motion-choreography.ts
|
|
3399
|
+
var jt = "1.0.0";
|
|
3400
|
+
function Y(e) {
|
|
3401
|
+
if (typeof e != "object" || !e || typeof e.then == "function" && typeof e.catch == "function") return e;
|
|
3402
|
+
if (Array.isArray(e)) {
|
|
3403
|
+
let t = e.map((e) => Y(e));
|
|
3404
|
+
return Object.freeze(t);
|
|
3405
|
+
}
|
|
3406
|
+
let t = {};
|
|
3407
|
+
for (let [n, r] of Object.entries(e)) t[n] = Y(r);
|
|
3408
|
+
return Object.freeze(t);
|
|
3409
|
+
}
|
|
3410
|
+
function Mt(e) {
|
|
3411
|
+
let t = {};
|
|
3412
|
+
for (let [n, r] of Object.entries(e.properties)) t[n] = [r[0], r[1]];
|
|
3413
|
+
return {
|
|
3414
|
+
type: "animation",
|
|
3415
|
+
target: e.target,
|
|
3416
|
+
properties: t,
|
|
3417
|
+
...e.options ? { options: { ...e.options } } : {},
|
|
3418
|
+
...e.adaptive === void 0 ? {} : { adaptive: e.adaptive },
|
|
3419
|
+
...e.motionDNA ? { motionDNA: {
|
|
3420
|
+
name: e.motionDNA.name,
|
|
3421
|
+
...e.motionDNA.overrides ? { overrides: { ...e.motionDNA.overrides } } : {}
|
|
3422
|
+
} } : {},
|
|
3423
|
+
...e.designSystem === void 0 ? {} : { designSystem: e.designSystem },
|
|
3424
|
+
...e.label === void 0 ? {} : { label: e.label },
|
|
3425
|
+
...e.delay === void 0 ? {} : { delay: e.delay },
|
|
3426
|
+
...e.offset === void 0 ? {} : { offset: e.offset }
|
|
3427
|
+
};
|
|
3428
|
+
}
|
|
3429
|
+
function Nt(e) {
|
|
3430
|
+
return typeof e == "function" ? e : "motionDNA" in e && e.motionDNA !== void 0 ? {
|
|
3431
|
+
start: e.start,
|
|
3432
|
+
motionDNA: {
|
|
3433
|
+
name: e.motionDNA.name,
|
|
3434
|
+
...e.motionDNA.overrides ? { overrides: { ...e.motionDNA.overrides } } : {}
|
|
3435
|
+
}
|
|
3436
|
+
} : "start" in e && typeof e.start == "function" ? { start: e.start } : e;
|
|
3437
|
+
}
|
|
3438
|
+
function Pt(e) {
|
|
3439
|
+
return {
|
|
3440
|
+
type: "preset",
|
|
3441
|
+
preset: e.preset,
|
|
3442
|
+
...e.target === void 0 ? {} : { target: e.target },
|
|
3443
|
+
...e.label === void 0 ? {} : { label: e.label },
|
|
3444
|
+
...e.delay === void 0 ? {} : { delay: e.delay },
|
|
3445
|
+
...e.offset === void 0 ? {} : { offset: e.offset },
|
|
3446
|
+
...e.duration === void 0 ? {} : { duration: e.duration },
|
|
3447
|
+
...e.easing === void 0 ? {} : { easing: e.easing },
|
|
3448
|
+
...e.overrides ? { overrides: { ...e.overrides } } : {},
|
|
3449
|
+
...e.adaptive === void 0 ? {} : { adaptive: e.adaptive },
|
|
3450
|
+
...e.motionDNA ? { motionDNA: {
|
|
3451
|
+
name: e.motionDNA.name,
|
|
3452
|
+
...e.motionDNA.overrides ? { overrides: { ...e.motionDNA.overrides } } : {}
|
|
3453
|
+
} } : {},
|
|
3454
|
+
...e.designSystem === void 0 ? {} : { designSystem: e.designSystem }
|
|
3455
|
+
};
|
|
3456
|
+
}
|
|
3457
|
+
function Ft(e) {
|
|
3458
|
+
return {
|
|
3459
|
+
type: "recipe",
|
|
3460
|
+
recipe: e.recipe,
|
|
3461
|
+
...e.targets === void 0 ? {} : { targets: e.targets },
|
|
3462
|
+
...e.label === void 0 ? {} : { label: e.label },
|
|
3463
|
+
...e.delay === void 0 ? {} : { delay: e.delay },
|
|
3464
|
+
...e.offset === void 0 ? {} : { offset: e.offset },
|
|
3465
|
+
...e.overrides ? { overrides: { ...e.overrides } } : {},
|
|
3466
|
+
...e.stepOverrides ? { stepOverrides: { ...e.stepOverrides } } : {},
|
|
3467
|
+
...e.adaptive === void 0 ? {} : { adaptive: e.adaptive },
|
|
3468
|
+
...e.motionDNA ? { motionDNA: {
|
|
3469
|
+
name: e.motionDNA.name,
|
|
3470
|
+
...e.motionDNA.overrides ? { overrides: { ...e.motionDNA.overrides } } : {}
|
|
3471
|
+
} } : {},
|
|
3472
|
+
...e.designSystem === void 0 ? {} : { designSystem: e.designSystem }
|
|
3473
|
+
};
|
|
3474
|
+
}
|
|
3475
|
+
function X(e) {
|
|
3476
|
+
return e.type === "animation" || e.type === "preset" || e.type === "recipe" ? !0 : e.type === "sequence" || e.type === "parallel" ? e.actions.some(X) : e.type === "branch" ? e.then.some(X) || (e.else ? e.else.some(X) : !1) : !1;
|
|
3477
|
+
}
|
|
3478
|
+
function Z(e, t = !1) {
|
|
3479
|
+
if (!Array.isArray(e)) throw TypeError("Choreography actions must be an array");
|
|
3480
|
+
if (!t && e.length === 0) throw TypeError("Choreography actions must not be empty");
|
|
3481
|
+
return e.map((e, t) => {
|
|
3482
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError(`Choreography action ${t} must be an object`);
|
|
3483
|
+
if (e.type === "animation") return Mt(e);
|
|
3484
|
+
if (e.type === "preset") return Pt(e);
|
|
3485
|
+
if (e.type === "recipe") return Ft(e);
|
|
3486
|
+
if (e.type === "effect" && e.effect && (typeof e.effect == "object" || typeof e.effect == "function")) return {
|
|
3487
|
+
type: "effect",
|
|
3488
|
+
effect: Nt(e.effect),
|
|
3489
|
+
...e.label === void 0 ? {} : { label: e.label },
|
|
3490
|
+
...e.delay === void 0 ? {} : { delay: e.delay }
|
|
3491
|
+
};
|
|
3492
|
+
if (e.type === "sequence") {
|
|
3493
|
+
if (!Array.isArray(e.actions) || e.actions.length === 0) throw TypeError(`Choreography sequence ${t} actions must be a non-empty array`);
|
|
3494
|
+
return {
|
|
3495
|
+
type: "sequence",
|
|
3496
|
+
actions: Z(e.actions, !1),
|
|
3497
|
+
...e.label === void 0 ? {} : { label: e.label },
|
|
3498
|
+
...e.delay === void 0 ? {} : { delay: e.delay }
|
|
3499
|
+
};
|
|
3500
|
+
}
|
|
3501
|
+
if (e.type === "branch") {
|
|
3502
|
+
if (typeof e.condition != "function") throw TypeError(`Choreography branch ${t} condition must be a function`);
|
|
3503
|
+
if (!Array.isArray(e.then) || e.else !== void 0 && !Array.isArray(e.else)) throw TypeError(`Choreography branch ${t} paths must be arrays`);
|
|
3504
|
+
return {
|
|
3505
|
+
type: "branch",
|
|
3506
|
+
condition: e.condition,
|
|
3507
|
+
then: Z(e.then, !0),
|
|
3508
|
+
...e.else === void 0 ? {} : { else: Z(e.else, !0) },
|
|
3509
|
+
...e.label === void 0 ? {} : { label: e.label }
|
|
3510
|
+
};
|
|
3511
|
+
}
|
|
3512
|
+
if (e.type === "parallel") {
|
|
3513
|
+
if (!Array.isArray(e.actions) || e.actions.length === 0) throw TypeError(`Choreography action ${t} must be an animation or non-empty parallel group`);
|
|
3514
|
+
let n = e.actions.map((e, t) => {
|
|
3515
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError(`Parallel action ${t} must be an object`);
|
|
3516
|
+
if (e.type === "animation") return Mt(e);
|
|
3517
|
+
if (e.type === "preset") return Pt(e);
|
|
3518
|
+
if (e.type === "recipe") return Ft(e);
|
|
3519
|
+
if (e.type === "sequence") return {
|
|
3520
|
+
type: "sequence",
|
|
3521
|
+
actions: Z(e.actions, !1),
|
|
3522
|
+
...e.label === void 0 ? {} : { label: e.label },
|
|
3523
|
+
...e.delay === void 0 ? {} : { delay: e.delay }
|
|
3524
|
+
};
|
|
3525
|
+
if (e.type === "effect" && e.effect && (typeof e.effect == "object" || typeof e.effect == "function")) return {
|
|
3526
|
+
type: "effect",
|
|
3527
|
+
effect: Nt(e.effect),
|
|
3528
|
+
...e.label === void 0 ? {} : { label: e.label },
|
|
3529
|
+
...e.delay === void 0 ? {} : { delay: e.delay }
|
|
3530
|
+
};
|
|
3531
|
+
if (e.type === "branch") {
|
|
3532
|
+
if (typeof e.condition != "function") throw TypeError(`Parallel branch ${t} condition must be a function`);
|
|
3533
|
+
if (!Array.isArray(e.then) || e.else !== void 0 && !Array.isArray(e.else)) throw TypeError(`Parallel branch ${t} paths must be arrays`);
|
|
3534
|
+
return {
|
|
3535
|
+
type: "branch",
|
|
3536
|
+
condition: e.condition,
|
|
3537
|
+
then: Z(e.then, !0),
|
|
3538
|
+
...e.else === void 0 ? {} : { else: Z(e.else, !0) },
|
|
3539
|
+
...e.label === void 0 ? {} : { label: e.label }
|
|
3540
|
+
};
|
|
3541
|
+
}
|
|
3542
|
+
if (e.type === "parallel") return {
|
|
3543
|
+
type: "parallel",
|
|
3544
|
+
actions: Z(e.actions, !1),
|
|
3545
|
+
...e.label === void 0 ? {} : { label: e.label },
|
|
3546
|
+
...e.delay === void 0 ? {} : { delay: e.delay }
|
|
3547
|
+
};
|
|
3548
|
+
throw TypeError(`Parallel action ${t} must be an animation or effect`);
|
|
3549
|
+
});
|
|
3550
|
+
if (!n.some(X)) throw TypeError("A parallel group must include at least one animation to define its duration");
|
|
3551
|
+
return {
|
|
3552
|
+
type: "parallel",
|
|
3553
|
+
actions: n,
|
|
3554
|
+
...e.label === void 0 ? {} : { label: e.label },
|
|
3555
|
+
...e.delay === void 0 ? {} : { delay: e.delay }
|
|
3556
|
+
};
|
|
3557
|
+
}
|
|
3558
|
+
throw TypeError(`Choreography action ${t} must be an animation or non-empty parallel group`);
|
|
3559
|
+
});
|
|
3560
|
+
}
|
|
3561
|
+
function Q(e, t, n) {
|
|
3562
|
+
if (typeof e == "string") {
|
|
3563
|
+
let r = e.startsWith("$") ? e.slice(1) : e;
|
|
3564
|
+
if (t && typeof t == "object" && !("nodeType" in t) && !("style" in t) && !Array.isArray(t)) {
|
|
3565
|
+
let e = t;
|
|
3566
|
+
if (e[r] !== void 0) return e[r];
|
|
3567
|
+
if (e[`$${r}`] !== void 0) return e[`$${r}`];
|
|
3568
|
+
}
|
|
3569
|
+
if (e.startsWith("$") || n && n.includes(r)) throw TypeError(`Missing target binding for slot "${e}"`);
|
|
3570
|
+
return e;
|
|
3571
|
+
}
|
|
3572
|
+
if (e !== void 0) return e;
|
|
3573
|
+
if (t) {
|
|
3574
|
+
if (typeof t != "object" || "nodeType" in t || "style" in t || Array.isArray(t) || typeof t == "string") return t;
|
|
3575
|
+
let e = t;
|
|
3576
|
+
if (e.default !== void 0) return e.default;
|
|
3577
|
+
if (e.container !== void 0) return e.container;
|
|
3578
|
+
if (e.root !== void 0) return e.root;
|
|
3579
|
+
}
|
|
3580
|
+
throw TypeError("Choreography step does not define a target and no default target was provided");
|
|
3581
|
+
}
|
|
3582
|
+
function It(e, t) {
|
|
3583
|
+
if (e) return e;
|
|
3584
|
+
if (t) {
|
|
3585
|
+
if (typeof t == "string") return { name: t };
|
|
3586
|
+
if ("name" in t && typeof t.name == "string") return {
|
|
3587
|
+
name: t.name,
|
|
3588
|
+
overrides: t.overrides
|
|
3589
|
+
};
|
|
3590
|
+
}
|
|
3591
|
+
}
|
|
3592
|
+
function Lt(e) {
|
|
3593
|
+
for (let t of e) if (t.type !== "animation" && t.type !== "preset") return !1;
|
|
3594
|
+
return !0;
|
|
3595
|
+
}
|
|
3596
|
+
function Rt() {
|
|
3597
|
+
let e = /* @__PURE__ */ Error("Motion choreography was cancelled");
|
|
3598
|
+
return e.name = "AbortError", e;
|
|
3599
|
+
}
|
|
3600
|
+
var zt = [
|
|
3601
|
+
Y({
|
|
3602
|
+
id: "heroEntrance",
|
|
3603
|
+
name: "Hero Entrance",
|
|
3604
|
+
description: "Staggered hero section reveal: headline rises, subtitle fades in, and CTA button bounces.",
|
|
3605
|
+
targets: [
|
|
3606
|
+
"headline",
|
|
3607
|
+
"subhead",
|
|
3608
|
+
"cta"
|
|
3609
|
+
],
|
|
3610
|
+
actions: [
|
|
3611
|
+
{
|
|
3612
|
+
type: "preset",
|
|
3613
|
+
preset: "slideUp",
|
|
3614
|
+
target: "$headline",
|
|
3615
|
+
label: "headline",
|
|
3616
|
+
duration: 600,
|
|
3617
|
+
easing: "easeOutCubic"
|
|
3618
|
+
},
|
|
3619
|
+
{
|
|
3620
|
+
type: "preset",
|
|
3621
|
+
preset: "fadeIn",
|
|
3622
|
+
target: "$subhead",
|
|
3623
|
+
label: "subhead",
|
|
3624
|
+
delay: 150,
|
|
3625
|
+
duration: 500
|
|
3626
|
+
},
|
|
3627
|
+
{
|
|
3628
|
+
type: "preset",
|
|
3629
|
+
preset: "bounceIn",
|
|
3630
|
+
target: "$cta",
|
|
3631
|
+
label: "cta",
|
|
3632
|
+
delay: 100,
|
|
3633
|
+
duration: 400
|
|
3634
|
+
}
|
|
3635
|
+
],
|
|
3636
|
+
metadata: {
|
|
3637
|
+
category: "entrance",
|
|
3638
|
+
tags: [
|
|
3639
|
+
"hero",
|
|
3640
|
+
"landing",
|
|
3641
|
+
"entrance",
|
|
3642
|
+
"stagger"
|
|
3643
|
+
]
|
|
3644
|
+
}
|
|
3645
|
+
}),
|
|
3646
|
+
Y({
|
|
3647
|
+
id: "pageTransition",
|
|
3648
|
+
name: "Page Transition",
|
|
3649
|
+
description: "Coordinated page transition: outgoing page fades out before incoming page slides up.",
|
|
3650
|
+
targets: ["outgoing", "incoming"],
|
|
3651
|
+
actions: [{
|
|
3652
|
+
type: "preset",
|
|
3653
|
+
preset: "fadeOut",
|
|
3654
|
+
target: "$outgoing",
|
|
3655
|
+
label: "outgoing",
|
|
3656
|
+
duration: 250
|
|
3657
|
+
}, {
|
|
3658
|
+
type: "preset",
|
|
3659
|
+
preset: "slideUp",
|
|
3660
|
+
target: "$incoming",
|
|
3661
|
+
label: "incoming",
|
|
3662
|
+
duration: 350
|
|
3663
|
+
}],
|
|
3664
|
+
metadata: {
|
|
3665
|
+
category: "page-transition",
|
|
3666
|
+
tags: [
|
|
3667
|
+
"page",
|
|
3668
|
+
"transition",
|
|
3669
|
+
"navigation"
|
|
3670
|
+
]
|
|
3671
|
+
}
|
|
3672
|
+
}),
|
|
3673
|
+
Y({
|
|
3674
|
+
id: "cardReveal",
|
|
3675
|
+
name: "Card Reveal",
|
|
3676
|
+
description: "Coordinated card entrance: card container scales in while content fades and lifts.",
|
|
3677
|
+
targets: ["card", "content"],
|
|
3678
|
+
actions: [{
|
|
3679
|
+
type: "parallel",
|
|
3680
|
+
actions: [{
|
|
3681
|
+
type: "preset",
|
|
3682
|
+
preset: "scaleIn",
|
|
3683
|
+
target: "$card",
|
|
3684
|
+
label: "card-scale",
|
|
3685
|
+
duration: 400
|
|
3686
|
+
}, {
|
|
3687
|
+
type: "preset",
|
|
3688
|
+
preset: "slideUp",
|
|
3689
|
+
target: "$content",
|
|
3690
|
+
label: "content-slide",
|
|
3691
|
+
delay: 100,
|
|
3692
|
+
duration: 450
|
|
3693
|
+
}]
|
|
3694
|
+
}],
|
|
3695
|
+
metadata: {
|
|
3696
|
+
category: "entrance",
|
|
3697
|
+
tags: [
|
|
3698
|
+
"card",
|
|
3699
|
+
"reveal",
|
|
3700
|
+
"container",
|
|
3701
|
+
"entrance"
|
|
3702
|
+
]
|
|
3703
|
+
}
|
|
3704
|
+
})
|
|
3705
|
+
], Bt = new Set(zt.map((e) => e.id)), $ = /* @__PURE__ */ new Map();
|
|
3706
|
+
function Vt() {
|
|
3707
|
+
$.clear();
|
|
3708
|
+
for (let e of zt) $.set(e.id, e);
|
|
3709
|
+
}
|
|
3710
|
+
Vt();
|
|
3711
|
+
function Ht(e) {
|
|
3712
|
+
let t = [];
|
|
3713
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return {
|
|
3714
|
+
valid: !1,
|
|
3715
|
+
errors: [{ message: "Choreography definition must be an object" }]
|
|
3716
|
+
};
|
|
3717
|
+
let n = e;
|
|
3718
|
+
return n.id && typeof n.id == "string" && n.id.trim() !== "" || t.push({
|
|
3719
|
+
parameter: "id",
|
|
3720
|
+
message: "Choreography must have a non-empty string \"id\""
|
|
3721
|
+
}), n.name && typeof n.name == "string" && n.name.trim() !== "" || t.push({
|
|
3722
|
+
parameter: "name",
|
|
3723
|
+
message: "Choreography must have a non-empty string \"name\""
|
|
3724
|
+
}), !Array.isArray(n.actions) || n.actions.length === 0 ? t.push({
|
|
3725
|
+
parameter: "actions",
|
|
3726
|
+
message: "Choreography must have a non-empty \"actions\" array"
|
|
3727
|
+
}) : n.actions.forEach((e, n) => {
|
|
3728
|
+
!e || typeof e != "object" ? t.push({
|
|
3729
|
+
parameter: `actions[${n}]`,
|
|
3730
|
+
message: `Action ${n} must be an object`
|
|
3731
|
+
}) : ([
|
|
3732
|
+
"animation",
|
|
3733
|
+
"preset",
|
|
3734
|
+
"recipe",
|
|
3735
|
+
"parallel",
|
|
3736
|
+
"sequence",
|
|
3737
|
+
"branch",
|
|
3738
|
+
"effect"
|
|
3739
|
+
].includes(e.type) || t.push({
|
|
3740
|
+
parameter: `actions[${n}].type`,
|
|
3741
|
+
message: `Action ${n} has unknown type "${e.type}"`
|
|
3742
|
+
}), e.type !== "preset" || "preset" in e && typeof e.preset == "string" || t.push({
|
|
3743
|
+
parameter: `actions[${n}].preset`,
|
|
3744
|
+
message: `Preset action ${n} must specify a preset name`
|
|
3745
|
+
}), e.type !== "parallel" || Array.isArray(e.actions) && e.actions.length !== 0 || t.push({
|
|
3746
|
+
parameter: `actions[${n}].actions`,
|
|
3747
|
+
message: `Parallel action ${n} must have non-empty actions array`
|
|
3748
|
+
}));
|
|
3749
|
+
}), {
|
|
3750
|
+
valid: t.length === 0,
|
|
3751
|
+
errors: t
|
|
3752
|
+
};
|
|
3753
|
+
}
|
|
3754
|
+
function Ut(e) {
|
|
3755
|
+
let t = Ht(e);
|
|
3756
|
+
if (!t.valid) throw TypeError(`Invalid choreography definition: ${t.errors.map((e) => e.message).join(", ")}`);
|
|
3757
|
+
if (Bt.has(e.id)) throw Error(`Cannot overwrite built-in choreography "${e.id}"`);
|
|
3758
|
+
$.set(e.id, Y(e));
|
|
3759
|
+
}
|
|
3760
|
+
function Wt(e) {
|
|
3761
|
+
return $.get(e);
|
|
3762
|
+
}
|
|
3763
|
+
function Gt() {
|
|
3764
|
+
return Array.from($.values());
|
|
3765
|
+
}
|
|
3766
|
+
function Kt(e) {
|
|
3767
|
+
let t = Gt();
|
|
3768
|
+
if (typeof e == "string") {
|
|
3769
|
+
let n = e.trim().toLowerCase();
|
|
3770
|
+
return n === "" ? t : t.filter((e) => e.id.toLowerCase().includes(n) || e.name.toLowerCase().includes(n) || e.description && e.description.toLowerCase().includes(n) || e.metadata?.category && e.metadata.category.toLowerCase().includes(n) || e.metadata?.tags && e.metadata.tags.some((e) => e.toLowerCase().includes(n)));
|
|
3771
|
+
}
|
|
3772
|
+
return t.filter((t) => {
|
|
3773
|
+
if (e.text) {
|
|
3774
|
+
let n = e.text.toLowerCase();
|
|
3775
|
+
if (!(t.id.toLowerCase().includes(n) || t.name.toLowerCase().includes(n) || t.description && t.description.toLowerCase().includes(n))) return !1;
|
|
3776
|
+
}
|
|
3777
|
+
return !(e.category && t.metadata?.category !== e.category || e.tag && (!t.metadata?.tags || !t.metadata.tags.includes(e.tag)) || e.motionDNA && (typeof t.motionDNA == "string" ? t.motionDNA : t.motionDNA?.name) !== e.motionDNA || e.designSystem && (typeof t.designSystem == "string" ? t.designSystem : t.designSystem?.id) !== e.designSystem);
|
|
3778
|
+
});
|
|
3779
|
+
}
|
|
3780
|
+
function qt(e) {
|
|
3781
|
+
if (Bt.has(e)) throw Error(`Cannot remove built-in choreography "${e}"`);
|
|
3782
|
+
return $.delete(e);
|
|
3783
|
+
}
|
|
3784
|
+
function Jt() {
|
|
3785
|
+
Vt();
|
|
3786
|
+
}
|
|
3787
|
+
function Yt(e) {
|
|
3788
|
+
let t = typeof e == "string" ? Wt(e) : e;
|
|
3789
|
+
if (!t) throw TypeError(`Unknown choreography "${String(e)}"`);
|
|
3790
|
+
let n = {
|
|
3791
|
+
$schemaVersion: jt,
|
|
3792
|
+
...t
|
|
3793
|
+
};
|
|
3794
|
+
return JSON.stringify(n, null, 2);
|
|
3795
|
+
}
|
|
3796
|
+
function Xt() {
|
|
3797
|
+
let e = {
|
|
3798
|
+
$schemaVersion: jt,
|
|
3799
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3800
|
+
count: $.size,
|
|
3801
|
+
choreographies: Gt()
|
|
3802
|
+
};
|
|
3803
|
+
return JSON.stringify(e, null, 2);
|
|
3804
|
+
}
|
|
3805
|
+
function Zt(e) {
|
|
3806
|
+
if (typeof e != "string") throw TypeError("Choreography JSON must be a string");
|
|
3807
|
+
let t;
|
|
3808
|
+
try {
|
|
3809
|
+
t = JSON.parse(e, (e, t) => e === "__proto__" || e === "constructor" || e === "prototype" ? void 0 : t);
|
|
3810
|
+
} catch (e) {
|
|
3811
|
+
throw TypeError(`Invalid JSON syntax: ${e.message}`);
|
|
3812
|
+
}
|
|
3813
|
+
let n = Ht(t);
|
|
3814
|
+
if (!n.valid) throw TypeError(`Invalid choreography JSON: ${n.errors.map((e) => e.message).join(", ")}`);
|
|
3815
|
+
return Y(t);
|
|
3816
|
+
}
|
|
3817
|
+
function Qt(t, n) {
|
|
3818
|
+
let i, a, o;
|
|
3819
|
+
if (typeof t == "string") {
|
|
3820
|
+
let e = Wt(t);
|
|
3821
|
+
if (!e) throw TypeError(`Unknown motion choreography "${t}"`);
|
|
3822
|
+
o = e, i = o.actions, a = o.targets;
|
|
3823
|
+
} else if (Array.isArray(t)) i = t, a = void 0;
|
|
3824
|
+
else if (typeof t == "object" && t && "actions" in t) o = t, i = o.actions, a = o.targets;
|
|
3825
|
+
else throw TypeError("Choreography definition must be an array of actions, a choreography definition object, or a choreography ID");
|
|
3826
|
+
let c = Z(i), l = n?.targets, u = n?.stepOverrides ?? {};
|
|
3827
|
+
if (a && a.length > 0) {
|
|
3828
|
+
if (!l) throw TypeError(`Missing required target bindings for slots: ${a.join(", ")}`);
|
|
3829
|
+
if (typeof l == "object" && !("nodeType" in l) && !("style" in l) && !Array.isArray(l) && typeof l != "string") {
|
|
3830
|
+
let e = l;
|
|
3831
|
+
for (let t of a) if (e[t] === void 0 && e[`$${t}`] === void 0) throw TypeError(`Missing target binding for slot "${t}"`);
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
let f = n?.designSystem ?? o?.designSystem, p = f ? Se(f) : void 0, m = n?.motionDNA ?? o?.motionDNA ?? p?.resolvedMotionDNA, h = n?.adaptive ?? o?.adaptive;
|
|
3835
|
+
if (Lt(c)) {
|
|
3836
|
+
let t = s(c.map((t, n) => {
|
|
3837
|
+
let i = t.label ?? String(n), o = u[i] ?? u[String(n)] ?? {};
|
|
3838
|
+
if (t.type === "animation") {
|
|
3839
|
+
let n = Q(t.target, l, a), i = It(t.motionDNA, m), s = {
|
|
3840
|
+
...i ? e(i.name, i.overrides) : {},
|
|
3841
|
+
...t.options,
|
|
3842
|
+
...o
|
|
3843
|
+
};
|
|
3844
|
+
t.delay !== void 0 && (s.delay = (s.delay ?? 0) + t.delay), t.offset !== void 0 && (s.delay = (s.delay ?? 0) + t.offset);
|
|
3845
|
+
let c = t.adaptive ?? h ?? s.adaptive, u = c ? r(s, typeof c == "object" ? c : void 0) : s;
|
|
3846
|
+
return {
|
|
3847
|
+
target: n,
|
|
3848
|
+
properties: t.properties,
|
|
3849
|
+
options: u
|
|
3850
|
+
};
|
|
3851
|
+
}
|
|
3852
|
+
let s = t, c = Q(s.target, l, a), d = {
|
|
3853
|
+
...s.overrides,
|
|
3854
|
+
...s.duration === void 0 ? {} : { duration: s.duration },
|
|
3855
|
+
...s.delay === void 0 ? {} : { delay: s.delay },
|
|
3856
|
+
...s.offset === void 0 ? {} : { delay: (s.delay ?? 0) + s.offset },
|
|
3857
|
+
...s.easing === void 0 ? {} : { easing: s.easing },
|
|
3858
|
+
...s.overrides?.motionDNA === void 0 && m !== void 0 ? { motionDNA: m } : {},
|
|
3859
|
+
...s.overrides?.designSystem === void 0 && f !== void 0 ? { designSystem: f } : {},
|
|
3860
|
+
...s.overrides?.adaptive === void 0 && h !== void 0 ? { adaptive: h } : {},
|
|
3861
|
+
...o
|
|
3862
|
+
}, { properties: p, options: g } = J(s.preset, d);
|
|
3863
|
+
return {
|
|
3864
|
+
target: c,
|
|
3865
|
+
properties: p,
|
|
3866
|
+
options: g
|
|
3867
|
+
};
|
|
3868
|
+
}));
|
|
3869
|
+
return {
|
|
3870
|
+
finished: t.finished.catch((e) => {
|
|
3871
|
+
throw e instanceof Error && (e.name === "AbortError" || e.message.includes("Animation sequence was cancelled")) ? Rt() : e;
|
|
3872
|
+
}),
|
|
3873
|
+
pause: () => t.pause(),
|
|
3874
|
+
resume: () => t.resume(),
|
|
3875
|
+
cancel: () => t.cancel(),
|
|
3876
|
+
destroy: () => t.cancel(),
|
|
3877
|
+
play: () => t.resume(),
|
|
3878
|
+
reverse: () => t.reverse()
|
|
3879
|
+
};
|
|
3880
|
+
}
|
|
3881
|
+
let g = () => void 0, _ = () => void 0, v = new Promise((e, t) => {
|
|
3882
|
+
g = e, _ = t;
|
|
3883
|
+
}), y = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set(), x = /* @__PURE__ */ new Set(), S = !1, C = !1, w = !1, T = () => {
|
|
3884
|
+
let e = [];
|
|
3885
|
+
for (let t of y) try {
|
|
3886
|
+
t.cancel();
|
|
3887
|
+
} catch (t) {
|
|
3888
|
+
e.push(t);
|
|
3889
|
+
}
|
|
3890
|
+
y.clear();
|
|
3891
|
+
for (let t of b) try {
|
|
3892
|
+
t.destroy();
|
|
3893
|
+
} catch (t) {
|
|
3894
|
+
e.push(t);
|
|
3895
|
+
}
|
|
3896
|
+
b.clear();
|
|
3897
|
+
for (let t of x) try {
|
|
3898
|
+
t.cancel();
|
|
3899
|
+
} catch (t) {
|
|
3900
|
+
e.push(t);
|
|
3901
|
+
}
|
|
3902
|
+
if (x.clear(), e.length > 0) throw AggregateError(e, "Motion choreography cleanup failed");
|
|
3903
|
+
}, ee = async (t, n) => {
|
|
3904
|
+
let i = Q(t.target, l, a), o = t.label ?? String(n), c = u[o] ?? u[String(n)] ?? {}, d = It(t.motionDNA, m), f = {
|
|
3905
|
+
...d ? e(d.name, d.overrides) : {},
|
|
3906
|
+
...t.options,
|
|
3907
|
+
...c
|
|
3908
|
+
};
|
|
3909
|
+
t.delay !== void 0 && (f.delay = (f.delay ?? 0) + t.delay), t.offset !== void 0 && (f.delay = (f.delay ?? 0) + t.offset);
|
|
3910
|
+
let p = t.adaptive ?? h ?? f.adaptive, g = p ? r(f, typeof p == "object" ? p : void 0) : f, _ = s([{
|
|
3911
|
+
target: i,
|
|
3912
|
+
properties: t.properties,
|
|
3913
|
+
options: g
|
|
3914
|
+
}]);
|
|
3915
|
+
y.add(_), w && _.pause();
|
|
3916
|
+
try {
|
|
3917
|
+
await _.finished;
|
|
3918
|
+
} finally {
|
|
3919
|
+
y.delete(_);
|
|
3920
|
+
}
|
|
3921
|
+
}, E = async (e, t) => {
|
|
3922
|
+
let n = Q(e.target, l, a), r = e.label ?? String(t), i = u[r] ?? u[String(t)] ?? {}, o = {
|
|
3923
|
+
...e.overrides,
|
|
3924
|
+
...e.duration === void 0 ? {} : { duration: e.duration },
|
|
3925
|
+
...e.delay === void 0 ? {} : { delay: e.delay },
|
|
3926
|
+
...e.offset === void 0 ? {} : { delay: (e.delay ?? 0) + e.offset },
|
|
3927
|
+
...e.easing === void 0 ? {} : { easing: e.easing },
|
|
3928
|
+
...e.overrides?.motionDNA === void 0 && m !== void 0 ? { motionDNA: m } : {},
|
|
3929
|
+
...e.overrides?.designSystem === void 0 && f !== void 0 ? { designSystem: f } : {},
|
|
3930
|
+
...e.overrides?.adaptive === void 0 && h !== void 0 ? { adaptive: h } : {},
|
|
3931
|
+
...i
|
|
3932
|
+
}, { properties: c, options: d } = J(e.preset, o), p = s([{
|
|
3933
|
+
target: n,
|
|
3934
|
+
properties: c,
|
|
3935
|
+
options: d
|
|
3936
|
+
}]);
|
|
3937
|
+
y.add(p), w && p.pause();
|
|
3938
|
+
try {
|
|
3939
|
+
await p.finished;
|
|
3940
|
+
} finally {
|
|
3941
|
+
y.delete(p);
|
|
3942
|
+
}
|
|
3943
|
+
}, te = async (e) => {
|
|
3944
|
+
let t = typeof l == "object" && l && !("nodeType" in l) && !Array.isArray(l) && typeof e.targets == "object" && e.targets !== null && !("nodeType" in e.targets) && !Array.isArray(e.targets) ? {
|
|
3945
|
+
...l,
|
|
3946
|
+
...e.targets
|
|
3947
|
+
} : e.targets ?? l, n = (e.delay ?? 0) + (e.offset ?? 0), r = {
|
|
3948
|
+
...e.overrides,
|
|
3949
|
+
...n > 0 || e.delay !== void 0 || e.offset !== void 0 ? { delay: (e.overrides?.delay ?? 0) + n } : {},
|
|
3950
|
+
...e.motionDNA === void 0 ? e.overrides?.motionDNA === void 0 && m !== void 0 ? { motionDNA: m } : {} : { motionDNA: e.motionDNA },
|
|
3951
|
+
...e.designSystem === void 0 ? e.overrides?.designSystem === void 0 && f !== void 0 ? { designSystem: f } : {} : { designSystem: e.designSystem },
|
|
3952
|
+
...e.adaptive === void 0 ? e.overrides?.adaptive === void 0 && h !== void 0 ? { adaptive: h } : {} : { adaptive: e.adaptive }
|
|
3953
|
+
}, i = U(e.recipe, {
|
|
3954
|
+
targets: t,
|
|
3955
|
+
overrides: r,
|
|
3956
|
+
stepOverrides: e.stepOverrides
|
|
3957
|
+
});
|
|
3958
|
+
x.add(i), w && i.pause();
|
|
3959
|
+
try {
|
|
3960
|
+
i.finished && await i.finished;
|
|
3961
|
+
} finally {
|
|
3962
|
+
x.delete(i);
|
|
3963
|
+
}
|
|
3964
|
+
}, ne = async (t) => {
|
|
3965
|
+
let n = t.actions.filter((e) => e.type === "effect").map((e) => e.effect), i = n.length > 0 ? d(n) : null;
|
|
3966
|
+
i && (b.add(i), w && i.pause()), t.actions.filter((e) => e.type !== "effect");
|
|
3967
|
+
let o = [], c, u = !1;
|
|
3968
|
+
try {
|
|
3969
|
+
let n = [];
|
|
3970
|
+
for (let i = 0; i < t.actions.length; i++) {
|
|
3971
|
+
let c = t.actions[i];
|
|
3972
|
+
if (c.type === "animation") {
|
|
3973
|
+
let t = Q(c.target, l, a), i = It(c.motionDNA, m), u = {
|
|
3974
|
+
...i ? e(i.name, i.overrides) : {},
|
|
3975
|
+
...c.options
|
|
3976
|
+
}, d = c.adaptive ?? h ?? u.adaptive, f = d ? r(u, typeof d == "object" ? d : void 0) : u, p = s([{
|
|
3977
|
+
target: t,
|
|
3978
|
+
properties: c.properties,
|
|
3979
|
+
options: f
|
|
3980
|
+
}]);
|
|
3981
|
+
o.push(p), y.add(p), w && p.pause(), n.push(p.finished);
|
|
3982
|
+
} else if (c.type === "preset") n.push(E(c, i));
|
|
3983
|
+
else if (c.type === "recipe") n.push(te(c));
|
|
3984
|
+
else if (c.type === "sequence") n.push(D(c.actions));
|
|
3985
|
+
else if (c.type === "branch") {
|
|
3986
|
+
let e = c.condition();
|
|
3987
|
+
if (typeof e != "boolean") throw TypeError("Motion choreography branch condition must return a boolean");
|
|
3988
|
+
n.push(D(e ? c.then : c.else ?? []));
|
|
3989
|
+
} else c.type === "parallel" && n.push(ne(c));
|
|
3990
|
+
}
|
|
3991
|
+
await Promise.all(n);
|
|
3992
|
+
} catch (e) {
|
|
3993
|
+
u = !0, c = e;
|
|
3994
|
+
}
|
|
3995
|
+
let f = [];
|
|
3996
|
+
for (let e of o) try {
|
|
3997
|
+
e.cancel();
|
|
3998
|
+
} catch (e) {
|
|
3999
|
+
f.push(e);
|
|
4000
|
+
} finally {
|
|
4001
|
+
y.delete(e);
|
|
4002
|
+
}
|
|
4003
|
+
if (i) {
|
|
4004
|
+
b.delete(i);
|
|
4005
|
+
try {
|
|
4006
|
+
i.destroy();
|
|
4007
|
+
} catch (e) {
|
|
4008
|
+
f.push(e);
|
|
4009
|
+
}
|
|
4010
|
+
}
|
|
4011
|
+
if (u) throw f.length > 0 ? AggregateError([c, ...f], "Parallel choreography action failed") : c;
|
|
4012
|
+
if (f.length > 0) throw AggregateError(f, "Parallel choreography cleanup failed");
|
|
4013
|
+
}, D = async (e) => {
|
|
4014
|
+
for (let t = 0; t < e.length; t++) {
|
|
4015
|
+
if (S) return;
|
|
4016
|
+
let n = e[t];
|
|
4017
|
+
if (n.type === "animation") await ee(n, t);
|
|
4018
|
+
else if (n.type === "preset") await E(n, t);
|
|
4019
|
+
else if (n.type === "recipe") await te(n);
|
|
4020
|
+
else if (n.type === "sequence") await D(n.actions);
|
|
4021
|
+
else if (n.type === "parallel") await ne(n);
|
|
4022
|
+
else if (n.type === "branch") {
|
|
4023
|
+
let e = n.condition();
|
|
4024
|
+
if (typeof e != "boolean") throw TypeError("Motion choreography branch condition must return a boolean");
|
|
4025
|
+
await D(e ? n.then : n.else ?? []);
|
|
4026
|
+
}
|
|
4027
|
+
}
|
|
4028
|
+
};
|
|
4029
|
+
(async () => {
|
|
4030
|
+
try {
|
|
4031
|
+
if (await D(c), S) return;
|
|
4032
|
+
C = !0, g();
|
|
4033
|
+
} catch (e) {
|
|
4034
|
+
if (S) return;
|
|
4035
|
+
C = !0;
|
|
4036
|
+
try {
|
|
4037
|
+
T();
|
|
4038
|
+
} catch (t) {
|
|
4039
|
+
_(AggregateError([e, t], "Motion choreography failed"));
|
|
4040
|
+
return;
|
|
4041
|
+
}
|
|
4042
|
+
_(e);
|
|
4043
|
+
}
|
|
4044
|
+
})();
|
|
4045
|
+
let O = () => {
|
|
4046
|
+
if (S || C) return;
|
|
4047
|
+
S = !0;
|
|
4048
|
+
let e = (() => {
|
|
4049
|
+
try {
|
|
4050
|
+
T();
|
|
4051
|
+
return;
|
|
4052
|
+
} catch (e) {
|
|
4053
|
+
return e;
|
|
4054
|
+
}
|
|
4055
|
+
})();
|
|
4056
|
+
_(e ? AggregateError([Rt(), e], "Motion choreography was cancelled with cleanup errors") : Rt());
|
|
4057
|
+
};
|
|
4058
|
+
return {
|
|
4059
|
+
finished: v,
|
|
4060
|
+
pause: () => {
|
|
4061
|
+
if (!(S || C || w)) {
|
|
4062
|
+
w = !0;
|
|
4063
|
+
for (let e of y) e.pause();
|
|
4064
|
+
for (let e of b) e.pause();
|
|
4065
|
+
for (let e of x) e.pause();
|
|
4066
|
+
}
|
|
4067
|
+
},
|
|
4068
|
+
resume: () => {
|
|
4069
|
+
if (!(S || C || !w)) {
|
|
4070
|
+
w = !1;
|
|
4071
|
+
for (let e of y) e.resume();
|
|
4072
|
+
for (let e of b) e.resume();
|
|
4073
|
+
for (let e of x) e.resume();
|
|
4074
|
+
}
|
|
4075
|
+
},
|
|
4076
|
+
play: () => {
|
|
4077
|
+
if (!(S || C) && w) {
|
|
4078
|
+
w = !1;
|
|
4079
|
+
for (let e of y) e.resume();
|
|
4080
|
+
for (let e of b) e.resume();
|
|
4081
|
+
for (let e of x) e.resume();
|
|
4082
|
+
}
|
|
4083
|
+
},
|
|
4084
|
+
cancel: O,
|
|
4085
|
+
destroy: O
|
|
4086
|
+
};
|
|
4087
|
+
}
|
|
4088
|
+
Ie(Qt);
|
|
4089
|
+
export { oe as $, bt as A, et as B, gt as C, ae as Ct, Et as D, f as Dt, mt as E, re as Et, L as F, Ke as G, tt as H, Le as I, We as J, at as K, Qe as L, vt as M, xt as N, Tt as O, d as Ot, St as P, A as Q, it as R, kt as S, te as St, ht as T, ie as Tt, Ue as U, B as V, Ge as W, qe as X, V as Y, F as Z, Ct as _, Oe as _t, Yt as a, N as at, Dt as b, O as bt, Gt as c, _e as ct, Jt as d, Se as dt, be as et, Kt as f, Ce as ft, ot as g, De as gt, W as h, ye as ht, Xt as i, Ee as it, J as j, yt as k, s as kt, Ut as l, xe as lt, K as m, Te as mt, jt as n, Ae as nt, Wt as o, Me as ot, Ht as p, we as pt, U as q, Qt as r, je as rt, Zt as s, ve as st, zt as t, k as tt, qt as u, ke as ut, wt as v, de as vt, _t as w, ee as wt, At as x, E as xt, Ot as y, D as yt, $e as z };
|