From f0fc407cbcc581cf4b6f75bd0fe0ddec182fd853 Mon Sep 17 00:00:00 2001 From: bender Date: Mon, 9 Mar 2026 08:26:45 +0000 Subject: [PATCH] Switch to version 1: modified src/components/sections/pricing/PricingCardFive.tsx --- .../sections/pricing/PricingCardFive.tsx | 266 +++++++++++++++--- 1 file changed, 223 insertions(+), 43 deletions(-) diff --git a/src/components/sections/pricing/PricingCardFive.tsx b/src/components/sections/pricing/PricingCardFive.tsx index ad1ef66..0e79a7d 100644 --- a/src/components/sections/pricing/PricingCardFive.tsx +++ b/src/components/sections/pricing/PricingCardFive.tsx @@ -1,51 +1,231 @@ "use client"; -import React from "react"; +import { Check } from "lucide-react"; import CardList from "@/components/cardStack/CardList"; +import Tag from "@/components/shared/Tag"; +import Button from "@/components/button/Button"; +import { getButtonProps } from "@/lib/buttonUtils"; +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 PricingPlan = { + id: string; + tag: string; + tagIcon?: LucideIcon; + price: string; + period: string; + description: string; + button: ButtonConfig; + featuresTitle: string; + features: string[]; +}; interface PricingCardFiveProps { - plans?: any[]; - title?: string; - description?: string; - animationType?: string; - useInvertedBackground?: boolean; - textboxLayout?: string; - tag?: string; - tagIcon?: any; - tagAnimation?: string; - buttons?: any[]; - buttonAnimation?: string; - titleSegments?: any[]; - ariaLabel?: string; - className?: string; - containerClassName?: string; - cardClassName?: string; - textBoxTitleClassName?: string; - textBoxDescriptionClassName?: string; - textBoxClassName?: string; - textBoxTagClassName?: string; - textBoxButtonContainerClassName?: string; - textBoxButtonClassName?: string; - textBoxButtonTextClassName?: string; - titleImageWrapperClassName?: string; - titleImageClassName?: string; + plans: PricingPlan[]; + animationType: CardAnimationType; + title: string; + titleSegments?: TitleSegment[]; + description: string; + tag?: string; + tagIcon?: LucideIcon; + tagAnimation?: ButtonAnimationType; + buttons?: ButtonConfig[]; + buttonAnimation?: ButtonAnimationType; + textboxLayout: TextboxLayout; + useInvertedBackground: InvertedBackground; + ariaLabel?: string; + className?: string; + containerClassName?: string; + cardClassName?: string; + textBoxTitleClassName?: string; + textBoxDescriptionClassName?: string; + textBoxClassName?: string; + textBoxTagClassName?: string; + textBoxButtonContainerClassName?: string; + textBoxButtonClassName?: string; + textBoxButtonTextClassName?: string; + titleImageWrapperClassName?: string; + titleImageClassName?: string; + cardContentClassName?: string; + planTagClassName?: string; + planPriceClassName?: string; + planPeriodClassName?: string; + planDescriptionClassName?: string; + planButtonClassName?: string; + planButtonTextClassName?: string; + featuresTitleClassName?: string; + featuresListClassName?: string; + featureItemClassName?: string; + featureIconClassName?: string; + featureTextClassName?: string; } -export default function PricingCardFive({ - plans = [], - title = "Pricing", description = "Our pricing plans", animationType = "slide-up", useInvertedBackground = false, - textboxLayout = "default"}: PricingCardFiveProps) { - const items = plans.map((plan) => ({ - id: plan.id, - label: plan.badge, - detail: plan.price, - })); +const PricingCardFive = ({ + plans, + animationType, + title, + titleSegments, + description, + tag, + tagIcon, + tagAnimation, + buttons, + buttonAnimation, + textboxLayout, + useInvertedBackground, + ariaLabel = "Pricing section", + className = "", + containerClassName = "", + cardClassName = "", + textBoxTitleClassName = "", + textBoxDescriptionClassName = "", + textBoxClassName = "", + textBoxTagClassName = "", + textBoxButtonContainerClassName = "", + textBoxButtonClassName = "", + textBoxButtonTextClassName = "", + titleImageWrapperClassName = "", + titleImageClassName = "", + cardContentClassName = "", + planTagClassName = "", + planPriceClassName = "", + planPeriodClassName = "", + planDescriptionClassName = "", + planButtonClassName = "", + planButtonTextClassName = "", + featuresTitleClassName = "", + featuresListClassName = "", + featureItemClassName = "", + featureIconClassName = "", + featureTextClassName = "", +}: PricingCardFiveProps) => { + const theme = useTheme(); + const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); - return ( -
-

{title}

-

{description}

- -
- ); -} + const getButtonConfigProps = () => { + if (theme.defaultButtonVariant === "hover-bubble") { + return { bgClassName: "w-full" }; + } + if (theme.defaultButtonVariant === "icon-arrow") { + return { className: "justify-between" }; + } + return {}; + }; + + return ( + + {plans.map((plan) => ( +
+
+
+ +
+ + {plan.price} + + + {plan.period} + +
+

+ {plan.description} +

+
+
+ +
+ +
+

+ {plan.featuresTitle} +

+
    + {plan.features.map((feature, index) => ( +
  • +
    + +
    + + {feature} + +
  • + ))} +
+
+
+ ))} + + ); +}; + +PricingCardFive.displayName = "PricingCardFive"; + +export default PricingCardFive;