Merge version_1 into main #2

Merged
development merged 4 commits from version_1 into main 2026-01-23 17:24:03 +00:00
4 changed files with 285 additions and 674 deletions

View File

@@ -1,251 +1,140 @@
"use client"; "use client";
import React, { useState, useEffect } from 'react'; import { useState } from 'react';
import { ChevronRight, Sparkles, Zap, Shield, Rocket, ArrowRight, Star, CheckCircle2, Globe, Users, TrendingUp, Award } from 'lucide-react'; import { ArrowRight, Sparkles, Star } from 'lucide-react';
export default function HomePage() { export default function HomePage() {
const [isLoaded, setIsLoaded] = useState(false); const [isLoaded] = useState(true);
const [activeFeature, setActiveFeature] = useState(0);
useEffect(() => {
setIsLoaded(true);
}, []);
const features = [ const features = [
{ {
icon: Zap, icon: Star,
title: "Lightning Fast", description: "Optimized performance with cutting-edge technology" title: "Premium Quality", description: "Top-tier components built with modern standards"
}, },
{ {
icon: Shield, icon: Sparkles,
title: "Enterprise Security", description: "Bank-level security protocols to protect your data" title: "Easy Integration", description: "Drop-in components that work out of the box"
}, },
{ {
icon: Rocket, icon: ArrowRight,
title: "Scalable Growth", description: "Built to scale with your business needs" title: "Fast Development", description: "Speed up your development workflow"
} }
]; ];
const testimonials = [
{
name: "Sarah Chen", role: "CTO at TechCorp", content: "This platform transformed our workflow completely. The efficiency gains are incredible.", rating: 5
},
{
name: "Michael Rodriguez", role: "Product Manager", content: "Best decision we made this year. The ROI was immediate and substantial.", rating: 5
},
{
name: "Emily Johnson", role: "Startup Founder", content: "Simple, powerful, and exactly what we needed to scale our operations.", rating: 5
}
];
const stats = [
{ label: "Active Users", value: "10M+" },
{ label: "Success Rate", value: "99.9%" },
{ label: "Countries", value: "150+" },
{ label: "Uptime", value: "99.99%" }
];
return ( return (
<div className="min-h-screen bg-gradient-to-br from-slate-50 to-blue-50"> <div className="min-h-screen bg-gradient-to-br from-purple-50 to-blue-50">
{/* Navigation */} {/* Header */}
<nav className="fixed top-0 w-full bg-white/80 backdrop-blur-md border-b border-gray-200 z-50"> <header className="bg-white shadow-sm">
<div className="max-w-7xl mx-auto px-6 py-4"> <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex items-center justify-between"> <div className="flex justify-between items-center py-6">
<div className="flex items-center space-x-2"> <div className="flex items-center">
<Sparkles className="w-8 h-8 text-blue-600" /> <Sparkles className="h-8 w-8 text-purple-600" />
<span className="text-2xl font-bold text-gray-900">WebApp</span> <span className="ml-2 text-xl font-bold text-gray-900">WebComponents</span>
</div>
<div className="hidden md:flex items-center space-x-8">
<a href="#features" className="text-gray-700 hover:text-blue-600 transition-colors">Features</a>
<a href="#pricing" className="text-gray-700 hover:text-blue-600 transition-colors">Pricing</a>
<a href="#about" className="text-gray-700 hover:text-blue-600 transition-colors">About</a>
<button className="bg-blue-600 text-white px-6 py-2 rounded-full hover:bg-blue-700 transition-colors">
Get Started
</button>
</div> </div>
<nav className="hidden md:flex space-x-8">
<a href="#" className="text-gray-500 hover:text-gray-900">Features</a>
<a href="#" className="text-gray-500 hover:text-gray-900">Pricing</a>
<a href="#" className="text-gray-500 hover:text-gray-900">About</a>
<a href="#" className="text-gray-500 hover:text-gray-900">Contact</a>
</nav>
<button className="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 transition-colors">
Get Started
</button>
</div> </div>
</div> </div>
</nav> </header>
{/* Hero Section */} {/* Hero Section */}
<section className={`pt-32 pb-20 px-6 transition-all duration-1000 ${isLoaded ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-10'}`}> <main className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div className="max-w-7xl mx-auto text-center"> <div className={`text-center transition-opacity duration-1000 ${isLoaded ? 'opacity-100' : 'opacity-0'}`}>
<div className="inline-flex items-center bg-blue-100 text-blue-800 px-4 py-2 rounded-full text-sm font-medium mb-8"> <h1 className="text-4xl md:text-6xl font-bold text-gray-900 mb-6">
<Sparkles className="w-4 h-4 mr-2" /> Build Beautiful
New: AI-Powered Analytics Now Available <span className="text-purple-600 block">Web Components</span>
</div>
<h1 className="text-5xl md:text-7xl font-bold text-gray-900 mb-6 leading-tight">
Build the Future
<span className="block bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent">
Today
</span>
</h1> </h1>
<p className="text-xl text-gray-600 mb-10 max-w-3xl mx-auto leading-relaxed"> <p className="text-xl text-gray-600 mb-8 max-w-3xl mx-auto">
Transform your business with our cutting-edge platform. Streamline operations, Create stunning, responsive web components with our premium collection of templates and tools.
boost productivity, and unlock unprecedented growth opportunities.
</p>
<div className="flex flex-col sm:flex-row gap-4 justify-center mb-16">
<button className="bg-blue-600 text-white px-8 py-4 rounded-full hover:bg-blue-700 transition-all duration-300 transform hover:scale-105 flex items-center justify-center">
Start Free Trial
<ArrowRight className="ml-2 w-5 h-5" />
</button>
<button className="border-2 border-gray-300 text-gray-700 px-8 py-4 rounded-full hover:border-blue-600 hover:text-blue-600 transition-colors">
Watch Demo
</button>
</div>
{/* Stats */}
<div className="grid grid-cols-2 md:grid-cols-4 gap-8 max-w-4xl mx-auto">
{stats.map((stat, index) => (
<div key={index} className="text-center">
<div className="text-3xl md:text-4xl font-bold text-blue-600 mb-2">{stat.value}</div>
<div className="text-gray-600">{stat.label}</div>
</div>
))}
</div>
</div>
</section>
{/* Features Section */}
<section id="features" className="py-20 px-6 bg-white">
<div className="max-w-7xl mx-auto">
<div className="text-center mb-16">
<h2 className="text-4xl md:text-5xl font-bold text-gray-900 mb-6">
Powerful Features
</h2>
<p className="text-xl text-gray-600 max-w-3xl mx-auto">
Everything you need to succeed, built with modern technology and designed for scale.
</p>
</div>
<div className="grid md:grid-cols-3 gap-8">
{features.map((feature, index) => {
const IconComponent = feature.icon;
return (
<div
key={index}
className={`p-8 rounded-2xl border-2 transition-all duration-300 cursor-pointer transform hover:scale-105 ${
activeFeature === index
? 'border-blue-500 bg-blue-50 shadow-lg'
: 'border-gray-200 bg-white hover:border-blue-300'
}`}
onMouseEnter={() => setActiveFeature(index)}
>
<IconComponent className="w-12 h-12 text-blue-600 mb-4" />
<h3 className="text-2xl font-bold text-gray-900 mb-4">{feature.title}</h3>
<p className="text-gray-600 leading-relaxed">{feature.description}</p>
</div>
);
})}
</div>
</div>
</section>
{/* Testimonials Section */}
<section className="py-20 px-6 bg-gray-50">
<div className="max-w-7xl mx-auto">
<div className="text-center mb-16">
<h2 className="text-4xl md:text-5xl font-bold text-gray-900 mb-6">
Loved by Thousands
</h2>
<p className="text-xl text-gray-600">
See what our customers are saying about their experience.
</p>
</div>
<div className="grid md:grid-cols-3 gap-8">
{testimonials.map((testimonial, index) => (
<div key={index} className="bg-white p-8 rounded-2xl shadow-sm hover:shadow-md transition-shadow">
<div className="flex items-center mb-4">
{[...Array(testimonial.rating)].map((_, i) => (
<Star key={i} className="w-5 h-5 text-yellow-400 fill-current" />
))}
</div>
<p className="text-gray-700 mb-6 italic">"{testimonial.content}"</p>
<div className="flex items-center">
<div className="w-12 h-12 bg-gradient-to-r from-blue-400 to-purple-500 rounded-full flex items-center justify-center text-white font-bold mr-4">
{testimonial.name.charAt(0)}
</div>
<div>
<div className="font-semibold text-gray-900">{testimonial.name}</div>
<div className="text-gray-600 text-sm">{testimonial.role}</div>
</div>
</div>
</div>
))}
</div>
</div>
</section>
{/* CTA Section */}
<section className="py-20 px-6 bg-gradient-to-r from-blue-600 to-purple-600">
<div className="max-w-4xl mx-auto text-center">
<h2 className="text-4xl md:text-5xl font-bold text-white mb-6">
Ready to Get Started?
</h2>
<p className="text-xl text-blue-100 mb-10 max-w-2xl mx-auto">
Join thousands of satisfied customers and transform your business today.
</p> </p>
<div className="flex flex-col sm:flex-row gap-4 justify-center"> <div className="flex flex-col sm:flex-row gap-4 justify-center">
<button className="bg-white text-blue-600 px-8 py-4 rounded-full hover:bg-gray-50 transition-colors font-semibold flex items-center justify-center"> <button className="bg-purple-600 text-white px-8 py-3 rounded-lg hover:bg-purple-700 transition-colors flex items-center justify-center">
Start Your Free Trial Start Building
<ChevronRight className="ml-2 w-5 h-5" /> <ArrowRight className="ml-2 h-5 w-5" />
</button> </button>
<button className="border-2 border-white text-white px-8 py-4 rounded-full hover:bg-white hover:text-blue-600 transition-colors"> <button className="border border-gray-300 text-gray-700 px-8 py-3 rounded-lg hover:bg-gray-50 transition-colors">
Contact Sales View Examples
</button> </button>
</div> </div>
</div> </div>
</section>
{/* Features Grid */}
<div className="mt-20 grid md:grid-cols-3 gap-8">
{features.map((feature, index) => {
const IconComponent = feature.icon;
return (
<div key={index} className="bg-white p-6 rounded-xl shadow-sm hover:shadow-md transition-shadow">
<div className="w-12 h-12 bg-purple-100 rounded-lg flex items-center justify-center mb-4">
<IconComponent className="h-6 w-6 text-purple-600" />
</div>
<h3 className="text-xl font-semibold text-gray-900 mb-2">{feature.title}</h3>
<p className="text-gray-600">{feature.description}</p>
</div>
);
})}
</div>
{/* CTA Section */}
<div className="mt-20 bg-purple-600 rounded-2xl p-8 md:p-12 text-center">
<h2 className="text-3xl md:text-4xl font-bold text-white mb-4">
Ready to get started?
</h2>
<p className="text-purple-100 text-lg mb-8">
Join thousands of developers building amazing web experiences.
</p>
<button className="bg-white text-purple-600 px-8 py-3 rounded-lg hover:bg-gray-50 transition-colors font-semibold">
Start Your Free Trial
</button>
</div>
</main>
{/* Footer */} {/* Footer */}
<footer className="bg-gray-900 text-white py-16 px-6"> <footer className="bg-gray-900 text-white py-12 mt-20">
<div className="max-w-7xl mx-auto"> <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="grid md:grid-cols-4 gap-8 mb-12"> <div className="grid md:grid-cols-4 gap-8">
<div> <div>
<div className="flex items-center space-x-2 mb-6"> <div className="flex items-center mb-4">
<Sparkles className="w-8 h-8 text-blue-400" /> <Sparkles className="h-6 w-6 text-purple-400" />
<span className="text-2xl font-bold">WebApp</span> <span className="ml-2 text-lg font-bold">WebComponents</span>
</div> </div>
<p className="text-gray-400 leading-relaxed"> <p className="text-gray-400">
Building the future of digital experiences with cutting-edge technology. Building the future of web development, one component at a time.
</p> </p>
</div> </div>
<div> <div>
<h3 className="text-lg font-semibold mb-4">Product</h3> <h3 className="font-semibold mb-4">Product</h3>
<ul className="space-y-2 text-gray-400"> <ul className="space-y-2 text-gray-400">
<li><a href="#" className="hover:text-white transition-colors">Features</a></li> <li><a href="#" className="hover:text-white">Features</a></li>
<li><a href="#" className="hover:text-white transition-colors">Pricing</a></li> <li><a href="#" className="hover:text-white">Pricing</a></li>
<li><a href="#" className="hover:text-white transition-colors">Integrations</a></li> <li><a href="#" className="hover:text-white">Documentation</a></li>
<li><a href="#" className="hover:text-white transition-colors">API</a></li>
</ul> </ul>
</div> </div>
<div> <div>
<h3 className="text-lg font-semibold mb-4">Company</h3> <h3 className="font-semibold mb-4">Company</h3>
<ul className="space-y-2 text-gray-400"> <ul className="space-y-2 text-gray-400">
<li><a href="#" className="hover:text-white transition-colors">About</a></li> <li><a href="#" className="hover:text-white">About</a></li>
<li><a href="#" className="hover:text-white transition-colors">Careers</a></li> <li><a href="#" className="hover:text-white">Blog</a></li>
<li><a href="#" className="hover:text-white transition-colors">Blog</a></li> <li><a href="#" className="hover:text-white">Contact</a></li>
<li><a href="#" className="hover:text-white transition-colors">Contact</a></li>
</ul> </ul>
</div> </div>
<div> <div>
<h3 className="text-lg font-semibold mb-4">Support</h3> <h3 className="font-semibold mb-4">Support</h3>
<ul className="space-y-2 text-gray-400"> <ul className="space-y-2 text-gray-400">
<li><a href="#" className="hover:text-white transition-colors">Help Center</a></li> <li><a href="#" className="hover:text-white">Help Center</a></li>
<li><a href="#" className="hover:text-white transition-colors">Documentation</a></li> <li><a href="#" className="hover:text-white">Community</a></li>
<li><a href="#" className="hover:text-white transition-colors">Status</a></li> <li><a href="#" className="hover:text-white">Status</a></li>
<li><a href="#" className="hover:text-white transition-colors">Security</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<div className="border-t border-gray-800 pt-8 flex flex-col md:flex-row items-center justify-between"> <div className="border-t border-gray-800 mt-8 pt-8 text-center text-gray-400">
<p className="text-gray-400">© 2024 WebApp. All rights reserved.</p> <p>&copy; 2024 WebComponents. All rights reserved.</p>
<div className="flex space-x-6 mt-4 md:mt-0">
<a href="#" className="text-gray-400 hover:text-white transition-colors">Privacy</a>
<a href="#" className="text-gray-400 hover:text-white transition-colors">Terms</a>
<a href="#" className="text-gray-400 hover:text-white transition-colors">Cookies</a>
</div>
</div> </div>
</div> </div>
</footer> </footer>

View File

@@ -1,118 +1,32 @@
import { useEffect, useState, useRef, RefObject } from "react"; import { useCallback, useState, useEffect } from 'react';
const MOBILE_BREAKPOINT = 768; export const useDepth3DAnimation = () => {
const ANIMATION_SPEED = 0.05; const [isAnimating, setIsAnimating] = useState(false);
const ROTATION_SPEED = 0.1; const [depth, setDepth] = useState(0);
const MOUSE_MULTIPLIER = 0.5;
const ROTATION_MULTIPLIER = 0.25;
interface UseDepth3DAnimationProps { const startAnimation = useCallback(() => {
itemRefs: RefObject<(HTMLElement | null)[]>; setIsAnimating(true);
containerRef: RefObject<HTMLDivElement | null>; setDepth(100);
perspectiveRef?: RefObject<HTMLDivElement | null>; }, []);
isEnabled: boolean;
} const stopAnimation = useCallback(() => {
setIsAnimating(false);
export const useDepth3DAnimation = ({ setDepth(0);
itemRefs,
containerRef,
perspectiveRef,
isEnabled,
}: UseDepth3DAnimationProps) => {
const [isMobile, setIsMobile] = useState(false);
// Detect mobile viewport
useEffect(() => {
const checkMobile = () => {
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
};
checkMobile();
window.addEventListener("resize", checkMobile);
return () => {
window.removeEventListener("resize", checkMobile);
};
}, []); }, []);
// 3D mouse-tracking effect (desktop only)
useEffect(() => { useEffect(() => {
if (!isEnabled || isMobile) return; if (isAnimating) {
const timer = setTimeout(() => {
let animationFrameId: number; setIsAnimating(false);
let isAnimating = true; }, 1000);
return () => clearTimeout(timer);
// Apply perspective to the perspective ref (grid) if provided, otherwise to container (section)
const perspectiveElement = perspectiveRef?.current || containerRef.current;
if (perspectiveElement) {
perspectiveElement.style.perspective = "1200px";
perspectiveElement.style.transformStyle = "preserve-3d";
} }
}, [isAnimating]);
let mouseX = 0; return {
let mouseY = 0; isAnimating,
let isMouseInSection = false; depth,
startAnimation,
let currentX = 0; stopAnimation
let currentY = 0; };
let currentRotationX = 0;
let currentRotationY = 0;
const handleMouseMove = (event: MouseEvent): void => {
if (containerRef.current) {
const rect = containerRef.current.getBoundingClientRect();
isMouseInSection =
event.clientX >= rect.left &&
event.clientX <= rect.right &&
event.clientY >= rect.top &&
event.clientY <= rect.bottom;
}
if (isMouseInSection) {
mouseX = (event.clientX / window.innerWidth) * 100 - 50;
mouseY = (event.clientY / window.innerHeight) * 100 - 50;
}
};
const animate = (): void => {
if (!isAnimating) return;
if (isMouseInSection) {
const distX = mouseX * MOUSE_MULTIPLIER - currentX;
const distY = mouseY * MOUSE_MULTIPLIER - currentY;
currentX += distX * ANIMATION_SPEED;
currentY += distY * ANIMATION_SPEED;
const distRotX = -mouseY * ROTATION_MULTIPLIER - currentRotationX;
const distRotY = mouseX * ROTATION_MULTIPLIER - currentRotationY;
currentRotationX += distRotX * ROTATION_SPEED;
currentRotationY += distRotY * ROTATION_SPEED;
} else {
currentX += -currentX * ANIMATION_SPEED;
currentY += -currentY * ANIMATION_SPEED;
currentRotationX += -currentRotationX * ROTATION_SPEED;
currentRotationY += -currentRotationY * ROTATION_SPEED;
}
itemRefs.current?.forEach((ref) => {
if (!ref) return;
ref.style.transform = `translate(${currentX}px, ${currentY}px) rotateX(${currentRotationX}deg) rotateY(${currentRotationY}deg)`;
});
animationFrameId = requestAnimationFrame(animate);
};
animate();
window.addEventListener("mousemove", handleMouseMove);
return () => {
window.removeEventListener("mousemove", handleMouseMove);
if (animationFrameId) {
cancelAnimationFrame(animationFrameId);
}
isAnimating = false;
};
}, [isEnabled, isMobile, itemRefs, containerRef]);
return { isMobile };
}; };

View File

@@ -1,143 +1,95 @@
"use client"; import React from 'react';
import React, { Children, useCallback } from "react"; interface TimelineItem {
import { cls } from "@/lib/utils"; id: string;
import CardStackTextBox from "../../CardStackTextBox"; title: string;
import { useCardAnimation } from "../../hooks/useCardAnimation"; description: string;
import type { LucideIcon } from "lucide-react"; date: string;
import type { ButtonConfig, CardAnimationType, TitleSegment } from "../../types"; status: 'completed' | 'active' | 'pending';
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
type TimelineVariant = "timeline";
interface TimelineBaseProps {
children: React.ReactNode;
variant?: TimelineVariant;
uniformGridCustomHeightClasses?: string;
animationType: CardAnimationType;
title?: string;
titleSegments?: TitleSegment[];
description?: string;
tag?: string;
tagIcon?: LucideIcon;
buttons?: ButtonConfig[];
textboxLayout?: TextboxLayout;
useInvertedBackground?: InvertedBackground;
className?: string;
containerClassName?: string;
textBoxClassName?: string;
titleClassName?: string;
titleImageWrapperClassName?: string;
titleImageClassName?: string;
descriptionClassName?: string;
tagClassName?: string;
buttonContainerClassName?: string;
buttonClassName?: string;
buttonTextClassName?: string;
ariaLabel?: string;
} }
const TimelineBase = ({ interface TimelineBaseProps {
children, items: TimelineItem[];
variant = "timeline", orientation?: 'vertical' | 'horizontal';
uniformGridCustomHeightClasses = "min-h-80 2xl:min-h-90", variant?: 'default' | 'compact' | 'detailed';
animationType, className?: string;
title, }
titleSegments,
description,
tag,
tagIcon,
buttons,
textboxLayout = "default",
useInvertedBackground,
className = "",
containerClassName = "",
textBoxClassName = "",
titleClassName = "",
titleImageWrapperClassName = "",
titleImageClassName = "",
descriptionClassName = "",
tagClassName = "",
buttonContainerClassName = "",
buttonClassName = "",
buttonTextClassName = "",
ariaLabel = "Timeline section",
}: TimelineBaseProps) => {
const childrenArray = Children.toArray(children);
const { itemRefs } = useCardAnimation({
animationType,
itemCount: childrenArray.length,
isGrid: false
});
const getItemClasses = useCallback((index: number) => { export const TimelineBase: React.FC<TimelineBaseProps> = ({
// Timeline variant - scattered/organic pattern items,
const alignmentClass = orientation = 'vertical',
index % 2 === 0 ? "self-start ml-0" : "self-end mr-0"; className = ''
}) => {
const getStatusColor = (status: TimelineItem['status']) => {
switch (status) {
case 'completed':
return 'bg-green-500';
case 'active':
return 'bg-blue-500';
case 'pending':
return 'bg-gray-300';
default:
return 'bg-gray-300';
}
};
const marginClasses = cls( const getTextColor = (status: TimelineItem['status']) => {
index % 4 === 0 && "md:ml-0", switch (status) {
index % 4 === 1 && "md:mr-20", case 'completed':
index % 4 === 2 && "md:ml-15", return 'text-green-700';
index % 4 === 3 && "md:mr-30" case 'active':
return 'text-blue-700';
case 'pending':
return 'text-gray-500';
default:
return 'text-gray-500';
}
};
if (orientation === 'horizontal') {
return (
<div className={`flex items-center space-x-4 ${className}`}>
{items.map((item, index) => (
<div key={item.id} className="flex items-center">
<div className="flex flex-col items-center">
<div className={`w-4 h-4 rounded-full ${getStatusColor(item.status)}`} />
<div className="mt-2 text-center">
<div className={`text-sm font-medium ${getTextColor(item.status)}`}>
{item.title}
</div>
<div className="text-xs text-gray-500 mt-1">{item.date}</div>
</div>
</div>
{index < items.length - 1 && (
<div className="w-8 h-px bg-gray-300 mx-4" />
)}
</div>
))}
</div>
); );
}
return cls(alignmentClass, marginClasses);
}, []);
return ( return (
<section <div className={`space-y-4 ${className}`}>
className={cls( {items.map((item, index) => (
"relative py-20 w-full", <div key={item.id} className="flex items-start space-x-4">
useInvertedBackground === "invertDefault" && "bg-foreground", <div className="flex flex-col items-center">
className <div className={`w-4 h-4 rounded-full ${getStatusColor(item.status)}`} />
)} {index < items.length - 1 && (
aria-label={ariaLabel} <div className="w-px h-8 bg-gray-300 mt-2" />
> )}
<div </div>
className={cls("w-content-width mx-auto flex flex-col gap-6", containerClassName)} <div className="flex-1 pb-4">
> <div className={`font-medium ${getTextColor(item.status)}`}>
{(title || titleSegments || description) && ( {item.title}
<CardStackTextBox
title={title}
titleSegments={titleSegments}
description={description}
tag={tag}
tagIcon={tagIcon}
buttons={buttons}
textboxLayout={textboxLayout}
useInvertedBackground={useInvertedBackground}
textBoxClassName={textBoxClassName}
titleClassName={titleClassName}
titleImageWrapperClassName={titleImageWrapperClassName}
titleImageClassName={titleImageClassName}
descriptionClassName={descriptionClassName}
tagClassName={tagClassName}
buttonContainerClassName={buttonContainerClassName}
buttonClassName={buttonClassName}
buttonTextClassName={buttonTextClassName}
/>
)}
<div
className={cls(
"relative z-10 flex flex-col gap-6 md:gap-15"
)}
>
{Children.map(childrenArray, (child, index) => (
<div
key={index}
className={cls("w-65 md:w-25", uniformGridCustomHeightClasses, getItemClasses(index))}
ref={(el) => { itemRefs.current[index] = el; }}
>
{child}
</div> </div>
))} <div className="text-sm text-gray-600 mt-1">
{item.description}
</div>
<div className="text-xs text-gray-500 mt-2">{item.date}</div>
</div>
</div> </div>
</div> ))}
</section> </div>
); );
}; };
TimelineBase.displayName = "TimelineBase";
export default React.memo(TimelineBase);

View File

@@ -1,242 +1,98 @@
"use client"; import React from 'react';
import { Check } from 'lucide-react';
import { memo } from "react"; interface PricingFeature {
import CardStack from "@/components/cardStack/CardStack"; text: string;
import Button from "@/components/button/Button"; included: boolean;
import PricingBadge from "@/components/shared/PricingBadge"; }
import PricingFeatureList from "@/components/shared/PricingFeatureList";
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, CardAnimationType, TitleSegment } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
type PricingPlan = { interface PricingPlan {
id: string; id: string;
badge: string; name: string;
badgeIcon?: LucideIcon; price: number;
price: string; period: string;
subtitle: string; description: string;
buttons: ButtonConfig[]; features: PricingFeature[];
features: string[]; popular?: boolean;
}; buttonText: string;
}
interface PricingCardEightProps { interface PricingCardEightProps {
plans: PricingPlan[]; plan: PricingPlan;
carouselMode?: "auto" | "buttons"; className?: string;
uniformGridCustomHeightClasses?: string; onSelect?: (planId: string) => void;
animationType: CardAnimationType;
title: string;
titleSegments?: TitleSegment[];
description: string;
tag?: string;
tagIcon?: LucideIcon;
buttons?: ButtonConfig[];
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
ariaLabel?: string;
className?: string;
containerClassName?: string;
cardClassName?: string;
textBoxTitleClassName?: string;
textBoxTitleImageWrapperClassName?: string;
textBoxTitleImageClassName?: string;
textBoxDescriptionClassName?: string;
badgeClassName?: string;
priceClassName?: string;
subtitleClassName?: string;
planButtonContainerClassName?: string;
planButtonClassName?: string;
featuresClassName?: string;
featureItemClassName?: string;
gridClassName?: string;
carouselClassName?: string;
controlsClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
} }
interface PricingCardItemProps { export const PricingCardEight: React.FC<PricingCardEightProps> = ({
plan: PricingPlan; plan,
shouldUseLightText: boolean; className = '',
cardClassName?: string; onSelect
badgeClassName?: string; }) => {
priceClassName?: string; const handleSelect = () => {
subtitleClassName?: string; if (onSelect) {
planButtonContainerClassName?: string; onSelect(plan.id);
planButtonClassName?: string; }
featuresClassName?: string; };
featureItemClassName?: string;
}
const PricingCardItem = memo(({ const cardClasses = [
plan, 'relative bg-white rounded-2xl shadow-lg border border-gray-200 p-8',
shouldUseLightText, 'hover:shadow-xl transition-all duration-300',
cardClassName = "", plan.popular ? 'ring-2 ring-blue-500 scale-105' : '',
badgeClassName = "", className
priceClassName = "", ].filter(Boolean).join(' ');
subtitleClassName = "",
planButtonContainerClassName = "",
planButtonClassName = "",
featuresClassName = "",
featureItemClassName = "",
}: PricingCardItemProps) => {
const theme = useTheme();
const getButtonConfigProps = () => { const buttonClasses = [
if (theme.defaultButtonVariant === "hover-bubble") { 'w-full py-3 px-6 rounded-lg font-semibold transition-colors duration-200',
return { bgClassName: "w-full" }; plan.popular
} ? 'bg-blue-600 text-white hover:bg-blue-700'
if (theme.defaultButtonVariant === "icon-arrow") { : 'bg-gray-100 text-gray-900 hover:bg-gray-200 border border-gray-300'
return { className: "justify-between" }; ].join(' ');
}
return {};
};
return ( return (
<div className={cls("relative h-full card text-foreground rounded-theme-capped p-3 flex flex-col gap-3", cardClassName)}> <div className={cardClasses}>
<div className="relative secondary-button p-3 flex flex-col gap-3 rounded-theme-capped" > {plan.popular && (
<PricingBadge <div className="absolute -top-4 left-1/2 transform -translate-x-1/2">
badge={plan.badge} <span className="bg-blue-600 text-white px-4 py-1 rounded-full text-sm font-medium">
badgeIcon={plan.badgeIcon} Most Popular
className={badgeClassName} </span>
/>
<div className="relative z-1 flex flex-col gap-1">
<div className="text-5xl font-medium text-foreground">
{plan.price}
</div>
<p className="text-base text-foreground">
{plan.subtitle}
</p>
</div>
{plan.buttons && plan.buttons.length > 0 && (
<div className={cls("relative z-1 w-full flex flex-col gap-3", planButtonContainerClassName)}>
{plan.buttons.slice(0, 2).map((button, index) => (
<Button
key={`${button.text}-${index}`}
{...getButtonProps(
{ ...button, props: { ...button.props, ...getButtonConfigProps() } },
index,
theme.defaultButtonVariant,
cls("w-full", planButtonClassName)
)}
/>
))}
</div>
)}
</div>
<div className="p-3 pt-0" >
<PricingFeatureList
features={plan.features}
shouldUseLightText={shouldUseLightText}
className={cls("mt-1", featuresClassName)}
featureItemClassName={featureItemClassName}
/>
</div>
</div> </div>
); )}
});
PricingCardItem.displayName = "PricingCardItem"; <div className="text-center">
<h3 className="text-2xl font-bold text-gray-900 mb-2">{plan.name}</h3>
<p className="text-gray-600 mb-6">{plan.description}</p>
const PricingCardEight = ({ <div className="mb-8">
plans, <span className="text-5xl font-bold text-gray-900">${plan.price}</span>
carouselMode = "buttons", <span className="text-gray-600 ml-2">/{plan.period}</span>
uniformGridCustomHeightClasses, </div>
animationType, </div>
title,
titleSegments,
description,
tag,
tagIcon,
buttons,
textboxLayout,
useInvertedBackground,
ariaLabel = "Pricing section",
className = "",
containerClassName = "",
cardClassName = "",
textBoxTitleClassName = "",
textBoxTitleImageWrapperClassName = "",
textBoxTitleImageClassName = "",
textBoxDescriptionClassName = "",
badgeClassName = "",
priceClassName = "",
subtitleClassName = "",
planButtonContainerClassName = "",
planButtonClassName = "",
featuresClassName = "",
featureItemClassName = "",
gridClassName = "",
carouselClassName = "",
controlsClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
}: PricingCardEightProps) => {
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
return ( <div className="space-y-4 mb-8">
<CardStack {plan.features.map((feature, index) => (
useInvertedBackground={useInvertedBackground} <div key={index} className="flex items-start space-x-3">
mode={carouselMode} <div className={`flex-shrink-0 w-5 h-5 rounded-full flex items-center justify-center mt-0.5 ${
gridVariant="uniform-all-items-equal" feature.included
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses} ? 'bg-green-100 text-green-600'
animationType={animationType} : 'bg-gray-100 text-gray-400'
}`}>
<Check className="w-3 h-3" />
</div>
<span className={`text-sm ${
feature.included ? 'text-gray-900' : 'text-gray-500 line-through'
}`}>
{feature.text}
</span>
</div>
))}
</div>
title={title} <button
titleSegments={titleSegments} onClick={handleSelect}
description={description} className={buttonClasses}
tag={tag} >
tagIcon={tagIcon} {plan.buttonText}
buttons={buttons} </button>
textboxLayout={textboxLayout} </div>
className={className} );
containerClassName={containerClassName}
gridClassName={gridClassName}
carouselClassName={carouselClassName}
controlsClassName={controlsClassName}
textBoxClassName={textBoxClassName}
titleClassName={textBoxTitleClassName}
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
titleImageClassName={textBoxTitleImageClassName}
descriptionClassName={textBoxDescriptionClassName}
tagClassName={textBoxTagClassName}
buttonContainerClassName={textBoxButtonContainerClassName}
buttonClassName={textBoxButtonClassName}
buttonTextClassName={textBoxButtonTextClassName}
ariaLabel={ariaLabel}
>
{plans.map((plan, index) => (
<PricingCardItem
key={`${plan.id}-${index}`}
plan={plan}
shouldUseLightText={shouldUseLightText}
cardClassName={cardClassName}
badgeClassName={badgeClassName}
priceClassName={priceClassName}
subtitleClassName={subtitleClassName}
planButtonContainerClassName={planButtonContainerClassName}
planButtonClassName={planButtonClassName}
featuresClassName={featuresClassName}
featureItemClassName={featureItemClassName}
/>
))}
</CardStack>
);
}; };
PricingCardEight.displayName = "PricingCardEight";
export default PricingCardEight;