diff --git a/.changeset/nine-flowers-matter.md b/.changeset/nine-flowers-matter.md new file mode 100644 index 000000000..fe7c8d63b --- /dev/null +++ b/.changeset/nine-flowers-matter.md @@ -0,0 +1,5 @@ +--- +"@bigcommerce/catalyst-core": patch +--- + +Add `Slide` component to be used in `Slideshow`. diff --git a/core/components/hero/index.tsx b/core/components/hero/index.tsx index 10003ff0f..768ccad7a 100644 --- a/core/components/hero/index.tsx +++ b/core/components/hero/index.tsx @@ -1,53 +1,34 @@ -import Image from 'next/image'; - -import { Button } from '~/components/ui/button'; import { Slideshow } from '~/components/ui/slideshow'; +import { Slide } from '../ui/slide'; + import SlideshowBG from './slideshow-bg-01.jpg'; const slides = [ -
- An assortment of brandless products against a blank background -
-

25% Off Sale

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut - labore et dolore magna aliqua. Ut enim ad minim veniam. -

- -
-
, -
-

Great Deals

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut - labore et dolore magna aliqua. Ut enim ad minim veniam. -

- -
, -
-

Low Prices

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut - labore et dolore magna aliqua. Ut enim ad minim veniam. -

- -
, + , + , ]; export const Hero = () => ; diff --git a/core/components/ui/slide/index.ts b/core/components/ui/slide/index.ts new file mode 100644 index 000000000..e8b68b892 --- /dev/null +++ b/core/components/ui/slide/index.ts @@ -0,0 +1 @@ +export * from './slide'; diff --git a/core/components/ui/slide/slide.tsx b/core/components/ui/slide/slide.tsx new file mode 100644 index 000000000..98a14d0e0 --- /dev/null +++ b/core/components/ui/slide/slide.tsx @@ -0,0 +1,42 @@ +import Image, { StaticImageData } from 'next/image'; + +import { cn } from '~/lib/utils'; + +import { Button } from '../button'; + +interface Props { + cta?: { url: string; label: string }; + description: string; + image?: { src: StaticImageData; alt: string; blurDataUrl?: string }; + title: string; +} + +const Slide = ({ cta, description, image, title }: Props) => { + return ( +
+ {image && ( + {image.alt} + )} +
+

{title}

+

{description}

+ {cta && ( + + )} +
+
+ ); +}; + +export { Slide };