motion 10.4.0 → 10.5.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/README.md +0 -19
  2. package/dist/main.cjs.js +11 -13
  3. package/dist/main.es.js +7 -6
  4. package/dist/motion.min.js +1 -1
  5. package/dist/motion.umd.js +8 -1292
  6. package/dist/size-index.js +1 -0
  7. package/lib/index.js +5 -0
  8. package/lib/index.js.map +1 -0
  9. package/package.json +5 -138
  10. package/types/index.d.ts +3 -7
  11. package/types/index.d.ts.map +1 -0
  12. package/CHANGELOG.md +0 -103
  13. package/LICENSE +0 -21
  14. package/dist/react.cjs.js +0 -9
  15. package/dist/react.es.js +0 -1
  16. package/dist/size-animate-dom.js +0 -1
  17. package/dist/size-animate-style.js +0 -1
  18. package/dist/size-react.js +0 -1
  19. package/dist/size-spring.js +0 -1
  20. package/dist/size-timeline-dom.js +0 -1
  21. package/dist/size-webpack-animate.js +0 -1
  22. package/dist/targets/dom/animate-style.cjs.js +0 -182
  23. package/dist/targets/dom/animate-style.es.js +0 -178
  24. package/dist/targets/dom/animate.cjs.js +0 -42
  25. package/dist/targets/dom/animate.es.js +0 -38
  26. package/dist/targets/dom/data.cjs.js +0 -18
  27. package/dist/targets/dom/data.es.js +0 -14
  28. package/dist/targets/dom/style.cjs.js +0 -22
  29. package/dist/targets/dom/style.es.js +0 -18
  30. package/dist/targets/dom/timeline/index.cjs.js +0 -190
  31. package/dist/targets/dom/timeline/index.es.js +0 -185
  32. package/dist/targets/dom/timeline/utils/calc-time.cjs.js +0 -23
  33. package/dist/targets/dom/timeline/utils/calc-time.es.js +0 -19
  34. package/dist/targets/dom/timeline/utils/edit.cjs.js +0 -36
  35. package/dist/targets/dom/timeline/utils/edit.es.js +0 -31
  36. package/dist/targets/dom/timeline/utils/sort.cjs.js +0 -14
  37. package/dist/targets/dom/timeline/utils/sort.es.js +0 -10
  38. package/dist/targets/dom/utils/apply.cjs.js +0 -9
  39. package/dist/targets/dom/utils/apply.es.js +0 -4
  40. package/dist/targets/dom/utils/controls.cjs.js +0 -59
  41. package/dist/targets/dom/utils/controls.es.js +0 -54
  42. package/dist/targets/dom/utils/css-var.cjs.js +0 -29
  43. package/dist/targets/dom/utils/css-var.es.js +0 -23
  44. package/dist/targets/dom/utils/defaults.cjs.js +0 -13
  45. package/dist/targets/dom/utils/defaults.es.js +0 -9
  46. package/dist/targets/dom/utils/easing.cjs.js +0 -18
  47. package/dist/targets/dom/utils/easing.es.js +0 -10
  48. package/dist/targets/dom/utils/feature-detection.cjs.js +0 -31
  49. package/dist/targets/dom/utils/feature-detection.es.js +0 -27
  50. package/dist/targets/dom/utils/get-style-name.cjs.js +0 -13
  51. package/dist/targets/dom/utils/get-style-name.es.js +0 -9
  52. package/dist/targets/dom/utils/keyframes.cjs.js +0 -16
  53. package/dist/targets/dom/utils/keyframes.es.js +0 -11
  54. package/dist/targets/dom/utils/options.cjs.js +0 -13
  55. package/dist/targets/dom/utils/options.es.js +0 -9
  56. package/dist/targets/dom/utils/resolve-elements.cjs.js +0 -22
  57. package/dist/targets/dom/utils/resolve-elements.es.js +0 -18
  58. package/dist/targets/dom/utils/stop-animation.cjs.js +0 -19
  59. package/dist/targets/dom/utils/stop-animation.es.js +0 -15
  60. package/dist/targets/dom/utils/time.cjs.js +0 -7
  61. package/dist/targets/dom/utils/time.es.js +0 -3
  62. package/dist/targets/dom/utils/transforms.cjs.js +0 -85
  63. package/dist/targets/dom/utils/transforms.es.js +0 -74
  64. package/dist/targets/js/NumberAnimation.cjs.js +0 -144
  65. package/dist/targets/js/NumberAnimation.es.js +0 -140
  66. package/dist/targets/js/easing/cubic-bezier.cjs.js +0 -57
  67. package/dist/targets/js/easing/cubic-bezier.es.js +0 -53
  68. package/dist/targets/js/easing/glide/generator.cjs.js +0 -99
  69. package/dist/targets/js/easing/glide/generator.es.js +0 -95
  70. package/dist/targets/js/easing/glide/index.cjs.js +0 -10
  71. package/dist/targets/js/easing/glide/index.es.js +0 -6
  72. package/dist/targets/js/easing/spring/generator.cjs.js +0 -64
  73. package/dist/targets/js/easing/spring/generator.es.js +0 -57
  74. package/dist/targets/js/easing/spring/index.cjs.js +0 -10
  75. package/dist/targets/js/easing/spring/index.es.js +0 -6
  76. package/dist/targets/js/easing/steps.cjs.js +0 -15
  77. package/dist/targets/js/easing/steps.es.js +0 -11
  78. package/dist/targets/js/easing/utils/create-generator-easing.cjs.js +0 -71
  79. package/dist/targets/js/easing/utils/create-generator-easing.es.js +0 -67
  80. package/dist/targets/js/easing/utils/get-function.cjs.js +0 -37
  81. package/dist/targets/js/easing/utils/get-function.es.js +0 -33
  82. package/dist/targets/js/easing/utils/has-reached-target.cjs.js +0 -10
  83. package/dist/targets/js/easing/utils/has-reached-target.es.js +0 -6
  84. package/dist/targets/js/easing/utils/pregenerate-keyframes.cjs.js +0 -34
  85. package/dist/targets/js/easing/utils/pregenerate-keyframes.es.js +0 -30
  86. package/dist/targets/js/utils/get-easing.cjs.js +0 -14
  87. package/dist/targets/js/utils/get-easing.es.js +0 -10
  88. package/dist/targets/js/utils/interpolate.cjs.js +0 -35
  89. package/dist/targets/js/utils/interpolate.es.js +0 -31
  90. package/dist/targets/js/utils/offset.cjs.js +0 -22
  91. package/dist/targets/js/utils/offset.es.js +0 -17
  92. package/dist/targets/react/animated.cjs.js +0 -126
  93. package/dist/targets/react/animated.es.js +0 -101
  94. package/dist/targets/react/context.cjs.js +0 -9
  95. package/dist/targets/react/context.es.js +0 -5
  96. package/dist/targets/react/hooks/use-animation.cjs.js +0 -47
  97. package/dist/targets/react/hooks/use-animation.es.js +0 -43
  98. package/dist/targets/react/hooks/use-exit.cjs.js +0 -27
  99. package/dist/targets/react/hooks/use-exit.es.js +0 -23
  100. package/dist/targets/react/hooks/use-gesture-state.cjs.js +0 -17
  101. package/dist/targets/react/hooks/use-gesture-state.es.js +0 -13
  102. package/dist/targets/react/hooks/use-hover.cjs.js +0 -24
  103. package/dist/targets/react/hooks/use-hover.es.js +0 -20
  104. package/dist/targets/react/hooks/use-press.cjs.js +0 -25
  105. package/dist/targets/react/hooks/use-press.es.js +0 -21
  106. package/dist/targets/react/hooks/use-viewport.cjs.js +0 -37
  107. package/dist/targets/react/hooks/use-viewport.es.js +0 -33
  108. package/dist/targets/react/index.cjs.js +0 -17
  109. package/dist/targets/react/index.es.js +0 -13
  110. package/dist/targets/react/utils/has-changed.cjs.js +0 -24
  111. package/dist/targets/react/utils/has-changed.es.js +0 -19
  112. package/dist/targets/react/utils/keyframes.cjs.js +0 -38
  113. package/dist/targets/react/utils/keyframes.es.js +0 -34
  114. package/dist/targets/react/utils/poses.cjs.js +0 -14
  115. package/dist/targets/react/utils/poses.es.js +0 -10
  116. package/dist/targets/react/utils/update-target.cjs.js +0 -20
  117. package/dist/targets/react/utils/update-target.es.js +0 -16
  118. package/dist/utils/array.cjs.js +0 -14
  119. package/dist/utils/array.es.js +0 -9
  120. package/dist/utils/clamp.cjs.js +0 -7
  121. package/dist/utils/clamp.es.js +0 -3
  122. package/dist/utils/is-number.cjs.js +0 -7
  123. package/dist/utils/is-number.es.js +0 -3
  124. package/dist/utils/mix.cjs.js +0 -28
  125. package/dist/utils/mix.es.js +0 -24
  126. package/dist/utils/noop.cjs.js +0 -9
  127. package/dist/utils/noop.es.js +0 -4
  128. package/dist/utils/progress.cjs.js +0 -20
  129. package/dist/utils/progress.es.js +0 -16
  130. package/dist/utils/stagger.cjs.js +0 -38
  131. package/dist/utils/stagger.es.js +0 -32
  132. package/dist/utils/velocity-per-second.cjs.js +0 -15
  133. package/dist/utils/velocity-per-second.es.js +0 -11
  134. package/dist/utils/wrap.cjs.js +0 -10
  135. package/dist/utils/wrap.es.js +0 -6
  136. package/react/package.json +0 -6
  137. package/types/react-entry.d.ts +0 -2
  138. package/types/targets/dom/animate-style.d.ts +0 -2
  139. package/types/targets/dom/animate.d.ts +0 -2
  140. package/types/targets/dom/data.d.ts +0 -2
  141. package/types/targets/dom/style.d.ts +0 -3
  142. package/types/targets/dom/timeline/index.d.ts +0 -15
  143. package/types/targets/dom/timeline/types.d.ts +0 -13
  144. package/types/targets/dom/timeline/utils/calc-time.d.ts +0 -2
  145. package/types/targets/dom/timeline/utils/edit.d.ts +0 -4
  146. package/types/targets/dom/timeline/utils/sort.d.ts +0 -2
  147. package/types/targets/dom/types.d.ts +0 -114
  148. package/types/targets/dom/utils/apply.d.ts +0 -3
  149. package/types/targets/dom/utils/controls.d.ts +0 -12
  150. package/types/targets/dom/utils/css-var.d.ts +0 -3
  151. package/types/targets/dom/utils/defaults.d.ts +0 -8
  152. package/types/targets/dom/utils/easing.d.ts +0 -6
  153. package/types/targets/dom/utils/feature-detection.d.ts +0 -8
  154. package/types/targets/dom/utils/get-style-name.d.ts +0 -1
  155. package/types/targets/dom/utils/keyframes.d.ts +0 -3
  156. package/types/targets/dom/utils/options.d.ts +0 -2
  157. package/types/targets/dom/utils/resolve-elements.d.ts +0 -4
  158. package/types/targets/dom/utils/stop-animation.d.ts +0 -6
  159. package/types/targets/dom/utils/time.d.ts +0 -1
  160. package/types/targets/dom/utils/transforms.d.ts +0 -20
  161. package/types/targets/js/NumberAnimation.d.ts +0 -24
  162. package/types/targets/js/easing/cubic-bezier.d.ts +0 -1
  163. package/types/targets/js/easing/glide/generator.d.ts +0 -5
  164. package/types/targets/js/easing/glide/index.d.ts +0 -2
  165. package/types/targets/js/easing/glide/types.d.ts +0 -14
  166. package/types/targets/js/easing/spring/generator.d.ts +0 -6
  167. package/types/targets/js/easing/spring/index.d.ts +0 -2
  168. package/types/targets/js/easing/spring/types.d.ts +0 -10
  169. package/types/targets/js/easing/steps.d.ts +0 -3
  170. package/types/targets/js/easing/utils/create-generator-easing.d.ts +0 -3
  171. package/types/targets/js/easing/utils/get-function.d.ts +0 -3
  172. package/types/targets/js/easing/utils/has-reached-target.d.ts +0 -1
  173. package/types/targets/js/easing/utils/pregenerate-keyframes.d.ts +0 -7
  174. package/types/targets/js/types.d.ts +0 -12
  175. package/types/targets/js/utils/get-easing.d.ts +0 -1
  176. package/types/targets/js/utils/interpolate.d.ts +0 -2
  177. package/types/targets/js/utils/offset.d.ts +0 -2
  178. package/types/targets/react/animated.d.ts +0 -3
  179. package/types/targets/react/context.d.ts +0 -3
  180. package/types/targets/react/hooks/use-animation.d.ts +0 -4
  181. package/types/targets/react/hooks/use-exit.d.ts +0 -3
  182. package/types/targets/react/hooks/use-gesture-state.d.ts +0 -4
  183. package/types/targets/react/hooks/use-hover.d.ts +0 -4
  184. package/types/targets/react/hooks/use-press.d.ts +0 -4
  185. package/types/targets/react/hooks/use-viewport.d.ts +0 -4
  186. package/types/targets/react/index.d.ts +0 -2
  187. package/types/targets/react/types.d.ts +0 -108
  188. package/types/targets/react/utils/has-changed.d.ts +0 -2
  189. package/types/targets/react/utils/keyframes.d.ts +0 -3
  190. package/types/targets/react/utils/poses.d.ts +0 -2
  191. package/types/targets/react/utils/supported-elements.d.ts +0 -8
  192. package/types/targets/react/utils/update-target.d.ts +0 -3
  193. package/types/utils/array.d.ts +0 -2
  194. package/types/utils/clamp.d.ts +0 -1
  195. package/types/utils/interpolate.d.ts +0 -0
  196. package/types/utils/is-number.d.ts +0 -1
  197. package/types/utils/mix.d.ts +0 -1
  198. package/types/utils/noop.d.ts +0 -2
  199. package/types/utils/progress.d.ts +0 -1
  200. package/types/utils/stagger.d.ts +0 -12
  201. package/types/utils/value-types.d.ts +0 -0
  202. package/types/utils/velocity-per-second.d.ts +0 -1
  203. package/types/utils/wrap.d.ts +0 -1
