Skip to content

Commit

Permalink
Merge pull request #2092 from framer/fix/attrscale-types
Browse files Browse the repository at this point in the history
Adding attr transform types
  • Loading branch information
mergetron[bot] authored Apr 18, 2023
2 parents 3044ef1 + bc0d24f commit 2c405b4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ describe("SVG", () => {
)
})

test("accepts attrX/attrY/attrScale in types", () => {
render(<motion.circle animate={{ attrX: 1, attrY: 2, attrScale: 3 }} />)
})

test("recognises MotionValues in attributes", () => {
let r = motionValue(0)
let fill = motionValue("#000")
Expand Down
7 changes: 7 additions & 0 deletions packages/framer-motion/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,15 @@ type CSSPropertiesWithoutTransitionOrSingleTransforms = Omit<
"transition" | "rotate" | "scale" | "perspective"
>

type SVGTransformAttributes = {
attrX?: number
attrY?: number
attrScale?: number
}

type TargetProperties = CSSPropertiesWithoutTransitionOrSingleTransforms &
SVGAttributes<SVGElement> &
SVGTransformAttributes &
TransformProperties &
CustomStyles &
SVGPathProperties
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7844,8 +7844,8 @@ __metadata:
cache-loader: ^1.2.5
convert-tsconfig-paths-to-webpack-aliases: ^0.9.2
fork-ts-checker-webpack-plugin: ^6.2.0
framer-motion: ^10.12.2
framer-motion-3d: ^10.12.2
framer-motion: ^10.12.3
framer-motion-3d: ^10.12.3
path-browserify: ^1.0.1
react: ^18.2.0
react-dom: ^18.2.0
Expand Down Expand Up @@ -7911,14 +7911,14 @@ __metadata:
languageName: unknown
linkType: soft

"framer-motion-3d@^10.12.2, framer-motion-3d@workspace:packages/framer-motion-3d":
"framer-motion-3d@^10.12.3, framer-motion-3d@workspace:packages/framer-motion-3d":
version: 0.0.0-use.local
resolution: "framer-motion-3d@workspace:packages/framer-motion-3d"
dependencies:
"@react-three/fiber": ^8.2.2
"@react-three/test-renderer": ^9.0.0
"@rollup/plugin-commonjs": ^22.0.1
framer-motion: ^10.12.2
framer-motion: ^10.12.3
react-merge-refs: ^2.0.1
peerDependencies:
"@react-three/fiber": ^8.2.2
Expand All @@ -7928,7 +7928,7 @@ __metadata:
languageName: unknown
linkType: soft

"framer-motion@^10.12.2, framer-motion@workspace:packages/framer-motion":
"framer-motion@^10.12.3, framer-motion@workspace:packages/framer-motion":
version: 0.0.0-use.local
resolution: "framer-motion@workspace:packages/framer-motion"
dependencies:
Expand Down

0 comments on commit 2c405b4

Please sign in to comment.