diff --git a/packages/ui/src/components/Molecules/FadeUp.tsx b/packages/ui/src/components/Molecules/FadeUp.tsx new file mode 100644 index 000000000..4f5a3cb9d --- /dev/null +++ b/packages/ui/src/components/Molecules/FadeUp.tsx @@ -0,0 +1,21 @@ +'use client'; +import { motion, useReducedMotion } from 'framer-motion'; +import React, { PropsWithChildren } from 'react'; + +export function FadeUp({ + yGap, + children, + className, +}: PropsWithChildren<{ yGap: number; className?: string }>) { + const reducedMotion = useReducedMotion(); + return ( + + {children} + + ); +} diff --git a/packages/ui/src/components/Organisms/PageContent/BlockCta.tsx b/packages/ui/src/components/Organisms/PageContent/BlockCta.tsx index 363257b8c..2a74999f9 100644 --- a/packages/ui/src/components/Organisms/PageContent/BlockCta.tsx +++ b/packages/ui/src/components/Organisms/PageContent/BlockCta.tsx @@ -8,31 +8,35 @@ import { import clsx from 'clsx'; import React from 'react'; +import { FadeUp } from '../../Molecules/FadeUp'; + export function BlockCta(props: BlockCtaFragment) { return ( -
-
-
- - {props.text} - {!!props.icon && props.icon === CtaIconType.Arrow && ( - - )} - + +
+
+
+ + {props.text} + {!!props.icon && props.icon === CtaIconType.Arrow && ( + + )} + +
-
+ ); } diff --git a/packages/ui/src/components/Organisms/PageContent/BlockHorizontalSeparator.tsx b/packages/ui/src/components/Organisms/PageContent/BlockHorizontalSeparator.tsx index 271c36326..9de52523c 100644 --- a/packages/ui/src/components/Organisms/PageContent/BlockHorizontalSeparator.tsx +++ b/packages/ui/src/components/Organisms/PageContent/BlockHorizontalSeparator.tsx @@ -1,11 +1,15 @@ import React from 'react'; +import { FadeUp } from '../../Molecules/FadeUp'; + export function BlockHorizontalSeparator() { return ( -
-
-
+ +
+
+
+
-
+ ); } diff --git a/packages/ui/src/components/Organisms/PageContent/BlockImageTeasers.tsx b/packages/ui/src/components/Organisms/PageContent/BlockImageTeasers.tsx index 596a50f38..c36ed1dba 100644 --- a/packages/ui/src/components/Organisms/PageContent/BlockImageTeasers.tsx +++ b/packages/ui/src/components/Organisms/PageContent/BlockImageTeasers.tsx @@ -3,23 +3,25 @@ import clsx from 'clsx'; import React from 'react'; import { isTruthy } from '../../../utils/isTruthy'; +import { FadeUp } from '../../Molecules/FadeUp'; export function BlockImageTeasers(props: BlockImageTeasersFragment) { return ( - // eslint-disable-next-line tailwindcss/no-custom-classname -
-
-
1, - })} - > - {props.teasers.filter(isTruthy).map((teaser, index) => ( - - ))} + +
+
+
1, + })} + > + {props.teasers.filter(isTruthy).map((teaser, index) => ( + + ))} +
-
-
+ + ); } diff --git a/packages/ui/src/components/Organisms/PageContent/BlockImageWithText.tsx b/packages/ui/src/components/Organisms/PageContent/BlockImageWithText.tsx index 26cbc5406..f179c667f 100644 --- a/packages/ui/src/components/Organisms/PageContent/BlockImageWithText.tsx +++ b/packages/ui/src/components/Organisms/PageContent/BlockImageWithText.tsx @@ -6,38 +6,41 @@ import { import clsx from 'clsx'; import React from 'react'; +import { FadeUp } from '../../Molecules/FadeUp'; import { BlockMarkup } from './BlockMarkup'; export function BlockImageWithText(props: BlockImageWithTextFragment) { return ( -
-
-
- {!!props.image?.source && ( -
- {props.image.alt -
- )} - -
- {props.textContent?.markup && ( - + +
+
+
+ {!!props.image?.source && ( +
+ {props.image.alt +
)} + +
+ {props.textContent?.markup && ( + + )} +
-
+ ); } diff --git a/packages/ui/src/components/Organisms/PageContent/BlockMarkup.tsx b/packages/ui/src/components/Organisms/PageContent/BlockMarkup.tsx index fd5a9ec22..0e9cc494d 100644 --- a/packages/ui/src/components/Organisms/PageContent/BlockMarkup.tsx +++ b/packages/ui/src/components/Organisms/PageContent/BlockMarkup.tsx @@ -5,6 +5,8 @@ import { selectAll } from 'hast-util-select'; import React, { PropsWithChildren } from 'react'; import { Plugin } from 'unified'; +import { FadeUp } from '../../Molecules/FadeUp'; + const unorderedItems: Plugin<[], Element> = () => (tree) => { selectAll('ul > li', tree).forEach((node) => { node.properties!.unordered = true; @@ -13,44 +15,46 @@ const unorderedItems: Plugin<[], Element> = () => (tree) => { export function BlockMarkup(props: BlockMarkupFragment) { return ( -
-
-
-
- ) => { - return ( -
- - - - {children} -
- ); - }, - }} - markup={props.markup} - /> + +
+
+
+
+ ) => { + return ( +
+ + + + {children} +
+ ); + }, + }} + markup={props.markup} + /> +
-
+ ); } diff --git a/packages/ui/src/components/Organisms/PageContent/BlockMedia.tsx b/packages/ui/src/components/Organisms/PageContent/BlockMedia.tsx index 532bd8697..2d830e2a1 100644 --- a/packages/ui/src/components/Organisms/PageContent/BlockMedia.tsx +++ b/packages/ui/src/components/Organisms/PageContent/BlockMedia.tsx @@ -2,14 +2,14 @@ import { BlockMediaFragment, Html, Image } from '@custom/schema'; import React from 'react'; import { UnreachableCaseError } from '../../../utils/unreachable-case-error'; -import { ScrollPop } from '../../Client/ScrollPop'; +import { FadeUp } from '../../Molecules/FadeUp'; export function BlockMedia(props: BlockMediaFragment) { if (!props.media) { return null; } return ( - +
@@ -22,7 +22,7 @@ export function BlockMedia(props: BlockMediaFragment) {
-
+ ); } diff --git a/packages/ui/src/components/Organisms/PageContent/BlockQuote.tsx b/packages/ui/src/components/Organisms/PageContent/BlockQuote.tsx index a26e8d355..c899d09fb 100644 --- a/packages/ui/src/components/Organisms/PageContent/BlockQuote.tsx +++ b/packages/ui/src/components/Organisms/PageContent/BlockQuote.tsx @@ -1,53 +1,59 @@ import { BlockQuoteFragment, Html, Image } from '@custom/schema'; import React from 'react'; +import { FadeUp } from '../../Molecules/FadeUp'; + export function BlockQuote(props: BlockQuoteFragment) { return ( -
-
-
-
-
- - Quote Symbol - - -

{props.quote && }

-
- {props.image && ( - {props.image.alt +
+
+
+
+
+ + Quote Symbol + - )} -
- {props.author &&

{props.author}

} + +

{props.quote && }

+
+ {props.image && ( + {props.image.alt + )} +
+ {props.author && ( +

{props.author}

+ )} +
+ {props.role && ( +

+ / + + {props.role} + +

+ )}
- {props.role && ( -

- / - - {props.role} - -

- )} -
-
+
+
-
+ ); }