framer-motion 12.23.11 → 13.0.0-alpha.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.
Files changed (56) hide show
  1. package/README.md +79 -65
  2. package/dist/cjs/client.js +1 -2
  3. package/dist/cjs/{feature-bundle-PNQ-8QDo.js → feature-bundle-C8gfmTBU.js} +0 -1
  4. package/dist/cjs/index.js +1 -2
  5. package/dist/dom.js +1 -1
  6. package/dist/es/animation/hooks/use-animate-style.mjs +1 -0
  7. package/dist/es/animation/hooks/use-animate.mjs +1 -0
  8. package/dist/es/animation/hooks/use-animated-state.mjs +1 -0
  9. package/dist/es/animation/hooks/use-animation.mjs +1 -0
  10. package/dist/es/client.mjs +0 -2
  11. package/dist/es/components/AnimatePresence/use-presence-data.mjs +1 -0
  12. package/dist/es/components/AnimatePresence/use-presence.mjs +1 -0
  13. package/dist/es/components/AnimateSharedLayout.mjs +1 -0
  14. package/dist/es/context/DeprecatedLayoutGroupContext.mjs +1 -0
  15. package/dist/es/context/MotionContext/create.mjs +1 -0
  16. package/dist/es/events/use-dom-event.mjs +1 -0
  17. package/dist/es/index.mjs +0 -2
  18. package/dist/es/m.mjs +0 -1
  19. package/dist/es/motion/utils/use-motion-ref.mjs +1 -0
  20. package/dist/es/motion/utils/use-visual-element.mjs +1 -0
  21. package/dist/es/motion/utils/use-visual-state.mjs +1 -0
  22. package/dist/es/render/dom/use-render.mjs +1 -0
  23. package/dist/es/render/html/use-html-visual-state.mjs +1 -0
  24. package/dist/es/render/html/use-props.mjs +1 -0
  25. package/dist/es/render/svg/use-props.mjs +1 -0
  26. package/dist/es/render/svg/use-svg-visual-state.mjs +1 -0
  27. package/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs +1 -0
  28. package/dist/es/utils/reduced-motion/use-reduced-motion.mjs +1 -0
  29. package/dist/es/utils/use-animation-frame.mjs +1 -0
  30. package/dist/es/utils/use-constant.mjs +1 -0
  31. package/dist/es/utils/use-cycle.mjs +1 -0
  32. package/dist/es/utils/use-force-update.mjs +1 -0
  33. package/dist/es/utils/use-in-view.mjs +1 -0
  34. package/dist/es/utils/use-instant-transition.mjs +1 -0
  35. package/dist/es/utils/use-is-mounted.mjs +1 -0
  36. package/dist/es/utils/use-isomorphic-effect.mjs +1 -0
  37. package/dist/es/utils/use-motion-value-event.mjs +1 -0
  38. package/dist/es/utils/use-page-in-view.mjs +1 -0
  39. package/dist/es/utils/use-unmount-effect.mjs +1 -0
  40. package/dist/es/value/use-combine-values.mjs +1 -0
  41. package/dist/es/value/use-computed.mjs +1 -0
  42. package/dist/es/value/use-inverted-scale.mjs +1 -0
  43. package/dist/es/value/use-motion-template.mjs +1 -0
  44. package/dist/es/value/use-motion-value.mjs +1 -0
  45. package/dist/es/value/use-scroll.mjs +1 -0
  46. package/dist/es/value/use-spring.mjs +1 -0
  47. package/dist/es/value/use-time.mjs +1 -0
  48. package/dist/es/value/use-transform.mjs +1 -0
  49. package/dist/es/value/use-velocity.mjs +1 -0
  50. package/dist/es/value/use-will-change/index.mjs +1 -0
  51. package/dist/framer-motion.dev.js +5 -3
  52. package/dist/framer-motion.js +1 -1
  53. package/dist/types/client.d.ts +2 -4
  54. package/dist/types/index.d.ts +78 -3
  55. package/dist/{types.d-Cjd591yU.d.ts → types.d-C7Th3txw.d.ts} +3 -79
  56. package/package.json +3 -3
package/README.md CHANGED
@@ -1,62 +1,46 @@
1
- <p align="center">
2
- <img width="42" height="42" alt="Motion logo" src="https://github.com/user-attachments/assets/00d6d1c3-72c4-4c2f-a664-69da13182ffc" />
3
- </p>
4
- <h1 align="center">Motion for React</h1>
1
+
2
+ <h1 align="center"> <img width="35" height="35" alt="Motion logo" src="https://github.com/user-attachments/assets/00d6d1c3-72c4-4c2f-a664-69da13182ffc" /><br />Motion for React</h1>
5
3
  <h3 align="center">
