@bevelo/motion 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bevelo contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,50 @@
1
- # Temporary Holding Version
1
+ # @bevelo/motion
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Animation with time as an input. Springs are solved in closed form, easings and keyframe
4
+ lists are pure functions of progress, and every loop reads its time from an injected
5
+ `Scheduler`, so the same motion runs in a browser and frame by frame in a test. On top of
6
+ that sit orchestration (sequence, stagger, parallel), presence for exit animations, FLIP
7
+ layout, and a live layer of stages, scenes, SVG and drag motion.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ pnpm add @bevelo/motion
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```ts
18
+ import { animate, createScheduler, easeOutCubic } from "@bevelo/motion";
19
+
20
+ const reduce = matchMedia("(prefers-reduced-motion: reduce)");
21
+ const driver = { scheduler: createScheduler(), reducedMotion: () => reduce.matches };
22
+
23
+ const box = document.querySelector<HTMLElement>("#box")!;
24
+ const motion = animate({
25
+ from: 0,
26
+ to: 240,
27
+ easing: easeOutCubic,
28
+ durationMs: 300,
29
+ driver,
30
+ onUpdate: (x) => {
31
+ box.style.transform = `translateX(${x}px)`;
32
+ },
33
+ });
34
+
35
+ await motion.finished;
36
+ ```
37
+
38
+ Pass `spring: { stiffness, damping }` instead of `easing` for a physical motion. In tests,
39
+ `createManualScheduler()` and `advance(ms)` step the same code by hand.
40
+
41
+ ## Stability
42
+
43
+ The pure curves (`easing`, `spring`, `keyframes`) are `@stable` and follow semver.
44
+ Everything else, including `animate`, orchestration, presence, layout, the segment engine
45
+ and the live layer, is `@experimental` and may change in any minor release.
46
+
47
+ ## Docs
48
+
49
+ See [the behaviors docs](https://github.com/bevelo/bevelo/tree/main/apps/docs/src/content/docs/core/behaviors)
50
+ and the repository at https://github.com/bevelo/bevelo.