Mission Control Dashboard - Initial implementation
This commit is contained in:
36
node_modules/motion-dom/dist/es/value/spring-value.mjs
generated
vendored
Normal file
36
node_modules/motion-dom/dist/es/value/spring-value.mjs
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import { attachFollow, followValue } from './follow-value.mjs';
|
||||
|
||||
/**
|
||||
* Create a `MotionValue` that animates to its latest value using a spring.
|
||||
* Can either be a value or track another `MotionValue`.
|
||||
*
|
||||
* ```jsx
|
||||
* const x = motionValue(0)
|
||||
* const y = springValue(x, { stiffness: 300 })
|
||||
* ```
|
||||
*
|
||||
* @param source - Initial value or MotionValue to track
|
||||
* @param options - Spring configuration options
|
||||
* @returns `MotionValue`
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
function springValue(source, options) {
|
||||
return followValue(source, { type: "spring", ...options });
|
||||
}
|
||||
/**
|
||||
* Attach a spring animation to a MotionValue that will animate whenever the value changes.
|
||||
*
|
||||
* @param value - The MotionValue to animate
|
||||
* @param source - Initial value or MotionValue to track
|
||||
* @param options - Spring configuration options
|
||||
* @returns Cleanup function
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
function attachSpring(value, source, options) {
|
||||
return attachFollow(value, source, { type: "spring", ...options });
|
||||
}
|
||||
|
||||
export { attachSpring, springValue };
|
||||
//# sourceMappingURL=spring-value.mjs.map
|
||||
Reference in New Issue
Block a user