6
- An open source, production-ready animation library
4
+ An open source animation library<br />for React
7
5
  </h3>
8
- <p align="center">Previously Framer Motion. Also available for <a href="https://github.com/motiondivision/motion/tree/main/packages/motion">JavaScript</a> and <a href="https://github.com/motiondivision/motion-vue">Vue</a></p>
9
-
10
- <br>
11
6
 
12
7
  <p align="center">
13
- <a href="https://www.npmjs.com/package/framer-motion" target="_blank">
14
- <img src="https://img.shields.io/npm/v/framer-motion.svg?style=flat-square" />
15
- </a>
16
- <a href="https://www.npmjs.com/package/framer-motion" target="_blank">
17
- <img src="https://img.shields.io/npm/dm/framer-motion.svg?style=flat-square" />
18
- </a>
19
- <a href="https://twitter.com/mattgperry" target="_blank">
20
- <img src="https://img.shields.io/twitter/follow/mattgperry.svg?style=social&label=Follow" />
21
- </a>
8
+ <a href="https://www.npmjs.com/package/motion" rel="noopener noreferrer nofollow" ><img src="https://img.shields.io/npm/v/motion?color=0368FF&label=version" alt="npm version"></a>
9
+ <a href="https://www.npmjs.com/package/motion" rel="noopener noreferrer nofollow" ><img src="https://img.shields.io/npm/dm/framer-motion?color=8D30FF&label=npm" alt="npm downloads per month"></a>
10
+ <a target="_blank" rel="noopener noreferrer nofollow" href="https://www.jsdelivr.com/package/npm/motion"><img alt="jsDelivr hits (npm)" src="https://img.shields.io/jsdelivr/npm/hm/framer-motion?logo=jsdeliver&color=FF4FBA"></a>
11
+ <img alt="NPM License" src="https://img.shields.io/npm/l/motion?color=FF2B6E">
22
12
  </p>
23
13
 
24
- <br>
25
-
26
- Motion for React is an open source, production-ready library that’s designed for all creative developers.
27
14
 
28
- It's the only animation library with a hybrid engine, combining the power of JavaScript animations with the performance of native browser APIs.
15
+ ```bash
16
+ npm install motion
17
+ ```
29
18
 
30
- It looks like this:
19
+ ## Table of Contents
31
20
 
