framer-motion 6.3.11 → 6.3.12

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 (230) hide show
  1. package/dist/cjs/index.js +2 -20
  2. package/dist/es/animation/use-animated-state.mjs +0 -1
  3. package/dist/es/animation/utils/transitions.mjs +0 -2
  4. package/dist/es/context/DeprecatedLayoutGroupContext.mjs +0 -1
  5. package/dist/es/context/LayoutGroupContext.mjs +0 -3
  6. package/dist/es/motion/index.mjs +0 -2
  7. package/dist/es/render/utils/animation.mjs +0 -3
  8. package/dist/es/render/utils/motion-values.mjs +1 -1
  9. package/dist/es/value/index.mjs +1 -4
  10. package/dist/es/value/use-inverted-scale.mjs +0 -1
  11. package/dist/es/value/utils/resolve-motion-value.mjs +0 -2
  12. package/dist/framer-motion.dev.js +2 -20
  13. package/dist/framer-motion.js +1 -1
  14. package/dist/index.d.ts +4118 -0
  15. package/dist/projection.dev.js +2 -9
  16. package/dist/size-rollup-dom-animation.js +1 -1
  17. package/dist/size-rollup-dom-max.js +1 -1
  18. package/dist/three-entry.d.ts +2428 -0
  19. package/package.json +4 -4
  20. package/types/animation/animate.d.ts +0 -54
  21. package/types/animation/animation-controls.d.ts +0 -5
  22. package/types/animation/types.d.ts +0 -79
  23. package/types/animation/use-animated-state.d.ts +0 -6
  24. package/types/animation/use-animation.d.ts +0 -31
  25. package/types/animation/utils/default-transitions.d.ts +0 -19
  26. package/types/animation/utils/easing.d.ts +0 -3
  27. package/types/animation/utils/is-animatable.d.ts +0 -11
  28. package/types/animation/utils/is-animation-controls.d.ts +0 -2
  29. package/types/animation/utils/is-keyframes-target.d.ts +0 -2
  30. package/types/animation/utils/transitions.d.ts +0 -29
  31. package/types/animation/utils/variant-resolvers.d.ts +0 -12
  32. package/types/components/AnimatePresence/PresenceChild.d.ts +0 -12
  33. package/types/components/AnimatePresence/index.d.ts +0 -36
  34. package/types/components/AnimatePresence/types.d.ts +0 -61
  35. package/types/components/AnimatePresence/use-presence.d.ts +0 -52
  36. package/types/components/AnimateSharedLayout.d.ts +0 -2
  37. package/types/components/LayoutGroup/index.d.ts +0 -12
  38. package/types/components/LazyMotion/index.d.ts +0 -38
  39. package/types/components/LazyMotion/types.d.ts +0 -54
  40. package/types/components/MotionConfig/index.d.ts +0 -25
  41. package/types/components/Reorder/Group.d.ts +0 -297
  42. package/types/components/Reorder/Item.d.ts +0 -278
  43. package/types/components/Reorder/index.d.ts +0 -509
  44. package/types/components/Reorder/types.d.ts +0 -10
  45. package/types/components/Reorder/utils/check-reorder.d.ts +0 -2
  46. package/types/context/DeprecatedLayoutGroupContext.d.ts +0 -6
  47. package/types/context/LayoutGroupContext.d.ts +0 -11
  48. package/types/context/LazyContext.d.ts +0 -7
  49. package/types/context/MotionConfigContext.d.ts +0 -36
  50. package/types/context/MotionContext/create.d.ts +0 -3
  51. package/types/context/MotionContext/index.d.ts +0 -9
  52. package/types/context/MotionContext/utils.d.ts +0 -3
  53. package/types/context/PresenceContext.d.ts +0 -17
  54. package/types/context/ReorderContext.d.ts +0 -3
  55. package/types/context/SwitchLayoutGroupContext.d.ts +0 -23
  56. package/types/events/event-info.d.ts +0 -5
  57. package/types/events/types.d.ts +0 -10
  58. package/types/events/use-dom-event.d.ts +0 -24
  59. package/types/events/use-pointer-event.d.ts +0 -4
  60. package/types/events/utils.d.ts +0 -3
  61. package/types/gestures/PanSession.d.ts +0 -127
  62. package/types/gestures/drag/VisualElementDragControls.d.ts +0 -56
  63. package/types/gestures/drag/types.d.ts +0 -294
  64. package/types/gestures/drag/use-drag-controls.d.ts +0 -74
  65. package/types/gestures/drag/use-drag.d.ts +0 -7
  66. package/types/gestures/drag/utils/constraints.d.ts +0 -77
  67. package/types/gestures/drag/utils/lock.d.ts +0 -4
  68. package/types/gestures/types.d.ts +0 -225
  69. package/types/gestures/use-focus-gesture.d.ts +0 -8
  70. package/types/gestures/use-hover-gesture.d.ts +0 -2
  71. package/types/gestures/use-pan-gesture.d.ts +0 -14
  72. package/types/gestures/use-tap-gesture.d.ts +0 -6
  73. package/types/gestures/utils/event-type.d.ts +0 -2
  74. package/types/gestures/utils/is-node-or-child.d.ts +0 -8
  75. package/types/index.d.ts +0 -96
  76. package/types/motion/features/animations.d.ts +0 -2
  77. package/types/motion/features/definitions.d.ts +0 -3
  78. package/types/motion/features/drag.d.ts +0 -2
  79. package/types/motion/features/gestures.d.ts +0 -2
  80. package/types/motion/features/layout/MeasureLayout.d.ts +0 -3
  81. package/types/motion/features/layout/index.d.ts +0 -2
  82. package/types/motion/features/layout/types.d.ts +0 -75
  83. package/types/motion/features/types.d.ts +0 -52
  84. package/types/motion/features/use-features.d.ts +0 -8
  85. package/types/motion/features/use-projection.d.ts +0 -3
  86. package/types/motion/features/viewport/observers.d.ts +0 -3
  87. package/types/motion/features/viewport/types.d.ts +0 -21
  88. package/types/motion/features/viewport/use-viewport.d.ts +0 -2
  89. package/types/motion/index.d.ts +0 -25
  90. package/types/motion/types.d.ts +0 -279
  91. package/types/motion/utils/VisualElementHandler.d.ts +0 -18
  92. package/types/motion/utils/is-forced-motion-value.d.ts +0 -2
  93. package/types/motion/utils/make-renderless-component.d.ts +0 -2
  94. package/types/motion/utils/should-inherit-variant.d.ts +0 -2
  95. package/types/motion/utils/use-motion-ref.d.ts +0 -8
  96. package/types/motion/utils/use-visual-element.d.ts +0 -6
  97. package/types/motion/utils/use-visual-state.d.ts +0 -14
  98. package/types/motion/utils/valid-prop.d.ts +0 -9
  99. package/types/projection/animation/mix-values.d.ts +0 -2
  100. package/types/projection/geometry/conversion.d.ts +0 -14
  101. package/types/projection/geometry/copy.d.ts +0 -13
  102. package/types/projection/geometry/delta-apply.d.ts +0 -37
  103. package/types/projection/geometry/delta-calc.d.ts +0 -10
  104. package/types/projection/geometry/delta-remove.d.ts +0 -20
  105. package/types/projection/geometry/models.d.ts +0 -5
  106. package/types/projection/geometry/types.d.ts +0 -29
  107. package/types/projection/geometry/utils.d.ts +0 -3
  108. package/types/projection/index.d.ts +0 -14
  109. package/types/projection/node/DocumentProjectionNode.d.ts +0 -108
  110. package/types/projection/node/HTMLProjectionNode.d.ts +0 -112
  111. package/types/projection/node/create-projection-node.d.ts +0 -301
  112. package/types/projection/node/group.d.ts +0 -7
  113. package/types/projection/node/id.d.ts +0 -1
  114. package/types/projection/node/types.d.ts +0 -136
  115. package/types/projection/shared/stack.d.ts +0 -17
  116. package/types/projection/styles/scale-border-radius.d.ts +0 -11
  117. package/types/projection/styles/scale-box-shadow.d.ts +0 -2
  118. package/types/projection/styles/scale-correction.d.ts +0 -3
  119. package/types/projection/styles/transform-origin.d.ts +0 -0
  120. package/types/projection/styles/transform.d.ts +0 -4
  121. package/types/projection/styles/types.d.ts +0 -9
  122. package/types/projection/use-instant-layout-transition.d.ts +0 -1
  123. package/types/projection/use-reset-projection.d.ts +0 -1
  124. package/types/projection/utils/each-axis.d.ts +0 -3
  125. package/types/projection/utils/has-transform.d.ts +0 -3
  126. package/types/projection/utils/measure.d.ts +0 -4
  127. package/types/render/dom/create-visual-element.d.ts +0 -2
  128. package/types/render/dom/features-animation.d.ts +0 -5
  129. package/types/render/dom/features-max.d.ts +0 -5
  130. package/types/render/dom/motion-minimal.d.ts +0 -5
  131. package/types/render/dom/motion-proxy.d.ts +0 -30
  132. package/types/render/dom/motion.d.ts +0 -25
  133. package/types/render/dom/types.d.ts +0 -28
  134. package/types/render/dom/use-render.d.ts +0 -4
  135. package/types/render/dom/utils/camel-to-dash.d.ts +0 -4
  136. package/types/render/dom/utils/create-config.d.ts +0 -8
  137. package/types/render/dom/utils/css-variables-conversion.d.ts +0 -22
  138. package/types/render/dom/utils/filter-props.d.ts +0 -4
  139. package/types/render/dom/utils/is-css-variable.d.ts +0 -4
  140. package/types/render/dom/utils/is-svg-component.d.ts +0 -2
  141. package/types/render/dom/utils/parse-dom-variant.d.ts +0 -6
  142. package/types/render/dom/utils/unit-conversion.d.ts +0 -27
  143. package/types/render/dom/value-types/animatable-none.d.ts +0 -1
  144. package/types/render/dom/value-types/defaults.d.ts +0 -9
  145. package/types/render/dom/value-types/dimensions.d.ts +0 -8
  146. package/types/render/dom/value-types/find.d.ts +0 -9
  147. package/types/render/dom/value-types/get-as-type.d.ts +0 -5
  148. package/types/render/dom/value-types/number.d.ts +0 -2
  149. package/types/render/dom/value-types/test.d.ts +0 -5
  150. package/types/render/dom/value-types/type-auto.d.ts +0 -5
  151. package/types/render/dom/value-types/type-int.d.ts +0 -8
  152. package/types/render/dom/value-types/types.d.ts +0 -4
  153. package/types/render/html/config-motion.d.ts +0 -3
  154. package/types/render/html/supported-elements.d.ts +0 -7
  155. package/types/render/html/types.d.ts +0 -61
  156. package/types/render/html/use-props.d.ts +0 -8
  157. package/types/render/html/utils/build-styles.d.ts +0 -5
  158. package/types/render/html/utils/build-transform.d.ts +0 -15
  159. package/types/render/html/utils/create-render-state.d.ts +0 -7
  160. package/types/render/html/utils/render.d.ts +0 -4
  161. package/types/render/html/utils/scrape-motion-values.d.ts +0 -2
  162. package/types/render/html/utils/transform.d.ts +0 -15
  163. package/types/render/html/visual-element.d.ts +0 -6
  164. package/types/render/index.d.ts +0 -2
  165. package/types/render/svg/config-motion.d.ts +0 -3
  166. package/types/render/svg/lowercase-elements.d.ts +0 -5
  167. package/types/render/svg/supported-elements.d.ts +0 -7
  168. package/types/render/svg/types.d.ts +0 -44
  169. package/types/render/svg/use-props.d.ts +0 -7
  170. package/types/render/svg/utils/build-attrs.d.ts +0 -8
  171. package/types/render/svg/utils/camel-case-attrs.d.ts +0 -4
  172. package/types/render/svg/utils/create-render-state.d.ts +0 -2
  173. package/types/render/svg/utils/path.d.ts +0 -9
  174. package/types/render/svg/utils/render.d.ts +0 -4
  175. package/types/render/svg/utils/scrape-motion-values.d.ts +0 -2
  176. package/types/render/svg/utils/transform-origin.d.ts +0 -6
  177. package/types/render/svg/visual-element.d.ts +0 -2
  178. package/types/render/types.d.ts +0 -113
  179. package/types/render/utils/animation-state.d.ts +0 -31
  180. package/types/render/utils/animation.d.ts +0 -21
  181. package/types/render/utils/compare-by-depth.d.ts +0 -5
  182. package/types/render/utils/flat-tree.d.ts +0 -8
  183. package/types/render/utils/is-draggable.d.ts +0 -2
  184. package/types/render/utils/lifecycles.d.ts +0 -114
  185. package/types/render/utils/motion-values.d.ts +0 -3
  186. package/types/render/utils/setters.d.ts +0 -792
  187. package/types/render/utils/types.d.ts +0 -9
  188. package/types/render/utils/variants.d.ts +0 -20
  189. package/types/three-entry.d.ts +0 -19
  190. package/types/types.d.ts +0 -981
  191. package/types/utils/array.d.ts +0 -3
  192. package/types/utils/each-axis.d.ts +0 -1
  193. package/types/utils/is-browser.d.ts +0 -1
  194. package/types/utils/is-numerical-string.d.ts +0 -4
  195. package/types/utils/is-ref-object.d.ts +0 -2
  196. package/types/utils/is-zero-value-string.d.ts +0 -4
  197. package/types/utils/noop.d.ts +0 -1
  198. package/types/utils/process.d.ts +0 -1
  199. package/types/utils/resolve-value.d.ts +0 -3
  200. package/types/utils/shallow-compare.d.ts +0 -1
  201. package/types/utils/subscription-manager.d.ts +0 -9
  202. package/types/utils/time-conversion.d.ts +0 -7
  203. package/types/utils/transform.d.ts +0 -91
  204. package/types/utils/use-animation-frame.d.ts +0 -2
  205. package/types/utils/use-constant.d.ts +0 -10
  206. package/types/utils/use-cycle.d.ts +0 -30
  207. package/types/utils/use-force-update.d.ts +0 -1
  208. package/types/utils/use-id.d.ts +0 -6
  209. package/types/utils/use-instant-transition-state.d.ts +0 -3
  210. package/types/utils/use-instant-transition.d.ts +0 -1
  211. package/types/utils/use-is-mounted.d.ts +0 -2
  212. package/types/utils/use-isomorphic-effect.d.ts +0 -2
  213. package/types/utils/use-reduced-motion.d.ts +0 -28
  214. package/types/utils/use-unmount-effect.d.ts +0 -1
  215. package/types/utils/warn-once.d.ts +0 -2
  216. package/types/value/index.d.ts +0 -260
  217. package/types/value/scroll/use-element-scroll.d.ts +0 -28
  218. package/types/value/scroll/use-viewport-scroll.d.ts +0 -22
  219. package/types/value/scroll/utils.d.ts +0 -19
  220. package/types/value/use-combine-values.d.ts +0 -2
  221. package/types/value/use-inverted-scale.d.ts +0 -28
  222. package/types/value/use-motion-template.d.ts +0 -24
  223. package/types/value/use-motion-value.d.ts +0 -19
  224. package/types/value/use-on-change.d.ts +0 -3
  225. package/types/value/use-spring.d.ts +0 -22
  226. package/types/value/use-time.d.ts +0 -1
  227. package/types/value/use-transform.d.ts +0 -93
  228. package/types/value/use-velocity.d.ts +0 -13
  229. package/types/value/utils/is-motion-value.d.ts +0 -2
  230. package/types/value/utils/resolve-motion-value.d.ts +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-motion",