@@ -1,2 +0,0 @@
1
- import { NextTime } from "../types";
2
- export declare function calcNextTime(current: number, next: NextTime, prev: number, labels: Map<string, number>): number;
@@ -1,4 +0,0 @@
1
- import { Easing, UnresolvedValueKeyframe } from "../../types";
2
- import { ValueSequence } from "../types";
3
- export declare function eraseKeyframes(sequence: ValueSequence, startTime: number, endTime: number): void;
4
- export declare function addKeyframes(sequence: ValueSequence, keyframes: UnresolvedValueKeyframe[], easing: Easing | Easing[], offset: number[], startTime: number, endTime: number): void;
@@ -1,2 +0,0 @@
1
- import { AbsoluteKeyframe } from "../types";
2
- export declare function compareByTime(a: AbsoluteKeyframe, b: AbsoluteKeyframe): number;
@@ -1,114 +0,0 @@
1
- import { OptionResolver } from "../../utils/stagger";
2
- import { AnimationGenerator, AnimationGeneratorState } from "../js/types";
3
- import { NextTime } from "./timeline/types";
4
- export interface AnimationData {
5
- transforms: string[];
6
- animations: {
7
- [key: string]: BasicAnimationControls | undefined;
8
- };
9
- generators: {
10
- [key: string]: AnimationGenerator | undefined;
11
- };
12
- prevGeneratorState: {
13
- [key: string]: AnimationGeneratorState | undefined;
14
- };
15
- }
16
- export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
17
- export declare type AcceptedElements = Element | Element[] | NodeListOf<Element> | string;
18
- export declare type BezierDefinition = [number, number, number, number];
19
- export interface CSSStyleDeclarationWithTransform extends Omit<CSSStyleDeclaration, "direction"> {
20
- x: number;
21
- y: number;
22
- z: number;
23
- rotateX: number;
24
- rotateY: number;
25
- rotateZ: number;
26
- scaleX: number;
27
- scaleY: number;
28
- scaleZ: number;
29
- skewX: number;
30
- skewY: number;
31
- }
32
- export declare type StyleAnimationOptions = {
33
- [K in keyof CSSStyleDeclarationWithTransform]?: AnimationOptions;
34
- };
35
- export declare type VariableAnimationOptions = {
36
- [key: `--${string}`]: AnimationOptions;
37
- };
38
- export declare type AnimationOptionsWithOverrides = StyleAnimationOptions & VariableAnimationOptions & AnimationOptions;
39
- export declare type ValueKeyframe = string | number;
40
- export declare type UnresolvedValueKeyframe = ValueKeyframe | null;
41
- export declare type ValueKeyframesDefinition = ValueKeyframe | ValueKeyframe[] | UnresolvedValueKeyframe[];
42
- export declare type StyleKeyframes = {
43
- [K in keyof CSSStyleDeclarationWithTransform]?: ValueKeyframe | ValueKeyframe[];
44
- };
45
- export declare type VariableKeyframes = {
46
- [key: `--${string}`]: ValueKeyframe | ValueKeyframe[];
47
- };
48
- export declare type MotionKeyframes = StyleKeyframes & VariableKeyframes;
49
- export declare type StyleKeyframesDefinition = {
50
- [K in keyof CSSStyleDeclarationWithTransform]?: ValueKeyframesDefinition;
51
- };
52
- export declare type VariableKeyframesDefinition = {
53
- [key: `--${string}`]: ValueKeyframesDefinition;
54
- };
55
- export declare type MotionKeyframesDefinition = StyleKeyframesDefinition & VariableKeyframesDefinition;
56
- export declare type CustomAnimationSettings = {
57
- easing: Easing;
58
- keyframes?: number[];
59
- duration?: number;
60
- };
61
- export declare type CustomEasing = {
62
- createAnimation: (keyframes: UnresolvedValueKeyframe[], getOrigin: () => string, isTransform: boolean, name?: string, data?: AnimationData) => CustomAnimationSettings;
63
- };
64
- export declare type Easing = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "steps-start" | "steps-end" | `steps(${number}, ${"start" | "end"})` | BezierDefinition;
65
- export declare type KeyframeOptions = {
66
- duration?: number;
67
- easing?: CustomEasing | Easing | Easing[];
68
- offset?: number[];
69
- };
70
- export declare type PlaybackOptions = {
71
- delay?: number;
72
- endDelay?: number;
73
- repeat?: number;
74
- direction?: "normal" | "reverse" | "alternate" | "alternate-reverse";
75
- };
76
- export declare type AnimationOptions = KeyframeOptions & PlaybackOptions & {
77
- allowWebkitAcceleration?: boolean;
78
- };
79
- export interface AnimationWithCommitStyles extends Animation {
80
- commitStyles: () => void;
81
- }
82
- export declare type PlayState = "idle" | "running" | "paused" | "finished";
83
- export interface BasicAnimationControls {
84
- pause: () => void;
85
- play: () => void;
86
- commitStyles: () => void;
87
- cancel: () => void;
88
- playState: PlayState;
89
- }
90
- export declare type AnimationListOptions = Omit<AnimationOptionsWithOverrides, "delay"> & {
91
- delay?: number | OptionResolver<number>;
92
- at?: NextTime;
93
- };
94
- export interface AnimationControls {
95
- play: VoidFunction;
96
- pause: VoidFunction;
97
- stop: VoidFunction;
98
- finish: VoidFunction;
99
- reverse: VoidFunction;
100
- cancel: VoidFunction;
101
- finished: Promise<any>;
102
- currentTime: number | null;
103
- duration: number;
104
- playbackRate: number;
105
- }
106
- export interface CssPropertyDefinition {
107
- syntax: `<${string}>`;
108
- initialValue: string | number;
109
- toDefaultUnit: (v: number) => string | number;
110
- }
111
- export declare type CssPropertyDefinitionMap = {
112
- [key: string]: CssPropertyDefinition;
113
- };
114
- export declare type AnimationFactory = () => BasicAnimationControls | undefined;
@@ -1,3 +0,0 @@
1
- export declare type RendererFactory = (element: Element, name: string) => (latest: string | number) => void;
2
- export declare const cssVariableRenderer: RendererFactory;
3
- export declare const styleRenderer: RendererFactory;
@@ -1,12 +0,0 @@
1
- import { AnimationControls, AnimationFactory, AnimationWithCommitStyles } from "../types";
2
- interface AnimationState {
3
- animations: AnimationWithCommitStyles[];
4
- duration: number;
5
- finished?: Promise<any>;
6
- }
7
- export declare const createAnimations: (animationFactory: AnimationFactory[], duration: number) => AnimationControls;
8
- export declare const controls: {
9
- get: (target: AnimationState, key: string) => number | Promise<any> | (() => void) | undefined;
10
- set: (target: AnimationState, key: string, value: number) => boolean;
11
- };
12
- export {};
@@ -1,3 +0,0 @@
1
- export declare const isCssVar: (name: string) => boolean;
2
- export declare const registeredProperties: Set<string>;
3
- export declare function registerCssVariable(name: string): void;
@@ -1,8 +0,0 @@
1
- import { Easing } from "../types";
2
- export declare const defaults: {
3
- duration: number;
4
- delay: number;
5
- endDelay: number;
6
- repeat: number;
7
- easing: Easing;
8
- };
@@ -1,6 +0,0 @@
1
- import { BezierDefinition, CustomEasing, Easing } from "../types";
2
- export declare const isCubicBezier: (easing: Easing | Easing[]) => easing is BezierDefinition;
3
- export declare const isEasingList: (easing: Easing | Easing[]) => easing is Easing[];
4
- export declare const isCustomEasing: (easing: Easing | Easing[] | CustomEasing) => easing is CustomEasing;
5
- export declare const convertEasing: (easing: Easing) => string;
6
- export declare const cubicBezierAsString: ([a, b, c, d]: BezierDefinition) => string;
@@ -1,8 +0,0 @@
1
- interface FeatureTests {
2
- cssRegisterProperty: () => boolean;
3
- waapi: () => boolean;
4
- partialKeyframes: () => boolean;
5
- finished: () => boolean;
6
- }
7
- export declare const supports: FeatureTests;
8
- export {};
@@ -1 +0,0 @@
1
- export declare function getStyleName(key: string): string;
@@ -1,3 +0,0 @@
1
- import { UnresolvedValueKeyframe, ValueKeyframe } from "../types";
2
- export declare function hydrateKeyframes(keyframes: UnresolvedValueKeyframe[], readInitialValue: () => string | number): ValueKeyframe[];
3
- export declare const keyframesList: (keyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]) => UnresolvedValueKeyframe[];
@@ -1,2 +0,0 @@
1
- import { AnimationListOptions, AnimationOptions, AnimationOptionsWithOverrides } from "../types";
2
- export declare const getOptions: (options: AnimationOptionsWithOverrides | AnimationListOptions, key: string) => AnimationOptions;
@@ -1,4 +0,0 @@
1
- import { AcceptedElements } from "../types";
2
- export declare function resolveElements(elements: AcceptedElements, selectorCache?: {
3
- [key: string]: NodeListOf<Element>;
4
- }): Element[];
@@ -1,6 +0,0 @@
1
- import { BasicAnimationControls } from "../types";
2
- export interface WithCommitStyles {
3
- commitStyles: VoidFunction;
4
- cancel: VoidFunction;
5
- }
6
- export declare function stopAnimation(animation?: BasicAnimationControls): void;
@@ -1 +0,0 @@
1
- export declare const ms: (seconds: number) => number;
@@ -1,20 +0,0 @@
1
- import { CssPropertyDefinition } from "../types";
2
- /**
3
- * A list of all transformable axes. We'll use this list to generated a version
4
- * of each axes for each transform.
5
- */
6
- export declare const axes: string[];
7
- export declare const transformAlias: {
8
- x: string;
9
- y: string;
10
- z: string;
11
- };
12
- export declare const transformDefinitions: Map<string, CssPropertyDefinition>;
13
- export declare const asTransformCssVar: (name: string) => string;
14
- /**
15
- * A function to use with Array.sort to sort transform keys by their default order.
16
- */
17
- export declare const compareTransformOrder: (a: string, b: string) => number;
18
- export declare const isTransform: (name: string) => boolean;
19
- export declare const addTransformToElement: (element: HTMLElement, name: string) => void;
20
- export declare const buildTransformTemplate: (transforms: string[]) => string;
@@ -1,24 +0,0 @@
1
- import { AnimationControls, AnimationOptions } from "../dom/types";
2
- export declare class NumberAnimation implements Omit<AnimationControls, "stop" | "duration"> {
3
- private resolve;
4
- private reject;
5
- private startTime;
6
- private pauseTime;
7
- private rate;
8
- private tick;
9
- private t;
10
- private cancelTimestamp;
11
- playState: AnimationPlayState;
12
- constructor(output: (v: number) => void, keyframes?: number[], { easing, duration, delay, endDelay, repeat, offset, direction, }?: AnimationOptions);
13
- finished: Promise<unknown>;
14
- play(): void;
15
- pause(): void;
16
- finish(): void;
17
- cancel(): void;
18
- reverse(): void;
19
- commitStyles(): void;
20
- get currentTime(): number;
21
- set currentTime(t: number);
22
- get playbackRate(): number;
23
- set playbackRate(rate: number);
24
- }
@@ -1 +0,0 @@
1
- export declare function cubicBezier(mX1: number, mY1: number, mX2: number, mY2: number): (t: number) => number;
@@ -1,5 +0,0 @@
1
- import { GlideOptions } from "./types";
2
- import { AnimationGeneratorState } from "../../types";
3
- export declare const createGlideGenerator: ({ from, velocity, power, decay, bounceDamping, bounceStiffness, changeTarget, min, max, restDistance, restSpeed, }: GlideOptions) => {
4
- next: (t: number) => AnimationGeneratorState;
5
- };
@@ -1,2 +0,0 @@
1
- import { GlideOptions } from "./types";
2
- export declare const glide: (options?: GlideOptions) => import("../../../..").CustomEasing;
@@ -1,14 +0,0 @@
1
- export interface GlideOptions {
2
- power?: number;
3
- decay?: number;
4
- changeTarget?: (v: number) => number;
5
- max?: number;
6
- min?: number;
7
- bounceDamping?: number;
8
- bounceStiffness?: number;
9
- restSpeed?: number;
10
- restDistance?: number;
11
- from?: number;
12
- to?: number;
13
- velocity?: number;
14
- }
@@ -1,6 +0,0 @@
1
- import { AnimationGenerator } from "../../types";
2
- import { SpringOptions } from "./types";
3
- export declare const calcDampingRatio: (stiffness?: number, damping?: number, mass?: number) => number;
4
- export declare const calcAngularFreq: (undampedFreq: number, dampingRatio: number) => number;
5
- export declare const createSpringGenerator: ({ stiffness, damping, mass, from, to, velocity, restSpeed, restDistance, }?: SpringOptions) => AnimationGenerator;
6
- export declare function calcVelocity(resolveValue: (v: number) => number, t: number, current: number): number;
@@ -1,2 +0,0 @@
1
- import { SpringOptions } from "./types";
2
- export declare const spring: (options?: SpringOptions) => import("../../../..").CustomEasing;
@@ -1,10 +0,0 @@
1
- export interface SpringOptions {
2
- stiffness?: number;
3
- damping?: number;
4
- mass?: number;
5
- restSpeed?: number;
6
- restDistance?: number;
7
- from?: number;
8
- to?: number;
9
- velocity?: number;
10
- }
@@ -1,3 +0,0 @@
1
- import { EasingFunction } from "../types";
2
- export declare type Direction = "start" | "end";
3
- export declare const steps: (steps: number, direction?: Direction) => EasingFunction;
@@ -1,3 +0,0 @@
1
- import { CustomEasing } from "../../../..";
2
- import { AnimationGeneratorFactory } from "../../types";
3
- export declare function createGeneratorEasing<Options extends {} = {}>(createGenerator: AnimationGeneratorFactory<Options>): (options?: Options) => CustomEasing;
@@ -1,3 +0,0 @@
1
- import { Easing } from "../../../dom/types";
2
- import { EasingFunction } from "../../types";
3
- export declare function getEasingFunction(definition: Easing | EasingFunction): EasingFunction;
@@ -1 +0,0 @@
1
- export declare function hasReachedTarget(origin: number, target: number, current: number): boolean;
@@ -1,7 +0,0 @@
1
- import { AnimationGenerator } from "../../types";
2
- export interface KeyframesMetadata {
3
- keyframes: number[];
4
- duration: number;
5
- overshootDuration: number;
6
- }
7
- export declare function pregenerateKeyframes(generator: AnimationGenerator): KeyframesMetadata;
@@ -1,12 +0,0 @@
1
- export declare type EasingFunction = (v: number) => number;
2
- export declare type AnimationGeneratorState = {
3
- value: number;
4
- target: number;
5
- done: boolean;
6
- velocity: number;
7
- hasReachedTarget: boolean;
8
- };
9
- export declare type AnimationGenerator = {
10
- next: (t: number) => AnimationGeneratorState;
11
- };
12
- export declare type AnimationGeneratorFactory<Options> = (options: Options) => AnimationGenerator;
@@ -1 +0,0 @@
1
- export declare function getEasingForSegment<T>(easing: T | T[], i: number): any;
@@ -1,2 +0,0 @@
1
- import { EasingFunction } from "../types";
2
- export declare function slowInterpolateNumbers(output: number[], input?: number[], easing?: EasingFunction | EasingFunction[]): (t: number) => number;
@@ -1,2 +0,0 @@
1
- export declare function fillOffset(offset: number[], remaining: number): void;
2
- export declare function defaultOffset(length: number): number[];
@@ -1,3 +0,0 @@
1
- import * as React from "react";
2
- import { AnimatedProps } from "./types";
3
- export declare function createAnimatedComponent<Props extends {}>(Component: string): React.ForwardRefExoticComponent<React.PropsWithoutRef<Props & AnimatedProps> & React.RefAttributes<Element>>;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { AnimationContextProps } from "./types";
3
- export declare const AnimationContext: import("react").Context<AnimationContextProps>;
@@ -1,4 +0,0 @@
1
- import { AnimationOptionsWithOverrides, MotionKeyframes } from "../../dom/types";
2
- import { AnimationCallback, MotionCSSProperties } from "../types";
3
- import { RefObject } from "react";
4
- export declare function useAnimation(ref: RefObject<HTMLElement>, initial: MotionKeyframes | MotionCSSProperties, target: MotionKeyframes, options: AnimationOptionsWithOverrides, onStart?: AnimationCallback, onComplete?: AnimationCallback): void;
@@ -1,3 +0,0 @@
1
- import { AnimationOptionsWithOverrides, MotionKeyframes } from "../../dom/types";
2
- import { AnimatedProps, AnimationContextProps } from "../types";
3
- export declare function useExit(target: MotionKeyframes, options: AnimationOptionsWithOverrides, { exit, poses }: AnimatedProps, { exit: inheritedExit }: AnimationContextProps): import("framer-motion/types/components/AnimatePresence/use-presence").SafeToRemove | null | undefined;
@@ -1,4 +0,0 @@
1
- import { Dispatch, SetStateAction } from "react";
2
- import { AnimationOptionsWithOverrides, MotionKeyframes } from "../../dom/types";
3
- import { Poses } from "../types";
4
- export declare function useGestureState(target: MotionKeyframes, options: AnimationOptionsWithOverrides, stylesToApply?: MotionKeyframes | string, inheritedPose?: string, poses?: Poses): [boolean, Dispatch<SetStateAction<boolean>>];
@@ -1,4 +0,0 @@
1
- import { HTMLProps } from "react";
2
- import { AnimationOptionsWithOverrides, MotionKeyframes } from "../../dom/types";
3
- import { AnimatedProps, AnimationContextProps, PoseActiveState } from "../types";
4
- export declare function useHover(target: MotionKeyframes, options: AnimationOptionsWithOverrides, { hover, onPointerEnter, onPointerLeave, poses, }: (AnimatedProps & HTMLProps<any>) | undefined, { hover: inheritedHover }: AnimationContextProps, isPoseActive: PoseActiveState): HTMLProps<any>;
@@ -1,4 +0,0 @@
1
- import { HTMLProps } from "react";
2
- import { AnimationOptionsWithOverrides, MotionKeyframes } from "../../dom/types";
3
- import { AnimatedProps, AnimationContextProps, PoseActiveState } from "../types";
4
- export declare function usePress(target: MotionKeyframes, options: AnimationOptionsWithOverrides, { press, onPointerDown, poses }: (AnimatedProps & HTMLProps<any>) | undefined, { press: inheritedPress }: AnimationContextProps, isPoseActive: PoseActiveState): HTMLProps<any>;
@@ -1,4 +0,0 @@
1
- import { RefObject } from "react";
2
- import { AnimationOptionsWithOverrides, MotionKeyframes } from "../../dom/types";
3
- import { AnimatedProps, AnimationContextProps, PoseActiveState } from "../types";
4
- export declare function useViewport(ref: RefObject<Element>, target: MotionKeyframes, options: AnimationOptionsWithOverrides, { inViewport, poses, viewport, onViewportEnter, onViewportLeave, }: AnimatedProps, { inViewport: inheritedInViewport }: AnimationContextProps, isPoseActive: PoseActiveState): void;
@@ -1,2 +0,0 @@
1
- import { AnimatedDOMComponents } from "./types";
2
- export declare const animated: AnimatedDOMComponents;
@@ -1,108 +0,0 @@
1
- import { CSSProperties, DetailedHTMLFactory, ForwardRefExoticComponent, HTMLAttributes, PropsWithoutRef, ReactHTML, RefAttributes, RefObject, SVGAttributes } from "react";
2
- import { AnimationOptions, AnimationOptionsWithOverrides, MotionKeyframes } from "../dom/types";
3
- import { svgElements, htmlElements } from "./utils/supported-elements";
4
- export declare type AnimationCallback = (target: MotionKeyframes) => void;
5
- export interface CSSPropertiesWithTransform extends CSSProperties {
6
- x?: number | string;
7
- y?: number | string;
8
- z?: number;
9
- rotateX?: number | string;
10
- rotateY?: number | string;
11
- rotateZ?: number | string;
12
- scaleX?: number;
13
- scaleY?: number;
14
- scaleZ?: number;
15
- skewX?: number;
16
- skewY?: number;
17
- }
18
- export declare type CSSVariables = {
19
- [key: `--${string}`]: string | number;
20
- };
21
- export declare type MotionKeyframesWithOptions = MotionKeyframes & {
22
- options?: AnimationOptionsWithOverrides;
23
- };
24
- export declare type MotionCSSProperties = CSSPropertiesWithTransform & CSSVariables;
25
- export declare type Poses = {
26
- [key: string]: MotionKeyframesWithOptions;
27
- };
28
- export interface ViewportOptions {
29
- root?: RefObject<Element>;
30
- once?: boolean;
31
- margin?: string;
32
- threshold?: number;
33
- }
34
- export interface AnimatedProps {
35
- initial?: MotionCSSProperties | string;
36
- style?: MotionKeyframesWithOptions | string;
37
- hover?: MotionKeyframesWithOptions | string;
38
- press?: MotionKeyframesWithOptions | string;
39
- exit?: MotionKeyframesWithOptions | string;
40
- inViewport?: MotionKeyframesWithOptions | string;
41
- inherit?: boolean;
42
- poses?: Poses;
43
- viewport?: ViewportOptions;
44
- options?: AnimationOptions;
45
- onStart?: AnimationCallback;
46
- onComplete?: AnimationCallback;
47
- onViewportEnter?: (entry: IntersectionObserverEntry) => void;
48
- onViewportLeave?: (entry: IntersectionObserverEntry) => void;
49
- }
50
- export declare type PoseProps = {
51
- initial?: boolean;
52
- style?: boolean;
53
- hover?: boolean;
54
- press?: boolean;
55
- exit?: boolean;
56
- inViewport?: boolean;
57
- };
58
- export declare type AnimationContextProps = {
59
- [K in keyof PoseProps]?: string;
60
- };
61
- export declare type PoseActiveState = {
62
- [K in keyof PoseProps]?: boolean;
63
- };
64
- declare type UnionStringArray<T extends Readonly<string[]>> = T[number];
65
- export declare type HTMLElements = UnionStringArray<typeof htmlElements>;
66
- export declare type SVGElements = UnionStringArray<typeof svgElements>;
67
- /**
68
- * @public
69
- */
70
- export declare type ForwardRefComponent<T, P> = ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
71
- /**
72
- * Support for React component props
73
- */
74
- declare type UnwrapFactoryAttributes<F> = F extends DetailedHTMLFactory<infer P, any> ? P : never;
75
- declare type UnwrapFactoryElement<F> = F extends DetailedHTMLFactory<any, infer P> ? P : never;
76
- declare type HTMLAttributesWithoutAnimatedProps<Attributes extends HTMLAttributes<Element>, Element extends HTMLElement> = {
77
- [K in Exclude<keyof Attributes, keyof AnimatedProps>]?: Attributes[K];
78
- };
79
- /**
80
- * @public
81
- */
82
- export declare type AnimatedHTMLProps<TagName extends keyof ReactHTML> = HTMLAttributesWithoutAnimatedProps<UnwrapFactoryAttributes<ReactHTML[TagName]>, UnwrapFactoryElement<ReactHTML[TagName]>> & AnimatedProps;
83
- /**
84
- * Motion-optimised versions of React's HTML components.
85
- *
86
- * @public
87
- */
88
- export declare type AnimatedHTMLComponents = {
89
- [K in HTMLElements]: ForwardRefComponent<UnwrapFactoryElement<ReactHTML[K]>, AnimatedHTMLProps<K>>;
90
- };
91
- interface SVGAttributesWithoutAnimatedProps<T> extends Pick<SVGAttributes<T>, Exclude<keyof SVGAttributes<T>, keyof AnimatedProps>> {
92
- }
93
- declare type UnwrapSVGFactoryElement<F> = F extends React.SVGProps<infer P> ? P : never;
94
- /**
95
- * @public
96
- */
97
- export interface AnimatedSVGProps<T> extends SVGAttributesWithoutAnimatedProps<T>, AnimatedProps {
98
- }
99
- /**
100
- * Motion-optimised versions of React's SVG components.
101
- *
102
- * @public
103
- */
104
- export declare type AnimatedSVGComponents = {
105
- [K in SVGElements]: ForwardRefComponent<UnwrapSVGFactoryElement<JSX.IntrinsicElements[K]>, AnimatedSVGProps<UnwrapSVGFactoryElement<JSX.IntrinsicElements[K]>>>;
106
- };
107
- export declare type AnimatedDOMComponents = AnimatedHTMLComponents & AnimatedSVGComponents;
108
- export {};
@@ -1,2 +0,0 @@
1
- export declare function hasChanged(a: any, b: any): boolean;
2
- export declare function shallowCompare(next: any[], prev: any[]): boolean;
@@ -1,3 +0,0 @@
1
- import { MotionKeyframes } from "../../dom/types";
2
- import { MotionCSSProperties } from "../types";
3
- export declare function convertKeyframesToStyles(keyframes?: MotionKeyframes): MotionCSSProperties;
@@ -1,2 +0,0 @@
1
- import { MotionKeyframesWithOptions, Poses } from "../types";
2
- export declare function resolvePose(definition?: MotionKeyframesWithOptions | string, inheritedDefinition?: string, poses?: Poses): MotionKeyframesWithOptions | undefined;
@@ -1,8 +0,0 @@
1
- /**
2
- * @internal
3
- */
4
- export declare const htmlElements: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "webview"];
5
- /**
6
- * @internal
7
- */
8
- export declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"];
@@ -1,3 +0,0 @@
1
- import { AnimationOptionsWithOverrides, MotionKeyframes } from "../../dom/types";
2
- import { MotionKeyframesWithOptions } from "../types";
3
- export declare function updateTargetAndOptions(target: MotionKeyframes, options: AnimationOptionsWithOverrides, toApply?: MotionKeyframesWithOptions): void;
@@ -1,2 +0,0 @@
1
- export declare function addUniqueItem<T>(array: T[], item: T): void;
2
- export declare function removeItem<T>(arr: T[], item: T): void;
@@ -1 +0,0 @@
1
- export declare const clamp: (min: number, max: number, v: number) => number;
File without changes
@@ -1 +0,0 @@
1
- export declare const isNumber: (value: unknown) => value is number;
@@ -1 +0,0 @@
1
- export declare const mix: (from: number, to: number, progress: number) => number;
@@ -1,2 +0,0 @@
1
- export declare const noop: () => void;
2
- export declare const noopReturn: <V>(v: V) => V;
@@ -1 +0,0 @@
1
- export declare const progress: (from: number, to: number, value: number) => number;
@@ -1,12 +0,0 @@
1
- import { Easing } from "../targets/dom/types";
2
- import { EasingFunction } from "../targets/js/types";
3
- export declare type From = "first" | "last" | "center" | number;
4
- export declare type StaggerOptions = {
5
- start?: number;
6
- from?: From;
7
- easing?: EasingFunction | Easing;
8
- };
9
- export declare type OptionResolver<T> = (i: number, total: number) => T;
10
- export declare function stagger(duration?: number, { start, from, easing }?: StaggerOptions): OptionResolver<number>;
11
- export declare function getFromIndex(from: From, total: number): number;
12
- export declare function resolveOption<T>(option: T | OptionResolver<T>, i: number, total: number): T;
File without changes
@@ -1 +0,0 @@
1
- export declare function velocityPerSecond(velocity: number, frameDuration: number): number;
@@ -1 +0,0 @@
1
- export declare const wrap: (min: number, max: number, v: number) => number;