Skip to content

Commit 06540fa

Browse files
authored
Merge branch 'main' into worktree-fix-issue-3735
2 parents 7af07f9 + adaf7a4 commit 06540fa

60 files changed

Lines changed: 1753 additions & 418 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@ Motion adheres to [Semantic Versioning](http://semver.org/).
44

55
Undocumented APIs should be considered internal and may change without warning.
66

7+
## [13.1.0] 2026-08-10
8+
9+
### Added
10+
11+
- `Reorder`: Multidimensional reorder.
12+
- `Reorder`: Automatic axis detection.
13+
- `Reorder`: RTL support.
14+
15+
## [13.0.0] 2026-08-05
16+
17+
### Changed
18+
19+
- Removed optional `@emotion/is-prop-valid` dependency in favour of explicit `<MotionConfig isValidProp={isPropValid}>`.
20+
21+
### Fixed
22+
23+
- Hardware-accelerated SVG elements correctly apply final style on animation complete.
24+
- `AnimatePresence`: Ensure nodes are marked as safe to remove when rendering `propagate` with no `motion` children.
25+
26+
## [12.43.0] 2026-07-27
27+
28+
### Added
29+
30+
- Hardware acceleration for `backgroundColor` in supported browsers.
31+
- Hardware acceleration for SVG elements.
32+
33+
### Fixed
34+
35+
- `AnimatePresence`: Exiting children no longer interleave with entering children, which could reorder and remount children present in both renders.
36+
- `motion`: Throw error when passing a custom `motion` component an incorrect `ref` type.
37+
738
## [12.42.2] 2026-07-01
839

940
### Fixed

‎dev/html/package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "html-env",
33
"private": true,
4-
"version": "12.42.2",
4+
"version": "13.1.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -10,9 +10,9 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"framer-motion": "^12.42.2",
14-
"motion": "^12.42.2",
15-
"motion-dom": "^12.42.2",
13+
"framer-motion": "^13.1.0",
14+
"motion": "^13.1.0",
15+
"motion-dom": "^13.0.0",
1616
"react": "^18.3.1",
1717
"react-dom": "^18.3.1"
1818
},
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<html>
2+
<head>
3+
<style>
4+
body {
5+
margin: 0;
6+
font-family: sans-serif;
7+
}
8+
9+
.box {
10+
width: 100px;
11+
height: 100px;
12+
background-color: rgb(255, 0, 0);
13+
}
14+
</style>
15+
</head>
16+
<body>
17+
<div class="box" id="color"></div>
18+
<script type="module" src="/src/inc.js"></script>
19+
<script type="module">
20+
const { animate } = window.Motion
21+
22+
// Long duration + linear ease so a mid-animation measurement lands
23+
// strictly between the endpoints. backgroundColor is now in the
24+
// accelerated set, so this should run as a WAAPI animation.
25+
animate(
26+
"#color",
27+
{ backgroundColor: "rgb(0, 0, 255)" },
28+
{ duration: 10, ease: "linear" }
29+
)
30+
</script>
31+
</body>
32+
</html>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<html>
2+
<head>
3+
<style>
4+
body {
5+
margin: 0;
6+
font-family: sans-serif;
7+
}
8+
9+
.box {
10+
width: 100px;
11+
height: 100px;
12+
background-color: rgb(255, 0, 0);
13+
}
14+
</style>
15+
</head>
16+
<body>
17+
<div class="box" id="color">animating</div>
18+
<script type="module" src="/src/inc.js"></script>
19+
<script type="module">
20+
const { animate } = window.Motion
21+
22+
window.addEventListener("error", () => {
23+
document.getElementById("color").innerText = "error"
24+
})
25+
26+
// Start a long red -> blue animation, then interrupt it mid-flight
27+
// with a short animation to green. Interrupt sampling reads the
28+
// WAAPI value, so the new animation must start from the current
29+
// colour (no jump) and land exactly on green.
30+
animate(
31+
"#color",
32+
{ backgroundColor: "rgb(0, 0, 255)" },
33+
{ duration: 10, ease: "linear" }
34+
)
35+
36+
setTimeout(() => {
37+
animate(
38+
"#color",
39+
{ backgroundColor: "rgb(0, 255, 0)" },
40+
{ duration: 0.3, ease: "linear" }
41+
).then(() => {
42+
const el = document.getElementById("color")
43+
if (el.innerText !== "error") el.innerText = "finished"
44+
})
45+
}, 500)
46+
</script>
47+
</body>
48+
</html>

‎dev/next/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "next-env",
33
"private": true,
4-
"version": "12.42.2",
4+
"version": "13.1.0",
55
"type": "module",
66
"scripts": {
77
"dev": "next dev",
@@ -10,7 +10,7 @@
1010
"build": "next build"
1111
},
1212
"dependencies": {
13-
"motion": "^12.42.2",
13+
"motion": "^13.1.0",
1414
"next": "15.5.21",
1515
"react": "19.0.0",
1616
"react-dom": "19.0.0"

‎dev/react-19/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-19-env",
33
"private": true,
4-
"version": "12.42.2",
4+
"version": "13.1.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@tanstack/react-virtual": "^3.13.22",
15-
"motion": "^12.42.2",
15+
"motion": "^13.1.0",
1616
"react": "^19.0.0",
1717
"react-dom": "^19.0.0"
1818
},