3
- "version": "6.3.11",
3
+ "version": "6.3.12",
4
4
  "description": "A simple and powerful React animation library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.mjs",
@@ -8,14 +8,14 @@
8
8
  ".": {
9
9
  "require": "./dist/cjs/index.js",
10
10
  "import": {
11
- "types": "./types/index.d.ts",
11
+ "types": "./dist/index.d.ts",
12
12
  "default": "./dist/es/index.mjs"
13
13
  },
14
14
  "default": "./dist/cjs/index.js"
15
15
  },
16
16
  "./package.json": "./package.json"
17
17
  },
18
- "types": "types/index.d.ts",
18
+ "types": "dist/index.d.ts",
19
19
  "author": "Framer",
20
20
  "license": "MIT",
21
21
  "repository": "https://github.com/framer/motion/",
@@ -106,5 +106,5 @@
106
106
  "maxSize": "31.6 kB"
107
107
  }
108
108
  ],
109
- "gitHead": "b12b137e1f57d32b04bfec0eba13789c58e99f58"
109
+ "gitHead": "302ce6a81112c64a332080b87372a7a128f8379d"
110
110
  }
@@ -1,54 +0,0 @@
1
- import { Spring, Tween } from "../types";
2
- import { MotionValue } from "../value";
3
- /**
4
- * @public
5
- */
6
- export interface AnimationPlaybackControls {
7
- stop: () => void;
8
- isAnimating: () => boolean;
9
- }
10
- /**
11
- * @public
12
- */
13
- export interface AnimationPlaybackLifecycles<V> {
14
- onUpdate?: (latest: V) => void;
15
- onPlay?: () => void;
16
- onComplete?: () => void;
17
- onRepeat?: () => void;
18
- onStop?: () => void;
19
- }
20
- /**
21
- * @public
22
- */
23
- export declare type AnimationOptions<V> = (Tween | Spring) & AnimationPlaybackLifecycles<V> & {
24
- delay?: number;
25
- type?: "tween" | "spring";
26
- };
27
- /**
28
- * Animate a single value or a `MotionValue`.
29
- *
30
- * The first argument is either a `MotionValue` to animate, or an initial animation value.
31
- *
32
- * The second is either a value to animate to, or an array of keyframes to animate through.
33
- *
34
- * The third argument can be either tween or spring options, and optional lifecycle methods: `onUpdate`, `onPlay`, `onComplete`, `onRepeat` and `onStop`.
35
- *
36
- * Returns `AnimationPlaybackControls`, currently just a `stop` method.
37
- *
38
- * ```javascript
39
- * const x = useMotionValue(0)
40
- *
41
- * useEffect(() => {
42
- * const controls = animate(x, 100, {
43
- * type: "spring",
44
- * stiffness: 2000,
45
- * onComplete: v => {}
46
- * })
47
- *
48
- * return controls.stop
49
- * })
50
- * ```
51
- *
52
- * @public
53
- */
54
- export declare function animate<V>(from: MotionValue<V> | V, to: V | V[], transition?: AnimationOptions<V>): AnimationPlaybackControls;
@@ -1,5 +0,0 @@
1
- import { AnimationControls } from "./types";
2
- /**
3
- * @public
4
- */
5
- export declare function animationControls(): AnimationControls;
@@ -1,79 +0,0 @@
1
- import { TargetAndTransition, TargetResolver, Transition } from "../types";
2
- import { VisualElement } from "../render/types";
3
- /**
4
- * @public
5
- */
6
- export declare type ControlsAnimationDefinition = string | string[] | TargetAndTransition | TargetResolver;
7
- /**
8
- * @public
9
- */
10
- export declare type PendingAnimations = {
11
- animation: [ControlsAnimationDefinition, Transition | undefined];
12
- resolve: () => void;
13
- };
14
- /**
15
- * @public
16
- */
17
- export interface AnimationControls {
18
- /**
19
- * Subscribes a component's animation controls to this.
20
- *
21
- * @param controls - The controls to subscribe
22
- * @returns An unsubscribe function.
23
- *
24
- * @internal
25
- */
26
- subscribe(visualElement: VisualElement): () => void;
27
- /**
28
- * Starts an animation on all linked components.
29
- *
30
- * @remarks
31
- *
32
- * ```jsx
33
- * controls.start("variantLabel")
34
- * controls.start({
35
- * x: 0,
36
- * transition: { duration: 1 }
37
- * })
38
- * ```
39
- *
40
- * @param definition - Properties or variant label to animate to
41
- * @param transition - Optional `transtion` to apply to a variant
42
- * @returns - A `Promise` that resolves when all animations have completed.
43
- *
44
- * @public
45
- */
46
- start(definition: ControlsAnimationDefinition, transitionOverride?: Transition): Promise<any>;
47
- /**
48
- * Instantly set to a set of properties or a variant.
49
- *
50
- * ```jsx
51
- * // With properties
52
- * controls.set({ opacity: 0 })
53
- *
54
- * // With variants
55
- * controls.set("hidden")
56
- * ```
57
- *
58
- * @internalremarks
59
- * We could perform a similar trick to `.start` where this can be called before mount
60
- * and we maintain a list of of pending actions that get applied on mount. But the
61
- * expectation of `set` is that it happens synchronously and this would be difficult
62
- * to do before any children have even attached themselves. It's also poor practise
63
- * and we should discourage render-synchronous `.start` calls rather than lean into this.
64
- *
65
- * @public
66
- */
67
- set(definition: ControlsAnimationDefinition): void;
68
- /**
69
- * Stops animations on all linked components.
70
- *
71
- * ```jsx
72
- * controls.stop()
73
- * ```
74
- *
75
- * @public
76
- */
77
- stop(): void;
78
- mount(): () => void;
79
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * This is not an officially supported API and may be removed
3
- * on any version.
4
- * @internal
5
- */
6
- export declare function useAnimatedState(initialState: any): any[];
@@ -1,31 +0,0 @@
1
- import { AnimationControls } from "./types";
2
- /**
3
- * Creates `AnimationControls`, which can be used to manually start, stop
4
- * and sequence animations on one or more components.
5
- *
6
- * The returned `AnimationControls` should be passed to the `animate` property
7
- * of the components you want to animate.
8
- *
9
- * These components can then be animated with the `start` method.
10
- *
11
- * ```jsx
12
- * import * as React from 'react'
13
- * import { motion, useAnimation } from 'framer-motion'
14
- *
15
- * export function MyComponent(props) {
16
- * const controls = useAnimation()
17
- *
18
- * controls.start({
19
- * x: 100,
20
- * transition: { duration: 0.5 },
21
- * })
22
- *
23
- * return <motion.div animate={controls} />
24
- * }
25
- * ```
26
- *
27
- * @returns Animation controller with `start` and `stop` methods
28
- *
29
- * @public
30
- */
31
- export declare function useAnimation(): AnimationControls;
@@ -1,19 +0,0 @@
1
- import { PopmotionTransitionProps, ValueTarget, SingleTarget } from "../../types";
2
- export declare const underDampedSpring: () => {
3
- type: string;
4
- stiffness: number;
5
- damping: number;
6
- restSpeed: number;
7
- };
8
- export declare const criticallyDampedSpring: (to: SingleTarget) => {
9
- type: string;
10
- stiffness: number;
11
- damping: number;
12
- restSpeed: number;
13
- };
14
- export declare const linearTween: () => {
15
- type: string;
16
- ease: string;
17
- duration: number;
18
- };
19
- export declare const getDefaultTransition: (valueKey: string, to: ValueTarget) => PopmotionTransitionProps;
@@ -1,3 +0,0 @@
1
- import { Easing } from "../../types";
2
- export declare const easingDefinitionToFunction: (definition: Easing) => import("../../types").EasingFunction;
3
- export declare const isEasingArray: (ease: any) => ease is Easing[];
@@ -1,11 +0,0 @@
1
- import { ResolvedValueTarget } from "../../types";
2
- /**
3
- * Check if a value is animatable. Examples:
4
- *
5
- * ✅: 100, "100px", "#fff"
6
- * ❌: "block", "url(2.jpg)"
7
- * @param value
8
- *
9
- * @internal
10
- */
11
- export declare const isAnimatable: (key: string, value: ResolvedValueTarget) => boolean;
@@ -1,2 +0,0 @@
1
- import { AnimationControls } from "../types";
2
- export declare function isAnimationControls(v?: unknown): v is AnimationControls;
@@ -1,2 +0,0 @@
1
- import { ValueTarget, KeyframesTarget } from "../../types";
2
- export declare const isKeyframesTarget: (v: ValueTarget) => v is KeyframesTarget;
@@ -1,29 +0,0 @@
1
- import { Transition, PermissiveTransitionDefinition, ResolvedValueTarget } from "../../types";
2
- import { AnimationOptions } from "popmotion";
3
- import { MotionValue } from "../../value";
4
- /**
5
- * Decide whether a transition is defined on a given Transition.
6
- * This filters out orchestration options and returns true
7
- * if any options are left.
8
- */
9
- export declare function isTransitionDefined({ when, delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, ...transition }: Transition): boolean;
10
- /**
11
- * Convert Framer Motion's Transition type into Popmotion-compatible options.
12
- */
13
- export declare function convertTransitionToAnimationOptions<T>({ ease, times, yoyo, flip, loop, ...transition }: PermissiveTransitionDefinition): AnimationOptions<T>;
14
- /**
15
- * Get the delay for a value by checking Transition with decreasing specificity.
16
- */
17
- export declare function getDelayFromTransition(transition: Transition, key: string): any;
18
- export declare function hydrateKeyframes(options: PermissiveTransitionDefinition): PermissiveTransitionDefinition;
19
- export declare function getPopmotionAnimationOptions(transition: PermissiveTransitionDefinition, options: any, key: string): any;
20
- export declare function isZero(value: string | number): boolean;
21
- export declare function getZeroUnit(potentialUnitType: string | number): string | number;
22
- export declare function getValueTransition(transition: Transition, key: string): any;
23
- /**
24
- * Start animation on a MotionValue. This function is an interface between
25
- * Framer Motion and Popmotion
26
- *
27
- * @internal
28
- */
29
- export declare function startAnimation(key: string, value: MotionValue, target: ResolvedValueTarget, transition?: Transition): Promise<void>;
@@ -1,12 +0,0 @@
1
- import { MotionValue } from "../../value";
2
- declare type VariantNameList = string[];
3
- declare type VariantName = string | VariantNameList;
4
- declare type UnresolvedVariant = VariantName | MotionValue;
5
- export declare const resolveVariantLabels: (variant?: UnresolvedVariant | undefined) => VariantNameList;
6
- /**
7
- * Hooks in React sometimes accept a dependency array as their final argument. (ie useEffect/useMemo)
8
- * When values in this array change, React re-runs the dependency. However if the array
9
- * contains a variable number of items, React throws an error.
10
- */
11
- export declare const asDependencyList: (list: VariantNameList) => string[];
12
- export {};
@@ -1,12 +0,0 @@
1
- import * as React from "react";
2
- import { VariantLabels } from "../../motion/types";
3
- interface PresenceChildProps {
4
- children: React.ReactElement<any>;
5
- isPresent: boolean;
6
- onExitComplete?: () => void;
7
- initial?: false | VariantLabels;
8
- custom?: any;
9
- presenceAffectsLayout: boolean;
10
- }
11
- export declare const PresenceChild: ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, }: PresenceChildProps) => JSX.Element;
12
- export {};
@@ -1,36 +0,0 @@
1
- import * as React from "react";
2
- import { AnimatePresenceProps } from "./types";
3
- /**
4
- * `AnimatePresence` enables the animation of components that have been removed from the tree.
5
- *
6
- * When adding/removing more than a single child, every child **must** be given a unique `key` prop.
7
- *
8
- * Any `motion` components that have an `exit` property defined will animate out when removed from
9
- * the tree.
10
- *
11
- * ```jsx
12
- * import { motion, AnimatePresence } from 'framer-motion'
13
- *
14
- * export const Items = ({ items }) => (
15
- * <AnimatePresence>
16
- * {items.map(item => (
17
- * <motion.div
18
- * key={item.id}
19
- * initial={{ opacity: 0 }}
20
- * animate={{ opacity: 1 }}
21
- * exit={{ opacity: 0 }}
22
- * />
23
- * ))}
24
- * </AnimatePresence>
25
- * )
26
- * ```
27
- *
28
- * You can sequence exit animations throughout a tree using variants.
29
- *
30
- * If a child contains multiple `motion` components with `exit` props, it will only unmount the child
31
- * once all `motion` components have finished animating out. Likewise, any components using
32
- * `usePresence` all need to call `safeToRemove`.
33
- *
34
- * @public
35
- */
36
- export declare const AnimatePresence: React.FunctionComponent<React.PropsWithChildren<AnimatePresenceProps>>;
@@ -1,61 +0,0 @@
1
- /**
2
- * @public
3
- */
4
- export interface AnimatePresenceProps {
5
- /**
6
- * By passing `initial={false}`, `AnimatePresence` will disable any initial animations on children
7
- * that are present when the component is first rendered.
8
- *
9
- * ```jsx
10
- * <AnimatePresence initial={false}>
11
- * {isVisible && (
12
- * <motion.div
13
- * key="modal"
14
- * initial={{ opacity: 0 }}
15
- * animate={{ opacity: 1 }}
16
- * exit={{ opacity: 0 }}
17
- * />
18
- * )}
19
- * </AnimatePresence>
20
- * ```
21
- *
22
- * @public
23
- */
24
- initial?: boolean;
25
- /**
26
- * When a component is removed, there's no longer a chance to update its props. So if a component's `exit`
27
- * prop is defined as a dynamic variant and you want to pass a new `custom` prop, you can do so via `AnimatePresence`.
28
- * This will ensure all leaving components animate using the latest data.
29
- *
30
- * @public
31
- */
32
- custom?: any;
33
- /**
34
- * Fires when all exiting nodes have completed animating out.
35
- *
36
- * @public
37
- */
38
- onExitComplete?: () => void;
39
- /**
40
- * If set to `true`, `AnimatePresence` will only render one component at a time. The exiting component
41
- * will finish its exit animation before the entering component is rendered.
42
- *
43
- * ```jsx
44
- * const MyComponent = ({ currentItem }) => (
45
- * <AnimatePresence exitBeforeEnter>
46
- * <motion.div key={currentItem} exit={{ opacity: 0 }} />
47
- * </AnimatePresence>
48
- * )
49
- * ```
50
- *
51
- * @beta
52
- */
53
- exitBeforeEnter?: boolean;
54
- /**
55
- * Used in Framer to flag that sibling children *shouldn't* re-render as a result of a
56
- * child being removed.
57
- *
58
- * @internal
59
- */
60
- presenceAffectsLayout?: boolean;
61
- }
@@ -1,52 +0,0 @@
1
- import { PresenceContextProps } from "../../context/PresenceContext";
2
- export declare type SafeToRemove = () => void;
3
- declare type AlwaysPresent = [true, null];
4
- declare type Present = [true];
5
- declare type NotPresent = [false, SafeToRemove];
6
- /**
7
- * When a component is the child of `AnimatePresence`, it can use `usePresence`
8
- * to access information about whether it's still present in the React tree.
9
- *
10
- * ```jsx
11
- * import { usePresence } from "framer-motion"
12
- *
13
- * export const Component = () => {
14
- * const [isPresent, safeToRemove] = usePresence()
15
- *
16
- * useEffect(() => {
17
- * !isPresent && setTimeout(safeToRemove, 1000)
18
- * }, [isPresent])
19
- *
20
- * return <div />
21
- * }
22
- * ```
23
- *
24
- * If `isPresent` is `false`, it means that a component has been removed the tree, but
25
- * `AnimatePresence` won't really remove it until `safeToRemove` has been called.
26
- *
27
- * @public
28
- */
29
- export declare function usePresence(): AlwaysPresent | Present | NotPresent;
30
- /**
31
- * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.
32
- * There is no `safeToRemove` function.
33
- *
34
- * ```jsx
35
- * import { useIsPresent } from "framer-motion"
36
- *
37
- * export const Component = () => {
38
- * const isPresent = useIsPresent()
39
- *
40
- * useEffect(() => {
41
- * !isPresent && console.log("I've been removed!")
42
- * }, [isPresent])
43
- *
44
- * return <div />
45
- * }
46
- * ```
47
- *
48
- * @public
49
- */
50
- export declare function useIsPresent(): boolean;
51
- export declare function isPresent(context: PresenceContextProps | null): boolean;
52
- export {};
@@ -1,2 +0,0 @@
1
- import * as React from "react";
2
- export declare const AnimateSharedLayout: React.FunctionComponent;
@@ -1,12 +0,0 @@
1
- import * as React from "react";
2
- declare type InheritOption = boolean | "id";
3
- export interface Props {
4
- id?: string;
5
- inherit?: InheritOption;
6
- /**
7
- * @deprecated
8
- */
9
- inheritId?: boolean;
10
- }
11
- export declare const LayoutGroup: React.FunctionComponent<React.PropsWithChildren<Props>>;
12
- export {};
@@ -1,38 +0,0 @@
1
- /// <reference types="react" />
2
- import { LazyProps } from "./types";
3
- /**
4
- * Used in conjunction with the `m` component to reduce bundle size.
5
- *
6
- * `m` is a version of the `motion` component that only loads functionality
7
- * critical for the initial render.
8
- *
9
- * `LazyMotion` can then be used to either synchronously or asynchronously
10
- * load animation and gesture support.
11
- *
12
- * ```jsx
13
- * // Synchronous loading
14
- * import { LazyMotion, m, domAnimations } from "framer-motion"
15
- *
16
- * function App() {
17
- * return (
18
- * <LazyMotion features={domAnimations}>
19
- * <m.div animate={{ scale: 2 }} />
20
- * </LazyMotion>
21
- * )
22
- * }
23
- *
24
- * // Asynchronous loading
25
- * import { LazyMotion, m } from "framer-motion"
26
- *
27
- * function App() {
28
- * return (
29
- * <LazyMotion features={() => import('./path/to/domAnimations')}>
30
- * <m.div animate={{ scale: 2 }} />
31
- * </LazyMotion>
32
- * )
33
- * }
34
- * ```
35
- *
36
- * @public
37
- */
38
- export declare function LazyMotion({ children, features, strict }: LazyProps): JSX.Element;
@@ -1,54 +0,0 @@
1
- /// <reference types="react" />
2
- import { FeatureBundle } from "../../motion/features/types";
3
- export declare type LazyFeatureBundle = () => Promise<FeatureBundle>;
4
- /**
5
- * @public
6
- */
7
- export interface LazyProps {
8
- children?: React.ReactNode;
9
- /**
10
- * Can be used to provide a feature bundle synchronously or asynchronously.
11
- *
12
- * ```jsx
13
- * // features.js
14
- * import { domAnimations } from "framer-motion"
15
- * export default domAnimations
16
- *
17
- * // index.js
18
- * import { LazyMotion, m } from "framer-motion"
19
- *
20
- * const loadFeatures = import("./features.js")
21
- * .then(res => res.default)
22
- *
23
- * function Component() {
24
- * return (
25
- * <LazyMotion features={loadFeatures}>
26
- * <m.div animate={{ scale: 1.5 }} />
27
- * </LazyMotion>
28
- * )
29
- * }
30
- * ```
31
- *
32
- * @public
33
- */
34
- features: FeatureBundle | LazyFeatureBundle;
35
- /**
36
- * If `true`, will throw an error if a `motion` component renders within
37
- * a `LazyMotion` component.
38
- *
39
- * ```jsx
40
- * // This component will throw an error that explains using a motion component
41
- * // instead of the m component will break the benefits of code-splitting.
42
- * function Component() {
43
- * return (
44
- * <LazyMotion features={domAnimation} strict>
45
- * <motion.div />
46
- * </LazyMotion>
47
- * )
48
- * }
49
- * ```
50
- *
51
- * @public
52
- */
53
- strict?: boolean;
54
- }
@@ -1,25 +0,0 @@
1
- import * as React from "react";
2
- import { MotionConfigContext } from "../../context/MotionConfigContext";
3
- import { IsValidProp } from "../../render/dom/utils/filter-props";
4
- export interface MotionConfigProps extends Partial<MotionConfigContext> {
5
- children?: React.ReactNode;
6
- isValidProp?: IsValidProp;
7
- }
8
- /**
9
- * `MotionConfig` is used to set configuration options for all children `motion` components.
10
- *
11
- * ```jsx
12
- * import { motion, MotionConfig } from "framer-motion"
13
- *
14
- * export function App() {
15
- * return (
16
- * <MotionConfig transition={{ type: "spring" }}>
17
- * <motion.div animate={{ x: 100 }} />
18
- * </MotionConfig>
19
- * )
20
- * }
21
- * ```
22
- *
23
- * @public
24
- */
25
- export declare function MotionConfig({ children, isValidProp, ...config }: MotionConfigProps): JSX.Element;