32
- ```jsx
33
- <motion.div animate={{ x: 0 }} />
34
- ```
21
+ 1. [Why Motion?](#why-motion)
22
+ 2. [🍦 Flavours](#-flavours)
23
+ 3. [🎓 Examples](#-examples)
24
+ 4. [🎨 Studio](#-studio)
25
+ 5. [⚡️ Motion+](#-motion)
26
+ 6. [👩🏻‍⚖️ License](#-license)
27
+ 7. [💎 Contribute](#-contribute)
28
+ 8. [✨ Sponsors](#-sponsors)
35
29
 
36
- It does all this:
30
+ ## Why Motion?
37
31
 
38
- - [Springs](https://motion.dev/docs/react-transitions#spring)
39
- - [Keyframes](https://motion.dev/docs/react-animation#keyframes)
40
- - [Layout animations](https://motion.dev/docs/react-layout-animations)
41
- - [Shared layout animations](https://motion.dev/docs/react-layout-animations#shared-layout-animations)
42
- - [Gestures (drag/tap/hover)](https://motion.dev/docs/react-gestures)
43
- - [Scroll animations](https://motion.dev/docs/react-scroll-animations)
44
- - [SVG paths](https://motion.dev/docs/react-animation#svg-line-drawing)
45
- - [Exit animations](https://motion.dev/docs/react-animation#exit-animations)
46
- - [Server-side rendering](https://motion.dev/docs/react-motion-component#server-side-rendering)
47
- - [Independent transforms](https://motion.dev/docs/react-motion-component#style)
48
- - [Orchestrate animations across components](https://motion.dev/docs/react-animation#orchestration)
49
- - [CSS variables](https://motion.dev/docs/react-animation#css-variables)
32
+ Motion is an animation library for making beautiful animations.
50
33
 
51
- ...and a whole lot more.
34
+ * The **only** library with first‑class APIs for React, JavaScript, **and** Vue.
35
+ * Powered by a **hybrid engine** that blends JavaScript flexibility with native browser APIs for **120fps GPU‑accelerated** motion.
36
+ * Tiny footprint, tree‑shakable, and fully TypeScript‑typed.
52
37
 
53
- ## Get started
38
+ ## 🍦 Flavours
54
39
 
55
- ### 🐇 Quick start
40
+ Motion is available for [React](https://motion.dev/docs/react), [JavaScript](https://motion.dev/docs/quick-start) and [Vue](https://motion.dev/docs/vue).
56
41
 
57
- ```bash
58
- npm install motion
59
- ```
42
+ <details>
43
+ <summary>React ⬇</summary>
60
44
 
61
45
  ```jsx
62
46
  import { motion } from "motion/react"
@@ -66,42 +50,72 @@ function Component() {
66
50
  }
67
51
  ```
68
52
 
69
- Get started with [Motion for React](https://motion.dev/docs/react-quick-start).
53
+ Get started with [Motion for React](https://motion.dev/docs/react).
70
54
 
71
- ## 🎨 Studio
55
+ </details>
72
56
 
73
- ![Video of bezier curve editing](https://framerusercontent.com/images/KO5dnHOUSNGb9S73p1J7nLhoFI.gif)
57
+ <details>
58
+ <summary>JavaScript ⬇</summary>
74
59
 
75
- Motion Studio is a versatile suite of developer tools allowing you to:
60
+ ```javascript
61
+ import { animate } from "motion"
76
62
 
77
- - Visually edit CSS and Motion easing curves in VS Code
78
- - Generate CSS springs with LLMs
79
- - Load Motion docs into your LLM
63
+ animate("#box", { x: 100 })
64
+ ```
80
65
 
81
- Get started with [Motion Studio](https://motion.dev/docs/tools-quick-start).
66
+ Get started with [JavaScript](https://motion.dev/docs/quick-start).
67
+
68
+ </details>
69
+
70
+ <details>
71
+ <summary>Vue ⬇</summary>
72
+
73
+ ```html
74
+ <script>
75
+ import { motion } from "motion-v"
76
+ </script>
77
+
78
+ <template> <motion.div :animate={{ x: 100 }} /> </template>
79
+ ```
80
+
81
+ Get started with [Motion for Vue](https://motion.dev/docs/vue).
82
+
83
+ </details>
82
84
 
83
85
  ## 🎓 Examples
84
86
 
85
- [Motion Examples](https://examples.motion.dev/react) offers 100s of free and Motion+ examples for beginners and advanced users alike. Easy copy/paste code to kickstart your next project.
87
+ [Motion Examples](https://motion.dev/examples) offers 100s of free and Motion+ examples for beginners and advanced users alike. Easy copy/paste code to kick‑start your next project.
86
88
 
87
89
  ## ⚡️ Motion+
88
90
 
89
- [Motion+](https://motion.dev/plus) is a one-time fee, lifetime membership that unlocks over 100 premium examples, early access, powerful Studio tools, a private Discord, and exclusive APIs like:
90
-
91
- - Cursor
92
- - Ticker
93
- - AnimateNumber
94
- - splitText
91
+ Learn, Design, Build. [Motion+](https://motion.dev/plus) is a one-time fee, lifetime update membership that provides:
92
+ - 160+ premium Motion Examples
93
+ - Motion UI features like Cursor and Ticker
94
+ - Motion Studio animation editing for VS Code `alpha`
95
+ - Early access content
96
+ - Private Discord
95
97
 
96
98
  [Get Motion+](https://motion.dev/plus)
97
99
 
98
- ### 💎 Contribute
100
+ ## 🎨 Studio
99
101
 
100
- - Want to contribute to Motion? Our [contributing guide](https://github.com/motiondivision/motion/blob/master/CONTRIBUTING.md) has you covered.
102
+ ![Video of bezier curve editing](https://framerusercontent.com/images/KO5dnHOUSNGb9S73p1J7nLhoFI.gif)
101
103
 
102
- ### 👩🏻‍⚖️ License
104
+ Motion Studio is a versatile suite of developer tools allowing you to:
103
105
 
104
- - Motion for React is MIT licensed.
106
+ - Visually edit CSS and Motion easing curves in VS Code
107
+ - Generate CSS springs with LLMs
108
+ - Load Motion docs into your LLM
109
+
110
+ Get started with [Motion Studio](https://motion.dev/docs/tools-quick-start).
111
+
112
+ ## 👩🏻‍⚖️ License
113
+
114
+ - Motion is MIT licensed.
115
+
116
+ ## 💎 Contribute
117
+
118
+ - Want to contribute to Motion? Our [contributing guide](https://github.com/motiondivision/motion/blob/master/CONTRIBUTING.md) has you covered.
105
119
 
106
120
  ## ✨ Sponsors
107
121
 
@@ -119,11 +133,11 @@ Motion powers Framer animations, the web builder for creative pros. Design and s
119
133
 
120
134
  ### Platinum
121
135
 
122
- <a href="https://tailwindcss.com"><img alt="Tailwind" src="https://github.com/user-attachments/assets/c0496f09-b8ee-4bc4-85ab-83a071bbbdec" width="300px" height="200px"></a> <a href="https://emilkowal.ski"><img alt="Emil Kowalski" src="https://github.com/user-attachments/assets/29f56b1a-37fb-4695-a6a6-151f6c24864f" width="300px" height="200px"></a> <a href="https://linear.app"><img alt="Linear" src="https://github.com/user-attachments/assets/a93710bb-d8ed-40e3-b0fb-1c5b3e2b16bb" width="300px" height="200px"></a>
136
+ <a href="https://tailwindcss.com"><img alt="Tailwind" src="https://github.com/user-attachments/assets/c0496f09-b8ee-4bc4-85ab-83a071bbbdec" width="300px" height="200px"></a> <a href="https://linear.app"><img alt="Linear" src="https://github.com/user-attachments/assets/a93710bb-d8ed-40e3-b0fb-1c5b3e2b16bb" width="300px" height="200px"></a>
123
137
 
124
138
  ### Gold
125
139
 
126
- <a href="https://vercel.com"><img alt="Vercel" src="https://github.com/user-attachments/assets/23cb1e37-fa67-49ad-8f77-7f4b8eaba325" width="225px" height="150px"></a> <a href="https://liveblocks.io"><img alt="Liveblocks" src="https://github.com/user-attachments/assets/31436a47-951e-4eab-9a68-bdd54ccf9444" width="225px" height="150px"></a> <a href="https://lu.ma"><img alt="Luma" src="https://github.com/user-attachments/assets/4fae0c9d-de0f-4042-9cd6-e07885d028a9" width="225px" height="150px"></a>
140
+ <a href="https://vercel.com"><img alt="Vercel" src="https://github.com/user-attachments/assets/23cb1e37-fa67-49ad-8f77-7f4b8eaba325" width="225px" height="150px"></a> <a href="https://liveblocks.io"><img alt="Liveblocks" src="https://github.com/user-attachments/assets/31436a47-951e-4eab-9a68-bdd54ccf9444" width="225px" height="150px"></a> <a href="https://lu.ma"><img alt="Luma" src="https://github.com/user-attachments/assets/4fae0c9d-de0f-4042-9cd6-e07885d028a9" width="225px" height="150px"></a> <a href="https://emilkowal.ski"><img alt="Emil Kowalski" src="https://github.com/user-attachments/assets/29f56b1a-37fb-4695-a6a6-151f6c24864f" width="300px" height="200px"></a>
127
141
 
128
142
  ### Silver
129
143
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var featureBundle = require('./feature-bundle-PNQ-8QDo.js');
5
+ var featureBundle = require('./feature-bundle-C8gfmTBU.js');
6
6
  require('react');
7
7
  require('motion-dom');
8
8
  require('motion-utils');
@@ -202,7 +202,6 @@ const MotionRadialGradient =
202
202
  /*@__PURE__*/ createMotionComponentWithFeatures("radialGradient");
203
203
  const MotionTextPath = /*@__PURE__*/ createMotionComponentWithFeatures("textPath");
204
204
 
205
- exports.create = featureBundle.createMotionComponent;
206
205
  exports.a = MotionA;
207
206
  exports.abbr = MotionAbbr;
208
207
  exports.address = MotionAddress;
@@ -6227,7 +6227,6 @@ const featureBundle = {
6227
6227
  ...layout,
6228
6228
  };
6229
6229
 
6230
- exports.FlatTree = FlatTree;
6231
6230
  exports.HTMLVisualElement = HTMLVisualElement;
6232
6231
  exports.LayoutGroupContext = LayoutGroupContext;
6233
6232
  exports.LazyContext = LazyContext;
package/dist/cjs/index.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
- var featureBundle = require('./feature-bundle-PNQ-8QDo.js');
7
+ var featureBundle = require('./feature-bundle-C8gfmTBU.js');
8
8
  var motionDom = require('motion-dom');
9
9
  var motionUtils = require('motion-utils');
10
10
 
@@ -2861,7 +2861,6 @@ function useInvertedScale(scale) {
2861
2861
  return { scaleX, scaleY };
2862
2862
  }
2863
2863
 
2864
- exports.FlatTree = featureBundle.FlatTree;
2865
2864
  exports.LayoutGroupContext = featureBundle.LayoutGroupContext;
2866
2865
  exports.MotionConfigContext = featureBundle.MotionConfigContext;
2867
2866
  exports.MotionContext = featureBundle.MotionContext;