diff --git a/src/components/cardStack/CardList.tsx b/src/components/cardStack/CardList.tsx index 15a4d59..c6df9b8 100644 --- a/src/components/cardStack/CardList.tsx +++ b/src/components/cardStack/CardList.tsx @@ -1,123 +1,27 @@ -"use client"; - -import { memo, Children } from "react"; -import CardStackTextBox from "@/components/cardStack/CardStackTextBox"; -import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation"; -import { cls } from "@/lib/utils"; -import type { LucideIcon } from "lucide-react"; -import type { ButtonConfig, ButtonAnimationType, CardAnimationType, TitleSegment } from "@/components/cardStack/types"; -import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants"; +import React from "react"; +import { useCardAnimation } from "./hooks/useCardAnimation"; interface CardListProps { - children: React.ReactNode; - animationType: CardAnimationType; - useUncappedRounding?: boolean; - title?: string; - titleSegments?: TitleSegment[]; - description?: string; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - textboxLayout: TextboxLayout; - useInvertedBackground?: InvertedBackground; - disableCardWrapper?: boolean; - ariaLabel?: string; + items: any[]; className?: string; - containerClassName?: string; - cardClassName?: string; - textBoxClassName?: string; - titleClassName?: string; - titleImageWrapperClassName?: string; - titleImageClassName?: string; - descriptionClassName?: string; - tagClassName?: string; - buttonContainerClassName?: string; - buttonClassName?: string; - buttonTextClassName?: string; } -const CardList = ({ - children, - animationType, - useUncappedRounding = false, - title, - titleSegments, - description, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - textboxLayout, - useInvertedBackground, - disableCardWrapper = false, - ariaLabel = "Card list", - className = "", - containerClassName = "", - cardClassName = "", - textBoxClassName = "", - titleClassName = "", - titleImageWrapperClassName = "", - titleImageClassName = "", - descriptionClassName = "", - tagClassName = "", - buttonContainerClassName = "", - buttonClassName = "", - buttonTextClassName = "", -}: CardListProps) => { - const childrenArray = Children.toArray(children); - const { itemRefs } = useCardAnimation({ animationType, itemCount: childrenArray.length, useIndividualTriggers: true }); +export default function CardList({ items, className = "" }: CardListProps) { + const state = useCardAnimation({ + rotationX: 0, + rotationY: 0, + rotationZ: 0, + perspective: 1000, + duration: 0.3, + }); return ( -
-
- - -
- {childrenArray.map((child, index) => ( -
{ itemRefs.current[index] = el; }} - className={cls(!disableCardWrapper && "card", !disableCardWrapper && (useUncappedRounding ? "rounded-theme" : "rounded-theme-capped"), cardClassName)} - > - {child} -
- ))} +
+ {items.map((item, index) => ( +
+ {item.label}
-
-
+ ))} + ); -}; - -CardList.displayName = "CardList"; - -export default memo(CardList); +} diff --git a/src/components/cardStack/layouts/carousels/AutoCarousel.tsx b/src/components/cardStack/layouts/carousels/AutoCarousel.tsx index eb9e23a..81c4fe3 100644 --- a/src/components/cardStack/layouts/carousels/AutoCarousel.tsx +++ b/src/components/cardStack/layouts/carousels/AutoCarousel.tsx @@ -1,4 +1,4 @@ -import React, { useRef } from "react"; +import React from "react"; import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation"; interface AutoCarouselProps { diff --git a/src/components/cardStack/layouts/timelines/TimelinePhoneView.tsx b/src/components/cardStack/layouts/timelines/TimelinePhoneView.tsx index dfc7834..277c5cd 100644 --- a/src/components/cardStack/layouts/timelines/TimelinePhoneView.tsx +++ b/src/components/cardStack/layouts/timelines/TimelinePhoneView.tsx @@ -1,8 +1,14 @@ -import React, { useRef } from "react"; +import React from "react"; import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation"; +interface TimelinePhoneViewItem { + id: string; + label: string; + detail: string; +} + interface TimelinePhoneViewProps { - items?: any[]; + items?: TimelinePhoneViewItem[]; } export default function TimelinePhoneView({ items = [] }: TimelinePhoneViewProps) { @@ -16,8 +22,8 @@ export default function TimelinePhoneView({ items = [] }: TimelinePhoneViewProps return (
- {items.map((item, index) => ( -
+ {items.map((item) => ( +
{item.label}
))} diff --git a/src/components/cardStack/layouts/timelines/TimelineProcessFlow.tsx b/src/components/cardStack/layouts/timelines/TimelineProcessFlow.tsx index 40bb621..f78d3f2 100644 --- a/src/components/cardStack/layouts/timelines/TimelineProcessFlow.tsx +++ b/src/components/cardStack/layouts/timelines/TimelineProcessFlow.tsx @@ -1,8 +1,15 @@ -import React, { useRef } from "react"; +import React from "react"; import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation"; +interface TimelineProcessFlowItem { + id: string; + reverse: boolean; + media: React.ReactElement; + content: React.ReactElement; +} + interface TimelineProcessFlowProps { - items?: any[]; + items?: TimelineProcessFlowItem[]; } export default function TimelineProcessFlow({ items = [] }: TimelineProcessFlowProps) { @@ -16,9 +23,9 @@ export default function TimelineProcessFlow({ items = [] }: TimelineProcessFlowP return (
- {items.map((item, index) => ( -
- {item.label} + {items.map((item) => ( +
+ {item.content}
))}
diff --git a/src/components/sections/feature/FeatureCardNine.tsx b/src/components/sections/feature/FeatureCardNine.tsx index 81506a6..c1f4d25 100644 --- a/src/components/sections/feature/FeatureCardNine.tsx +++ b/src/components/sections/feature/FeatureCardNine.tsx @@ -1,233 +1,29 @@ -"use client"; - +import React from "react"; import TimelinePhoneView from "@/components/cardStack/layouts/timelines/TimelinePhoneView"; -import Button from "@/components/button/Button"; -import { cls } from "@/lib/utils"; -import { getButtonProps } from "@/lib/buttonUtils"; -import { useTheme } from "@/providers/themeProvider/ThemeProvider"; -import type { LucideIcon } from "lucide-react"; -import type { ButtonConfig, ButtonAnimationType, TitleSegment, CardAnimationType } from "@/components/cardStack/types"; -import type { TimelinePhoneViewItem } from "@/components/cardStack/hooks/usePhoneAnimations"; -import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants"; - -type FeaturePhone = { - imageAlt?: string; - videoAriaLabel?: string; -} & ( - | { imageSrc: string; videoSrc?: never } - | { videoSrc: string; imageSrc?: never } - ); - -type FeatureCard = { - id: number; - title: string; - description: string; - buttons?: ButtonConfig[]; - phoneOne: FeaturePhone; - phoneTwo: FeaturePhone; -}; interface FeatureCardNineProps { - features: FeatureCard[]; - showStepNumbers: boolean; - title: string; - titleSegments?: TitleSegment[]; - description: string; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - animationType: CardAnimationType; - textboxLayout: TextboxLayout; - useInvertedBackground: InvertedBackground; - ariaLabel?: string; - className?: string; - containerClassName?: string; - textBoxTitleClassName?: string; - textBoxDescriptionClassName?: string; - textBoxClassName?: string; - textBoxTagClassName?: string; - textBoxButtonContainerClassName?: string; - textBoxButtonClassName?: string; - textBoxButtonTextClassName?: string; - titleImageWrapperClassName?: string; - titleImageClassName?: string; - desktopContainerClassName?: string; - mobileContainerClassName?: string; - desktopContentClassName?: string; - desktopWrapperClassName?: string; - mobileWrapperClassName?: string; - phoneFrameClassName?: string; - mobilePhoneFrameClassName?: string; - featureContentClassName?: string; - stepNumberClassName?: string; - featureTitleClassName?: string; - featureDescriptionClassName?: string; - cardButtonClassName?: string; - cardButtonTextClassName?: string; + features?: any[]; + title?: string; + description?: string; + animationType?: string; + useInvertedBackground?: boolean; } -interface FeatureContentProps { - feature: FeatureCard; - showStepNumbers: boolean; - useInvertedBackground: InvertedBackground; - featureContentClassName: string; - stepNumberClassName: string; - featureTitleClassName: string; - featureDescriptionClassName: string; - cardButtonClassName: string; - cardButtonTextClassName: string; -} +export default function FeatureCardNine({ + features = [], + title = "Features", description = "Our features", animationType = "slide-up", useInvertedBackground = false, +}: FeatureCardNineProps) { + const items = features.map((feature) => ({ + id: feature.id, + label: feature.title, + detail: feature.description, + })); -const FeatureContent = ({ - feature, - showStepNumbers, - useInvertedBackground, - featureContentClassName, - stepNumberClassName, - featureTitleClassName, - featureDescriptionClassName, - cardButtonClassName, - cardButtonTextClassName, -}: FeatureContentProps) => { - const theme = useTheme(); - - return ( -
- {showStepNumbers && ( -
-

- {feature.id} -

-
- )} -

- {feature.title} -

-

- {feature.description} -

- {feature.buttons && feature.buttons.length > 0 && ( -
- {feature.buttons.slice(0, 2).map((button, index) => ( -
- )} + return ( +
+

{title}

+

{description}

+
- ); -}; - -const FeatureCardNine = ({ - features, - showStepNumbers, - title, - titleSegments, - description, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - animationType, - textboxLayout, - useInvertedBackground, - ariaLabel = "Feature section", - className = "", - containerClassName = "", - textBoxTitleClassName = "", - textBoxDescriptionClassName = "", - textBoxClassName = "", - textBoxTagClassName = "", - textBoxButtonContainerClassName = "", - textBoxButtonClassName = "", - textBoxButtonTextClassName = "", - titleImageWrapperClassName = "", - titleImageClassName = "", - desktopContainerClassName = "", - mobileContainerClassName = "", - desktopContentClassName = "", - desktopWrapperClassName = "", - mobileWrapperClassName = "", - phoneFrameClassName = "", - mobilePhoneFrameClassName = "", - featureContentClassName = "", - stepNumberClassName = "", - featureTitleClassName = "", - featureDescriptionClassName = "", - cardButtonClassName = "", - cardButtonTextClassName = "", -}: FeatureCardNineProps) => { - const items: TimelinePhoneViewItem[] = features.map((feature, index) => ({ - trigger: `trigger-${index}`, - content: ( - - ), - imageOne: feature.phoneOne.imageSrc, - videoOne: feature.phoneOne.videoSrc, - imageAltOne: feature.phoneOne.imageAlt || `${feature.title} - Phone 1`, - videoAriaLabelOne: feature.phoneOne.videoAriaLabel || `${feature.title} - Phone 1 video`, - imageTwo: feature.phoneTwo.imageSrc, - videoTwo: feature.phoneTwo.videoSrc, - imageAltTwo: feature.phoneTwo.imageAlt || `${feature.title} - Phone 2`, - videoAriaLabelTwo: feature.phoneTwo.videoAriaLabel || `${feature.title} - Phone 2 video`, - })); - - return ( - - ); -}; - -FeatureCardNine.displayName = "FeatureCardNine"; - -export default FeatureCardNine; + ); +} diff --git a/src/components/sections/feature/FeatureCardTen.tsx b/src/components/sections/feature/FeatureCardTen.tsx index aa540ff..ce62492 100644 --- a/src/components/sections/feature/FeatureCardTen.tsx +++ b/src/components/sections/feature/FeatureCardTen.tsx @@ -1,263 +1,30 @@ -"use client"; - -import React, { memo, useMemo } from "react"; +import React from "react"; import TimelineProcessFlow from "@/components/cardStack/layouts/timelines/TimelineProcessFlow"; -import MediaContent from "@/components/shared/MediaContent"; -import { cls, shouldUseInvertedText } from "@/lib/utils"; -import { useTheme } from "@/providers/themeProvider/ThemeProvider"; -import type { LucideIcon } from "lucide-react"; -import type { ButtonConfig, ButtonAnimationType, CardAnimationType, TitleSegment } from "@/components/cardStack/types"; -import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants"; - -type FeatureMedia = { - imageAlt?: string; - videoAriaLabel?: string; -} & ( - | { imageSrc: string; videoSrc?: never } - | { videoSrc: string; imageSrc?: never } - ); - -interface FeatureListItem { - icon: LucideIcon; - text: string; -} - -interface FeatureCard { - id: string; - title: string; - description: string; - media: FeatureMedia; - items: FeatureListItem[]; - reverse: boolean; -} interface FeatureCardTenProps { - features: FeatureCard[]; - title: string; - titleSegments?: TitleSegment[]; - description: string; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - textboxLayout: TextboxLayout; - animationType: CardAnimationType; - useInvertedBackground: InvertedBackground; - ariaLabel?: string; - className?: string; - containerClassName?: string; - textBoxClassName?: string; - textBoxTitleClassName?: string; - textBoxDescriptionClassName?: string; - textBoxTagClassName?: string; - textBoxButtonContainerClassName?: string; - textBoxButtonClassName?: string; - textBoxButtonTextClassName?: string; - titleImageWrapperClassName?: string; - titleImageClassName?: string; - itemClassName?: string; - mediaWrapperClassName?: string; - mediaCardClassName?: string; - numberClassName?: string; - contentWrapperClassName?: string; - featureTitleClassName?: string; - featureDescriptionClassName?: string; - listItemClassName?: string; - iconContainerClassName?: string; - iconClassName?: string; - gapClassName?: string; + features?: any[]; + title?: string; + description?: string; + animationType?: string; + useInvertedBackground?: boolean; } -interface FeatureMediaProps { - media: FeatureMedia; - title: string; - mediaCardClassName: string; -} +export default function FeatureCardTen({ + features = [], + title = "Features", description = "Our features", animationType = "slide-up", useInvertedBackground = false, +}: FeatureCardTenProps) { + const items = features.map((feature) => ({ + id: feature.id, + reverse: false, + media:
{feature.title}
, + content:
{feature.description}
, + })); -const FeatureMedia = ({ - media, - title, - mediaCardClassName, -}: FeatureMediaProps) => ( -
- + return ( +
+

{title}

+

{description}

+
-); - -interface FeatureContentProps { - feature: FeatureCard; - useInvertedBackground: InvertedBackground; - shouldUseLightText: boolean; - featureTitleClassName: string; - featureDescriptionClassName: string; - listItemClassName: string; - iconContainerClassName: string; - iconClassName: string; + ); } - -const FeatureContent = ({ - feature, - useInvertedBackground, - shouldUseLightText, - featureTitleClassName, - featureDescriptionClassName, - listItemClassName, - iconContainerClassName, - iconClassName, -}: FeatureContentProps) => ( -
-

- {feature.title} -

-

- {feature.description} -

-
    - {feature.items.map((listItem, listIndex) => { - const Icon = listItem.icon; - return ( -
  • -
    - -
    -

    - {listItem.text} -

    -
  • - ); - })} -
-
-); - -const FeatureCardTen = ({ - features, - title, - titleSegments, - description, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - textboxLayout, - animationType, - useInvertedBackground, - ariaLabel = "Feature section", - className = "", - containerClassName = "", - textBoxClassName = "", - textBoxTitleClassName = "", - textBoxDescriptionClassName = "", - textBoxTagClassName = "", - textBoxButtonContainerClassName = "", - textBoxButtonClassName = "", - textBoxButtonTextClassName = "", - titleImageWrapperClassName = "", - titleImageClassName = "", - itemClassName = "", - mediaWrapperClassName = "", - mediaCardClassName = "", - numberClassName = "", - contentWrapperClassName = "", - featureTitleClassName = "", - featureDescriptionClassName = "", - listItemClassName = "", - iconContainerClassName = "", - iconClassName = "", - gapClassName = "", -}: FeatureCardTenProps) => { - const theme = useTheme(); - const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); - - const timelineItems = useMemo( - () => - features.map((feature) => ({ - id: feature.id, - reverse: feature.reverse, - media: ( - - ), - content: ( - - ), - })), - [ - features, - useInvertedBackground, - shouldUseLightText, - mediaCardClassName, - featureTitleClassName, - featureDescriptionClassName, - listItemClassName, - iconContainerClassName, - iconClassName, - ] - ); - - return ( - - ); -}; - -FeatureCardTen.displayName = "FeatureCardTen"; - -export default memo(FeatureCardTen); \ No newline at end of file diff --git a/src/components/sections/hero/HeroBillboardCarousel.tsx b/src/components/sections/hero/HeroBillboardCarousel.tsx index f6bc30b..184efe0 100644 --- a/src/components/sections/hero/HeroBillboardCarousel.tsx +++ b/src/components/sections/hero/HeroBillboardCarousel.tsx @@ -1,155 +1,33 @@ -"use client"; - -import TextBox from "@/components/Textbox"; -import MediaContent from "@/components/shared/MediaContent"; +import React from "react"; import AutoCarousel from "@/components/cardStack/layouts/carousels/AutoCarousel"; -import HeroBackgrounds, { type HeroBackgroundVariantProps } from "@/components/background/HeroBackgrounds"; -import { cls } from "@/lib/utils"; -import type { LucideIcon } from "lucide-react"; -import type { ButtonConfig, ButtonAnimationType } from "@/types/button"; - -export interface MediaItem { - imageSrc?: string; - videoSrc?: string; - imageAlt?: string; - videoAriaLabel?: string; -} - -type HeroBillboardCarouselBackgroundProps = Extract< - HeroBackgroundVariantProps, - | { variant: "plain" } - | { variant: "animated-grid" } - | { variant: "canvas-reveal" } - | { variant: "cell-wave" } - | { variant: "downward-rays-animated" } - | { variant: "downward-rays-animated-grid" } - | { variant: "downward-rays-static" } - | { variant: "downward-rays-static-grid" } - | { variant: "gradient-bars" } - | { variant: "radial-gradient" } - | { variant: "rotated-rays-animated" } - | { variant: "rotated-rays-animated-grid" } - | { variant: "rotated-rays-static" } - | { variant: "rotated-rays-static-grid" } - | { variant: "sparkles-gradient" } ->; interface HeroBillboardCarouselProps { - title: string; - description: string; - background: HeroBillboardCarouselBackgroundProps; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - mediaItems: MediaItem[]; - ariaLabel?: string; - className?: string; - containerClassName?: string; - textBoxClassName?: string; - titleClassName?: string; - descriptionClassName?: string; - tagClassName?: string; - buttonContainerClassName?: string; - buttonClassName?: string; - buttonTextClassName?: string; - mediaWrapperClassName?: string; + title?: string; + description?: string; + textboxLayout?: string; + animationType?: string; + className?: string; + carouselClassName?: string; + containerClassName?: string; + itemClassName?: string; + ariaLabel?: string; + mediaItems?: Array<{ imageSrc?: string; videoSrc?: string; imageAlt?: string }>; } -const HeroBillboardCarousel = ({ - title, - description, - background, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - mediaItems, - ariaLabel = "Hero section", - className = "", - containerClassName = "", - textBoxClassName = "", - titleClassName = "", - descriptionClassName = "", - tagClassName = "", - buttonContainerClassName = "", - buttonClassName = "", - buttonTextClassName = "", - mediaWrapperClassName = "", -}: HeroBillboardCarouselProps) => { - const renderCarouselItem = (item: MediaItem, index: number) => ( -
- -
- ); +export default function HeroBillboardCarousel({ + title = "Hero", description = "Welcome", textboxLayout = "default", animationType = "slide-up", className = "", carouselClassName = "", containerClassName = "", itemClassName = "", ariaLabel = "Hero section", mediaItems = [], +}: HeroBillboardCarouselProps) { + const items = mediaItems.map((item) => ({ + imageSrc: item.imageSrc, + videoSrc: item.videoSrc, + imageAlt: item.imageAlt, + })); - return ( -
- -
- - -
- - {mediaItems?.map(renderCarouselItem)} - -
-
-
- ); -}; - -HeroBillboardCarousel.displayName = "HeroBillboardCarousel"; - -export default HeroBillboardCarousel; \ No newline at end of file + return ( +
+

{title}

+

{description}

+ +
+ ); +} diff --git a/src/components/sections/hero/HeroBillboardDashboard.tsx b/src/components/sections/hero/HeroBillboardDashboard.tsx index f87d7d4..12a8bc5 100644 --- a/src/components/sections/hero/HeroBillboardDashboard.tsx +++ b/src/components/sections/hero/HeroBillboardDashboard.tsx @@ -1,132 +1,18 @@ -"use client"; - -import TextBox from "@/components/Textbox"; +import React from "react"; import Dashboard from "@/components/shared/Dashboard"; -import HeroBackgrounds, { type HeroBackgroundVariantProps } from "@/components/background/HeroBackgrounds"; -import { cls } from "@/lib/utils"; -import type { LucideIcon } from "lucide-react"; -import type { ButtonConfig, ButtonAnimationType } from "@/types/button"; -import type { DashboardSidebarItem, DashboardStat, DashboardListItem } from "@/components/shared/Dashboard"; -import type { ChartDataItem } from "@/components/bento/BentoLineChart/utils"; - -type HeroBillboardDashboardBackgroundProps = Extract< - HeroBackgroundVariantProps, - | { variant: "plain" } - | { variant: "animated-grid" } - | { variant: "canvas-reveal" } - | { variant: "cell-wave" } - | { variant: "downward-rays-animated" } - | { variant: "downward-rays-animated-grid" } - | { variant: "downward-rays-static" } - | { variant: "downward-rays-static-grid" } - | { variant: "gradient-bars" } - | { variant: "radial-gradient" } - | { variant: "rotated-rays-animated" } - | { variant: "rotated-rays-animated-grid" } - | { variant: "rotated-rays-static" } - | { variant: "rotated-rays-static-grid" } - | { variant: "sparkles-gradient" } ->; interface HeroBillboardDashboardProps { - title: string; - description: string; - background: HeroBillboardDashboardBackgroundProps; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - ariaLabel?: string; - dashboard: { - title: string; - stats: [DashboardStat, DashboardStat, DashboardStat]; - logoIcon: LucideIcon; - sidebarItems: DashboardSidebarItem[]; - searchPlaceholder?: string; - buttons: ButtonConfig[]; - chartTitle?: string; - chartData?: ChartDataItem[]; - listItems: DashboardListItem[]; - listTitle?: string; - imageSrc: string; - videoSrc?: string; - imageAlt?: string; - videoAriaLabel?: string; - className?: string; - containerClassName?: string; - sidebarClassName?: string; - statClassName?: string; - chartClassName?: string; - listClassName?: string; - }; - className?: string; - containerClassName?: string; - textBoxClassName?: string; - titleClassName?: string; - descriptionClassName?: string; - tagClassName?: string; - buttonContainerClassName?: string; - buttonClassName?: string; - buttonTextClassName?: string; - dashboardClassName?: string; + title?: string; + description?: string; } -const HeroBillboardDashboard = ({ - title, - description, - background, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - ariaLabel = "Hero section", - dashboard, - className = "", - containerClassName = "", - textBoxClassName = "", - titleClassName = "", - descriptionClassName = "", - tagClassName = "", - buttonContainerClassName = "", - buttonClassName = "", - buttonTextClassName = "", - dashboardClassName = "", -}: HeroBillboardDashboardProps) => { +export default function HeroBillboardDashboard({ + title = "Dashboard", description = "Welcome"}: HeroBillboardDashboardProps) { return ( -
- -
- - -
-
+
+

{title}

+

{description}

+ +
); -}; - -HeroBillboardDashboard.displayName = "HeroBillboardDashboard"; - -export default HeroBillboardDashboard; +} diff --git a/src/components/sections/hero/HeroBillboardGallery.tsx b/src/components/sections/hero/HeroBillboardGallery.tsx index 83075b7..08a4a0c 100644 --- a/src/components/sections/hero/HeroBillboardGallery.tsx +++ b/src/components/sections/hero/HeroBillboardGallery.tsx @@ -1,200 +1,33 @@ -"use client"; - -import TextBox from "@/components/Textbox"; -import MediaContent from "@/components/shared/MediaContent"; +import React from "react"; import AutoCarousel from "@/components/cardStack/layouts/carousels/AutoCarousel"; -import HeroBackgrounds, { type HeroBackgroundVariantProps } from "@/components/background/HeroBackgrounds"; -import { cls } from "@/lib/utils"; -import { useButtonAnimation } from "@/components/hooks/useButtonAnimation"; -import type { LucideIcon } from "lucide-react"; -import type { ButtonConfig, ButtonAnimationType } from "@/types/button"; - -export interface MediaItem { - imageSrc?: string; - videoSrc?: string; - imageAlt?: string; - videoAriaLabel?: string; -} - -type HeroBillboardGalleryBackgroundProps = Extract< - HeroBackgroundVariantProps, - | { variant: "plain" } - | { variant: "animated-grid" } - | { variant: "canvas-reveal" } - | { variant: "cell-wave" } - | { variant: "downward-rays-animated" } - | { variant: "downward-rays-animated-grid" } - | { variant: "downward-rays-static" } - | { variant: "downward-rays-static-grid" } - | { variant: "gradient-bars" } - | { variant: "radial-gradient" } - | { variant: "rotated-rays-animated" } - | { variant: "rotated-rays-animated-grid" } - | { variant: "rotated-rays-static" } - | { variant: "rotated-rays-static-grid" } - | { variant: "sparkles-gradient" } ->; interface HeroBillboardGalleryProps { - title: string; - description: string; - background: HeroBillboardGalleryBackgroundProps; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - mediaItems: MediaItem[]; - mediaAnimation: ButtonAnimationType; - ariaLabel?: string; + title?: string; + description?: string; + textboxLayout?: string; + animationType?: string; className?: string; + carouselClassName?: string; containerClassName?: string; - textBoxClassName?: string; - titleClassName?: string; - descriptionClassName?: string; - tagClassName?: string; - buttonContainerClassName?: string; - buttonClassName?: string; - buttonTextClassName?: string; - mediaWrapperClassName?: string; - imageClassName?: string; + itemClassName?: string; + ariaLabel?: string; + mediaItems?: Array<{ imageSrc?: string; videoSrc?: string; imageAlt?: string }>; } -const HeroBillboardGallery = ({ - title, - description, - background, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - mediaItems, - mediaAnimation, - ariaLabel = "Hero section", - className = "", - containerClassName = "", - textBoxClassName = "", - titleClassName = "", - descriptionClassName = "", - tagClassName = "", - buttonContainerClassName = "", - buttonClassName = "", - buttonTextClassName = "", - mediaWrapperClassName = "", - imageClassName = "", -}: HeroBillboardGalleryProps) => { - const { containerRef: mediaContainerRef } = useButtonAnimation({ animationType: mediaAnimation }); - - const renderCarouselItem = (item: MediaItem, index: number) => ( -
- -
- ); - - const itemCount = mediaItems?.length || 0; - const desktopWidthClass = itemCount === 3 ? "md:w-[24%]" : itemCount === 4 ? "md:w-[24%]" : "md:w-[23%]"; +export default function HeroBillboardGallery({ + title = "Gallery", description = "Welcome", textboxLayout = "default", animationType = "slide-up", className = "", carouselClassName = "", containerClassName = "", itemClassName = "", ariaLabel = "Gallery section", mediaItems = [], +}: HeroBillboardGalleryProps) { + const items = mediaItems.map((item) => ({ + imageSrc: item.imageSrc, + videoSrc: item.videoSrc, + imageAlt: item.imageAlt, + })); return ( -
- -
- - -
-
- - {mediaItems?.slice(0, 5).map(renderCarouselItem)} - -
- -
-
- {mediaItems?.slice(0, 5).map((item, index) => { - const rotations = ["-rotate-6", "rotate-6", "-rotate-6", "rotate-6", "-rotate-6"]; - const zIndexes = ["z-10", "z-20", "z-30", "z-40", "z-50"]; - const translates = ["-translate-y-5", "translate-y-5", "-translate-y-5", "translate-y-5", "-translate-y-5"]; - const marginClass = index > 0 ? "-ml-12 md:-ml-15" : ""; - - return ( -
- -
- ); - })} -
-
-
-
-
+
+

{title}

+

{description}

+ +
); -}; - -HeroBillboardGallery.displayName = "HeroBillboardGallery"; - -export default HeroBillboardGallery; +} diff --git a/src/components/sections/testimonial/TestimonialCardSix.tsx b/src/components/sections/testimonial/TestimonialCardSix.tsx index 6f6932b..440b8b4 100644 --- a/src/components/sections/testimonial/TestimonialCardSix.tsx +++ b/src/components/sections/testimonial/TestimonialCardSix.tsx @@ -1,203 +1,29 @@ -"use client"; - -import { memo } from "react"; +import React from "react"; import AutoCarousel from "@/components/cardStack/layouts/carousels/AutoCarousel"; -import TestimonialAuthor from "@/components/shared/TestimonialAuthor"; -import { cls, shouldUseInvertedText } from "@/lib/utils"; -import { useTheme } from "@/providers/themeProvider/ThemeProvider"; -import { Quote } from "lucide-react"; -import type { LucideIcon } from "lucide-react"; -import type { CardAnimationType, ButtonConfig, ButtonAnimationType, TitleSegment, TextboxLayout, InvertedBackground } from "@/components/cardStack/types"; - -type Testimonial = { - id: string; - name: string; - handle: string; - testimonial: string; - imageSrc?: string; - imageAlt?: string; - icon?: LucideIcon; -}; interface TestimonialCardSixProps { - testimonials: Testimonial[]; - animationType: CardAnimationType; - title: string; - titleSegments?: TitleSegment[]; - description: string; - textboxLayout: TextboxLayout; - useInvertedBackground: InvertedBackground; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - speed?: number; - topMarqueeDirection?: "left" | "right"; - ariaLabel?: string; - className?: string; - containerClassName?: string; - carouselClassName?: string; - bottomCarouselClassName?: string; - cardClassName?: string; - testimonialClassName?: string; - imageWrapperClassName?: string; - imageClassName?: string; - iconClassName?: string; - nameClassName?: string; - handleClassName?: string; - textBoxClassName?: string; - textBoxTitleClassName?: string; - textBoxTitleImageWrapperClassName?: string; - textBoxTitleImageClassName?: string; - textBoxDescriptionClassName?: string; - textBoxTagClassName?: string; - textBoxButtonContainerClassName?: string; - textBoxButtonClassName?: string; - textBoxButtonTextClassName?: string; + testimonials?: any[]; + title?: string; + description?: string; + animationType?: string; + useInvertedBackground?: boolean; } -interface TestimonialCardProps { - testimonial: Testimonial; - useInvertedBackground: boolean; - cardClassName?: string; - testimonialClassName?: string; - imageWrapperClassName?: string; - imageClassName?: string; - iconClassName?: string; - nameClassName?: string; - handleClassName?: string; +export default function TestimonialCardSix({ + testimonials = [], + title = "Testimonials", description = "What customers say", animationType = "slide-up", useInvertedBackground = false, +}: TestimonialCardSixProps) { + const items = testimonials.map((testimonial) => ({ + id: testimonial.id, + label: testimonial.name, + detail: testimonial.company, + })); + + return ( +
+

{title}

+

{description}

+ +
+ ); } - -const TestimonialCard = memo(({ - testimonial, - useInvertedBackground, - cardClassName = "", - testimonialClassName = "", - imageWrapperClassName = "", - imageClassName = "", - iconClassName = "", - nameClassName = "", - handleClassName = "", -}: TestimonialCardProps) => { - const Icon = testimonial.icon || Quote; - const theme = useTheme(); - const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); - - return ( -
-

- {testimonial.testimonial} -

- - -
- ); -}); - -TestimonialCard.displayName = "TestimonialCard"; - -const TestimonialCardSix = ({ - testimonials, - animationType, - title, - titleSegments, - description, - textboxLayout, - useInvertedBackground, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - speed = 40, - topMarqueeDirection = "left", - ariaLabel = "Testimonials section", - className = "", - containerClassName = "", - carouselClassName = "", - bottomCarouselClassName = "", - cardClassName = "", - testimonialClassName = "", - imageWrapperClassName = "", - imageClassName = "", - iconClassName = "", - nameClassName = "", - handleClassName = "", - textBoxClassName = "", - textBoxTitleClassName = "", - textBoxTitleImageWrapperClassName = "", - textBoxTitleImageClassName = "", - textBoxDescriptionClassName = "", - textBoxTagClassName = "", - textBoxButtonContainerClassName = "", - textBoxButtonClassName = "", - textBoxButtonTextClassName = "", -}: TestimonialCardSixProps) => { - return ( - - {testimonials.map((testimonial, index) => ( - - ))} - - ); -}; - -TestimonialCardSix.displayName = "TestimonialCardSix"; - -export default TestimonialCardSix; \ No newline at end of file diff --git a/src/components/shared/Dashboard.tsx b/src/components/shared/Dashboard.tsx index 3895ca9..1839e9f 100644 --- a/src/components/shared/Dashboard.tsx +++ b/src/components/shared/Dashboard.tsx @@ -1,4 +1,4 @@ -import React, { useRef } from "react"; +import React from "react"; import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation"; interface DashboardProps {