Skip to content

Commit 43e9df1

Browse files
committedDec 28, 2024
Replace framer-motion with motion
1 parent 987cf16 commit 43e9df1

18 files changed

+111
-51
lines changed
 

‎.pnp.cjs

+48-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"@tsparticles/shape-square": "^3.7.1",
4949
"daisyui": "^4.12.20",
5050
"dotenv": "^16.4.7",
51-
"framer-motion": "^11.13.3",
5251
"gatsby": "^5.14.0",
5352
"gatsby-plugin-component-to-image": "^1.0.1",
5453
"gatsby-plugin-fontawesome": "^1.3.1",
@@ -65,6 +64,7 @@
6564
"gatsby-transformer-remark": "^6.14.0",
6665
"isomorphic-dompurify": "^2.18.0",
6766
"jsdom": "^24.1.3",
67+
"motion": "^11.15.0",
6868
"react": "^18.3.1",
6969
"react-dom": "^18.3.1",
7070
"react-hook-form": "^7.54.0"

‎src/components/card.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
useReducedMotion,
1212
useSpring,
1313
useTransform,
14-
} from 'framer-motion';
14+
} from 'motion/react';
1515
import type { PropsWithChildren } from 'react';
1616
import { SPRING_TRANSITION_PROPS } from '../config/constants.ts';
1717
import {
@@ -48,7 +48,7 @@ const HOVER_PROPS = {
4848
transition: getTransitionWithoutRestProps(SPRING_TRANSITION_PROPS.transition),
4949
};
5050

51-
// Remove the restDelta and restSpeed properties from a Framer Motion transition object
51+
// Remove the restDelta and restSpeed properties from a Motion transition object
5252
function getTransitionWithoutRestProps(
5353
transition: Spring,
5454
): AnimationProps['transition'] {

‎src/components/ghost-alert.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
faTriangleExclamation,
1111
} from '@fortawesome/free-solid-svg-icons';
1212
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
13-
import { AnimatePresence, motion } from 'framer-motion';
13+
import { AnimatePresence, motion } from 'motion/react';
1414
import { FADE_IN_ANIMATION_PROPS } from '../config/constants.ts';
1515
import { AlertType } from '../types/components.ts';
1616
import type { PropsWithClassName } from '../types/components.ts';

‎src/components/input/base-button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
8-
import { AnimatePresence, motion } from 'framer-motion';
8+
import { AnimatePresence, motion } from 'motion/react';
99
import { FADE_IN_ANIMATION_PROPS } from '../../config/constants.ts';
1010
import type { Button } from '../../types/components.ts';
1111
import { getClassNameProps, isDefined } from '../../utils/other.ts';

‎src/components/input/base-input.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
----------------------------------------------------------------------------------
55
*/
66

7-
import { motion } from 'framer-motion';
7+
import { motion } from 'motion/react';
88
import type { FieldValues } from 'react-hook-form';
99
import {
1010
AlertType,

‎src/components/input/contact-form.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import Botpoison from '@botpoison/browser';
77
import { faCircleNotch, faPaperPlane } from '@fortawesome/free-solid-svg-icons';
8-
import { LayoutGroup, motion } from 'framer-motion';
8+
import { LayoutGroup, motion } from 'motion/react';
99
import { useEffect, useState } from 'react';
1010
import { type SubmitHandler, useForm, useFormState } from 'react-hook-form';
1111
import {

‎src/components/layout/document-page-layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
---------------------------------------------------------------
44
*/
55

6-
import { MotionConfig } from 'framer-motion';
6+
import { MotionConfig } from 'motion/react';
77
import { type PropsWithChildren, StrictMode } from 'react';
88
import { SPRING_TRANSITION_PROPS } from '../../config/constants.ts';
99
import type { PropsWithClassName } from '../../types/components.ts';

‎src/components/layout/header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
---------------------------------
44
*/
55

6-
import { motion } from 'framer-motion';
6+
import { motion } from 'motion/react';
77
import { TITLE_LAYOUT_ID } from '../../config/constants.ts';
88
import { getSiteMetadata } from '../../managers/config.ts';
99
import { Breakpoint, type PageSection } from '../../types/components.ts';

‎src/components/layout/hero-header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
---------------------------------------------------------------
44
*/
55

6-
import { motion } from 'framer-motion';
6+
import { motion } from 'motion/react';
77
import { Heading } from '../../components/text/heading.tsx';
88
import { TITLE_LAYOUT_ID } from '../../config/constants.ts';
99
import { getSiteMetadata } from '../../managers/config.ts';

‎src/components/layout/page-layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--------------------------------------------------------------
44
*/
55

6-
import { MotionConfig } from 'framer-motion';
6+
import { MotionConfig } from 'motion/react';
77
import { type PropsWithChildren, StrictMode, lazy } from 'react';
88
import { SPRING_TRANSITION_PROPS } from '../../config/constants.ts';
99
import type { PageSection } from '../../types/components.ts';

‎src/components/layout/particles-background.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { loadBasic } from '@tsparticles/basic';
77
import type { IOptions, RecursivePartial } from '@tsparticles/engine';
88
import Particles, { initParticlesEngine } from '@tsparticles/react';
99
import { loadSquareShape } from '@tsparticles/shape-square';
10-
import { useReducedMotion } from 'framer-motion';
10+
import { useReducedMotion } from 'motion/react';
1111
import { memo, useEffect, useState } from 'react';
1212
import { getTheme } from '../../managers/config.ts';
1313
import { info } from '../../node/logger.ts';

‎src/components/tabs.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
----------------------------------------------
44
*/
55

6-
import { motion, useInView } from 'framer-motion';
6+
import { motion, useInView } from 'motion/react';
77
import { USE_IN_VIEW_OPTIONS } from '../config/constants.ts';
88
import { type PageSection, TooltipPosition } from '../types/components.ts';
99
import { getClassNameProps } from '../utils/other.ts';

‎src/config/constants.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ export const USE_IN_VIEW_OPTIONS = {
5656
margin: '-68px',
5757
} as const;
5858

59-
// Props for enabling a fade-in animation for a Framer Motion component
59+
// Props for enabling a fade-in animation for a Motion component
6060
export const FADE_IN_ANIMATION_PROPS = {
6161
initial: FADE_TRANSITION_VARIANTS.hidden,
6262
animate: FADE_TRANSITION_VARIANTS.show,
6363
exit: FADE_TRANSITION_VARIANTS.hidden,
6464
} as const;
6565

66-
// Props for setting a spring transition on a Framer Motion component
66+
// Props for setting a spring transition on a Motion component
6767
export const SPRING_TRANSITION_PROPS = {
6868
transition: {
6969
type: 'spring',

‎src/templates/page/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
faAngleDown,
88
faArrowUpRightFromSquare,
99
} from '@fortawesome/free-solid-svg-icons';
10-
import { useInView } from 'framer-motion';
1110
import type { HeadProps, PageProps } from 'gatsby';
11+
import { useInView } from 'motion/react';
1212
import { Suspense, lazy, useCallback, useRef } from 'react';
1313
import { HeroHeader } from '../../components/layout/hero-header.tsx';
1414
import { PageLayout } from '../../components/layout/page-layout.tsx';

‎src/types/components.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
6-
import type { LayoutProps } from 'framer-motion';
6+
import type { LayoutProps } from 'motion/react';
77
import type { RefObject } from 'react';
88
import type {
99
FieldErrors,
@@ -21,7 +21,7 @@ export interface PropsWithClassName {
2121
}
2222

2323
/**
24-
* Props for components that accept optional layout animations using Framer Motion
24+
* Props for components that accept optional layout animations using Motion
2525
*/
2626
export interface PropsWithLayoutAnimations {
2727
layout?: LayoutProps['layout'];

‎src/types/gatsby-types.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1378,8 +1378,11 @@ type GithubDataSortInput = {
13781378
/** Define schema for custom GithubRepo nodes */
13791379
type GithubRepo = Node & {
13801380
readonly category: ProjectCategory;
1381+
/** Returns the first child node of type MarkdownRemark or null if there are no children of given type on this node */
13811382
readonly childMarkdownRemark: Maybe<MarkdownRemark>;
13821383
readonly children: ReadonlyArray<Node>;
1384+
/** Returns all children nodes filtered by type MarkdownRemark */
1385+
readonly childrenMarkdownRemark: Maybe<ReadonlyArray<Maybe<MarkdownRemark>>>;
13831386
readonly createdAt: Scalars['Date'];
13841387
readonly description: Scalars['String'];
13851388
readonly descriptionHtml: Maybe<Scalars['String']>;
@@ -1453,6 +1456,7 @@ type GithubRepoFieldSelector = {
14531456
readonly category: InputMaybe<ProjectCategoryFieldSelector>;
14541457
readonly childMarkdownRemark: InputMaybe<MarkdownRemarkFieldSelector>;
14551458
readonly children: InputMaybe<NodeFieldSelector>;
1459+
readonly childrenMarkdownRemark: InputMaybe<MarkdownRemarkFieldSelector>;
14561460
readonly createdAt: InputMaybe<FieldSelectorEnum>;
14571461
readonly description: InputMaybe<FieldSelectorEnum>;
14581462
readonly descriptionHtml: InputMaybe<FieldSelectorEnum>;
@@ -1481,6 +1485,7 @@ type GithubRepoFilterInput = {
14811485
readonly category: InputMaybe<ProjectCategoryFilterInput>;
14821486
readonly childMarkdownRemark: InputMaybe<MarkdownRemarkFilterInput>;
14831487
readonly children: InputMaybe<NodeFilterListInput>;
1488+
readonly childrenMarkdownRemark: InputMaybe<MarkdownRemarkFilterListInput>;
14841489
readonly createdAt: InputMaybe<DateQueryOperatorInput>;
14851490
readonly description: InputMaybe<StringQueryOperatorInput>;
14861491
readonly descriptionHtml: InputMaybe<StringQueryOperatorInput>;
@@ -1550,6 +1555,7 @@ type GithubRepoSortInput = {
15501555
readonly category: InputMaybe<ProjectCategorySortInput>;
15511556
readonly childMarkdownRemark: InputMaybe<MarkdownRemarkSortInput>;
15521557
readonly children: InputMaybe<NodeSortInput>;
1558+
readonly childrenMarkdownRemark: InputMaybe<MarkdownRemarkSortInput>;
15531559
readonly createdAt: InputMaybe<SortOrderEnum>;
15541560
readonly description: InputMaybe<SortOrderEnum>;
15551561
readonly descriptionHtml: InputMaybe<SortOrderEnum>;
@@ -2175,6 +2181,7 @@ type Query_githubRepoArgs = {
21752181
category: InputMaybe<ProjectCategoryFilterInput>;
21762182
childMarkdownRemark: InputMaybe<MarkdownRemarkFilterInput>;
21772183
children: InputMaybe<NodeFilterListInput>;
2184+
childrenMarkdownRemark: InputMaybe<MarkdownRemarkFilterListInput>;
21782185
createdAt: InputMaybe<DateQueryOperatorInput>;
21792186
description: InputMaybe<StringQueryOperatorInput>;
21802187
descriptionHtml: InputMaybe<StringQueryOperatorInput>;

0 commit comments

Comments
 (0)
Please sign in to comment.