framer-motion 12.23.12 → 12.23.14
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/README.md +28 -43
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/{feature-bundle-PNQ-8QDo.js → feature-bundle-DUWayF3h.js} +2 -3
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/m.js +2 -3
- package/dist/es/motion/utils/use-motion-ref.mjs +2 -3
- package/dist/framer-motion.dev.js +2 -3
- package/dist/types/client.d.ts +2 -2
- package/dist/types/index.d.ts +16 -12
- package/dist/{types.d-Cjd591yU.d.ts → types.d-CSbqhfMB.d.ts} +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
<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>
|
|
3
2
|
<h3 align="center">
|
|
4
3
|
An open source animation library<br />for React
|
|
@@ -11,7 +10,6 @@
|
|
|
11
10
|
<img alt="NPM License" src="https://img.shields.io/npm/l/motion?color=FF2B6E">
|
|
12
11
|
</p>
|
|
13
12
|
|
|
14
|
-
|
|
15
13
|
```bash
|
|
16
14
|
npm install motion
|
|
17
15
|
```
|
|
@@ -19,28 +17,26 @@ npm install motion
|
|
|
19
17
|
## Table of Contents
|
|
20
18
|
|
|
21
19
|
1. [Why Motion?](#why-motion)
|
|
22
|
-
2. [🍦
|
|
20
|
+
2. [🍦 Platforms](#-platforms)
|
|
23
21
|
3. [🎓 Examples](#-examples)
|
|
24
|
-
4. [
|
|
25
|
-
5. [
|
|
26
|
-
6. [
|
|
27
|
-
7. [
|
|
28
|
-
8. [✨ Sponsors](#-sponsors)
|
|
22
|
+
4. [⚡️ Motion+](#-motion)
|
|
23
|
+
5. [👩🏻⚖️ License](#-license)
|
|
24
|
+
6. [💎 Contribute](#-contribute)
|
|
25
|
+
7. [✨ Sponsors](#-sponsors)
|
|
29
26
|
|
|
30
27
|
## Why Motion?
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* Tiny footprint, tree‑shakable, and fully TypeScript‑typed.
|
|
29
|
+
- **Simple API:** First-class React, JavaScript, and Vue packages.
|
|
30
|
+
- **Hybrid engine:** Power of JavaScript combined with native browser APIs for 120fps, GPU-accelerated animations.
|
|
31
|
+
- **Production-ready:** TypeScript, extensive test suite, tree-shakable, tiny footprint.
|
|
32
|
+
**Batteries included:** Gestures, springs, layout transitions, scroll-linked effects, timelines.
|
|
37
33
|
|
|
38
|
-
## 🍦
|
|
34
|
+
## 🍦 Platforms
|
|
39
35
|
|
|
40
36
|
Motion is available for [React](https://motion.dev/docs/react), [JavaScript](https://motion.dev/docs/quick-start) and [Vue](https://motion.dev/docs/vue).
|
|
41
37
|
|
|
42
38
|
<details>
|
|
43
|
-
<summary>React
|
|
39
|
+
<summary>React</summary>
|
|
44
40
|
|
|
45
41
|
```jsx
|
|
46
42
|
import { motion } from "motion/react"
|
|
@@ -55,7 +51,7 @@ Get started with [Motion for React](https://motion.dev/docs/react).
|
|
|
55
51
|
</details>
|
|
56
52
|
|
|
57
53
|
<details>
|
|
58
|
-
<summary>JavaScript
|
|
54
|
+
<summary>JavaScript</summary>
|
|
59
55
|
|
|
60
56
|
```javascript
|
|
61
57
|
import { animate } from "motion"
|
|
@@ -68,7 +64,7 @@ Get started with [JavaScript](https://motion.dev/docs/quick-start).
|
|
|
68
64
|
</details>
|
|
69
65
|
|
|
70
66
|
<details>
|
|
71
|
-
<summary>Vue
|
|
67
|
+
<summary>Vue</summary>
|
|
72
68
|
|
|
73
69
|
```html
|
|
74
70
|
<script>
|
|
@@ -84,30 +80,19 @@ Get started with [Motion for Vue](https://motion.dev/docs/vue).
|
|
|
84
80
|
|
|
85
81
|
## 🎓 Examples
|
|
86
82
|
|
|
87
|
-
[Motion Examples](https://motion.dev/examples)
|
|
83
|
+
Browse 100+ free and 180+ premium [Motion Examples](https://motion.dev/examples), with copy-paste code that'll level-up your animations whether you're a beginner or an expert.
|
|
88
84
|
|
|
89
85
|
## ⚡️ Motion+
|
|
90
86
|
|
|
91
|
-
|
|
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
|
|
97
|
-
|
|
98
|
-
[Get Motion+](https://motion.dev/plus)
|
|
87
|
+
A one-time payment, lifetime-updates membership:
|
|
99
88
|
|
|
100
|
-
|
|
89
|
+
- **180+ premium examples**
|
|
90
|
+
- **Premium APIs** like [Cursor](https://motion.dev/docs/cursor) and [Ticker](https://motion.dev/docs/react-ticker)
|
|
91
|
+
- **Visual editing** for VS Code (alpha)
|
|
92
|
+
- **Private Discord**
|
|
93
|
+
- **Early access content**
|
|
101
94
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
Motion Studio is a versatile suite of developer tools allowing you to:
|
|
105
|
-
|
|
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).
|
|
95
|
+
[Get Motion+](https://motion.dev/plus)
|
|
111
96
|
|
|
112
97
|
## 👩🏻⚖️ License
|
|
113
98
|
|
|
@@ -121,27 +106,27 @@ Get started with [Motion Studio](https://motion.dev/docs/tools-quick-start).
|
|
|
121
106
|
|
|
122
107
|
Motion is sustainable thanks to the kind support of its sponsors.
|
|
123
108
|
|
|
124
|
-
|
|
109
|
+
[Become a sponsor](https://motion.dev/sponsor)
|
|
125
110
|
|
|
126
|
-
|
|
111
|
+
### Partner
|
|
127
112
|
|
|
128
113
|
Motion powers Framer animations, the web builder for creative pros. Design and ship your dream site. Zero code, maximum speed.
|
|
129
114
|
|
|
130
|
-
<a href="https://
|
|
131
|
-
<img alt="Framer" src="https://github.com/user-attachments/assets/
|
|
115
|
+
<a href="https://framer.link/FlnUbQY">
|
|
116
|
+
<img alt="Framer" src="https://github.com/user-attachments/assets/22a79be7-672e-4336-bfb7-5d55d1deb917" width="250px" height="150px">
|
|
132
117
|
</a>
|
|
133
118
|
|
|
134
119
|
### Platinum
|
|
135
120
|
|
|
136
|
-
<a href="https://
|
|
121
|
+
<a href="https://linear.app"><img alt="Linear" src="https://github.com/user-attachments/assets/f9ce44b4-af28-4770-bb6e-9515b474bfb2" width="250px" height="150px"></a> <a href="https://figma.com"><img alt="Figma" src="https://github.com/user-attachments/assets/1077d0ab-4305-4a1f-81c8-d5be8c4c6717" width="250px" height="150px"></a> <a href="https://sanity.io"><img alt="Sanity" src="https://github.com/user-attachments/assets/80134088-f456-483f-8edd-940593c120ce" width="250px" height="150px"></a>
|
|
137
122
|
|
|
138
123
|
### Gold
|
|
139
124
|
|
|
140
|
-
<a href="https://
|
|
125
|
+
<a href="https://tailwindcss.com"><img alt="Tailwind" src="https://github.com/user-attachments/assets/1d5f2571-8bc3-4367-9fec-14d291168ff0" width="200px" height="120px"></a> <a href="https://emilkowal.ski"><img alt="Emil Kowalski" src="https://github.com/user-attachments/assets/33d1cb98-238a-4eed-a0df-9c7ab097d65b" width="200px" height="120px"></a> <a href="https://liveblocks.io"><img alt="Liveblocks" src="https://github.com/user-attachments/assets/28eddbe5-1617-4e74-969d-2eb6fcd481af" width="200px" height="120px"></a> <a href="https://vercel.com"><img alt="Vercel" src="https://github.com/user-attachments/assets/abc473bd-07ae-4a7d-9833-efe9dadb3773" width="200px" height="120px"></a> <a href="https://lu.ma"><img alt="Luma" src="https://github.com/user-attachments/assets/ac282433-6adb-4ad2-9fd2-5c6ee513c14b" width="200px" height="120px"></a>
|
|
141
126
|
|
|
142
127
|
### Silver
|
|
143
128
|
|
|
144
|
-
<a href="https://www.frontend.fyi/?utm_source=motion"><img alt="Frontend.fyi" src="https://github.com/user-attachments/assets/
|
|
129
|
+
<a href="https://www.frontend.fyi/?utm_source=motion"><img alt="Frontend.fyi" src="https://github.com/user-attachments/assets/f16e3eb9-f0bd-4ad1-8049-f079a3d65c69" width="150px" height="100px"></a> <a href="https://firecrawl.dev"><img alt="Firecrawl" src="https://github.com/user-attachments/assets/2c44e7f4-5c2a-4714-9050-1570538665ff" width="150px" height="100px"></a> <a href="https://puzzmo.com"><img alt="Puzzmo" src="https://github.com/user-attachments/assets/e32205a7-3ab1-41ec-8729-a794058fd655" width="150px" height="100px"></a> <a href="https://bolt.new"><img alt="Bolt.new" src="https://github.com/user-attachments/assets/7932d4b2-bb6c-422e-82b9-6ad78a7e3090" width="150px" height="100px"></a>
|
|
145
130
|
|
|
146
131
|
### Personal
|
|
147
132
|
|
package/dist/cjs/client.js
CHANGED
|
@@ -4091,9 +4091,8 @@ function useMotionRef(visualState, visualElement, externalRef) {
|
|
|
4091
4091
|
}
|
|
4092
4092
|
},
|
|
4093
4093
|
/**
|
|
4094
|
-
*
|
|
4095
|
-
*
|
|
4096
|
-
* or other dependencies change.
|
|
4094
|
+
* Include externalRef in dependencies to ensure the callback updates
|
|
4095
|
+
* when the ref changes, allowing proper ref forwarding.
|
|
4097
4096
|
*/
|
|
4098
4097
|
[visualElement]);
|
|
4099
4098
|
}
|
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-
|
|
7
|
+
var featureBundle = require('./feature-bundle-DUWayF3h.js');
|
|
8
8
|
var motionDom = require('motion-dom');
|
|
9
9
|
var motionUtils = require('motion-utils');
|
|
10
10
|
|
package/dist/cjs/m.js
CHANGED
|
@@ -799,9 +799,8 @@ function useMotionRef(visualState, visualElement, externalRef) {
|
|
|
799
799
|
}
|
|
800
800
|
},
|
|
801
801
|
/**
|
|
802
|
-
*
|
|
803
|
-
*
|
|
804
|
-
* or other dependencies change.
|
|
802
|
+
* Include externalRef in dependencies to ensure the callback updates
|
|
803
|
+
* when the ref changes, allowing proper ref forwarding.
|
|
805
804
|
*/
|
|
806
805
|
[visualElement]);
|
|
807
806
|
}
|
|
@@ -28,9 +28,8 @@ function useMotionRef(visualState, visualElement, externalRef) {
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* or other dependencies change.
|
|
31
|
+
* Include externalRef in dependencies to ensure the callback updates
|
|
32
|
+
* when the ref changes, allowing proper ref forwarding.
|
|
34
33
|
*/
|
|
35
34
|
[visualElement]);
|
|
36
35
|
}
|
|
@@ -9568,9 +9568,8 @@
|
|
|
9568
9568
|
}
|
|
9569
9569
|
},
|
|
9570
9570
|
/**
|
|
9571
|
-
*
|
|
9572
|
-
*
|
|
9573
|
-
* or other dependencies change.
|
|
9571
|
+
* Include externalRef in dependencies to ensure the callback updates
|
|
9572
|
+
* when the ref changes, allowing proper ref forwarding.
|
|
9574
9573
|
*/
|
|
9575
9574
|
[visualElement]);
|
|
9576
9575
|
}
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as ForwardRefComponent,
|
|
2
|
-
export { c as create } from '../types.d-
|
|
1
|
+
import { p as ForwardRefComponent, b as HTMLMotionProps, r as SVGMotionProps } from '../types.d-CSbqhfMB.js';
|
|
2
|
+
export { c as create } from '../types.d-CSbqhfMB.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'motion-dom';
|
|
5
5
|
import 'motion-utils';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export * from 'motion-dom';
|
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import * as React$1 from 'react';
|
|
7
7
|
import { useEffect, RefObject } from 'react';
|
|
8
|
-
import { F as FeatureBundle, M as MotionProps, a as MotionConfigContext, H as
|
|
9
|
-
export { A as AnimationType, C as CreateVisualElement, D as DOMMotionComponents, v as FeatureDefinition, w as FeatureDefinitions, x as FeaturePackage, s as FlatTree, p as ForwardRefComponent, t as HydratedFeatureDefinition, u as HydratedFeatureDefinitions, L as LazyFeatureBundle, k as MotionStyle, l as MotionTransform, P as PresenceContext, q as SVGAttributesAsMotionValues, r as SVGMotionProps, h as ScrapeMotionValuesFromProps, j as SwitchLayoutGroupContext, n as VariantLabels, i as VisualState, m as makeUseVisualState, o as optimizedAppearDataAttribute } from '../types.d-
|
|
8
|
+
import { F as FeatureBundle, M as MotionProps, a as MotionConfigContext, H as HTMLElements, b as HTMLMotionProps, c as createMotionComponent, d as HTMLMotionComponents, S as SVGMotionComponents, e as FeaturePackages, V as VisualElement, f as VisualElementAnimationOptions, I as IProjectionNode, R as ResolvedValues, g as HTMLRenderState } from '../types.d-CSbqhfMB.js';
|
|
9
|
+
export { A as AnimationType, C as CreateVisualElement, D as DOMMotionComponents, v as FeatureDefinition, w as FeatureDefinitions, x as FeaturePackage, s as FlatTree, p as ForwardRefComponent, t as HydratedFeatureDefinition, u as HydratedFeatureDefinitions, L as LazyFeatureBundle, k as MotionStyle, l as MotionTransform, P as PresenceContext, q as SVGAttributesAsMotionValues, r as SVGMotionProps, h as ScrapeMotionValuesFromProps, j as SwitchLayoutGroupContext, n as VariantLabels, i as VisualState, m as makeUseVisualState, o as optimizedAppearDataAttribute } from '../types.d-CSbqhfMB.js';
|
|
10
10
|
import { Easing, EasingFunction, Point, Axis, Box } from 'motion-utils';
|
|
11
11
|
export * from 'motion-utils';
|
|
12
12
|
export { MotionGlobalConfig } from 'motion-utils';
|
|
@@ -243,13 +243,17 @@ interface MotionConfigProps extends Partial<MotionConfigContext> {
|
|
|
243
243
|
*/
|
|
244
244
|
declare function MotionConfig({ children, isValidProp, ...config }: MotionConfigProps): react_jsx_runtime.JSX.Element;
|
|
245
245
|
|
|
246
|
-
|
|
246
|
+
type ReorderElementTag = keyof HTMLElements;
|
|
247
|
+
type DefaultGroupElement = "ul";
|
|
248
|
+
type DefaultItemElement = "li";
|
|
249
|
+
|
|
250
|
+
interface Props$1<V, TagName extends ReorderElementTag = DefaultGroupElement> {
|
|
247
251
|
/**
|
|
248
252
|
* A HTML element to render this component as. Defaults to `"ul"`.
|
|
249
253
|
*
|
|
250
254
|
* @public
|
|
251
255
|
*/
|
|
252
|
-
as?:
|
|
256
|
+
as?: TagName;
|
|
253
257
|
/**
|
|
254
258
|
* The axis to reorder along. By default, items will be draggable on this axis.
|
|
255
259
|
* To make draggable on both axes, set `<Reorder.Item drag />`
|
|
@@ -283,19 +287,19 @@ interface Props$1<V> {
|
|
|
283
287
|
*/
|
|
284
288
|
values: V[];
|
|
285
289
|
}
|
|
286
|
-
type ReorderGroupProps<V> = Props$1<V> & Omit<HTMLMotionProps<
|
|
287
|
-
declare function ReorderGroupComponent<V>({ children, as, axis, onReorder, values, ...props }: ReorderGroupProps<V>, externalRef?: React$1.ForwardedRef<any>):
|
|
288
|
-
declare const ReorderGroup: <V>(props: ReorderGroupProps<V> & {
|
|
290
|
+
type ReorderGroupProps<V, TagName extends ReorderElementTag = DefaultGroupElement> = Props$1<V, TagName> & Omit<HTMLMotionProps<TagName>, "values"> & React$1.PropsWithChildren<{}>;
|
|
291
|
+
declare function ReorderGroupComponent<V, TagName extends ReorderElementTag = DefaultGroupElement>({ children, as, axis, onReorder, values, ...props }: ReorderGroupProps<V, TagName>, externalRef?: React$1.ForwardedRef<any>): JSX.Element;
|
|
292
|
+
declare const ReorderGroup: <V, TagName extends keyof HTMLElements = "ul">(props: ReorderGroupProps<V, TagName> & {
|
|
289
293
|
ref?: React$1.ForwardedRef<any>;
|
|
290
294
|
}) => ReturnType<typeof ReorderGroupComponent>;
|
|
291
295
|
|
|
292
|
-
interface Props<V> {
|
|
296
|
+
interface Props<V, TagName extends ReorderElementTag = DefaultItemElement> {
|
|
293
297
|
/**
|
|
294
298
|
* A HTML element to render this component as. Defaults to `"li"`.
|
|
295
299
|
*
|
|
296
300
|
* @public
|
|
297
301
|
*/
|
|
298
|
-
as?:
|
|
302
|
+
as?: TagName;
|
|
299
303
|
/**
|
|
300
304
|
* The value in the list that this component represents.
|
|
301
305
|
*
|
|
@@ -310,9 +314,9 @@ interface Props<V> {
|
|
|
310
314
|
*/
|
|
311
315
|
layout?: true | "position";
|
|
312
316
|
}
|
|
313
|
-
type ReorderItemProps<V> = Props<V> & Omit<HTMLMotionProps<
|
|
314
|
-
declare function ReorderItemComponent<V>({ children, style, value, as, onDrag, layout, ...props }: ReorderItemProps<V>, externalRef?: React$1.ForwardedRef<any>):
|
|
315
|
-
declare const ReorderItem: <V>(props: ReorderItemProps<V> & {
|
|
317
|
+
type ReorderItemProps<V, TagName extends ReorderElementTag = DefaultItemElement> = Props<V, TagName> & Omit<HTMLMotionProps<TagName>, "value" | "layout"> & React$1.PropsWithChildren<{}>;
|
|
318
|
+
declare function ReorderItemComponent<V, TagName extends ReorderElementTag = DefaultItemElement>({ children, style, value, as, onDrag, layout, ...props }: ReorderItemProps<V, TagName>, externalRef?: React$1.ForwardedRef<any>): JSX.Element;
|
|
319
|
+
declare const ReorderItem: <V, TagName extends keyof HTMLElements = "li">(props: ReorderItemProps<V, TagName> & {
|
|
316
320
|
ref?: React$1.ForwardedRef<any>;
|
|
317
321
|
}) => ReturnType<typeof ReorderItemComponent>;
|
|
318
322
|
|
|
@@ -955,4 +955,4 @@ declare global {
|
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
957
|
|
|
958
|
-
export { type AnimationType as A, type CreateVisualElement as C, type DOMMotionComponents as D, type FeatureBundle as F, type
|
|
958
|
+
export { type AnimationType as A, type CreateVisualElement as C, type DOMMotionComponents as D, type FeatureBundle as F, type HTMLElements as H, type IProjectionNode as I, type LazyFeatureBundle as L, type MotionProps as M, PresenceContext as P, type ResolvedValues as R, type SVGMotionComponents as S, VisualElement as V, MotionConfigContext as a, type HTMLMotionProps as b, createMotionComponent as c, type HTMLMotionComponents as d, type FeaturePackages as e, type VisualElementAnimationOptions as f, type HTMLRenderState as g, type ScrapeMotionValuesFromProps as h, type VisualState as i, SwitchLayoutGroupContext as j, type MotionStyle as k, type MotionTransform as l, makeUseVisualState as m, type VariantLabels as n, optimizedAppearDataAttribute as o, type ForwardRefComponent as p, type SVGAttributesAsMotionValues as q, type SVGMotionProps as r, FlatTree as s, type HydratedFeatureDefinition as t, type HydratedFeatureDefinitions as u, type FeatureDefinition as v, type FeatureDefinitions as w, type FeaturePackage as x };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "framer-motion",
|
|
3
|
-
"version": "12.23.
|
|
3
|
+
"version": "12.23.14",
|
|
4
4
|
"description": "A simple and powerful JavaScript animation library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.mjs",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"maxSize": "2.26 kB"
|
|
143
143
|
}
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "c512db38b2259aaef412605f88799e05055f9be3"
|
|
146
146
|
}
|