‎dev/react/package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-env",
33
"private": true,
4-
"version": "12.42.2",
4+
"version": "13.1.0",
55
"type": "module",
66
"scripts": {
77
"dev": "yarn vite",
@@ -13,8 +13,8 @@
1313
"dependencies": {
1414
"@base-ui-components/react": "^1.0.0-rc.0",
1515
"@tanstack/react-virtual": "^3.13.22",
16-
"framer-motion": "^12.42.2",
17-
"motion": "^12.42.2",
16+
"framer-motion": "^13.1.0",
17+
"motion": "^13.1.0",
1818
"react": "^18.3.1",
1919
"react-dom": "^18.3.1"
2020
},
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { Reorder } from "motion/react"
2+
import { useState } from "react"
3+
4+
interface Item {
5+
id: number
6+
columns: number
7+
}
8+
9+
const initialItems: Item[] = Array.from({ length: 60 }, (_, index) => ({
10+
id: index + 1,
11+
columns: (index % 3) + 1,
12+
}))
13+
14+
export const App = () => {
15+
const [items, setItems] = useState(initialItems)
16+
17+
return (
18+
<main>
19+
<h1>Variable-width reorder flex wrap</h1>
20+
<p>Drag tiles between differently sized wrapped rows.</p>
21+
<Reorder.Group
22+
as="div"
23+
axis="xy"
24+
values={items}
25+
onReorder={setItems}
26+
style={{
27+
display: "flex",
28+
flexWrap: "wrap",
29+
gap: 8,
30+
width: "min(90vw, 840px)",
31+
}}
32+
>
33+
{items.map((item) => (
34+
<Reorder.Item
35+
as="div"
36+
key={item.id}
37+
value={item}
38+
transition={{
39+
type: "spring",
40+
stiffness: 350,
41+
damping: 30,
42+
}}
43+
whileDrag={{
44+
scale: 1.04,
45+
boxShadow: "0 12px 24px rgba(0, 0, 0, 0.2)",
46+
}}
47+
style={{
48+
alignItems: "center",
49+
background: `hsl(${item.id * 17} 75% 85%)`,
50+
borderRadius: 8,
51+
color: "#222",
52+
cursor: "grab",
53+
display: "flex",
54+
flex: `0 0 calc((100% - 88px) / 12 * ${
55+
item.columns
56+
} + ${8 * (item.columns - 1)}px)`,
57+
fontSize: 14,
58+
fontWeight: 600,
59+
height: 56,
60+
justifyContent: "center",
61+
}}
62+
>
63+
{item.id} · {item.columns}×
64+
</Reorder.Item>
65+
))}
66+
</Reorder.Group>
67+
<style>{styles}</style>
68+
</main>
69+
)
70+
}
71+
72+
const styles = `
73+
body {
74+
background: #f2f2f2;
75+
margin: 0;
76+
}
77+
78+
main {
79+
align-items: center;
80+
display: flex;
81+
flex-direction: column;
82+
font-family: sans-serif;
83+
min-height: 100vh;
84+
padding: 32px 0;
85+
}
86+
87+
h1 {
88+
margin: 0;
89+
}
90+
91+
p {
92+
color: #666;
93+
margin: 8px 0 24px;
94+
}
95+
`
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { Reorder } from "motion/react"
2+
import { useState } from "react"
3+
4+
const initialItems = Array.from({ length: 100 }, (_, index) => index + 1)
5+
6+
export const App = () => {
7+
const [items, setItems] = useState(initialItems)
8+
9+
return (
10+
<main>
11+
<h1>Reorder grid</h1>
12+
<p>Drag any tile to a new position.</p>
13+
<Reorder.Group
14+
as="div"
15+
axis="xy"
16+
values={items}
17+
onReorder={setItems}
18+
style={{
19+
display: "grid",
20+
gap: 8,
21+
gridTemplateColumns: "repeat(10, 1fr)",
22+
width: "min(90vw, 720px)",
23+
}}
24+
>
25+
{items.map((item) => (
26+
<Reorder.Item
27+
as="div"
28+
key={item}
29+
value={item}
30+
transition={{
31+
type: "spring",
32+
stiffness: 350,
33+
damping: 30,
34+
}}
35+
whileDrag={{
36+
scale: 1.08,
37+
boxShadow: "0 12px 24px rgba(0, 0, 0, 0.2)",
38+
}}
39+
style={{
40+
alignItems: "center",
41+
aspectRatio: 1,
42+
background: "#fff",
43+
borderRadius: 8,
44+
color: "#222",
45+
cursor: "grab",
46+
display: "flex",
47+
fontSize: 14,
48+
fontWeight: 600,
49+
justifyContent: "center",
50+
}}
51+
>
52+
{item}
53+
</Reorder.Item>
54+
))}
55+
</Reorder.Group>
56+
<style>{styles}</style>
57+
</main>
58+
)
59+
}
60+
61+
const styles = `
62+
body {
63+
background: #f2f2f2;
64+
margin: 0;
65+
}
66+
67+
main {
68+
align-items: center;
69+
display: flex;
70+
flex-direction: column;
71+
font-family: sans-serif;
72+
min-height: 100vh;
73+
padding: 32px 0;
74+
}
75+
76+
h1 {
77+
margin: 0;
78+
}
79+
80+
p {
81+
color: #666;
82+
margin: 8px 0 24px;
83+
}
84+
`

0 commit comments

Comments
 (0)