Compare commits
174 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d1df86219e | |||
| 31b0edabfa | |||
| b5c549e4be | |||
| 2c849e1bf8 | |||
| ae90841957 | |||
| 4fad9c6c78 | |||
| 8935af662c | |||
| d2c927eed5 | |||
| 7fb0941584 | |||
| 51549cae38 | |||
| 73dcb6c072 | |||
| 9f982e608b | |||
| fe197c7e27 | |||
| f13a3325c9 | |||
| ef227cb3ff | |||
| da7d2574ce | |||
| f83ab36449 | |||
| 3bdf547800 | |||
| 1db534f119 | |||
| 0dd7a323a3 | |||
| 49e85cdd1b | |||
| 5c4160147d | |||
| 411acf2199 | |||
| a61135fecc | |||
| 8b070f8351 | |||
| f3da7ddf9f | |||
| 3311cdc7bb | |||
| 90c6933b68 | |||
| 3752d71715 | |||
| bbc12e3cc3 | |||
| e56285cc48 | |||
| 10645f98e7 | |||
| 659e24341c | |||
| 6f88823459 | |||
| 8f67bd8f22 | |||
| dac30123b6 | |||
| 6365805b79 | |||
| e38e2b3961 | |||
| a0fb2d580c | |||
| b07d86f326 | |||
| 3511910f75 | |||
| 68e38376d2 | |||
| 47127e0690 | |||
| e4453d796c | |||
| 22daf9fdd2 | |||
| 27b5d9ed97 | |||
| 7a03ada4e4 | |||
| 568f0f00ec | |||
| 43bd4c53aa | |||
| 15ff56aae2 | |||
| 1a3cc55d1d | |||
| 2448957111 | |||
| 6a288adc4b | |||
| 14510f9a49 | |||
| 44ce27f88e | |||
| 0127db601d | |||
| 542a78040f | |||
| 9f7b6cc123 | |||
| 84a4adb109 | |||
| 60a276e40b | |||
| 8564688f8f | |||
| 04540c61fb | |||
| 6bdbf9cbd1 | |||
| 1af6b22b68 | |||
| 13d807dc3d | |||
| cb74bd6a08 | |||
| ecec418b7a | |||
| 95e7269d86 | |||
| 7ccb762324 | |||
| acb0030513 | |||
| a20613d302 | |||
| 63867862de | |||
| 7f0f34f7ca | |||
| 6825213821 | |||
| baf13bce50 | |||
| d478955ac3 | |||
| 9fcb0e446f | |||
| 568c47867a | |||
| f3c358c000 | |||
| b0c084ddad | |||
| ff96007360 | |||
| e5ebdb49fc | |||
| e0c048b9c4 | |||
| 05be6e80bf | |||
| d127392ee8 | |||
| 085cee5860 | |||
| d7f1497b3c | |||
| 417a5b22fb | |||
| 331be6c77c | |||
| 4cb0280f09 | |||
| 225d1980c1 | |||
| d2e12c5eb6 | |||
| 9ddc3ae1ca | |||
| a4ab8f67d2 | |||
| 1eb98ee897 | |||
| ab9f0ce23e | |||
| a67ee5de41 | |||
| b2386f2f43 | |||
| 458165c964 | |||
| 4ec5861e28 | |||
| 536348a49a | |||
| bbe53fb045 | |||
| 9a6b78854a | |||
| 9fee945c98 | |||
| f27c6debcc | |||
| 9e002aff62 | |||
| 76c6e4864b | |||
| e71318a94c | |||
| 25f8715b22 | |||
| ba3ee41d83 | |||
| 3178315c66 | |||
| 6616548a0b | |||
| 7948f1a727 | |||
| 664a624709 | |||
| 7a21b26360 | |||
| 83ad92b982 | |||
| 6b65c6bbe1 | |||
| 0bea53ab83 | |||
| a5b051a2ca | |||
| 7c4cfe3b64 | |||
| f6923aadd4 | |||
| 7d9c48ae02 | |||
| d97972a3ff | |||
| f56cc7e968 | |||
| fd26cb13cc | |||
| 408980bbd8 | |||
| f5ec9ea450 | |||
| 735e22a340 | |||
| 1960d52149 | |||
| a2ec4453cd | |||
| fdda2fc714 | |||
| 5d154806bc | |||
| ced50daa4a | |||
| 7586d39fa0 | |||
| 2bfda7530f | |||
| 32847a40c5 | |||
| 271b199b22 | |||
| 1e7cc1b5fd | |||
| 2ba27bae7b | |||
| a8d85a8309 | |||
| 59f833dba5 | |||
| 68525ac7fe | |||
| 16fb143fe1 | |||
| 3b27f272f5 | |||
| 04b12f46bd | |||
| 6725a831c9 | |||
| d30c75162a | |||
| 272db25c20 | |||
| d1a4eeeb3f | |||
| 992480d0eb | |||
| e137be5e5f | |||
| bb2d912f95 | |||
| ea86566fb4 | |||
| 269bee8b8f | |||
| f8db03ff88 | |||
| 47b76a49f1 | |||
| 26996b86bd | |||
| 2a63a64f07 | |||
| b414929c42 | |||
| 99de6b8afb | |||
| f9d4961f01 | |||
| f7e3753100 | |||
| f85657c457 | |||
| 2bc11c9719 | |||
| 7807971805 | |||
| 718928fdc2 | |||
| 6b0985b3f6 | |||
| 9d439f4676 | |||
| 18088de45c | |||
| f378001c02 | |||
| 68b1764c1e | |||
| 130732d1fa | |||
| b4c1b5a4fd | |||
| 6a6de596bf |
12
public/robots.txt
Normal file
12
public/robots.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# https://www.robotstxt.org/robotstxt.html
|
||||||
|
User-agent: *
|
||||||
|
Disallow: /admin
|
||||||
|
Disallow: /api
|
||||||
|
Disallow: /_next
|
||||||
|
Disallow: /private
|
||||||
|
|
||||||
|
Allow: /
|
||||||
|
|
||||||
|
Sitemap: https://ogretmen-platformu.com/sitemap.xml
|
||||||
|
|
||||||
|
Crawl-delay: 1
|
||||||
33
public/site.webmanifest
Normal file
33
public/site.webmanifest
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"name": "Öğretmen Platformu", "short_name": "Öğretmen Platformu", "description": "50+ deneyimli öğretmenle bağlantı kurun. Kişiselleştirilmiş eğitim, esnek zaman planlaması ve etkili öğrenme deneyimi.", "start_url": "/", "scope": "/", "display": "standalone", "background_color": "#ffffff", "theme_color": "#000000", "orientation": "portrait-primary", "icons": [
|
||||||
|
{
|
||||||
|
"src": "/favicon-192x192.png", "sizes": "192x192", "type": "image/png", "purpose": "any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/favicon-512x512.png", "sizes": "512x512", "type": "image/png", "purpose": "any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/favicon-maskable-192x192.png", "sizes": "192x192", "type": "image/png", "purpose": "maskable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/favicon-maskable-512x512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"screenshots": [
|
||||||
|
{
|
||||||
|
"src": "/screenshot1.png", "sizes": "540x720", "type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/screenshot2.png", "sizes": "1280x720", "type": "image/png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"categories": ["education", "business"],
|
||||||
|
"shortcuts": [
|
||||||
|
{
|
||||||
|
"name": "Öğretmen Bul", "short_name": "Öğretmen Bul", "description": "Öğretmen platformumuzda öğretmen bulun", "url": "/teachers", "icons": [{ "src": "/favicon-192x192.png", "sizes": "192x192" }]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Derslerim", "short_name": "Derslerim", "description": "Kayıtlı derslerinizi görüntüleyin", "url": "/my-lessons", "icons": [{ "src": "/favicon-192x192.png", "sizes": "192x192" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
121
src/app/contact/page.tsx
Normal file
121
src/app/contact/page.tsx
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
|
||||||
|
import ContactText from "@/components/sections/contact/ContactText";
|
||||||
|
import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal";
|
||||||
|
import { Mail, Phone, MapPin, Clock } from "lucide-react";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
|
export default function ContactPage() {
|
||||||
|
const navItems = [
|
||||||
|
{ name: "Ana Sayfa", id: "/" },
|
||||||
|
{ name: "Öğretmenler", id: "/teachers" },
|
||||||
|
{ name: "Etkinlikler", id: "/events" },
|
||||||
|
{ name: "Çalışma Programı", id: "/schedule" },
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="text-shift"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="rounded"
|
||||||
|
contentWidth="compact"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="circleGradient"
|
||||||
|
cardStyle="layered-gradient"
|
||||||
|
primaryButtonStyle="shadow"
|
||||||
|
secondaryButtonStyle="layered"
|
||||||
|
headingFontWeight="light"
|
||||||
|
>
|
||||||
|
{/* Breadcrumb */}
|
||||||
|
<nav className="hidden md:flex items-center gap-2 p-4 text-sm text-gray-600" aria-label="Breadcrumb">
|
||||||
|
<Link href="/" className="hover:text-primary-cta">Ana Sayfa</Link>
|
||||||
|
<span>/</span>
|
||||||
|
<span className="text-gray-900 font-semibold">İletişim</span>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleFullscreen
|
||||||
|
navItems={navItems}
|
||||||
|
brandName="Öğretmen Platformu"
|
||||||
|
bottomLeftText="Eğitim Topluluğu"
|
||||||
|
bottomRightText="info@platform.com"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="py-12 px-4 md:py-20">
|
||||||
|
<div className="max-w-6xl mx-auto">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="text-center mb-12 md:mb-16">
|
||||||
|
<h1 className="text-4xl md:text-5xl font-bold text-foreground mb-4">Bize Ulaşın</h1>
|
||||||
|
<p className="text-lg text-gray-600 max-w-2xl mx-auto">
|
||||||
|
Sorularınız mı var? Destek ekibimiz size yardımcı olmaktan mutluluk duyacaktır.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Contact Info Cards */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-12">
|
||||||
|
<div className="bg-card p-6 rounded-lg border border-border">
|
||||||
|
<div className="flex items-center gap-3 mb-4">
|
||||||
|
<Mail className="text-primary-cta" size={24} />
|
||||||
|
<h3 className="font-semibold text-foreground">Email</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-sm text-gray-600">info@platform.com</p>
|
||||||
|
<p className="text-xs text-gray-500 mt-2">Yanıt süresi: 2 saat</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-card p-6 rounded-lg border border-border">
|
||||||
|
<div className="flex items-center gap-3 mb-4">
|
||||||
|
<Phone className="text-primary-cta" size={24} />
|
||||||
|
<h3 className="font-semibold text-foreground">Telefon</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-sm text-gray-600">+90 (212) 555-0123</p>
|
||||||
|
<p className="text-xs text-gray-500 mt-2">Haftada 7 gün açık</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-card p-6 rounded-lg border border-border">
|
||||||
|
<div className="flex items-center gap-3 mb-4">
|
||||||
|
<MapPin className="text-primary-cta" size={24} />
|
||||||
|
<h3 className="font-semibold text-foreground">Adres</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-sm text-gray-600">İstanbul, Türkiye</p>
|
||||||
|
<p className="text-xs text-gray-500 mt-2">Merkez ofis</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-card p-6 rounded-lg border border-border">
|
||||||
|
<div className="flex items-center gap-3 mb-4">
|
||||||
|
<Clock className="text-primary-cta" size={24} />
|
||||||
|
<h3 className="font-semibold text-foreground">Saatler</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-sm text-gray-600">24/7 Müşteri Desteği</p>
|
||||||
|
<p className="text-xs text-gray-500 mt-2">Her zaman buradayız</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Contact Form Section */}
|
||||||
|
<div id="contact-form" data-section="contact-form" className="mt-16">
|
||||||
|
<ContactText
|
||||||
|
text="Mesajınızı bize gönderin ve en kısa sürede yanıt alalım."
|
||||||
|
background={{ variant: "plain" }}
|
||||||
|
useInvertedBackground={false}
|
||||||
|
buttons={[{ text: "İletişim Formu", href: "https://example.com/contact" }]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
|
<FooterLogoReveal
|
||||||
|
logoText="Öğretmen Platformu"
|
||||||
|
leftLink={{
|
||||||
|
text: "Gizlilik Politikası", href: "#"
|
||||||
|
}}
|
||||||
|
rightLink={{
|
||||||
|
text: "Kullanım Şartları", href: "#"
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
98
src/app/dashboard/page.tsx
Normal file
98
src/app/dashboard/page.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
"use client";
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
|
||||||
|
import HeroBillboardRotatedCarousel from '@/components/sections/hero/HeroBillboardRotatedCarousel';
|
||||||
|
import MetricCardEleven from '@/components/sections/metrics/MetricCardEleven';
|
||||||
|
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
|
||||||
|
import ContactText from '@/components/sections/contact/ContactText';
|
||||||
|
import FooterLogoReveal from '@/components/sections/footer/FooterLogoReveal';
|
||||||
|
import Link from 'next/link';
|
||||||
|
|
||||||
|
export default function Dashboard() {
|
||||||
|
const navItems = [
|
||||||
|
{ name: "Home", id: "/" },
|
||||||
|
{ name: "Dashboard", id: "/dashboard" },
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="text-stagger"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="rounded"
|
||||||
|
contentWidth="medium"
|
||||||
|
sizing="medium"
|
||||||
|
background="aurora"
|
||||||
|
cardStyle="glass-elevated"
|
||||||
|
primaryButtonStyle="gradient"
|
||||||
|
secondaryButtonStyle="glass"
|
||||||
|
headingFontWeight="normal"
|
||||||
|
>
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleFullscreen
|
||||||
|
navItems={[
|
||||||
|
{ name: "Home", id: "/" },
|
||||||
|
{ name: "Dashboard", id: "/dashboard" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div id="hero" data-section="hero">
|
||||||
|
<HeroBillboardRotatedCarousel
|
||||||
|
title="Dashboard"
|
||||||
|
description="View your statistics and information"
|
||||||
|
background={{ variant: "rotated-rays-animated" }}
|
||||||
|
carouselItems={[
|
||||||
|
{ id: "1", imageSrc: "/placeholder1.webp", imageAlt: "Dashboard 1" },
|
||||||
|
{ id: "2", imageSrc: "/placeholder2.webp", imageAlt: "Dashboard 2" },
|
||||||
|
{ id: "3", imageSrc: "/placeholder3.webp", imageAlt: "Dashboard 3" },
|
||||||
|
{ id: "4", imageSrc: "/placeholder4.webp", imageAlt: "Dashboard 4" },
|
||||||
|
{ id: "5", imageSrc: "/placeholder5.webp", imageAlt: "Dashboard 5" },
|
||||||
|
{ id: "6", imageSrc: "/placeholder6.webp", imageAlt: "Dashboard 6" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div id="metrics" data-section="metrics">
|
||||||
|
<MetricCardEleven
|
||||||
|
animationType="slide-up"
|
||||||
|
textboxLayout="default"
|
||||||
|
useInvertedBackground={false}
|
||||||
|
title="Dashboard Metrics"
|
||||||
|
description="Track your performance"
|
||||||
|
metrics={[
|
||||||
|
{ id: "1", value: "50K", title: "Total Users", description: "Active users this month" },
|
||||||
|
{ id: "2", value: "25M", title: "Revenue", description: "Monthly revenue" },
|
||||||
|
{ id: "3", value: "98.5%", title: "Uptime", description: "System availability" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div id="events" data-section="events">
|
||||||
|
<BlogCardTwo
|
||||||
|
animationType="slide-up"
|
||||||
|
useInvertedBackground={false}
|
||||||
|
textboxLayout="default"
|
||||||
|
title="Recent Activity"
|
||||||
|
description="Your latest updates and events"
|
||||||
|
blogs={[
|
||||||
|
{ id: "1", category: "Update", title: "Profile Updated", excerpt: "Your profile has been successfully updated", imageSrc: "/placeholder1.webp", authorName: "System", authorAvatar: "/avatar1.webp", date: "Today" },
|
||||||
|
{ id: "2", category: "Alert", title: "New Message", excerpt: "You have received a new message", imageSrc: "/placeholder2.webp", authorName: "User", authorAvatar: "/avatar2.webp", date: "Yesterday" },
|
||||||
|
{ id: "3", category: "Notice", title: "Settings Changed", excerpt: "Your account settings have been modified", imageSrc: "/placeholder3.webp", authorName: "System", authorAvatar: "/avatar3.webp", date: "2 days ago" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div id="contact" data-section="contact">
|
||||||
|
<ContactText
|
||||||
|
text="Need help? Contact our support team!"
|
||||||
|
background={{ variant: "plain" }}
|
||||||
|
useInvertedBackground={false}
|
||||||
|
buttons={[{ text: "Get Support", href: "mailto:support@example.com" }]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
|
<FooterLogoReveal
|
||||||
|
logoText="Webild"
|
||||||
|
leftLink={{ text: "Privacy", href: "#" }}
|
||||||
|
rightLink={{ text: "Terms", href: "#" }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
208
src/app/help/page.tsx
Normal file
208
src/app/help/page.tsx
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
|
||||||
|
import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal";
|
||||||
|
import FaqDouble from "@/components/sections/faq/FaqDouble";
|
||||||
|
import { Search, ChevronRight } from "lucide-react";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
|
export default function HelpPage() {
|
||||||
|
const [searchQuery, setSearchQuery] = useState("");
|
||||||
|
const [selectedCategory, setSelectedCategory] = useState("tümü");
|
||||||
|
|
||||||
|
const navItems = [
|
||||||
|
{ name: "Ana Sayfa", id: "/" },
|
||||||
|
{ name: "Öğretmenler", id: "/teachers" },
|
||||||
|
{ name: "Etkinlikler", id: "/events" },
|
||||||
|
{ name: "Çalışma Programı", id: "/schedule" },
|
||||||
|
];
|
||||||
|
|
||||||
|
const categories = [
|
||||||
|
{ id: "tümü", name: "Tüm Kategoriler", icon: "📚" },
|
||||||
|
{ id: "başlangıç", name: "Başlangıç Rehberi", icon: "🚀" },
|
||||||
|
{ id: "ödeme", name: "Ödeme & Faturalama", icon: "💳" },
|
||||||
|
{ id: "ders", name: "Dersler", icon: "📖" },
|
||||||
|
{ id: "teknik", name: "Teknik Destek", icon: "🔧" },
|
||||||
|
{ id: "hesap", name: "Hesap Yönetimi", icon: "👤" },
|
||||||
|
];
|
||||||
|
|
||||||
|
const helpArticles = [
|
||||||
|
{
|
||||||
|
id: "1", category: "başlangıç", title: "Nasıl Başlarım?", excerpt: "Platformda yeni misiniz? Adım adım başlangıç rehberimizi takip edin.", content: "Kayıt olun, profil oluşturun ve ilk öğretmeninizi seçin..."},
|
||||||
|
{
|
||||||
|
id: "2", category: "ödeme", title: "Ödeme Yöntemleri", excerpt: "Hangi ödeme yöntemlerini destekliyoruz?", content: "Kredi kartı, banka transferi, e-cüzdan ve daha fazlası..."},
|
||||||
|
{
|
||||||
|
id: "3", category: "ders", title: "Ders Rezervasyonu", excerpt: "Ders nasıl ayırılır?", content: "Öğretmen seçin, uygun saati bulun ve dersi rezerve edin..."},
|
||||||
|
{
|
||||||
|
id: "4", category: "teknik", title: "Video Konferans Problemi", excerpt: "Kamera veya mikrofon çalışmıyor mu?", content: "Tarayıcı izinlerini kontrol edin ve bağlantıyı yenileyin..."},
|
||||||
|
{
|
||||||
|
id: "5", category: "hesap", title: "Şifre Sıfırlama", excerpt: "Şifrenizi unuttuysanız ne yapmalısınız?", content: "Giriş sayfasında 'Şifremi Unuttum' seçeneğine tıklayın..."},
|
||||||
|
{
|
||||||
|
id: "6", category: "başlangıç", title: "Profil Oluşturma", excerpt: "Profilinizi nasıl tamamlayabilirsiniz?", content: "Fotoğraf yükleyin, hedeflerinizi belirtin ve tercihlerinizi ayarlayın..."},
|
||||||
|
];
|
||||||
|
|
||||||
|
const faqData = [
|
||||||
|
{
|
||||||
|
id: "1", title: "Ders iptal etmek istiyorum. Ne yapmalıyım?", content: "Dersin başlamadan 24 saat önce iptal edebilirsiniz. Uygulamada 'Derslerim' bölümüne giderek iptal düğmesine tıklayın. Geç iptaller geri iade edilmeyebilir."},
|
||||||
|
{
|
||||||
|
id: "2", title: "Öğretmen değiştirmek istiyorum.", content: "Evet, istediğiniz zaman öğretmen değiştirebilirsiniz. Destek ekibimizle iletişime geçerek veya uygulama içinden yeni bir öğretmen seçebilirsiniz."},
|
||||||
|
{
|
||||||
|
id: "3", title: "Sertifikat nasıl alırım?", content: "Kurs tamamlandıktan sonra sertifika otomatik olarak hesabınıza gönderilir. Sertifikayı indirip yazdırabilirsiniz."},
|
||||||
|
{
|
||||||
|
id: "4", title: "Para iadesi nasıl talep ederim?", content: "Tamamlanmamış dersler için 30 gün içinde para iade talebinde bulunabilirsiniz. Destek ekibimizle iletişime geçin."},
|
||||||
|
{
|
||||||
|
id: "5", title: "Grup dersine katılabilir miyim?", content: "Evet! Bireysel dersler dışında grup dersleri de bulunmaktadır. Platform üzerinde grup derslerine ayrı olarak kaydolabilirsiniz."},
|
||||||
|
{
|
||||||
|
id: "6", title: "Teknik sorularım için ne yapmalıyım?", content: "Canlı sohbet, email veya telefon aracılığıyla teknik desteğimize ulaşabilirsiniz. Ortalama yanıt süresi 5 dakikadır."},
|
||||||
|
];
|
||||||
|
|
||||||
|
const filteredArticles = helpArticles.filter((article) => {
|
||||||
|
const matchesCategory = selectedCategory === "tümü" || article.category === selectedCategory;
|
||||||
|
const matchesSearch = article.title.toLowerCase().includes(searchQuery.toLowerCase());
|
||||||
|
return matchesCategory && matchesSearch;
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="text-shift"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="rounded"
|
||||||
|
contentWidth="compact"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="circleGradient"
|
||||||
|
cardStyle="layered-gradient"
|
||||||
|
primaryButtonStyle="shadow"
|
||||||
|
secondaryButtonStyle="layered"
|
||||||
|
headingFontWeight="light"
|
||||||
|
>
|
||||||
|
{/* Breadcrumb */}
|
||||||
|
<nav className="hidden md:flex items-center gap-2 p-4 text-sm text-gray-600" aria-label="Breadcrumb">
|
||||||
|
<Link href="/" className="hover:text-primary-cta">Ana Sayfa</Link>
|
||||||
|
<span>/</span>
|
||||||
|
<span className="text-gray-900 font-semibold">Yardım Merkezi</span>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleFullscreen
|
||||||
|
navItems={navItems}
|
||||||
|
brandName="Öğretmen Platformu"
|
||||||
|
bottomLeftText="Eğitim Topluluğu"
|
||||||
|
bottomRightText="info@platform.com"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="py-12 px-4 md:py-20">
|
||||||
|
<div className="max-w-6xl mx-auto">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="text-center mb-12">
|
||||||
|
<h1 className="text-4xl md:text-5xl font-bold text-foreground mb-4">Yardım Merkezi</h1>
|
||||||
|
<p className="text-lg text-gray-600 mb-8">Soruların cevaplarını ve rehberleri burada bulabilirsiniz.</p>
|
||||||
|
|
||||||
|
{/* Search */}
|
||||||
|
<div className="max-w-2xl mx-auto">
|
||||||
|
<div className="flex items-center gap-2 bg-card border border-border rounded-lg px-4 py-3">
|
||||||
|
<Search size={20} className="text-gray-400" />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="Makaleler ve cevapları arayın..."
|
||||||
|
value={searchQuery}
|
||||||
|
onChange={(e) => setSearchQuery(e.target.value)}
|
||||||
|
className="w-full bg-transparent outline-none text-foreground"
|
||||||
|
aria-label="Yardım arama"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Categories */}
|
||||||
|
<div className="flex flex-wrap gap-2 justify-center mb-12 pb-8 border-b border-border">
|
||||||
|
{categories.map((cat) => (
|
||||||
|
<button
|
||||||
|
key={cat.id}
|
||||||
|
onClick={() => setSelectedCategory(cat.id)}
|
||||||
|
className={`px-4 py-2 rounded-lg text-sm font-semibold transition-colors ${
|
||||||
|
selectedCategory === cat.id
|
||||||
|
? "bg-primary-cta text-white"
|
||||||
|
: "bg-card text-foreground border border-border hover:bg-background"
|
||||||
|
}`}
|
||||||
|
aria-pressed={selectedCategory === cat.id}
|
||||||
|
>
|
||||||
|
{cat.icon} {cat.name}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Articles Grid */}
|
||||||
|
{filteredArticles.length > 0 ? (
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 mb-16">
|
||||||
|
{filteredArticles.map((article) => (
|
||||||
|
<div
|
||||||
|
key={article.id}
|
||||||
|
className="bg-card border border-border rounded-lg p-6 hover:border-primary-cta/50 cursor-pointer transition-colors group"
|
||||||
|
>
|
||||||
|
<h3 className="text-lg font-semibold text-foreground mb-2 group-hover:text-primary-cta transition-colors">
|
||||||
|
{article.title}
|
||||||
|
</h3>
|
||||||
|
<p className="text-sm text-gray-600 mb-4">{article.excerpt}</p>
|
||||||
|
<div className="flex items-center gap-2 text-primary-cta text-sm font-semibold">
|
||||||
|
Okuyun
|
||||||
|
<ChevronRight size={16} className="group-hover:translate-x-1 transition-transform" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-center py-12">
|
||||||
|
<p className="text-gray-600 text-lg">Aradığınız makaleler bulunamadı.</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* FAQ Section */}
|
||||||
|
<div id="faq" data-section="faq" className="mt-20">
|
||||||
|
<h2 className="text-3xl font-bold text-foreground mb-8 text-center">Sıkça Sorulan Sorular</h2>
|
||||||
|
<FaqDouble
|
||||||
|
faqs={faqData}
|
||||||
|
title=""
|
||||||
|
description=""
|
||||||
|
faqsAnimation="slide-up"
|
||||||
|
textboxLayout="default"
|
||||||
|
useInvertedBackground={false}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Contact CTA */}
|
||||||
|
<div className="mt-16 bg-card border border-border rounded-lg p-8 text-center">
|
||||||
|
<h3 className="text-2xl font-bold text-foreground mb-2">Hala yardıma mı ihtiyacınız var?</h3>
|
||||||
|
<p className="text-gray-600 mb-6">Destek ekibimiz 24/7 burada sizin için.</p>
|
||||||
|
<div className="flex gap-4 justify-center flex-wrap">
|
||||||
|
<Link
|
||||||
|
href="/contact"
|
||||||
|
className="px-6 py-3 bg-primary-cta text-white rounded-lg hover:opacity-90 transition-opacity font-semibold"
|
||||||
|
>
|
||||||
|
Bize Ulaşın
|
||||||
|
</Link>
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
className="px-6 py-3 bg-card border border-border text-foreground rounded-lg hover:bg-background transition-colors font-semibold"
|
||||||
|
>
|
||||||
|
Canlı Sohbet Başlat
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
|
<FooterLogoReveal
|
||||||
|
logoText="Öğretmen Platformu"
|
||||||
|
leftLink={{
|
||||||
|
text: "Gizlilik Politikası", href: "#"}}
|
||||||
|
rightLink={{
|
||||||
|
text: "Kullanım Şartları", href: "#"}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,58 +1,28 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Halant } from "next/font/google";
|
import { Geist, Geist_Mono } from "next/font/google";
|
||||||
import { Inter } from "next/font/google";
|
|
||||||
import { Open_Sans } from "next/font/google";
|
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import { ServiceWrapper } from "@/components/ServiceWrapper";
|
|
||||||
import Tag from "@/tag/Tag";
|
|
||||||
|
|
||||||
const halant = Halant({
|
const geist = Geist({
|
||||||
variable: "--font-halant",
|
variable: "--font-geist-sans", subsets: ["latin"],
|
||||||
subsets: ["latin"],
|
|
||||||
weight: ["300", "400", "500", "600", "700"],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const inter = Inter({
|
const geistMono = Geist_Mono({
|
||||||
variable: "--font-inter",
|
variable: "--font-geist-mono", subsets: ["latin"],
|
||||||
subsets: ["latin"],
|
|
||||||
});
|
|
||||||
|
|
||||||
const openSans = Open_Sans({
|
|
||||||
variable: "--font-open-sans",
|
|
||||||
subsets: ["latin"],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Çevrimiçi Öğretmen Platformu - Uzman Eğitim",
|
title: "Teacher Dashboard", description: "Teacher dashboard with lessons, students, and earnings management"};
|
||||||
description: "50+ deneyimli öğretmenle bağlantı kurun. Kişiselleştirilmiş eğitim, esnek zaman planlaması ve 4.9/5 memnuniyet oranı.",
|
|
||||||
keywords: "çevrimiçi öğretmen, ders platformu, eğitim, uzak eğitim, dersler",
|
|
||||||
openGraph: {
|
|
||||||
title: "Çevrimiçi Öğretmen Platformu",
|
|
||||||
description: "50+ deneyimli öğretmenle bağlantı kurun ve etkili eğitim alın",
|
|
||||||
siteName: "Öğretmen Platformu",
|
|
||||||
type: "website",
|
|
||||||
},
|
|
||||||
twitter: {
|
|
||||||
card: "summary_large_image",
|
|
||||||
title: "Çevrimiçi Öğretmen Platformu",
|
|
||||||
description: "Uzman öğretmenlerle dersler için kaydolun",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
children,
|
children,
|
||||||
}: Readonly<{
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<html lang="en" suppressHydrationWarning>
|
<html lang="en">
|
||||||
<ServiceWrapper>
|
<body className={`${geist.variable} ${geistMono.variable} antialiased`}>
|
||||||
<body
|
{children}
|
||||||
className={`${halant.variable} ${inter.variable} ${openSans.variable} antialiased`}
|
|
||||||
>
|
|
||||||
<Tag />
|
|
||||||
{children}
|
|
||||||
|
|
||||||
<script
|
<script
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: `
|
__html: `
|
||||||
@@ -1420,7 +1390,6 @@ export default function RootLayout({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</body>
|
</body>
|
||||||
</ServiceWrapper>
|
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
59
src/app/not-found.tsx
Normal file
59
src/app/not-found.tsx
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import Link from "next/link";
|
||||||
|
import { AlertCircle, Home, Search } from "lucide-react";
|
||||||
|
|
||||||
|
export default function NotFound() {
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen flex items-center justify-center px-4 py-12 bg-gradient-to-br from-background to-card">
|
||||||
|
<div className="max-w-md w-full text-center">
|
||||||
|
<div className="flex justify-center mb-6">
|
||||||
|
<AlertCircle size={64} className="text-primary-cta opacity-80" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h1 className="text-5xl font-bold text-foreground mb-2">404</h1>
|
||||||
|
<h2 className="text-2xl font-semibold text-foreground mb-4">Sayfa Bulunamadı</h2>
|
||||||
|
|
||||||
|
<p className="text-gray-600 mb-8">
|
||||||
|
Aradığınız sayfa taşınmış, silinmiş veya hiç var olmayabilir. Lütfen aşağıdaki bağlantılardan birini kullanarak geri dönün.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-3">
|
||||||
|
<Link
|
||||||
|
href="/"
|
||||||
|
className="inline-flex items-center justify-center gap-2 px-6 py-3 bg-primary-cta text-white rounded-lg hover:opacity-90 transition-opacity font-semibold"
|
||||||
|
>
|
||||||
|
<Home size={18} />
|
||||||
|
Ana Sayfaya Dön
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
<Link
|
||||||
|
href="/teachers"
|
||||||
|
className="inline-flex items-center justify-center gap-2 px-6 py-3 bg-card border border-border text-foreground rounded-lg hover:bg-background transition-colors font-semibold"
|
||||||
|
>
|
||||||
|
<Search size={18} />
|
||||||
|
Öğretmenleri Gözat
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="mt-12 p-6 bg-card rounded-lg border border-border">
|
||||||
|
<h3 className="font-semibold text-foreground mb-3">Başka ne yapabiliriz?</h3>
|
||||||
|
<ul className="text-sm text-gray-600 space-y-2 text-left">
|
||||||
|
<li className="flex items-start gap-2">
|
||||||
|
<span className="text-primary-cta mt-1">•</span>
|
||||||
|
<span>Arama yardımı için destek ekibimizle iletişime geçin</span>
|
||||||
|
</li>
|
||||||
|
<li className="flex items-start gap-2">
|
||||||
|
<span className="text-primary-cta mt-1">•</span>
|
||||||
|
<span>Ana menüyü kullanarak platformda gezin</span>
|
||||||
|
</li>
|
||||||
|
<li className="flex items-start gap-2">
|
||||||
|
<span className="text-primary-cta mt-1">•</span>
|
||||||
|
<span>İstenilen dersi veya konuyu seçin</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
167
src/app/page.tsx
167
src/app/page.tsx
@@ -1,154 +1,99 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
|
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
|
||||||
import HeroBillboardRotatedCarousel from "@/components/sections/hero/HeroBillboardRotatedCarousel";
|
import HeroBillboardRotatedCarousel from '@/components/sections/hero/HeroBillboardRotatedCarousel';
|
||||||
import MetricCardEleven from "@/components/sections/metrics/MetricCardEleven";
|
import MetricCardEleven from '@/components/sections/metrics/MetricCardEleven';
|
||||||
import BlogCardTwo from "@/components/sections/blog/BlogCardTwo";
|
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
|
||||||
import ContactText from "@/components/sections/contact/ContactText";
|
import ContactText from '@/components/sections/contact/ContactText';
|
||||||
import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal";
|
import FooterLogoReveal from '@/components/sections/footer/FooterLogoReveal';
|
||||||
import Link from "next/link";
|
import Link from 'next/link';
|
||||||
import { BookOpen } from "lucide-react";
|
|
||||||
|
|
||||||
export default function HomePage() {
|
export default function Home() {
|
||||||
const navItems = [
|
const navItems = [
|
||||||
{ name: "Ana Sayfa", id: "/" },
|
{ name: "Home", id: "/" },
|
||||||
{ name: "Öğretmenler", id: "/teachers" },
|
{ name: "Dashboard", id: "/dashboard" },
|
||||||
{ name: "Etkinlikler", id: "events" },
|
|
||||||
{ name: "Çalışma Programı", id: "schedule" },
|
|
||||||
];
|
|
||||||
|
|
||||||
const heroBtns = [
|
|
||||||
{
|
|
||||||
text: "Hemen Başla", href: "/teachers"},
|
|
||||||
];
|
|
||||||
|
|
||||||
const metricsData = [
|
|
||||||
{
|
|
||||||
id: "1", value: "50+", title: "Öğretmen", description: "Deneyimli eğitim profesyonelleri", imageSrc: "http://img.b2bpic.net/free-photo/people-standing-with-papers_23-2147657172.jpg", imageAlt: "professional teachers group portrait education"},
|
|
||||||
{
|
|
||||||
id: "2", value: "1000+", title: "Öğrenci", description: "Aktif kullanıcı topluluğu", imageSrc: "http://img.b2bpic.net/free-photo/happy-office-colleagues-watching-project-presentation-together_74855-10013.jpg", imageAlt: "students group learning education diverse"},
|
|
||||||
{
|
|
||||||
id: "3", value: "200+", title: "Ders", description: "Çeşitli konu başlıkları", imageSrc: "http://img.b2bpic.net/free-photo/flat-lay-educational-elements-arrangement-with-empty-notepad_23-2148721242.jpg", imageAlt: "course curriculum education subjects books"},
|
|
||||||
{
|
|
||||||
id: "4", value: "4.9/5", title: "Puan", description: "Ortalama memnuniyet oranı", imageSrc: "http://img.b2bpic.net/free-vector/education-white_24877-49399.jpg", imageAlt: "five star rating excellent satisfaction feedback"},
|
|
||||||
];
|
|
||||||
|
|
||||||
const carouselItems = [
|
|
||||||
{
|
|
||||||
id: "1", imageSrc: "http://img.b2bpic.net/free-psd/children-school-education-landing-page_23-2149901102.jpg", imageAlt: "online learning education platform interface"},
|
|
||||||
{
|
|
||||||
id: "2", imageSrc: "http://img.b2bpic.net/free-photo/senior-people-school-class-with-laptop-computer_23-2150104980.jpg", imageAlt: "online course learning platform screen"},
|
|
||||||
{
|
|
||||||
id: "3", imageSrc: "http://img.b2bpic.net/free-vector/virtual-graduation-ceremony-with-computer_23-2148569138.jpg", imageAlt: "online tutor video conference interface"},
|
|
||||||
{
|
|
||||||
id: "4", imageSrc: "http://img.b2bpic.net/free-photo/friends-learning-study-group_23-2149257210.jpg", imageAlt: "education app notification schedule planning"},
|
|
||||||
{
|
|
||||||
id: "5", imageSrc: "http://img.b2bpic.net/free-photo/crop-men-discussing-graph-tablet_23-2147785037.jpg", imageAlt: "digital education platform analytics dashboard"},
|
|
||||||
{
|
|
||||||
id: "6", imageSrc: "http://img.b2bpic.net/free-photo/front-view-older-business-woman-with-glasses-writing-agenda-looking-laptop_23-2148661168.jpg", imageAlt: "online class registration booking system"},
|
|
||||||
];
|
|
||||||
|
|
||||||
const eventsBlogsData = [
|
|
||||||
{
|
|
||||||
id: "1", category: ["Matematik"],
|
|
||||||
title: "Trigonometri Ustalaşma Sürümü", excerpt: "Trigonometri kurallarını derinlemesine öğrenin, örnekler ve pratik problemlerle desteklenen kapsamlı ders.", imageSrc: "http://img.b2bpic.net/free-vector/modern-background-with-geometric-shapes_23-2147546962.jpg", imageAlt: "mathematics geometry trigonometry education board", authorName: "Ayşe Kaya", authorAvatar: "http://img.b2bpic.net/free-photo/young-female-glasses-workplace_1301-980.jpg", date: "25 Ocak 2025"},
|
|
||||||
{
|
|
||||||
id: "2", category: ["İngilizce"],
|
|
||||||
title: "İngilizce Konuşma Atölyesi", excerpt: "Günlük İngilizce konuşma becerilerinizi geliştirin, doğal diyaloglar ve kültürel bağlam ile.", imageSrc: "http://img.b2bpic.net/free-vector/language-concept-background_23-2147872796.jpg", imageAlt: "english language learning book study", authorName: "Mehmet Yıldız", authorAvatar: "http://img.b2bpic.net/free-photo/portrait-businessman-office-3_1262-1489.jpg", date: "27 Ocak 2025"},
|
|
||||||
{
|
|
||||||
id: "3", category: ["Kimya"],
|
|
||||||
title: "Kimya Deneyimleri Laboratuvarı", excerpt: "Sanal laboratuvarıyla pratik deneyimler gain ve kimyasal reaksiyonları canlı tutun.", imageSrc: "http://img.b2bpic.net/free-photo/close-up-laboratory-test-tubes_23-2148891898.jpg", imageAlt: "chemistry laboratory science experiment beakers", authorName: "Zeynep Demir", authorAvatar: "http://img.b2bpic.net/free-photo/woman-posing-with-books_23-2148680219.jpg", date: "29 Ocak 2025"},
|
|
||||||
{
|
|
||||||
id: "4", category: ["Tarih"],
|
|
||||||
title: "Osmanlı İmparatorluğu Hikayesi", excerpt: "Osmanlı tarihinin önemli dönemleri, simgesel olaylar ve kültürel etkilerin kapsamlı incelemesi.", imageSrc: "http://img.b2bpic.net/free-photo/view-ancient-paper-scroll-writing-documenting_23-2151751754.jpg", imageAlt: "history book ancient civilization artifacts", authorName: "İbrahim Çelik", authorAvatar: "http://img.b2bpic.net/free-photo/young-man-wearing-blue-outfit-looking-satisfied_1298-169.jpg", date: "31 Ocak 2025"},
|
|
||||||
];
|
|
||||||
|
|
||||||
const contactButtons = [
|
|
||||||
{
|
|
||||||
text: "Bize Yazın", href: "/contact"},
|
|
||||||
{
|
|
||||||
text: "Canlı Sohbet", href: "#"},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
defaultButtonVariant="text-shift"
|
defaultButtonVariant="text-stagger"
|
||||||
defaultTextAnimation="entrance-slide"
|
defaultTextAnimation="entrance-slide"
|
||||||
borderRadius="rounded"
|
borderRadius="rounded"
|
||||||
contentWidth="compact"
|
contentWidth="medium"
|
||||||
sizing="mediumSizeLargeTitles"
|
sizing="medium"
|
||||||
background="circleGradient"
|
background="aurora"
|
||||||
cardStyle="layered-gradient"
|
cardStyle="glass-elevated"
|
||||||
primaryButtonStyle="shadow"
|
primaryButtonStyle="gradient"
|
||||||
secondaryButtonStyle="layered"
|
secondaryButtonStyle="glass"
|
||||||
headingFontWeight="light"
|
headingFontWeight="normal"
|
||||||
>
|
>
|
||||||
<div id="nav" data-section="nav">
|
<div id="nav" data-section="nav">
|
||||||
<NavbarStyleFullscreen
|
<NavbarStyleFullscreen
|
||||||
navItems={navItems}
|
navItems={[
|
||||||
brandName="Öğretmen Platformu"
|
{ name: "Home", id: "/" },
|
||||||
bottomLeftText="Eğitim Topluluğu"
|
{ name: "Dashboard", id: "/dashboard" },
|
||||||
bottomRightText="info@platform.com"
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="hero" data-section="hero">
|
<div id="hero" data-section="hero">
|
||||||
<HeroBillboardRotatedCarousel
|
<HeroBillboardRotatedCarousel
|
||||||
title="Hayalinizdeki Öğretmeni Bulun"
|
title="Welcome to Our Platform"
|
||||||
description="50+ deneyimli öğretmenle bağlantı kurun ve kişiselleştirilmiş eğitim alın. Esnek zaman planlaması ve etkili öğrenme deneyimi."
|
description="Discover amazing features and capabilities"
|
||||||
tag="Çevrimiçi Eğitim"
|
background={{ variant: "rotated-rays-animated" }}
|
||||||
tagIcon={BookOpen}
|
carouselItems={[
|
||||||
buttons={heroBtns}
|
{ id: "1", imageSrc: "/placeholder1.webp", imageAlt: "Image 1" },
|
||||||
background={{ variant: "plain" }}
|
{ id: "2", imageSrc: "/placeholder2.webp", imageAlt: "Image 2" },
|
||||||
carouselItems={carouselItems}
|
{ id: "3", imageSrc: "/placeholder3.webp", imageAlt: "Image 3" },
|
||||||
autoPlay={true}
|
{ id: "4", imageSrc: "/placeholder4.webp", imageAlt: "Image 4" },
|
||||||
autoPlayInterval={4000}
|
{ id: "5", imageSrc: "/placeholder5.webp", imageAlt: "Image 5" },
|
||||||
|
{ id: "6", imageSrc: "/placeholder6.webp", imageAlt: "Image 6" },
|
||||||
|
]}
|
||||||
|
buttons={[{ text: "Get Started", href: "/#contact" }]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="metrics" data-section="metrics">
|
<div id="metrics" data-section="metrics">
|
||||||
<MetricCardEleven
|
<MetricCardEleven
|
||||||
metrics={metricsData}
|
|
||||||
title="Platformumuz ile Tanışın"
|
|
||||||
description="Kalite ve etkililik konusunda güvenilebilir bir seçim"
|
|
||||||
textboxLayout="default"
|
|
||||||
animationType="slide-up"
|
animationType="slide-up"
|
||||||
|
textboxLayout="default"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
|
title="Key Metrics"
|
||||||
|
description="Track your performance"
|
||||||
|
metrics={[
|
||||||
|
{ id: "1", value: "100K", title: "Users", description: "Active users on platform" },
|
||||||
|
{ id: "2", value: "50M", title: "Revenue", description: "Annual revenue" },
|
||||||
|
{ id: "3", value: "99%", title: "Uptime", description: "System availability" },
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="events" data-section="events">
|
<div id="events" data-section="events">
|
||||||
<BlogCardTwo
|
<BlogCardTwo
|
||||||
blogs={eventsBlogsData}
|
|
||||||
title="Yaklaşan Etkinlikler"
|
|
||||||
description="Etkileşimli ders saatleri ve webinarlar"
|
|
||||||
textboxLayout="default"
|
|
||||||
animationType="slide-up"
|
animationType="slide-up"
|
||||||
useInvertedBackground={false}
|
useInvertedBackground={false}
|
||||||
carouselMode="buttons"
|
textboxLayout="default"
|
||||||
|
title="Latest Events"
|
||||||
|
description="Stay updated with our latest events"
|
||||||
|
blogs={[
|
||||||
|
{ id: "1", category: "Event", title: "Tech Summit 2025", excerpt: "Join us for the biggest tech event of the year", imageSrc: "/placeholder1.webp", authorName: "John Doe", authorAvatar: "/avatar1.webp", date: "20 Jan 2025" },
|
||||||
|
{ id: "2", category: "Webinar", title: "AI Workshop", excerpt: "Learn about the latest AI technologies", imageSrc: "/placeholder2.webp", authorName: "Jane Smith", authorAvatar: "/avatar2.webp", date: "25 Jan 2025" },
|
||||||
|
{ id: "3", category: "Conference", title: "Product Launch", excerpt: "Discover our newest product features", imageSrc: "/placeholder3.webp", authorName: "Bob Johnson", authorAvatar: "/avatar3.webp", date: "30 Jan 2025" },
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="contact" data-section="contact">
|
<div id="contact" data-section="contact">
|
||||||
<ContactText
|
<ContactText
|
||||||
text="Halen sorularınız mı var? Bize ulaşın ve eğitim yolculuğunuza başlayın. Destek ekibimiz 24/7 sizin hizmetinizde."
|
text="Ready to get started? Contact us today!"
|
||||||
animationType="entrance-slide"
|
|
||||||
buttons={contactButtons}
|
|
||||||
background={{ variant: "plain" }}
|
background={{ variant: "plain" }}
|
||||||
useInvertedBackground={true}
|
useInvertedBackground={false}
|
||||||
|
buttons={[{ text: "Contact Us", href: "mailto:hello@example.com" }]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="footer" data-section="footer">
|
<div id="footer" data-section="footer">
|
||||||
<FooterLogoReveal
|
<FooterLogoReveal
|
||||||
logoText="Öğretmen Platformu"
|
logoText="Webild"
|
||||||
leftLink={{
|
leftLink={{ text: "Privacy", href: "#" }}
|
||||||
text: "Gizlilik Politikası", href: "#"}}
|
rightLink={{ text: "Terms", href: "#" }}
|
||||||
rightLink={{
|
|
||||||
text: "Kullanım Şartları", href: "#"}}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
242
src/app/register/page.tsx
Normal file
242
src/app/register/page.tsx
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
|
||||||
|
import { useState } from "react";
|
||||||
|
import Textarea from "@/components/form/Textarea";
|
||||||
|
import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal";
|
||||||
|
|
||||||
|
export default function RegisterPage() {
|
||||||
|
const [formData, setFormData] = useState({
|
||||||
|
firstName: "", lastName: "", email: "", phone: "", subject: "", message: ""});
|
||||||
|
|
||||||
|
const [errors, setErrors] = useState<Record<string, string>>({});
|
||||||
|
const [submitted, setSubmitted] = useState(false);
|
||||||
|
|
||||||
|
const navItems = [
|
||||||
|
{ name: "Ana Sayfa", id: "/" },
|
||||||
|
{ name: "Öğretmenler", id: "/teachers" },
|
||||||
|
{ name: "Kayıt", id: "/register" },
|
||||||
|
{ name: "Çalışma Programı", id: "schedule" },
|
||||||
|
];
|
||||||
|
|
||||||
|
const validateForm = () => {
|
||||||
|
const newErrors: Record<string, string> = {};
|
||||||
|
|
||||||
|
if (!formData.firstName.trim()) {
|
||||||
|
newErrors.firstName = "Ad gereklidir";
|
||||||
|
}
|
||||||
|
if (!formData.lastName.trim()) {
|
||||||
|
newErrors.lastName = "Soyadı gereklidir";
|
||||||
|
}
|
||||||
|
if (!formData.email.trim()) {
|
||||||
|
newErrors.email = "E-posta gereklidir";
|
||||||
|
} else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) {
|
||||||
|
newErrors.email = "Geçerli bir e-posta adresi giriniz";
|
||||||
|
}
|
||||||
|
if (!formData.phone.trim()) {
|
||||||
|
newErrors.phone = "Telefon numarası gereklidir";
|
||||||
|
} else if (!/^[0-9+\-\s()]+$/.test(formData.phone)) {
|
||||||
|
newErrors.phone = "Geçerli bir telefon numarası giriniz";
|
||||||
|
}
|
||||||
|
if (!formData.subject.trim()) {
|
||||||
|
newErrors.subject = "Konu gereklidir";
|
||||||
|
}
|
||||||
|
if (!formData.message.trim()) {
|
||||||
|
newErrors.message = "Mesaj gereklidir";
|
||||||
|
} else if (formData.message.trim().length < 10) {
|
||||||
|
newErrors.message = "Mesaj en az 10 karakter olmalıdır";
|
||||||
|
}
|
||||||
|
|
||||||
|
setErrors(newErrors);
|
||||||
|
return Object.keys(newErrors).length === 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleChange = (field: string, value: string) => {
|
||||||
|
setFormData((prev) => ({
|
||||||
|
...prev,
|
||||||
|
[field]: value,
|
||||||
|
}));
|
||||||
|
if (errors[field]) {
|
||||||
|
setErrors((prev) => ({
|
||||||
|
...prev,
|
||||||
|
[field]: ""}));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent) => {
|
||||||
|
e.preventDefault();
|
||||||
|
if (validateForm()) {
|
||||||
|
console.log("Form gönderildi:", formData);
|
||||||
|
setSubmitted(true);
|
||||||
|
setFormData({
|
||||||
|
firstName: "", lastName: "", email: "", phone: "", subject: "", message: ""});
|
||||||
|
setTimeout(() => setSubmitted(false), 5000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="text-shift"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="rounded"
|
||||||
|
contentWidth="compact"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="circleGradient"
|
||||||
|
cardStyle="layered-gradient"
|
||||||
|
primaryButtonStyle="shadow"
|
||||||
|
secondaryButtonStyle="layered"
|
||||||
|
headingFontWeight="light"
|
||||||
|
>
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleFullscreen
|
||||||
|
navItems={navItems}
|
||||||
|
brandName="Öğretmen Platformu"
|
||||||
|
bottomLeftText="Eğitim Topluluğu"
|
||||||
|
bottomRightText="info@platform.com"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="register" data-section="register" className="min-h-screen py-20 px-4">
|
||||||
|
<div className="max-w-2xl mx-auto">
|
||||||
|
<div className="text-center mb-12">
|
||||||
|
<h1 className="text-4xl md:text-5xl font-light mb-4">Öğrenci Kaydı</h1>
|
||||||
|
<p className="text-lg text-foreground/70">
|
||||||
|
Platformumuza katılın ve eğitim yolculuğunuza başlayın
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{submitted && (
|
||||||
|
<div className="mb-6 p-4 bg-green-500/20 border border-green-500 rounded-lg">
|
||||||
|
<p className="text-green-700">Başarıyla gönderildi! Yakında sizinle iletişime geçeceğiz.</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<form
|
||||||
|
onSubmit={handleSubmit}
|
||||||
|
className="space-y-6 bg-card rounded-lg p-8 border border-foreground/10"
|
||||||
|
>
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Ad *</label>
|
||||||
|
<input
|
||||||
|
value={formData.firstName}
|
||||||
|
onChange={(e) => handleChange("firstName", e.target.value)}
|
||||||
|
type="text"
|
||||||
|
placeholder="Adınız"
|
||||||
|
required
|
||||||
|
className={`w-full px-4 py-2 rounded-md bg-secondary-button border border-foreground/10 text-foreground placeholder:text-foreground/75 focus:outline-none focus:ring-2 focus:ring-primary-cta transition-all ${
|
||||||
|
errors.firstName ? "border-red-500" : ""
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
{errors.firstName && (
|
||||||
|
<p className="text-red-500 text-sm mt-1">{errors.firstName}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Soyadı *</label>
|
||||||
|
<input
|
||||||
|
value={formData.lastName}
|
||||||
|
onChange={(e) => handleChange("lastName", e.target.value)}
|
||||||
|
type="text"
|
||||||
|
placeholder="Soyadınız"
|
||||||
|
required
|
||||||
|
className={`w-full px-4 py-2 rounded-md bg-secondary-button border border-foreground/10 text-foreground placeholder:text-foreground/75 focus:outline-none focus:ring-2 focus:ring-primary-cta transition-all ${
|
||||||
|
errors.lastName ? "border-red-500" : ""
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
{errors.lastName && (
|
||||||
|
<p className="text-red-500 text-sm mt-1">{errors.lastName}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">E-posta *</label>
|
||||||
|
<input
|
||||||
|
value={formData.email}
|
||||||
|
onChange={(e) => handleChange("email", e.target.value)}
|
||||||
|
type="email"
|
||||||
|
placeholder="örnek@email.com"
|
||||||
|
required
|
||||||
|
className={`w-full px-4 py-2 rounded-md bg-secondary-button border border-foreground/10 text-foreground placeholder:text-foreground/75 focus:outline-none focus:ring-2 focus:ring-primary-cta transition-all ${
|
||||||
|
errors.email ? "border-red-500" : ""
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
{errors.email && (
|
||||||
|
<p className="text-red-500 text-sm mt-1">{errors.email}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Telefon *</label>
|
||||||
|
<input
|
||||||
|
value={formData.phone}
|
||||||
|
onChange={(e) => handleChange("phone", e.target.value)}
|
||||||
|
type="tel"
|
||||||
|
placeholder="+90 555 123 4567"
|
||||||
|
required
|
||||||
|
className={`w-full px-4 py-2 rounded-md bg-secondary-button border border-foreground/10 text-foreground placeholder:text-foreground/75 focus:outline-none focus:ring-2 focus:ring-primary-cta transition-all ${
|
||||||
|
errors.phone ? "border-red-500" : ""
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
{errors.phone && (
|
||||||
|
<p className="text-red-500 text-sm mt-1">{errors.phone}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Konu *</label>
|
||||||
|
<input
|
||||||
|
value={formData.subject}
|
||||||
|
onChange={(e) => handleChange("subject", e.target.value)}
|
||||||
|
type="text"
|
||||||
|
placeholder="Kayıt nedeni"
|
||||||
|
required
|
||||||
|
className={`w-full px-4 py-2 rounded-md bg-secondary-button border border-foreground/10 text-foreground placeholder:text-foreground/75 focus:outline-none focus:ring-2 focus:ring-primary-cta transition-all ${
|
||||||
|
errors.subject ? "border-red-500" : ""
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
{errors.subject && (
|
||||||
|
<p className="text-red-500 text-sm mt-1">{errors.subject}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-2">Mesaj *</label>
|
||||||
|
<Textarea
|
||||||
|
value={formData.message}
|
||||||
|
onChange={(value) => handleChange("message", value)}
|
||||||
|
placeholder="Bize hakkınızda biraz bilgi verin"
|
||||||
|
rows={6}
|
||||||
|
required
|
||||||
|
className={errors.message ? "border-red-500" : ""}
|
||||||
|
/>
|
||||||
|
{errors.message && (
|
||||||
|
<p className="text-red-500 text-sm mt-1">{errors.message}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="w-full py-3 bg-primary-cta text-white rounded-md font-medium hover:opacity-90 transition-opacity"
|
||||||
|
>
|
||||||
|
Kaydı Tamamla
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
|
<FooterLogoReveal
|
||||||
|
logoText="Öğretmen Platformu"
|
||||||
|
leftLink={{
|
||||||
|
text: "Gizlilik Politikası", href: "#"}}
|
||||||
|
rightLink={{
|
||||||
|
text: "Kullanım Şartları", href: "#"}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
330
src/app/students/page.tsx
Normal file
330
src/app/students/page.tsx
Normal file
@@ -0,0 +1,330 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
|
||||||
|
import Input from "@/components/form/Input";
|
||||||
|
import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal";
|
||||||
|
import { Mail } from "lucide-react";
|
||||||
|
|
||||||
|
interface FormErrors {
|
||||||
|
firstName?: string;
|
||||||
|
lastName?: string;
|
||||||
|
email?: string;
|
||||||
|
grade?: string;
|
||||||
|
learningGoals?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function StudentRegistrationPage() {
|
||||||
|
const navItems = [
|
||||||
|
{ name: "Ana Sayfa", id: "/" },
|
||||||
|
{ name: "Öğretmenler", id: "/teachers" },
|
||||||
|
{ name: "Öğrenciler", id: "/students" },
|
||||||
|
{ name: "Çalışma Programı", id: "schedule" },
|
||||||
|
];
|
||||||
|
|
||||||
|
const [formData, setFormData] = useState({
|
||||||
|
firstName: "", lastName: "", email: "", grade: "", learningGoals: ""});
|
||||||
|
|
||||||
|
const [errors, setErrors] = useState<FormErrors>({});
|
||||||
|
const [submitted, setSubmitted] = useState(false);
|
||||||
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||||
|
|
||||||
|
const validateForm = (): boolean => {
|
||||||
|
const newErrors: FormErrors = {};
|
||||||
|
|
||||||
|
if (!formData.firstName.trim()) {
|
||||||
|
newErrors.firstName = "Ad gereklidir";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.lastName.trim()) {
|
||||||
|
newErrors.lastName = "Soyadı gereklidir";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
|
||||||
|
newErrors.email = "Geçerli bir email adı girin";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.grade.trim()) {
|
||||||
|
newErrors.grade = "Sınıf seçiniz";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.learningGoals.trim()) {
|
||||||
|
newErrors.learningGoals = "Öğrenme hedefleri gereklidir";
|
||||||
|
}
|
||||||
|
|
||||||
|
setErrors(newErrors);
|
||||||
|
return Object.keys(newErrors).length === 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = async (e: React.FormEvent) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
if (!validateForm()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setIsSubmitting(true);
|
||||||
|
// Simulate API call
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log("Form submitted:", formData);
|
||||||
|
setSubmitted(true);
|
||||||
|
setIsSubmitting(false);
|
||||||
|
}, 1500);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setFormData({
|
||||||
|
firstName: "", lastName: "", email: "", grade: "", learningGoals: ""});
|
||||||
|
setErrors({});
|
||||||
|
setSubmitted(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="text-shift"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="rounded"
|
||||||
|
contentWidth="compact"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="circleGradient"
|
||||||
|
cardStyle="layered-gradient"
|
||||||
|
primaryButtonStyle="shadow"
|
||||||
|
secondaryButtonStyle="layered"
|
||||||
|
headingFontWeight="light"
|
||||||
|
>
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleFullscreen
|
||||||
|
navItems={navItems}
|
||||||
|
brandName="Öğretmen Platformu"
|
||||||
|
bottomLeftText="Eğitim Topluluğu"
|
||||||
|
bottomRightText="info@platform.com"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 py-12 px-4 pt-32">
|
||||||
|
<div className="max-w-2xl mx-auto">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="text-center mb-12">
|
||||||
|
<h1 className="text-4xl font-bold text-slate-900 mb-2">Öğrenci Kaydı</h1>
|
||||||
|
<p className="text-lg text-slate-600">Eğitim yolculuğunuza katılın ve size uygun öğretmen bulun</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Success Message */}
|
||||||
|
{submitted ? (
|
||||||
|
<div className="bg-white rounded-lg shadow-lg p-12 text-center">
|
||||||
|
<div className="inline-flex items-center justify-center w-16 h-16 bg-green-100 rounded-full mb-6">
|
||||||
|
<svg
|
||||||
|
className="w-8 h-8 text-green-600"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<h2 className="text-2xl font-bold text-slate-900 mb-2">Kayıt Başarılı!</h2>
|
||||||
|
<p className="text-slate-600 mb-6">
|
||||||
|
Merhaba <strong>{formData.firstName} {formData.lastName}</strong>, kaydınız başarıyla tamamlanmıştır.
|
||||||
|
</p>
|
||||||
|
<p className="text-slate-600 mb-8">
|
||||||
|
En yakın zamanda size uygun öğretmen önerileri gönderilecektir. Lütfen email kutunuzu kontrol edin.
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
onClick={handleReset}
|
||||||
|
className="px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-medium transition"
|
||||||
|
>
|
||||||
|
Yeni Kayıt
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
/* Registration Form */
|
||||||
|
<form onSubmit={handleSubmit} className="bg-white rounded-lg shadow-lg p-8">
|
||||||
|
<div className="space-y-6">
|
||||||
|
{/* First Name */}
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Ad *</label>
|
||||||
|
<Input
|
||||||
|
value={formData.firstName}
|
||||||
|
onChange={(value) => {
|
||||||
|
setFormData({ ...formData, firstName: value });
|
||||||
|
if (errors.firstName) {
|
||||||
|
setErrors({ ...errors, firstName: undefined });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
type="text"
|
||||||
|
placeholder="Adınız"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{errors.firstName && (
|
||||||
|
<div className="flex items-center gap-2 mt-2">
|
||||||
|
<span className="text-red-500">⚠</span>
|
||||||
|
<p className="text-red-600 text-sm">{errors.firstName}</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Last Name */}
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Soyadı *</label>
|
||||||
|
<Input
|
||||||
|
value={formData.lastName}
|
||||||
|
onChange={(value) => {
|
||||||
|
setFormData({ ...formData, lastName: value });
|
||||||
|
if (errors.lastName) {
|
||||||
|
setErrors({ ...errors, lastName: undefined });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
type="text"
|
||||||
|
placeholder="Soyadınız"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{errors.lastName && (
|
||||||
|
<div className="flex items-center gap-2 mt-2">
|
||||||
|
<span className="text-red-500">⚠</span>
|
||||||
|
<p className="text-red-600 text-sm">{errors.lastName}</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Email */}
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Email Adresi *</label>
|
||||||
|
<div className="relative">
|
||||||
|
<Input
|
||||||
|
value={formData.email}
|
||||||
|
onChange={(value) => {
|
||||||
|
setFormData({ ...formData, email: value });
|
||||||
|
if (errors.email) {
|
||||||
|
setErrors({ ...errors, email: undefined });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
type="email"
|
||||||
|
placeholder="example@email.com"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{errors.email ? (
|
||||||
|
<div className="flex items-center gap-2 mt-2">
|
||||||
|
<span className="text-red-500">⚠</span>
|
||||||
|
<p className="text-red-600 text-sm">{errors.email}</p>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<p className="text-slate-500 text-sm mt-2">Güvenli ve gizli tutulacaktır</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Grade Level */}
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Sınıf Seviyesi *</label>
|
||||||
|
<select
|
||||||
|
value={formData.grade}
|
||||||
|
onChange={(e) => {
|
||||||
|
setFormData({ ...formData, grade: e.target.value });
|
||||||
|
if (errors.grade) {
|
||||||
|
setErrors({ ...errors, grade: undefined });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
className="w-full px-4 py-2 bg-slate-100 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-slate-900"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
<option value="">Sınıf seçiniz</option>
|
||||||
|
<option value="primary">İlkokul (1-4)</option>
|
||||||
|
<option value="middle">Ortaokul (5-8)</option>
|
||||||
|
<option value="high">Lise (9-12)</option>
|
||||||
|
<option value="university">Üniversite</option>
|
||||||
|
<option value="adult">Yetişkinler</option>
|
||||||
|
</select>
|
||||||
|
{errors.grade && (
|
||||||
|
<div className="flex items-center gap-2 mt-2">
|
||||||
|
<span className="text-red-500">⚠</span>
|
||||||
|
<p className="text-red-600 text-sm">{errors.grade}</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Learning Goals */}
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Öğrenme Hedefleri *</label>
|
||||||
|
<textarea
|
||||||
|
value={formData.learningGoals}
|
||||||
|
onChange={(e) => {
|
||||||
|
setFormData({ ...formData, learningGoals: e.target.value });
|
||||||
|
if (errors.learningGoals) {
|
||||||
|
setErrors({ ...errors, learningGoals: undefined });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
placeholder="Ne öğrenmek istiyorsunuz? Örn: Matematik becerilerimi geliştirmek, İngilizce konuşmayı öğrenmek..."
|
||||||
|
rows={4}
|
||||||
|
className="w-full px-4 py-2 bg-slate-100 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none text-slate-900"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{errors.learningGoals ? (
|
||||||
|
<div className="flex items-center gap-2 mt-2">
|
||||||
|
<span className="text-red-500">⚠</span>
|
||||||
|
<p className="text-red-600 text-sm">{errors.learningGoals}</p>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<p className="text-slate-500 text-sm mt-2">Hedefleriniz, size doğru öğretmen bulunması için önemlidir</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Terms Agreement */}
|
||||||
|
<div className="flex items-start gap-3 p-4 bg-blue-50 rounded-lg">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
id="terms"
|
||||||
|
className="mt-1 w-4 h-4 text-blue-600 rounded focus:ring-2 focus:ring-blue-500"
|
||||||
|
defaultChecked
|
||||||
|
/>
|
||||||
|
<label htmlFor="terms" className="text-sm text-slate-700">
|
||||||
|
Kullanım şartlarını ve gizlilik politikasını kabul ediyorum
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Submit Button */}
|
||||||
|
<div className="mt-8">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
className="w-full px-6 py-3 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded-lg font-medium transition flex items-center justify-center gap-2"
|
||||||
|
>
|
||||||
|
{isSubmitting ? (
|
||||||
|
<>
|
||||||
|
<div className="w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" />
|
||||||
|
Kaydediliyor...
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Mail size={20} />
|
||||||
|
Kaydı Tamamla
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Login Link */}
|
||||||
|
<p className="text-center text-slate-600 mt-6">
|
||||||
|
Zaten kayıtlı mısınız?{" "}
|
||||||
|
<a href="/" className="text-blue-600 hover:text-blue-700 font-medium">
|
||||||
|
Giriş yapın
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer" data-section="footer">
|
||||||
|
<FooterLogoReveal
|
||||||
|
logoText="Öğretmen Platformu"
|
||||||
|
leftLink={{
|
||||||
|
text: "Gizlilik Politikası", href: "#"}}
|
||||||
|
rightLink={{
|
||||||
|
text: "Kullanım Şartları", href: "#"}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ html {
|
|||||||
body {
|
body {
|
||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
color: var(--foreground);
|
color: var(--foreground);
|
||||||
font-family: var(--font-open-sans), sans-serif;
|
font-family: var(--font-dm-sans), sans-serif;
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
overscroll-behavior: none;
|
overscroll-behavior: none;
|
||||||
@@ -24,5 +24,5 @@ h3,
|
|||||||
h4,
|
h4,
|
||||||
h5,
|
h5,
|
||||||
h6 {
|
h6 {
|
||||||
font-family: var(--font-inter), sans-serif;
|
font-family: var(--font-dm-sans), sans-serif;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,15 +10,15 @@
|
|||||||
--accent: #ffffff;
|
--accent: #ffffff;
|
||||||
--background-accent: #ffffff; */
|
--background-accent: #ffffff; */
|
||||||
|
|
||||||
--background: #f7f6f7;
|
--background: #0a1628;
|
||||||
--card: #ffffff;
|
--card: #0f1f35;
|
||||||
--foreground: #250c0d;
|
--foreground: #e8f0f8;
|
||||||
--primary-cta: #b82b40;
|
--primary-cta: #1a5c3a;
|
||||||
--primary-cta-text: #f7f6f7;
|
--primary-cta-text: #f7f6f7;
|
||||||
--secondary-cta: #ffffff;
|
--secondary-cta: #0f1f35;
|
||||||
--secondary-cta-text: #250c0d;
|
--secondary-cta-text: #250c0d;
|
||||||
--accent: #b90941;
|
--accent: #22c55e;
|
||||||
--background-accent: #e8a8b6;
|
--background-accent: #16a34a;
|
||||||
|
|
||||||
/* text sizing - set by ThemeProvider */
|
/* text sizing - set by ThemeProvider */
|
||||||
/* --text-2xs: clamp(0.465rem, 0.62vw, 0.62rem);
|
/* --text-2xs: clamp(0.465rem, 0.62vw, 0.62rem);
|
||||||
|
|||||||
7
src/app/teacher-dashboard/layout.tsx
Normal file
7
src/app/teacher-dashboard/layout.tsx
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export default function TeacherDashboardLayout({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) {
|
||||||
|
return <>{children}</>;
|
||||||
|
}
|
||||||
367
src/app/teacher-dashboard/page.tsx
Normal file
367
src/app/teacher-dashboard/page.tsx
Normal file
@@ -0,0 +1,367 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
|
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
|
||||||
|
import MetricCardThree from "@/components/sections/metrics/MetricCardThree";
|
||||||
|
import {
|
||||||
|
Home,
|
||||||
|
Calendar,
|
||||||
|
Users,
|
||||||
|
MessageSquare,
|
||||||
|
DollarSign,
|
||||||
|
BarChart3,
|
||||||
|
Settings,
|
||||||
|
TrendingUp,
|
||||||
|
Award,
|
||||||
|
Star,
|
||||||
|
Clock,
|
||||||
|
CheckCircle,
|
||||||
|
Clock3,
|
||||||
|
Send,
|
||||||
|
} from "lucide-react";
|
||||||
|
|
||||||
|
export default function TeacherDashboard() {
|
||||||
|
const [activeMenu, setActiveMenu] = useState("home");
|
||||||
|
|
||||||
|
const navItems = [
|
||||||
|
{ name: "Ana Sayfa", id: "/" },
|
||||||
|
{ name: "Öğretmen Paneli", id: "/teacher-dashboard" },
|
||||||
|
];
|
||||||
|
|
||||||
|
const menuItems = [
|
||||||
|
{ id: "home", label: "Ana Sayfa", icon: Home },
|
||||||
|
{ id: "calendar", label: "Takvim", icon: Calendar },
|
||||||
|
{ id: "students", label: "Öğrencilerim", icon: Users },
|
||||||
|
{ id: "messages", label: "Mesajlar", icon: MessageSquare },
|
||||||
|
{ id: "earnings", label: "Kazançlar", icon: DollarSign },
|
||||||
|
{ id: "statistics", label: "İstatistikler", icon: BarChart3 },
|
||||||
|
{ id: "settings", label: "Ayarlar", icon: Settings },
|
||||||
|
];
|
||||||
|
|
||||||
|
const todayLessons = [
|
||||||
|
{
|
||||||
|
id: "1", title: "Matematik - Cebir Temelleri", student: "Ahmet Demir", time: "09:00 - 10:00", status: "scheduled"},
|
||||||
|
{
|
||||||
|
id: "2", title: "İngilizce - Konuşma Pratiği", student: "Zeynep Kaya", time: "11:00 - 12:00", status: "scheduled"},
|
||||||
|
{
|
||||||
|
id: "3", title: "Fizik - Hareket Kanunları", student: "Mehmet Yılmaz", time: "14:00 - 15:00", status: "in-progress"},
|
||||||
|
];
|
||||||
|
|
||||||
|
const pendingRequests = [
|
||||||
|
{
|
||||||
|
id: "1", student: "Ali Şahin", subject: "Kimya", date: "5 Şubat 2025", time: "15:00"},
|
||||||
|
{
|
||||||
|
id: "2", student: "Emine Çetin", subject: "Tarih", date: "6 Şubat 2025", time: "16:30"},
|
||||||
|
];
|
||||||
|
|
||||||
|
const newMessages = [
|
||||||
|
{
|
||||||
|
id: "1", from: "Ahmet Demir", message: "Ders için teşekkürler, çok faydalı oldu!", time: "5 dakika önce"},
|
||||||
|
{
|
||||||
|
id: "2", from: "Zeynep Kaya", message: "Sonraki ders için kaynak önerebilir misiniz?", time: "2 saat önce"},
|
||||||
|
{
|
||||||
|
id: "3", from: "Mehmet Yılmaz", message: "Pazartesi dersini erteleyebilir miyim?", time: "4 saat önce"},
|
||||||
|
];
|
||||||
|
|
||||||
|
const monthlyEarnings = [
|
||||||
|
{ month: "Ocak", amount: 2400 },
|
||||||
|
{ month: "Şubat", amount: 2800 },
|
||||||
|
{ month: "Mart", amount: 2200 },
|
||||||
|
{ month: "Nisan", amount: 3000 },
|
||||||
|
{ month: "Mayıs", amount: 2600 },
|
||||||
|
{ month: "Haziran", amount: 3200 },
|
||||||
|
];
|
||||||
|
|
||||||
|
const studentCount = [
|
||||||
|
{ month: "Ocak", count: 12 },
|
||||||
|
{ month: "Şubat", count: 15 },
|
||||||
|
{ month: "Mart", count: 18 },
|
||||||
|
{ month: "Nisan", count: 16 },
|
||||||
|
{ month: "Mayıs", count: 20 },
|
||||||
|
{ month: "Haziran", count: 22 },
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider
|
||||||
|
defaultButtonVariant="text-shift"
|
||||||
|
defaultTextAnimation="entrance-slide"
|
||||||
|
borderRadius="rounded"
|
||||||
|
contentWidth="compact"
|
||||||
|
sizing="mediumSizeLargeTitles"
|
||||||
|
background="circleGradient"
|
||||||
|
cardStyle="layered-gradient"
|
||||||
|
primaryButtonStyle="shadow"
|
||||||
|
secondaryButtonStyle="layered"
|
||||||
|
headingFontWeight="light"
|
||||||
|
>
|
||||||
|
<div id="nav" data-section="nav">
|
||||||
|
<NavbarStyleFullscreen
|
||||||
|
navItems={navItems}
|
||||||
|
brandName="Öğretmen Platformu"
|
||||||
|
bottomLeftText="Öğretmen Paneli"
|
||||||
|
bottomRightText="info@platform.com"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex min-h-screen bg-background pt-24">
|
||||||
|
{/* Left Sidebar Menu */}
|
||||||
|
<aside className="w-64 bg-card border-r border-accent p-6 fixed left-0 top-20 bottom-0 overflow-y-auto">
|
||||||
|
<nav className="space-y-2">
|
||||||
|
{menuItems.map((item) => {
|
||||||
|
const IconComponent = item.icon;
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
key={item.id}
|
||||||
|
onClick={() => setActiveMenu(item.id)}
|
||||||
|
className={`w-full flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${
|
||||||
|
activeMenu === item.id
|
||||||
|
? "bg-primary-cta text-background"
|
||||||
|
: "text-foreground hover:bg-background-accent"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<IconComponent size={20} />
|
||||||
|
<span className="font-medium">{item.label}</span>
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</nav>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
{/* Main Content */}
|
||||||
|
<main className="ml-64 flex-1 p-8">
|
||||||
|
{activeMenu === "home" && (
|
||||||
|
<div className="space-y-8">
|
||||||
|
{/* Welcome Card */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
|
||||||
|
<div className="md:col-span-4 bg-card border border-accent rounded-lg p-6 shadow-lg">
|
||||||
|
<h2 className="text-3xl font-bold text-foreground mb-2">
|
||||||
|
Hoşgeldiniz, Ayşe!
|
||||||
|
</h2>
|
||||||
|
<p className="text-foreground/70 mb-6">
|
||||||
|
Ocak ayında başarılı bir ay geçiriyorsunuz.
|
||||||
|
</p>
|
||||||
|
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||||
|
<div className="bg-background rounded-lg p-4">
|
||||||
|
<div className="text-sm text-foreground/70 mb-1">
|
||||||
|
Aylık Kazanç
|
||||||
|
</div>
|
||||||
|
<div className="text-2xl font-bold text-primary-cta">
|
||||||
|
₺2,400
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="bg-background rounded-lg p-4">
|
||||||
|
<div className="text-sm text-foreground/70 mb-1">
|
||||||
|
Ders Sayısı
|
||||||
|
</div>
|
||||||
|
<div className="text-2xl font-bold text-accent">24</div>
|
||||||
|
</div>
|
||||||
|
<div className="bg-background rounded-lg p-4">
|
||||||
|
<div className="text-sm text-foreground/70 mb-1">
|
||||||
|
Puan
|
||||||
|
</div>
|
||||||
|
<div className="text-2xl font-bold text-secondary-cta">
|
||||||
|
4.8/5
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="bg-background rounded-lg p-4">
|
||||||
|
<div className="text-sm text-foreground/70 mb-1">
|
||||||
|
Yeni Öğrenci
|
||||||
|
</div>
|
||||||
|
<div className="text-2xl font-bold text-accent">3</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Today's Lessons */}
|
||||||
|
<div className="bg-card border border-accent rounded-lg p-6 shadow-lg">
|
||||||
|
<div className="flex items-center gap-2 mb-6">
|
||||||
|
<Clock size={24} className="text-primary-cta" />
|
||||||
|
<h3 className="text-2xl font-bold text-foreground">
|
||||||
|
Bugünün Dersleri
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div className="space-y-3">
|
||||||
|
{todayLessons.map((lesson) => (
|
||||||
|
<div
|
||||||
|
key={lesson.id}
|
||||||
|
className="flex items-start gap-4 p-4 bg-background rounded-lg border border-background-accent"
|
||||||
|
>
|
||||||
|
<div className="flex-1">
|
||||||
|
<h4 className="font-semibold text-foreground">
|
||||||
|
{lesson.title}
|
||||||
|
</h4>
|
||||||
|
<p className="text-sm text-foreground/70">
|
||||||
|
Öğrenci: {lesson.student}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="text-right">
|
||||||
|
<p className="text-sm font-medium text-foreground">
|
||||||
|
{lesson.time}
|
||||||
|
</p>
|
||||||
|
<span
|
||||||
|
className={`inline-block text-xs px-2 py-1 rounded-full mt-1 ${
|
||||||
|
lesson.status === "in-progress"
|
||||||
|
? "bg-primary-cta/20 text-primary-cta"
|
||||||
|
: "bg-accent/20 text-accent"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{lesson.status === "in-progress"
|
||||||
|
? "Devam Ediyor"
|
||||||
|
: "Planlandı"}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Pending Requests and New Messages */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
|
{/* Pending Requests */}
|
||||||
|
<div className="bg-card border border-accent rounded-lg p-6 shadow-lg">
|
||||||
|
<div className="flex items-center gap-2 mb-6">
|
||||||
|
<CheckCircle size={24} className="text-accent" />
|
||||||
|
<h3 className="text-xl font-bold text-foreground">
|
||||||
|
Bekleyen İstekler
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div className="space-y-3">
|
||||||
|
{pendingRequests.map((request) => (
|
||||||
|
<div
|
||||||
|
key={request.id}
|
||||||
|
className="p-4 bg-background rounded-lg border border-background-accent"
|
||||||
|
>
|
||||||
|
<p className="font-semibold text-foreground">
|
||||||
|
{request.student}
|
||||||
|
</p>
|
||||||
|
<p className="text-sm text-foreground/70">
|
||||||
|
{request.subject} • {request.date} {request.time}
|
||||||
|
</p>
|
||||||
|
<div className="flex gap-2 mt-3">
|
||||||
|
<button className="flex-1 text-xs bg-primary-cta text-background px-3 py-1 rounded hover:opacity-90 transition-opacity">
|
||||||
|
Onayla
|
||||||
|
</button>
|
||||||
|
<button className="flex-1 text-xs bg-background-accent text-foreground px-3 py-1 rounded hover:opacity-80 transition-opacity">
|
||||||
|
İptal Et
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* New Messages */}
|
||||||
|
<div className="bg-card border border-accent rounded-lg p-6 shadow-lg">
|
||||||
|
<div className="flex items-center gap-2 mb-6">
|
||||||
|
<Send size={24} className="text-secondary-cta" />
|
||||||
|
<h3 className="text-xl font-bold text-foreground">
|
||||||
|
Yeni Mesajlar
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div className="space-y-3 max-h-64 overflow-y-auto">
|
||||||
|
{newMessages.map((msg) => (
|
||||||
|
<div
|
||||||
|
key={msg.id}
|
||||||
|
className="p-4 bg-background rounded-lg border border-background-accent hover:border-accent/50 transition-colors cursor-pointer"
|
||||||
|
>
|
||||||
|
<p className="font-semibold text-foreground">{msg.from}</p>
|
||||||
|
<p className="text-sm text-foreground/70 mt-1">{msg.message}</p>
|
||||||
|
<p className="text-xs text-foreground/50 mt-2">{msg.time}</p>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Charts Section */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
|
{/* Monthly Earnings Chart */}
|
||||||
|
<div className="bg-card border border-accent rounded-lg p-6 shadow-lg">
|
||||||
|
<h3 className="text-xl font-bold text-foreground mb-6">
|
||||||
|
Aylık Kazançlar
|
||||||
|
</h3>
|
||||||
|
<div className="space-y-4">
|
||||||
|
{monthlyEarnings.map((item, idx) => (
|
||||||
|
<div key={idx} className="flex items-center gap-3">
|
||||||
|
<span className="w-16 text-sm font-medium text-foreground/70">
|
||||||
|
{item.month}
|
||||||
|
</span>
|
||||||
|
<div className="flex-1 bg-background rounded-full h-8 relative">
|
||||||
|
<div
|
||||||
|
className="bg-gradient-to-r from-primary-cta to-accent h-full rounded-full flex items-center justify-end px-3"
|
||||||
|
style={{
|
||||||
|
width: `${(item.amount / 3200) * 100}%`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{item.amount > 2000 && (
|
||||||
|
<span className="text-xs font-bold text-background">
|
||||||
|
₺{item.amount}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{item.amount <= 2000 && (
|
||||||
|
<span className="absolute inset-y-0 right-2 flex items-center text-xs font-bold text-foreground">
|
||||||
|
₺{item.amount}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Student Count Chart */}
|
||||||
|
<div className="bg-card border border-accent rounded-lg p-6 shadow-lg">
|
||||||
|
<h3 className="text-xl font-bold text-foreground mb-6">
|
||||||
|
Öğrenci Sayısı Gelişimi
|
||||||
|
</h3>
|
||||||
|
<div className="space-y-4">
|
||||||
|
{studentCount.map((item, idx) => (
|
||||||
|
<div key={idx} className="flex items-center gap-3">
|
||||||
|
<span className="w-16 text-sm font-medium text-foreground/70">
|
||||||
|
{item.month}
|
||||||
|
</span>
|
||||||
|
<div className="flex-1 bg-background rounded-full h-8 relative">
|
||||||
|
<div
|
||||||
|
className="bg-gradient-to-r from-accent to-secondary-cta h-full rounded-full flex items-center justify-end px-3"
|
||||||
|
style={{
|
||||||
|
width: `${(item.count / 22) * 100}%`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{item.count > 10 && (
|
||||||
|
<span className="text-xs font-bold text-background">
|
||||||
|
{item.count}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{item.count <= 10 && (
|
||||||
|
<span className="absolute inset-y-0 right-2 flex items-center text-xs font-bold text-foreground">
|
||||||
|
{item.count}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{activeMenu !== "home" && (
|
||||||
|
<div className="text-center py-20">
|
||||||
|
<h2 className="text-3xl font-bold text-foreground mb-4">
|
||||||
|
{menuItems.find((m) => m.id === activeMenu)?.label}
|
||||||
|
</h2>
|
||||||
|
<p className="text-foreground/70 text-lg">
|
||||||
|
Bu bölüm yakında hazırlanacaktır.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,92 +1,167 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||||
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
|
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
|
||||||
import TeamCardEleven from "@/components/sections/team/TeamCardEleven";
|
import Input from "@/components/form/Input";
|
||||||
import FaqSplitText from "@/components/sections/faq/FaqSplitText";
|
|
||||||
import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal";
|
import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal";
|
||||||
|
import { ChevronRight, Check } from "lucide-react";
|
||||||
|
|
||||||
export default function TeachersPage() {
|
export default function TeacherRegistrationPage() {
|
||||||
const navItems = [
|
const navItems = [
|
||||||
{ name: "Ana Sayfa", id: "/" },
|
{ name: "Ana Sayfa", id: "/" },
|
||||||
{ name: "Öğretmenler", id: "/teachers" },
|
{ name: "Öğretmenler", id: "/teachers" },
|
||||||
{ name: "Etkinlikler", id: "events" },
|
{ name: "Öğrenciler", id: "/students" },
|
||||||
{ name: "Çalışma Programı", id: "schedule" },
|
{ name: "Çalışma Programı", id: "schedule" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const teacherGroups = [
|
const [currentStep, setCurrentStep] = useState(1);
|
||||||
{
|
const totalSteps = 5;
|
||||||
id: "group-1",
|
|
||||||
groupTitle: "İleri Seviye Öğretmenler",
|
|
||||||
members: [
|
|
||||||
{
|
|
||||||
id: "1",
|
|
||||||
title: "Ayşe Kaya",
|
|
||||||
subtitle: "Matematik & Fizik",
|
|
||||||
detail: "12 yıl tecrübe | 5.0 puan",
|
|
||||||
imageSrc: "http://img.b2bpic.net/free-photo/young-female-glasses-workplace_1301-980.jpg?_wi=1",
|
|
||||||
imageAlt: "professional woman teacher portrait headshot",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "2",
|
|
||||||
title: "Mehmet Yıldız",
|
|
||||||
subtitle: "İngilizce & Dil",
|
|
||||||
detail: "15 yıl tecrübe | 4.9 puan",
|
|
||||||
imageSrc: "http://img.b2bpic.net/free-photo/portrait-businessman-office-3_1262-1489.jpg?_wi=1",
|
|
||||||
imageAlt: "professional man teacher portrait headshot",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "3",
|
|
||||||
title: "Zeynep Demir",
|
|
||||||
subtitle: "Kimya & Biyoloji",
|
|
||||||
detail: "10 yıl tecrübe | 4.8 puan",
|
|
||||||
imageSrc: "http://img.b2bpic.net/free-photo/woman-posing-with-books_23-2148680219.jpg?_wi=1",
|
|
||||||
imageAlt: "female scientist professor portrait headshot",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "4",
|
|
||||||
title: "İbrahim Çelik",
|
|
||||||
subtitle: "Tarih & Sosyal Bilgiler",
|
|
||||||
detail: "8 yıl tecrübe | 4.9 puan",
|
|
||||||
imageSrc: "http://img.b2bpic.net/free-photo/young-man-wearing-blue-outfit-looking-satisfied_1298-169.jpg?_wi=1",
|
|
||||||
imageAlt: "male professor teacher history expert portrait",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const faqData = [
|
// Personal Info Step
|
||||||
{
|
const [personalInfo, setPersonalInfo] = useState({
|
||||||
id: "1",
|
firstName: "", lastName: "", email: "", phone: ""});
|
||||||
title: "Öğretmen seçerken nelere dikkat etmeliyim?",
|
const [personalErrors, setPersonalErrors] = useState<Record<string, string>>({});
|
||||||
content:
|
|
||||||
"Öğretmen profillerinde deneyim, uzmanlık alanı ve öğrenci puanlarını inceleyebilirsiniz. İlk dersini denemek için \"İletişime Geç\" düğmesini kullanarak öğretmenle bağlantı kurabilirsiniz.",
|
// Education Step
|
||||||
},
|
const [education, setEducation] = useState({
|
||||||
{
|
degree: "", university: "", field: "", year: ""});
|
||||||
id: "2",
|
const [educationErrors, setEducationErrors] = useState<Record<string, string>>({});
|
||||||
title: "Ders saatlerini nasıl düzenleyebilirim?",
|
|
||||||
content:
|
// Lesson Details Step
|
||||||
"Çalışma Programı sayfasında haftalık ders takvimini görebilirsiniz. Istediğiniz ders saatine tıklayarak \"Katıl\" butonu ile kaydolabilirsiniz.",
|
const [lessonDetails, setLessonDetails] = useState({
|
||||||
},
|
subjects: "", levels: "", experience: "", bio: ""});
|
||||||
{
|
const [lessonErrors, setLessonErrors] = useState<Record<string, string>>({});
|
||||||
id: "3",
|
|
||||||
title: "Etkinliklere nasıl katılabilirim?",
|
// Pricing Step
|
||||||
content:
|
const [pricing, setPricing] = useState({
|
||||||
"Etkinlikler sayfasında tüm yaklaşan dersleri ve webinarları görebilirsiniz. İlgilendiğiniz etkinliğin \"Kayıt Ol\" düğmesine tıklayarak katılabilirsiniz.",
|
hourlyRate: "", currency: "USD", availability: ""});
|
||||||
},
|
const [pricingErrors, setPricingErrors] = useState<Record<string, string>>({});
|
||||||
{
|
|
||||||
id: "4",
|
// Identity Verification Step
|
||||||
title: "Ödeme seçenekleri nelerdir?",
|
const [identity, setIdentity] = useState({
|
||||||
content:
|
idType: "", idNumber: "", dob: ""});
|
||||||
"Kredi kartı, banka havalesi ve e-cüzdan gibi çeşitli ödeme yöntemlerini destekliyoruz. Ödeme bilgileri gizli ve güvenlidir.",
|
const [identityErrors, setIdentityErrors] = useState<Record<string, string>>({});
|
||||||
},
|
|
||||||
{
|
const validateStep = (step: number): boolean => {
|
||||||
id: "5",
|
let isValid = true;
|
||||||
title: "Dersi iptal etmek istiyorsam ne yapmalıyım?",
|
const errors: Record<string, string> = {};
|
||||||
content:
|
|
||||||
"Dersin başlamasından en az 24 saat önce iptal edebilirsiniz. Profil bölümünde 'Kayıtlı Dersler' kısmından ders iptalini gerçekleştirebilirsiniz.",
|
if (step === 1) {
|
||||||
},
|
if (!personalInfo.firstName.trim()) {
|
||||||
];
|
errors.firstName = "Ad gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!personalInfo.lastName.trim()) {
|
||||||
|
errors.lastName = "Soyadı gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!personalInfo.email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
|
||||||
|
errors.email = "Geçerli bir email adı girin";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!personalInfo.phone.match(/^[0-9\s+()-]{10}$/)) {
|
||||||
|
errors.phone = "Geçerli bir telefon numarası girin";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
setPersonalErrors(errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (step === 2) {
|
||||||
|
if (!education.degree.trim()) {
|
||||||
|
errors.degree = "Derece türü gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!education.university.trim()) {
|
||||||
|
errors.university = "Üniversite adı gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!education.field.trim()) {
|
||||||
|
errors.field = "Alan gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!education.year.trim()) {
|
||||||
|
errors.year = "Mezuniyet yılı gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
setEducationErrors(errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (step === 3) {
|
||||||
|
if (!lessonDetails.subjects.trim()) {
|
||||||
|
errors.subjects = "Konular gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!lessonDetails.levels.trim()) {
|
||||||
|
errors.levels = "Seviyeler gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!lessonDetails.experience.trim()) {
|
||||||
|
errors.experience = "Deneyim gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!lessonDetails.bio.trim()) {
|
||||||
|
errors.bio = "Biyografi gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
setLessonErrors(errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (step === 4) {
|
||||||
|
if (!pricing.hourlyRate.match(/^[0-9]+(\.[0-9]{1,2})?$/)) {
|
||||||
|
errors.hourlyRate = "Geçerli bir fiyat girin";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!pricing.availability.trim()) {
|
||||||
|
errors.availability = "Kullanılabilirlik gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
setPricingErrors(errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (step === 5) {
|
||||||
|
if (!identity.idType.trim()) {
|
||||||
|
errors.idType = "Kimlik türü gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!identity.idNumber.trim()) {
|
||||||
|
errors.idNumber = "Kimlik numarası gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
if (!identity.dob.trim()) {
|
||||||
|
errors.dob = "Doğum tarihi gereklidir";
|
||||||
|
isValid = false;
|
||||||
|
}
|
||||||
|
setIdentityErrors(errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
return isValid;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleNext = () => {
|
||||||
|
if (validateStep(currentStep)) {
|
||||||
|
setCurrentStep(currentStep + 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePrevious = () => {
|
||||||
|
setCurrentStep(currentStep - 1);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = () => {
|
||||||
|
if (validateStep(currentStep)) {
|
||||||
|
console.log("Form submitted:", {
|
||||||
|
personalInfo,
|
||||||
|
education,
|
||||||
|
lessonDetails,
|
||||||
|
pricing,
|
||||||
|
identity,
|
||||||
|
});
|
||||||
|
alert("Kayıt başarıyla tamamlandı!");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const progressPercentage = (currentStep / totalSteps) * 100;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
@@ -95,7 +170,7 @@ export default function TeachersPage() {
|
|||||||
borderRadius="rounded"
|
borderRadius="rounded"
|
||||||
contentWidth="compact"
|
contentWidth="compact"
|
||||||
sizing="mediumSizeLargeTitles"
|
sizing="mediumSizeLargeTitles"
|
||||||
background="noise"
|
background="circleGradient"
|
||||||
cardStyle="layered-gradient"
|
cardStyle="layered-gradient"
|
||||||
primaryButtonStyle="shadow"
|
primaryButtonStyle="shadow"
|
||||||
secondaryButtonStyle="layered"
|
secondaryButtonStyle="layered"
|
||||||
@@ -110,40 +185,352 @@ export default function TeachersPage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="teachers" data-section="teachers">
|
<div className="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 py-12 px-4 pt-32">
|
||||||
<TeamCardEleven
|
<div className="max-w-3xl mx-auto">
|
||||||
groups={teacherGroups}
|
{/* Header */}
|
||||||
animationType="slide-up"
|
<div className="text-center mb-12">
|
||||||
title="Uzman Öğretmenlerimiz"
|
<h1 className="text-4xl font-bold text-slate-900 mb-2">Öğretmen Kaydı</h1>
|
||||||
description="Alanlarında deneyimli, nitelikli eğitim profesyonelleri"
|
<p className="text-lg text-slate-600">Adım {currentStep} / {totalSteps}</p>
|
||||||
textboxLayout="default"
|
</div>
|
||||||
useInvertedBackground={true}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="faq" data-section="faq">
|
{/* Progress Bar */}
|
||||||
<FaqSplitText
|
<div className="mb-8">
|
||||||
faqs={faqData}
|
<div className="flex gap-2 mb-3">
|
||||||
sideTitle="Sık Sorulan Sorular"
|
{Array.from({ length: totalSteps }).map((_, i) => (
|
||||||
sideDescription="Platformumuz hakkında bilmeniz gereken her şey"
|
<div key={i} className="flex-1">
|
||||||
textPosition="left"
|
<div className="h-2 bg-slate-300 rounded-full overflow-hidden">
|
||||||
useInvertedBackground={false}
|
<div
|
||||||
animationType="smooth"
|
className={`h-full transition-all duration-300 ${
|
||||||
faqsAnimation="slide-up"
|
i + 1 <= currentStep ? "bg-blue-600" : "bg-slate-300"
|
||||||
/>
|
}`}
|
||||||
|
style={{
|
||||||
|
width: i + 1 === currentStep ? "100%" : i + 1 < currentStep ? "100%" : "0%"}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div className="w-full h-1 bg-slate-300 rounded-full overflow-hidden">
|
||||||
|
<div
|
||||||
|
className="h-full bg-blue-600 transition-all duration-300"
|
||||||
|
style={{ width: `${progressPercentage}%` }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Form Container */}
|
||||||
|
<div className="bg-white rounded-lg shadow-lg p-8 mb-8">
|
||||||
|
{/* Step 1: Personal Info */}
|
||||||
|
{currentStep === 1 && (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<h2 className="text-2xl font-bold text-slate-900 mb-6">Kişisel Bilgiler</h2>
|
||||||
|
<div className="grid grid-cols-2 gap-4">
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Ad</label>
|
||||||
|
<Input
|
||||||
|
value={personalInfo.firstName}
|
||||||
|
onChange={(value) => setPersonalInfo({ ...personalInfo, firstName: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="Adınız"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{personalErrors.firstName && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{personalErrors.firstName}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Soyadı</label>
|
||||||
|
<Input
|
||||||
|
value={personalInfo.lastName}
|
||||||
|
onChange={(value) => setPersonalInfo({ ...personalInfo, lastName: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="Soyadınız"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{personalErrors.lastName && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{personalErrors.lastName}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Email</label>
|
||||||
|
<Input
|
||||||
|
value={personalInfo.email}
|
||||||
|
onChange={(value) => setPersonalInfo({ ...personalInfo, email: value })}
|
||||||
|
type="email"
|
||||||
|
placeholder="example@email.com"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{personalErrors.email && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{personalErrors.email}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Telefon</label>
|
||||||
|
<Input
|
||||||
|
value={personalInfo.phone}
|
||||||
|
onChange={(value) => setPersonalInfo({ ...personalInfo, phone: value })}
|
||||||
|
type="tel"
|
||||||
|
placeholder="+90 5XX XXX XXXX"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{personalErrors.phone && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{personalErrors.phone}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Step 2: Education */}
|
||||||
|
{currentStep === 2 && (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<h2 className="text-2xl font-bold text-slate-900 mb-6">Eğitim Bilgileri</h2>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Derece Türü</label>
|
||||||
|
<Input
|
||||||
|
value={education.degree}
|
||||||
|
onChange={(value) => setEducation({ ...education, degree: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="örn. Lisans, Yüksek Lisans"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{educationErrors.degree && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{educationErrors.degree}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Üniversite</label>
|
||||||
|
<Input
|
||||||
|
value={education.university}
|
||||||
|
onChange={(value) => setEducation({ ...education, university: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="Üniversite adı"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{educationErrors.university && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{educationErrors.university}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Alan</label>
|
||||||
|
<Input
|
||||||
|
value={education.field}
|
||||||
|
onChange={(value) => setEducation({ ...education, field: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="Çalışma alanı"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{educationErrors.field && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{educationErrors.field}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Mezuniyet Yılı</label>
|
||||||
|
<Input
|
||||||
|
value={education.year}
|
||||||
|
onChange={(value) => setEducation({ ...education, year: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="2020"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{educationErrors.year && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{educationErrors.year}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Step 3: Lesson Details */}
|
||||||
|
{currentStep === 3 && (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<h2 className="text-2xl font-bold text-slate-900 mb-6">Ders Detayları</h2>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Konular</label>
|
||||||
|
<Input
|
||||||
|
value={lessonDetails.subjects}
|
||||||
|
onChange={(value) => setLessonDetails({ ...lessonDetails, subjects: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="örn. Matematik, Fizik, İngilizce"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{lessonErrors.subjects && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{lessonErrors.subjects}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Seviyeler</label>
|
||||||
|
<Input
|
||||||
|
value={lessonDetails.levels}
|
||||||
|
onChange={(value) => setLessonDetails({ ...lessonDetails, levels: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="örn. İlkokul, Ortaokul, Lise"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{lessonErrors.levels && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{lessonErrors.levels}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Deneyim (yıl)</label>
|
||||||
|
<Input
|
||||||
|
value={lessonDetails.experience}
|
||||||
|
onChange={(value) => setLessonDetails({ ...lessonDetails, experience: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="örn. 5 yıl"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{lessonErrors.experience && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{lessonErrors.experience}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Biyografi</label>
|
||||||
|
<textarea
|
||||||
|
value={lessonDetails.bio}
|
||||||
|
onChange={(e) => setLessonDetails({ ...lessonDetails, bio: e.target.value })}
|
||||||
|
placeholder="Kendiniz hakkında yazın"
|
||||||
|
rows={4}
|
||||||
|
className="w-full px-4 py-2 bg-slate-100 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
|
/>
|
||||||
|
{lessonErrors.bio && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{lessonErrors.bio}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Step 4: Pricing */}
|
||||||
|
{currentStep === 4 && (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<h2 className="text-2xl font-bold text-slate-900 mb-6">Fiyatlandırma</h2>
|
||||||
|
<div className="grid grid-cols-2 gap-4">
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Saatlik Ücret</label>
|
||||||
|
<Input
|
||||||
|
value={pricing.hourlyRate}
|
||||||
|
onChange={(value) => setPricing({ ...pricing, hourlyRate: value })}
|
||||||
|
type="number"
|
||||||
|
placeholder="50"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{pricingErrors.hourlyRate && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{pricingErrors.hourlyRate}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Para Birimi</label>
|
||||||
|
<select
|
||||||
|
value={pricing.currency}
|
||||||
|
onChange={(e) => setPricing({ ...pricing, currency: e.target.value })}
|
||||||
|
className="w-full px-4 py-2 bg-slate-100 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
|
>
|
||||||
|
<option>USD</option>
|
||||||
|
<option>EUR</option>
|
||||||
|
<option>TRY</option>
|
||||||
|
<option>GBP</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Kullanılabilirlik</label>
|
||||||
|
<Input
|
||||||
|
value={pricing.availability}
|
||||||
|
onChange={(value) => setPricing({ ...pricing, availability: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="örn. Pazartesi-Cuma 15:00-20:00"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{pricingErrors.availability && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{pricingErrors.availability}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Step 5: Identity Verification */}
|
||||||
|
{currentStep === 5 && (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<h2 className="text-2xl font-bold text-slate-900 mb-6">Kimlik Doğrulaması</h2>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Kimlik Türü</label>
|
||||||
|
<Input
|
||||||
|
value={identity.idType}
|
||||||
|
onChange={(value) => setIdentity({ ...identity, idType: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="örn. Pasaport, Kimlik Kartı"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{identityErrors.idType && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{identityErrors.idType}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Kimlik Numarası</label>
|
||||||
|
<Input
|
||||||
|
value={identity.idNumber}
|
||||||
|
onChange={(value) => setIdentity({ ...identity, idNumber: value })}
|
||||||
|
type="text"
|
||||||
|
placeholder="Kimlik numarası"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{identityErrors.idNumber && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{identityErrors.idNumber}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-slate-700 mb-2">Doğum Tarihi</label>
|
||||||
|
<Input
|
||||||
|
value={identity.dob}
|
||||||
|
onChange={(value) => setIdentity({ ...identity, dob: value })}
|
||||||
|
type="date"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
{identityErrors.dob && (
|
||||||
|
<p className="text-red-600 text-sm mt-1">{identityErrors.dob}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="bg-blue-50 border border-blue-200 rounded-lg p-4 mt-4">
|
||||||
|
<p className="text-sm text-blue-800">✓ Tüm bilgileriniz güvenli şekilde saklanacaktır ve GDPR uyumlu olacaktır.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Navigation Buttons */}
|
||||||
|
<div className="flex gap-4 justify-between">
|
||||||
|
<button
|
||||||
|
onClick={handlePrevious}
|
||||||
|
disabled={currentStep === 1}
|
||||||
|
className="px-6 py-3 bg-slate-200 hover:bg-slate-300 disabled:opacity-50 disabled:cursor-not-allowed text-slate-900 rounded-lg font-medium transition"
|
||||||
|
>
|
||||||
|
Geri
|
||||||
|
</button>
|
||||||
|
{currentStep < totalSteps ? (
|
||||||
|
<button
|
||||||
|
onClick={handleNext}
|
||||||
|
className="px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-medium transition flex items-center gap-2"
|
||||||
|
>
|
||||||
|
İleri <ChevronRight size={20} />
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
onClick={handleSubmit}
|
||||||
|
className="px-6 py-3 bg-green-600 hover:bg-green-700 text-white rounded-lg font-medium transition flex items-center gap-2"
|
||||||
|
>
|
||||||
|
<Check size={20} /> Kayıt Tamamla
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="footer" data-section="footer">
|
<div id="footer" data-section="footer">
|
||||||
<FooterLogoReveal
|
<FooterLogoReveal
|
||||||
logoText="Öğretmen Platformu"
|
logoText="Öğretmen Platformu"
|
||||||
leftLink={{
|
leftLink={{
|
||||||
text: "Gizlilik Politikası",
|
text: "Gizlilik Politikası", href: "#"}}
|
||||||
href: "#",
|
|
||||||
}}
|
|
||||||
rightLink={{
|
rightLink={{
|
||||||
text: "Kullanım Şartları",
|
text: "Kullanım Şartları", href: "#"}}
|
||||||
href: "#",
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
|
|||||||
@@ -1,123 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from './CardStack';
|
||||||
|
|
||||||
import { memo, Children } from "react";
|
interface CardListProps extends Omit<CardStackProps, 'children'> {
|
||||||
import CardStackTextBox from "@/components/cardStack/CardStackTextBox";
|
children: React.ReactNode[];
|
||||||
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";
|
|
||||||
|
|
||||||
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;
|
|
||||||
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 = ({
|
export const CardList: React.FC<CardListProps> = (props) => {
|
||||||
children,
|
return <CardStack {...props}>{props.children}</CardStack>;
|
||||||
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 });
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
className={cls(
|
|
||||||
"relative py-20 w-full",
|
|
||||||
useInvertedBackground && "bg-foreground",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className={cls("w-content-width mx-auto flex flex-col gap-8", containerClassName)}>
|
|
||||||
<CardStackTextBox
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={titleClassName}
|
|
||||||
titleImageWrapperClassName={titleImageWrapperClassName}
|
|
||||||
titleImageClassName={titleImageClassName}
|
|
||||||
descriptionClassName={descriptionClassName}
|
|
||||||
tagClassName={tagClassName}
|
|
||||||
buttonContainerClassName={buttonContainerClassName}
|
|
||||||
buttonClassName={buttonClassName}
|
|
||||||
buttonTextClassName={buttonTextClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="flex flex-col gap-6">
|
|
||||||
{childrenArray.map((child, index) => (
|
|
||||||
<div
|
|
||||||
key={index}
|
|
||||||
ref={(el) => { itemRefs.current[index] = el; }}
|
|
||||||
className={cls(!disableCardWrapper && "card", !disableCardWrapper && (useUncappedRounding ? "rounded-theme" : "rounded-theme-capped"), cardClassName)}
|
|
||||||
>
|
|
||||||
{child}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CardList.displayName = "CardList";
|
export default CardList;
|
||||||
|
|
||||||
export default memo(CardList);
|
|
||||||
10
src/components/cardStack/CardStack.ts
Normal file
10
src/components/cardStack/CardStack.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export type CardStackProps = {
|
||||||
|
title: string;
|
||||||
|
description?: string;
|
||||||
|
children?: React.ReactNode;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const CardStack = (props: CardStackProps) => {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
@@ -1,148 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import { memo, Children } from "react";
|
interface AutoCarouselProps {
|
||||||
import Marquee from "react-fast-marquee";
|
children: React.ReactNode;
|
||||||
import CardStackTextBox from "../../CardStackTextBox";
|
className?: string;
|
||||||
import { cls } from "@/lib/utils";
|
}
|
||||||
import { AutoCarouselProps } from "../../types";
|
|
||||||
import { useCardAnimation } from "../../hooks/useCardAnimation";
|
|
||||||
|
|
||||||
const AutoCarousel = ({
|
export const AutoCarousel: React.FC<AutoCarouselProps> = ({ children, className }) => {
|
||||||
children,
|
return <div className={className}>{children}</div>;
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
speed = 50,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout = "default",
|
|
||||||
useInvertedBackground,
|
|
||||||
bottomContent,
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
itemClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
titleClassName = "",
|
|
||||||
titleImageWrapperClassName = "",
|
|
||||||
titleImageClassName = "",
|
|
||||||
descriptionClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
buttonContainerClassName = "",
|
|
||||||
buttonClassName = "",
|
|
||||||
buttonTextClassName = "",
|
|
||||||
ariaLabel,
|
|
||||||
showTextBox = true,
|
|
||||||
dualMarquee = false,
|
|
||||||
topMarqueeDirection = "left",
|
|
||||||
bottomCarouselClassName = "",
|
|
||||||
marqueeGapClassName = "",
|
|
||||||
}: AutoCarouselProps) => {
|
|
||||||
const childrenArray = Children.toArray(children);
|
|
||||||
const heightClasses = uniformGridCustomHeightClasses || "min-h-80 2xl:min-h-90";
|
|
||||||
const { itemRefs, bottomContentRef } = useCardAnimation({
|
|
||||||
animationType,
|
|
||||||
itemCount: childrenArray.length,
|
|
||||||
isGrid: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// Bottom marquee direction is opposite of top
|
|
||||||
const bottomMarqueeDirection = topMarqueeDirection === "left" ? "right" : "left";
|
|
||||||
|
|
||||||
// Reverse order for bottom marquee to avoid alignment with top
|
|
||||||
const bottomChildren = dualMarquee ? [...childrenArray].reverse() : [];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
className={cls(
|
|
||||||
"relative py-20 w-full",
|
|
||||||
useInvertedBackground && "bg-foreground",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
aria-live="off"
|
|
||||||
>
|
|
||||||
<div className={cls("w-full md:w-content-width mx-auto", containerClassName)}>
|
|
||||||
<div className="w-full flex flex-col items-center">
|
|
||||||
<div className="w-full flex flex-col gap-6">
|
|
||||||
{showTextBox && (title || titleSegments || description) && (
|
|
||||||
<CardStackTextBox
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
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(
|
|
||||||
"w-full flex flex-col",
|
|
||||||
marqueeGapClassName || "gap-6"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{/* Top/Single Marquee */}
|
|
||||||
<div className={cls("overflow-hidden w-full relative z-10 mask-padding-x", carouselClassName)}>
|
|
||||||
<Marquee gradient={false} speed={speed} direction={topMarqueeDirection}>
|
|
||||||
{Children.map(childrenArray, (child, index) => (
|
|
||||||
<div
|
|
||||||
key={index}
|
|
||||||
className={cls("flex-none w-carousel-item-3 xl:w-carousel-item-4 mb-1 mr-6", heightClasses, itemClassName)}
|
|
||||||
ref={(el) => { itemRefs.current[index] = el; }}
|
|
||||||
>
|
|
||||||
{child}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</Marquee>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Bottom Marquee (only if dualMarquee is true) - Reversed order, opposite direction */}
|
|
||||||
{dualMarquee && (
|
|
||||||
<div className={cls("overflow-hidden w-full relative z-10 mask-padding-x", bottomCarouselClassName || carouselClassName)}>
|
|
||||||
<Marquee gradient={false} speed={speed} direction={bottomMarqueeDirection}>
|
|
||||||
{Children.map(bottomChildren, (child, index) => (
|
|
||||||
<div
|
|
||||||
key={`bottom-${index}`}
|
|
||||||
className={cls("flex-none w-carousel-item-3 xl:w-carousel-item-4 mb-1 mr-6", heightClasses, itemClassName)}
|
|
||||||
>
|
|
||||||
{child}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</Marquee>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{bottomContent && (
|
|
||||||
<div ref={bottomContentRef}>
|
|
||||||
{bottomContent}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
AutoCarousel.displayName = "AutoCarousel";
|
export default AutoCarousel;
|
||||||
|
|
||||||
export default memo(AutoCarousel);
|
|
||||||
@@ -1,182 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import { memo, Children } from "react";
|
interface ButtonCarouselProps {
|
||||||
import useEmblaCarousel from "embla-carousel-react";
|
children: React.ReactNode;
|
||||||
import { ChevronLeft, ChevronRight } from "lucide-react";
|
className?: string;
|
||||||
import CardStackTextBox from "../../CardStackTextBox";
|
}
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import { ButtonCarouselProps } from "../../types";
|
|
||||||
import { usePrevNextButtons } from "../../hooks/usePrevNextButtons";
|
|
||||||
import { useScrollProgress } from "../../hooks/useScrollProgress";
|
|
||||||
import { useCardAnimation } from "../../hooks/useCardAnimation";
|
|
||||||
|
|
||||||
const ButtonCarousel = ({
|
export const ButtonCarousel: React.FC<ButtonCarouselProps> = ({ children, className }) => {
|
||||||
children,
|
return <div className={className}>{children}</div>;
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout = "default",
|
|
||||||
useInvertedBackground,
|
|
||||||
bottomContent,
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
carouselItemClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
titleClassName = "",
|
|
||||||
titleImageWrapperClassName = "",
|
|
||||||
titleImageClassName = "",
|
|
||||||
descriptionClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
buttonContainerClassName = "",
|
|
||||||
buttonClassName = "",
|
|
||||||
buttonTextClassName = "",
|
|
||||||
ariaLabel,
|
|
||||||
}: ButtonCarouselProps) => {
|
|
||||||
const [emblaRef, emblaApi] = useEmblaCarousel({ dragFree: true });
|
|
||||||
|
|
||||||
const {
|
|
||||||
prevBtnDisabled,
|
|
||||||
nextBtnDisabled,
|
|
||||||
onPrevButtonClick,
|
|
||||||
onNextButtonClick,
|
|
||||||
} = usePrevNextButtons(emblaApi);
|
|
||||||
|
|
||||||
const scrollProgress = useScrollProgress(emblaApi);
|
|
||||||
|
|
||||||
const childrenArray = Children.toArray(children);
|
|
||||||
const heightClasses = uniformGridCustomHeightClasses || "min-h-80 2xl:min-h-90";
|
|
||||||
const { itemRefs, bottomContentRef } = useCardAnimation({
|
|
||||||
animationType,
|
|
||||||
itemCount: childrenArray.length,
|
|
||||||
isGrid: false
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
className={cls(
|
|
||||||
"relative px-[var(--width-0)] py-20 w-full",
|
|
||||||
useInvertedBackground && "bg-foreground",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
>
|
|
||||||
<div className={cls("w-full mx-auto", containerClassName)}>
|
|
||||||
<div className="w-full flex flex-col items-center">
|
|
||||||
<div className="w-full flex flex-col gap-6">
|
|
||||||
{(title || titleSegments || description) && (
|
|
||||||
<div className="w-content-width mx-auto">
|
|
||||||
<CardStackTextBox
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={titleClassName}
|
|
||||||
titleImageWrapperClassName={titleImageWrapperClassName}
|
|
||||||
titleImageClassName={titleImageClassName}
|
|
||||||
descriptionClassName={descriptionClassName}
|
|
||||||
tagClassName={tagClassName}
|
|
||||||
buttonContainerClassName={buttonContainerClassName}
|
|
||||||
buttonClassName={buttonClassName}
|
|
||||||
buttonTextClassName={buttonTextClassName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"w-full flex flex-col gap-6"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"overflow-hidden w-full relative z-10 flex cursor-grab",
|
|
||||||
carouselClassName
|
|
||||||
)}
|
|
||||||
ref={emblaRef}
|
|
||||||
>
|
|
||||||
<div className="flex gap-6 w-full">
|
|
||||||
<div className="flex-shrink-0 w-carousel-padding" />
|
|
||||||
{Children.map(childrenArray, (child, index) => (
|
|
||||||
<div
|
|
||||||
key={index}
|
|
||||||
className={cls("flex-none select-none w-carousel-item-3 xl:w-carousel-item-4 mb-6", heightClasses, carouselItemClassName)}
|
|
||||||
ref={(el) => { itemRefs.current[index] = el; }}
|
|
||||||
>
|
|
||||||
{child}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
<div className="flex-shrink-0 w-carousel-padding" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={cls("w-full flex", controlsClassName)}>
|
|
||||||
<div className="flex-shrink-0 w-carousel-padding-controls" />
|
|
||||||
<div className="flex justify-between items-center w-full">
|
|
||||||
<div
|
|
||||||
className="rounded-theme card relative h-2 w-50 overflow-hidden"
|
|
||||||
role="progressbar"
|
|
||||||
aria-label="Carousel progress"
|
|
||||||
aria-valuenow={Math.round(scrollProgress)}
|
|
||||||
aria-valuemin={0}
|
|
||||||
aria-valuemax={100}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="bg-foreground primary-button absolute! w-full top-0 bottom-0 -left-full rounded-theme"
|
|
||||||
style={{ transform: `translate3d(${scrollProgress}%,0px,0px)` }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex items-center gap-3">
|
|
||||||
<button
|
|
||||||
onClick={onPrevButtonClick}
|
|
||||||
disabled={prevBtnDisabled}
|
|
||||||
className="secondary-button h-8 aspect-square flex items-center justify-center rounded-theme cursor-pointer transition-colors disabled:cursor-not-allowed disabled:opacity-50"
|
|
||||||
type="button"
|
|
||||||
aria-label="Previous slide"
|
|
||||||
>
|
|
||||||
<ChevronLeft className="h-[40%] w-auto aspect-square text-secondary-cta-text" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
onClick={onNextButtonClick}
|
|
||||||
disabled={nextBtnDisabled}
|
|
||||||
className="secondary-button h-8 aspect-square flex items-center justify-center rounded-theme cursor-pointer transition-colors disabled:cursor-not-allowed disabled:opacity-50"
|
|
||||||
type="button"
|
|
||||||
aria-label="Next slide"
|
|
||||||
>
|
|
||||||
<ChevronRight className="h-[40%] w-auto aspect-square text-secondary-cta-text" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex-shrink-0 w-carousel-padding-controls" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{bottomContent && (
|
|
||||||
<div ref={bottomContentRef} className="w-content-width mx-auto">
|
|
||||||
{bottomContent}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ButtonCarousel.displayName = "ButtonCarousel";
|
export default ButtonCarousel;
|
||||||
|
|
||||||
export default memo(ButtonCarousel);
|
|
||||||
@@ -1,150 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import { memo, Children } from "react";
|
interface GridLayoutProps {
|
||||||
import CardStackTextBox from "../../CardStackTextBox";
|
children: React.ReactNode;
|
||||||
import { cls } from "@/lib/utils";
|
className?: string;
|
||||||
import { GridLayoutProps } from "../../types";
|
}
|
||||||
import { gridConfigs } from "./gridConfigs";
|
|
||||||
import { useCardAnimation } from "../../hooks/useCardAnimation";
|
|
||||||
|
|
||||||
const GridLayout = ({
|
export const GridLayout: React.FC<GridLayoutProps> = ({ children, className }) => {
|
||||||
children,
|
return <div className={className}>{children}</div>;
|
||||||
itemCount,
|
|
||||||
gridVariant = "uniform-all-items-equal",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
gridRowsClassName,
|
|
||||||
itemHeightClassesOverride,
|
|
||||||
animationType,
|
|
||||||
supports3DAnimation = false,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout = "default",
|
|
||||||
useInvertedBackground,
|
|
||||||
bottomContent,
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
titleClassName = "",
|
|
||||||
titleImageWrapperClassName = "",
|
|
||||||
titleImageClassName = "",
|
|
||||||
descriptionClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
buttonContainerClassName = "",
|
|
||||||
buttonClassName = "",
|
|
||||||
buttonTextClassName = "",
|
|
||||||
ariaLabel,
|
|
||||||
}: GridLayoutProps) => {
|
|
||||||
// Get config for this variant and item count
|
|
||||||
const config = gridConfigs[gridVariant]?.[itemCount];
|
|
||||||
|
|
||||||
// Fallback to default uniform grid if no config
|
|
||||||
const gridColsMap = {
|
|
||||||
1: "md:grid-cols-1",
|
|
||||||
2: "md:grid-cols-2",
|
|
||||||
3: "md:grid-cols-3",
|
|
||||||
4: "md:grid-cols-4",
|
|
||||||
};
|
|
||||||
const defaultGridCols = gridColsMap[itemCount as keyof typeof gridColsMap] || "md:grid-cols-4";
|
|
||||||
|
|
||||||
// Use config values or fallback
|
|
||||||
const gridCols = config?.gridCols || defaultGridCols;
|
|
||||||
const gridRows = gridRowsClassName || config?.gridRows || "";
|
|
||||||
const itemClasses = config?.itemClasses || [];
|
|
||||||
const itemHeightClasses = itemHeightClassesOverride || config?.itemHeightClasses || [];
|
|
||||||
const heightClasses = uniformGridCustomHeightClasses || config?.heightClasses || "";
|
|
||||||
const itemWrapperClass = config?.itemWrapperClass || "";
|
|
||||||
|
|
||||||
const childrenArray = Children.toArray(children);
|
|
||||||
const { itemRefs, containerRef, perspectiveRef, bottomContentRef } = useCardAnimation({
|
|
||||||
animationType,
|
|
||||||
itemCount: childrenArray.length,
|
|
||||||
isGrid: true,
|
|
||||||
supports3DAnimation,
|
|
||||||
gridVariant
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
ref={containerRef}
|
|
||||||
className={cls(
|
|
||||||
"relative py-20 w-full",
|
|
||||||
useInvertedBackground && "bg-foreground",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
>
|
|
||||||
<div className={cls("w-content-width mx-auto flex flex-col gap-6", containerClassName)}>
|
|
||||||
{(title || titleSegments || description) && (
|
|
||||||
<CardStackTextBox
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={titleClassName}
|
|
||||||
titleImageWrapperClassName={titleImageWrapperClassName}
|
|
||||||
titleImageClassName={titleImageClassName}
|
|
||||||
descriptionClassName={descriptionClassName}
|
|
||||||
tagClassName={tagClassName}
|
|
||||||
buttonContainerClassName={buttonContainerClassName}
|
|
||||||
buttonClassName={buttonClassName}
|
|
||||||
buttonTextClassName={buttonTextClassName}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<div
|
|
||||||
ref={perspectiveRef}
|
|
||||||
className={cls(
|
|
||||||
"grid grid-cols-1 gap-6",
|
|
||||||
gridCols,
|
|
||||||
gridRows,
|
|
||||||
gridClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{childrenArray.map((child, index) => {
|
|
||||||
const itemClass = itemClasses[index] || "";
|
|
||||||
const itemHeightClass = itemHeightClasses[index] || "";
|
|
||||||
const combinedClass = cls(itemWrapperClass, itemClass, itemHeightClass, heightClasses);
|
|
||||||
return combinedClass ? (
|
|
||||||
<div
|
|
||||||
key={index}
|
|
||||||
className={combinedClass}
|
|
||||||
ref={(el) => { itemRefs.current[index] = el; }}
|
|
||||||
>
|
|
||||||
{child}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div
|
|
||||||
key={index}
|
|
||||||
ref={(el) => { itemRefs.current[index] = el; }}
|
|
||||||
>
|
|
||||||
{child}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
{bottomContent && (
|
|
||||||
<div ref={bottomContentRef}>
|
|
||||||
{bottomContent}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
GridLayout.displayName = "GridLayout";
|
export default GridLayout;
|
||||||
|
|
||||||
export default memo(GridLayout);
|
|
||||||
@@ -1,275 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import React, { memo } from "react";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import CardStackTextBox from "../../CardStackTextBox";
|
|
||||||
import { usePhoneAnimations, type TimelinePhoneViewItem } from "../../hooks/usePhoneAnimations";
|
|
||||||
import { useCardAnimation } from "../../hooks/useCardAnimation";
|
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, ButtonAnimationType, TitleSegment, CardAnimationType } from "../../types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
interface PhoneFrameProps {
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
phoneRef: (el: HTMLDivElement | null) => void;
|
|
||||||
className?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const PhoneFrame = memo(({
|
|
||||||
imageSrc,
|
|
||||||
videoSrc,
|
|
||||||
imageAlt,
|
|
||||||
videoAriaLabel,
|
|
||||||
phoneRef,
|
|
||||||
className = "",
|
|
||||||
}: PhoneFrameProps) => (
|
|
||||||
<div
|
|
||||||
ref={phoneRef}
|
|
||||||
className={cls("card rounded-theme-capped p-1 overflow-hidden", className)}
|
|
||||||
>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={imageSrc}
|
|
||||||
videoSrc={videoSrc}
|
|
||||||
imageAlt={imageAlt}
|
|
||||||
videoAriaLabel={videoAriaLabel}
|
|
||||||
imageClassName="w-full h-full object-cover rounded-theme-capped"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
));
|
|
||||||
|
|
||||||
PhoneFrame.displayName = "PhoneFrame";
|
|
||||||
|
|
||||||
interface TimelinePhoneViewProps {
|
interface TimelinePhoneViewProps {
|
||||||
items: TimelinePhoneViewItem[];
|
children: React.ReactNode;
|
||||||
showTextBox?: boolean;
|
|
||||||
showDivider?: boolean;
|
|
||||||
title: string;
|
|
||||||
titleSegments?: TitleSegment[];
|
|
||||||
description: string;
|
|
||||||
tag?: string;
|
|
||||||
tagIcon?: LucideIcon;
|
|
||||||
tagAnimation?: ButtonAnimationType;
|
|
||||||
buttons?: ButtonConfig[];
|
|
||||||
buttonAnimation?: ButtonAnimationType;
|
|
||||||
animationType: CardAnimationType;
|
|
||||||
textboxLayout: TextboxLayout;
|
|
||||||
useInvertedBackground?: InvertedBackground;
|
|
||||||
className?: string;
|
className?: string;
|
||||||
containerClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
titleClassName?: string;
|
|
||||||
descriptionClassName?: string;
|
|
||||||
tagClassName?: string;
|
|
||||||
buttonContainerClassName?: string;
|
|
||||||
buttonClassName?: string;
|
|
||||||
buttonTextClassName?: string;
|
|
||||||
desktopContainerClassName?: string;
|
|
||||||
mobileContainerClassName?: string;
|
|
||||||
desktopContentClassName?: string;
|
|
||||||
desktopWrapperClassName?: string;
|
|
||||||
mobileWrapperClassName?: string;
|
|
||||||
phoneFrameClassName?: string;
|
|
||||||
mobilePhoneFrameClassName?: string;
|
|
||||||
titleImageWrapperClassName?: string;
|
|
||||||
titleImageClassName?: string;
|
|
||||||
ariaLabel?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TimelinePhoneView = ({
|
export const TimelinePhoneView: React.FC<TimelinePhoneViewProps> = ({ children, className }) => {
|
||||||
items,
|
return <div className={className}>{children}</div>;
|
||||||
showTextBox = true,
|
|
||||||
showDivider = false,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
animationType,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
titleClassName = "",
|
|
||||||
descriptionClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
buttonContainerClassName = "",
|
|
||||||
buttonClassName = "",
|
|
||||||
buttonTextClassName = "",
|
|
||||||
desktopContainerClassName = "",
|
|
||||||
mobileContainerClassName = "",
|
|
||||||
desktopContentClassName = "",
|
|
||||||
desktopWrapperClassName = "",
|
|
||||||
mobileWrapperClassName = "",
|
|
||||||
phoneFrameClassName = "",
|
|
||||||
mobilePhoneFrameClassName = "",
|
|
||||||
titleImageWrapperClassName = "",
|
|
||||||
titleImageClassName = "",
|
|
||||||
ariaLabel = "Timeline phone view section",
|
|
||||||
}: TimelinePhoneViewProps) => {
|
|
||||||
const { imageRefs, mobileImageRefs } = usePhoneAnimations(items);
|
|
||||||
const { itemRefs: contentRefs } = useCardAnimation({
|
|
||||||
animationType,
|
|
||||||
itemCount: items.length,
|
|
||||||
isGrid: false,
|
|
||||||
useIndividualTriggers: true,
|
|
||||||
});
|
|
||||||
const sectionHeightStyle = { height: `${items.length * 100}vh` };
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
className={cls(
|
|
||||||
"relative py-20 overflow-hidden md:overflow-visible w-full",
|
|
||||||
useInvertedBackground && "bg-foreground",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
>
|
|
||||||
<div className={cls("w-full mx-auto flex flex-col gap-6", containerClassName)}>
|
|
||||||
{showTextBox && (
|
|
||||||
<div className="relative w-content-width mx-auto" >
|
|
||||||
<CardStackTextBox
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={titleClassName}
|
|
||||||
descriptionClassName={descriptionClassName}
|
|
||||||
tagClassName={tagClassName}
|
|
||||||
buttonContainerClassName={buttonContainerClassName}
|
|
||||||
buttonClassName={buttonClassName}
|
|
||||||
buttonTextClassName={buttonTextClassName}
|
|
||||||
titleImageWrapperClassName={titleImageWrapperClassName}
|
|
||||||
titleImageClassName={titleImageClassName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{showDivider && (
|
|
||||||
<div className="relative w-content-width mx-auto h-px bg-accent md:hidden" />
|
|
||||||
)}
|
|
||||||
<div className="hidden md:flex relative" style={sectionHeightStyle}>
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"absolute top-0 left-0 flex flex-col w-[calc(var(--width-content-width)-var(--width-20)*2)] 2xl:w-[calc(var(--width-content-width)-var(--width-25)*2)] mx-auto right-0 z-10",
|
|
||||||
desktopContainerClassName
|
|
||||||
)}
|
|
||||||
style={sectionHeightStyle}
|
|
||||||
>
|
|
||||||
{items.map((item, index) => (
|
|
||||||
<div
|
|
||||||
key={`content-${index}`}
|
|
||||||
className={cls(
|
|
||||||
item.trigger,
|
|
||||||
"w-full mx-auto h-screen flex justify-center items-center",
|
|
||||||
desktopContentClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
ref={(el) => { contentRefs.current[index] = el; }}
|
|
||||||
className={desktopWrapperClassName}
|
|
||||||
>
|
|
||||||
{item.content}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className="sticky top-0 left-0 h-screen w-full overflow-hidden">
|
|
||||||
{items.map((item, itemIndex) => (
|
|
||||||
<div
|
|
||||||
key={`phones-${itemIndex}`}
|
|
||||||
className="h-screen w-full absolute top-0 left-0"
|
|
||||||
>
|
|
||||||
<div className="w-content-width mx-auto h-full flex flex-row justify-between items-center">
|
|
||||||
<PhoneFrame
|
|
||||||
key={`phone-${itemIndex}-1`}
|
|
||||||
imageSrc={item.imageOne}
|
|
||||||
videoSrc={item.videoOne}
|
|
||||||
imageAlt={item.imageAltOne}
|
|
||||||
videoAriaLabel={item.videoAriaLabelOne}
|
|
||||||
phoneRef={(el) => {
|
|
||||||
if (imageRefs.current) {
|
|
||||||
imageRefs.current[itemIndex * 2] = el;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
className={cls("w-20 2xl:w-25 h-[70vh]", phoneFrameClassName)}
|
|
||||||
/>
|
|
||||||
<PhoneFrame
|
|
||||||
key={`phone-${itemIndex}-2`}
|
|
||||||
imageSrc={item.imageTwo}
|
|
||||||
videoSrc={item.videoTwo}
|
|
||||||
imageAlt={item.imageAltTwo}
|
|
||||||
videoAriaLabel={item.videoAriaLabelTwo}
|
|
||||||
phoneRef={(el) => {
|
|
||||||
if (imageRefs.current) {
|
|
||||||
imageRefs.current[itemIndex * 2 + 1] = el;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
className={cls("w-20 2xl:w-25 h-[70vh]", phoneFrameClassName)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={cls("md:hidden flex flex-col gap-20", mobileContainerClassName)}>
|
|
||||||
{items.map((item, itemIndex) => (
|
|
||||||
<div
|
|
||||||
key={`mobile-item-${itemIndex}`}
|
|
||||||
className="flex flex-col gap-10"
|
|
||||||
>
|
|
||||||
<div className={mobileWrapperClassName}>
|
|
||||||
{item.content}
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-row gap-6 justify-center">
|
|
||||||
<PhoneFrame
|
|
||||||
key={`mobile-phone-${itemIndex}-1`}
|
|
||||||
imageSrc={item.imageOne}
|
|
||||||
videoSrc={item.videoOne}
|
|
||||||
imageAlt={item.imageAltOne}
|
|
||||||
videoAriaLabel={item.videoAriaLabelOne}
|
|
||||||
phoneRef={(el) => {
|
|
||||||
if (mobileImageRefs.current) {
|
|
||||||
mobileImageRefs.current[itemIndex * 2] = el;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
className={cls("w-40 h-80", mobilePhoneFrameClassName)}
|
|
||||||
/>
|
|
||||||
<PhoneFrame
|
|
||||||
key={`mobile-phone-${itemIndex}-2`}
|
|
||||||
imageSrc={item.imageTwo}
|
|
||||||
videoSrc={item.videoTwo}
|
|
||||||
imageAlt={item.imageAltTwo}
|
|
||||||
videoAriaLabel={item.videoAriaLabelTwo}
|
|
||||||
phoneRef={(el) => {
|
|
||||||
if (mobileImageRefs.current) {
|
|
||||||
mobileImageRefs.current[itemIndex * 2 + 1] = el;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
className={cls("w-40 h-80", mobilePhoneFrameClassName)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TimelinePhoneView.displayName = "TimelinePhoneView";
|
export default TimelinePhoneView;
|
||||||
|
|
||||||
export default memo(TimelinePhoneView);
|
|
||||||
@@ -1,202 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import React, { useEffect, useRef, memo, useState } from "react";
|
|
||||||
import { gsap } from "gsap";
|
|
||||||
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
|
||||||
import CardStackTextBox from "../../CardStackTextBox";
|
|
||||||
import { useCardAnimation } from "../../hooks/useCardAnimation";
|
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, ButtonAnimationType, CardAnimationType, TitleSegment } from "../../types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
gsap.registerPlugin(ScrollTrigger);
|
|
||||||
|
|
||||||
interface TimelineProcessFlowItem {
|
|
||||||
id: string;
|
|
||||||
content: React.ReactNode;
|
|
||||||
media: React.ReactNode;
|
|
||||||
reverse: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TimelineProcessFlowProps {
|
interface TimelineProcessFlowProps {
|
||||||
items: TimelineProcessFlowItem[];
|
children: React.ReactNode;
|
||||||
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;
|
className?: string;
|
||||||
containerClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
itemClassName?: string;
|
|
||||||
mediaWrapperClassName?: string;
|
|
||||||
numberClassName?: string;
|
|
||||||
contentWrapperClassName?: string;
|
|
||||||
gapClassName?: string;
|
|
||||||
titleImageWrapperClassName?: string;
|
|
||||||
titleImageClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TimelineProcessFlow = ({
|
export const TimelineProcessFlow: React.FC<TimelineProcessFlowProps> = ({ children, className }) => {
|
||||||
items,
|
return <div className={className}>{children}</div>;
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
animationType,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Timeline process flow section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
itemClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
numberClassName = "",
|
|
||||||
contentWrapperClassName = "",
|
|
||||||
gapClassName = "",
|
|
||||||
titleImageWrapperClassName = "",
|
|
||||||
titleImageClassName = "",
|
|
||||||
}: TimelineProcessFlowProps) => {
|
|
||||||
const processLineRef = useRef<HTMLDivElement>(null);
|
|
||||||
const { itemRefs } = useCardAnimation({ animationType, itemCount: items.length, useIndividualTriggers: true });
|
|
||||||
const [isMdScreen, setIsMdScreen] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const checkScreenSize = () => {
|
|
||||||
setIsMdScreen(window.innerWidth >= 768);
|
|
||||||
};
|
|
||||||
|
|
||||||
checkScreenSize();
|
|
||||||
window.addEventListener('resize', checkScreenSize);
|
|
||||||
|
|
||||||
return () => window.removeEventListener('resize', checkScreenSize);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!processLineRef.current) return;
|
|
||||||
|
|
||||||
gsap.fromTo(
|
|
||||||
processLineRef.current,
|
|
||||||
{ yPercent: -100 },
|
|
||||||
{
|
|
||||||
yPercent: 0,
|
|
||||||
ease: "none",
|
|
||||||
scrollTrigger: {
|
|
||||||
trigger: ".timeline-line",
|
|
||||||
start: "top center",
|
|
||||||
end: "bottom center",
|
|
||||||
scrub: true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
ScrollTrigger.getAll().forEach((trigger) => trigger.kill());
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
className={cls(
|
|
||||||
"relative py-20 w-full",
|
|
||||||
useInvertedBackground && "bg-foreground",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
>
|
|
||||||
<div className={cls("w-full flex flex-col gap-6", containerClassName)}>
|
|
||||||
<div className="relative w-content-width mx-auto">
|
|
||||||
<CardStackTextBox
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
titleImageWrapperClassName={titleImageWrapperClassName}
|
|
||||||
titleImageClassName={titleImageClassName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="relative w-full">
|
|
||||||
<div className="pointer-events-none absolute top-0 right-[var(--width-10)] md:right-auto md:left-1/2 md:-translate-x-1/2 w-px h-full z-10 overflow-hidden md:py-6" >
|
|
||||||
<div className="relative timeline-line h-full bg-foreground overflow-hidden">
|
|
||||||
<div className="w-full h-full bg-accent" ref={processLineRef} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ol className={cls("relative w-content-width mx-auto flex flex-col gap-10 md:gap-20 md:p-6", isMdScreen && "card", "md:rounded-theme-capped", gapClassName)}>
|
|
||||||
{items.map((item, index) => (
|
|
||||||
<li
|
|
||||||
key={item.id}
|
|
||||||
ref={(el) => {
|
|
||||||
itemRefs.current[index] = el;
|
|
||||||
}}
|
|
||||||
className={cls(
|
|
||||||
"relative z-10 w-full flex flex-col gap-6 md:gap-0 md:flex-row justify-between",
|
|
||||||
item.reverse && "flex-col md:flex-row-reverse",
|
|
||||||
itemClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className={cls("relative w-70 md:w-30", mediaWrapperClassName)}
|
|
||||||
>
|
|
||||||
{item.media}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"absolute! top-1/2 right-[calc(var(--height-8)/-2)] md:right-auto md:left-1/2 md:-translate-x-1/2 -translate-y-1/2 h-8 aspect-square rounded-theme flex items-center justify-center z-10 primary-button",
|
|
||||||
numberClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<p className="text-sm text-primary-cta-text">{item.id}</p>
|
|
||||||
</div>
|
|
||||||
<div className={cls("relative w-70 md:w-30", contentWrapperClassName)}>
|
|
||||||
{item.content}
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TimelineProcessFlow.displayName = "TimelineProcessFlow";
|
export default TimelineProcessFlow;
|
||||||
|
|
||||||
export default memo(TimelineProcessFlow);
|
|
||||||
@@ -1,156 +1,33 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import { memo, useMemo, useCallback } from "react";
|
export interface CatalogProduct {
|
||||||
import { useRouter } from "next/navigation";
|
id: string;
|
||||||
import Input from "@/components/form/Input";
|
name: string;
|
||||||
import ProductDetailVariantSelect from "@/components/ecommerce/productDetail/ProductDetailVariantSelect";
|
price: string;
|
||||||
import type { ProductVariant } from "@/components/ecommerce/productDetail/ProductDetailCard";
|
imageSrc: string;
|
||||||
import { cls } from "@/lib/utils";
|
imageAlt: string;
|
||||||
import { useProducts } from "@/hooks/useProducts";
|
rating: number;
|
||||||
import ProductCatalogItem from "./ProductCatalogItem";
|
reviewCount: string;
|
||||||
import type { CatalogProduct } from "./ProductCatalogItem";
|
category: string;
|
||||||
|
onProductClick: () => void;
|
||||||
interface ProductCatalogProps {
|
|
||||||
layout: "page" | "section";
|
|
||||||
products?: CatalogProduct[];
|
|
||||||
searchValue?: string;
|
|
||||||
onSearchChange?: (value: string) => void;
|
|
||||||
searchPlaceholder?: string;
|
|
||||||
filters?: ProductVariant[];
|
|
||||||
emptyMessage?: string;
|
|
||||||
className?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
searchClassName?: string;
|
|
||||||
filterClassName?: string;
|
|
||||||
toolbarClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ProductCatalog = ({
|
interface ProductCatalogProps {
|
||||||
layout,
|
products?: CatalogProduct[];
|
||||||
products: productsProp,
|
className?: string;
|
||||||
searchValue = "",
|
}
|
||||||
onSearchChange,
|
|
||||||
searchPlaceholder = "Search products...",
|
|
||||||
filters,
|
|
||||||
emptyMessage = "No products found",
|
|
||||||
className = "",
|
|
||||||
gridClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
searchClassName = "",
|
|
||||||
filterClassName = "",
|
|
||||||
toolbarClassName = "",
|
|
||||||
}: ProductCatalogProps) => {
|
|
||||||
const router = useRouter();
|
|
||||||
const { products: fetchedProducts, isLoading } = useProducts();
|
|
||||||
|
|
||||||
const handleProductClick = useCallback((productId: string) => {
|
export const ProductCatalog: React.FC<ProductCatalogProps> = ({ products = [], className }) => {
|
||||||
router.push(`/shop/${productId}`);
|
return (
|
||||||
}, [router]);
|
<div className={className}>
|
||||||
|
{products.map((product) => (
|
||||||
const products: CatalogProduct[] = useMemo(() => {
|
<div key={product.id}>
|
||||||
if (productsProp && productsProp.length > 0) {
|
<h3>{product.name}</h3>
|
||||||
return productsProp;
|
<p>{product.price}</p>
|
||||||
}
|
</div>
|
||||||
|
))}
|
||||||
if (fetchedProducts.length === 0) {
|
</div>
|
||||||
return [];
|
);
|
||||||
}
|
|
||||||
|
|
||||||
return fetchedProducts.map((product) => ({
|
|
||||||
id: product.id,
|
|
||||||
name: product.name,
|
|
||||||
price: product.price,
|
|
||||||
imageSrc: product.imageSrc,
|
|
||||||
imageAlt: product.imageAlt || product.name,
|
|
||||||
rating: product.rating || 0,
|
|
||||||
reviewCount: product.reviewCount,
|
|
||||||
category: product.brand,
|
|
||||||
onProductClick: () => handleProductClick(product.id),
|
|
||||||
}));
|
|
||||||
}, [productsProp, fetchedProducts, handleProductClick]);
|
|
||||||
|
|
||||||
if (isLoading && (!productsProp || productsProp.length === 0)) {
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
className={cls(
|
|
||||||
"relative w-content-width mx-auto",
|
|
||||||
layout === "page" ? "pt-hero-page-padding pb-20" : "py-20",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<p className="text-sm text-foreground/50 text-center py-20">
|
|
||||||
Loading products...
|
|
||||||
</p>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
className={cls(
|
|
||||||
"relative w-content-width mx-auto",
|
|
||||||
layout === "page" ? "pt-hero-page-padding pb-20" : "py-20",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{(onSearchChange || (filters && filters.length > 0)) && (
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"flex flex-col md:flex-row gap-4 md:items-end mb-6",
|
|
||||||
toolbarClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{onSearchChange && (
|
|
||||||
<Input
|
|
||||||
value={searchValue}
|
|
||||||
onChange={onSearchChange}
|
|
||||||
placeholder={searchPlaceholder}
|
|
||||||
ariaLabel={searchPlaceholder}
|
|
||||||
className={cls("flex-1 w-full h-9 text-sm", searchClassName)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{filters && filters.length > 0 && (
|
|
||||||
<div className="flex gap-4 items-end">
|
|
||||||
{filters.map((filter) => (
|
|
||||||
<ProductDetailVariantSelect
|
|
||||||
key={filter.label}
|
|
||||||
variant={filter}
|
|
||||||
selectClassName={filterClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{products.length === 0 ? (
|
|
||||||
<p className="text-sm text-foreground/50 text-center py-20">
|
|
||||||
{emptyMessage}
|
|
||||||
</p>
|
|
||||||
) : (
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",
|
|
||||||
gridClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{products.map((product) => (
|
|
||||||
<ProductCatalogItem
|
|
||||||
key={product.id}
|
|
||||||
product={product}
|
|
||||||
className={cardClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ProductCatalog.displayName = "ProductCatalog";
|
export default ProductCatalog;
|
||||||
|
|
||||||
export default memo(ProductCatalog);
|
|
||||||
@@ -1,244 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type BlogCardOneProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import Image from "next/image";
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import Badge from "@/components/shared/Badge";
|
|
||||||
import OverlayArrowButton from "@/components/shared/OverlayArrowButton";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { BlogPost } from "@/lib/api/blog";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type BlogCard = BlogPost;
|
export const BlogCardOne: React.FC<BlogCardOneProps> = (props) => {
|
||||||
|
return <CardStack {...props} />;
|
||||||
interface BlogCardOneProps {
|
|
||||||
blogs: BlogCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
imageWrapperClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
categoryClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
excerptClassName?: string;
|
|
||||||
authorContainerClassName?: string;
|
|
||||||
authorAvatarClassName?: string;
|
|
||||||
authorNameClassName?: string;
|
|
||||||
dateClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BlogCardItemProps {
|
|
||||||
blog: BlogCard;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageWrapperClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
categoryClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
excerptClassName?: string;
|
|
||||||
authorContainerClassName?: string;
|
|
||||||
authorAvatarClassName?: string;
|
|
||||||
authorNameClassName?: string;
|
|
||||||
dateClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const BlogCardItem = memo(({
|
|
||||||
blog,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
imageWrapperClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
categoryClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
excerptClassName = "",
|
|
||||||
authorContainerClassName = "",
|
|
||||||
authorAvatarClassName = "",
|
|
||||||
authorNameClassName = "",
|
|
||||||
dateClassName = "",
|
|
||||||
}: BlogCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls("relative h-full card group flex flex-col gap-4 cursor-pointer p-4 rounded-theme-capped", cardClassName)}
|
|
||||||
onClick={blog.onBlogClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={`${blog.title} by ${blog.authorName}`}
|
|
||||||
>
|
|
||||||
<div className={cls("relative z-1 w-full aspect-[4/3] overflow-hidden rounded-theme-capped", imageWrapperClassName)}>
|
|
||||||
<Image
|
|
||||||
src={blog.imageSrc}
|
|
||||||
alt={blog.imageAlt || blog.title}
|
|
||||||
fill
|
|
||||||
className={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", imageClassName)}
|
|
||||||
unoptimized={blog.imageSrc.startsWith('http') || blog.imageSrc.startsWith('//')}
|
|
||||||
/>
|
|
||||||
<OverlayArrowButton ariaLabel={`Read ${blog.title}`} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex flex-col justify-between gap-6 flex-1">
|
|
||||||
<div className="flex flex-col gap-2">
|
|
||||||
<Badge text={blog.category} variant="primary" className={categoryClassName} />
|
|
||||||
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-[1.25] mt-1", shouldUseLightText ? "text-background" : "text-foreground", cardTitleClassName)}>
|
|
||||||
{blog.title}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<p className={cls("text-base leading-[1.25]", shouldUseLightText ? "text-background" : "text-foreground", excerptClassName)}>
|
|
||||||
{blog.excerpt}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={cls("flex items-center gap-3", authorContainerClassName)}>
|
|
||||||
<Image
|
|
||||||
src={blog.authorAvatar}
|
|
||||||
alt={blog.authorName}
|
|
||||||
width={40}
|
|
||||||
height={40}
|
|
||||||
className={cls("h-9 w-auto aspect-square rounded-theme object-cover", authorAvatarClassName)}
|
|
||||||
unoptimized={blog.authorAvatar.startsWith('http') || blog.authorAvatar.startsWith('//')}
|
|
||||||
/>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<p className={cls("text-sm font-medium", shouldUseLightText ? "text-background" : "text-foreground", authorNameClassName)}>
|
|
||||||
{blog.authorName}
|
|
||||||
</p>
|
|
||||||
<p className={cls("text-xs", shouldUseLightText ? "text-background/75" : "text-foreground/75", dateClassName)}>
|
|
||||||
{blog.date}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
BlogCardItem.displayName = "BlogCardItem";
|
|
||||||
|
|
||||||
const BlogCardOne = ({
|
|
||||||
blogs = [],
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Blog section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
imageWrapperClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
categoryClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
excerptClassName = "",
|
|
||||||
authorContainerClassName = "",
|
|
||||||
authorAvatarClassName = "",
|
|
||||||
authorNameClassName = "",
|
|
||||||
dateClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: BlogCardOneProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{blogs.map((blog) => (
|
|
||||||
<BlogCardItem
|
|
||||||
key={blog.id}
|
|
||||||
blog={blog}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageWrapperClassName={imageWrapperClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
categoryClassName={categoryClassName}
|
|
||||||
cardTitleClassName={cardTitleClassName}
|
|
||||||
excerptClassName={excerptClassName}
|
|
||||||
authorContainerClassName={authorContainerClassName}
|
|
||||||
authorAvatarClassName={authorAvatarClassName}
|
|
||||||
authorNameClassName={authorNameClassName}
|
|
||||||
dateClassName={dateClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
BlogCardOne.displayName = "BlogCardOne";
|
export default BlogCardOne;
|
||||||
|
|
||||||
export default BlogCardOne;
|
|
||||||
@@ -1,288 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type BlogCardThreeProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import Image from "next/image";
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import Tag from "@/components/shared/Tag";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import OverlayArrowButton from "@/components/shared/OverlayArrowButton";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { BlogPost } from "@/lib/api/blog";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type BlogCard = BlogPost;
|
export const BlogCardThree: React.FC<BlogCardThreeProps> = (props) => {
|
||||||
|
return <CardStack {...props} />;
|
||||||
interface BlogCardThreeProps {
|
|
||||||
blogs: BlogCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
cardContentClassName?: string;
|
|
||||||
categoryTagClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
excerptClassName?: string;
|
|
||||||
authorContainerClassName?: string;
|
|
||||||
authorAvatarClassName?: string;
|
|
||||||
authorNameClassName?: string;
|
|
||||||
dateClassName?: string;
|
|
||||||
mediaWrapperClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BlogCardItemProps {
|
|
||||||
blog: BlogCard;
|
|
||||||
useInvertedBackground: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
cardContentClassName?: string;
|
|
||||||
categoryTagClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
excerptClassName?: string;
|
|
||||||
authorContainerClassName?: string;
|
|
||||||
authorAvatarClassName?: string;
|
|
||||||
authorNameClassName?: string;
|
|
||||||
dateClassName?: string;
|
|
||||||
mediaWrapperClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const BlogCardItem = memo(({
|
|
||||||
blog,
|
|
||||||
useInvertedBackground,
|
|
||||||
cardClassName = "",
|
|
||||||
cardContentClassName = "",
|
|
||||||
categoryTagClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
excerptClassName = "",
|
|
||||||
authorContainerClassName = "",
|
|
||||||
authorAvatarClassName = "",
|
|
||||||
authorNameClassName = "",
|
|
||||||
dateClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
}: BlogCardItemProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls(
|
|
||||||
"relative h-full card group flex flex-col justify-between gap-6 p-6 cursor-pointer rounded-theme-capped overflow-hidden",
|
|
||||||
cardClassName
|
|
||||||
)}
|
|
||||||
onClick={blog.onBlogClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={blog.title}
|
|
||||||
>
|
|
||||||
<div className={cls("relative z-1 flex flex-col gap-3", cardContentClassName)}>
|
|
||||||
<Tag
|
|
||||||
text={blog.category}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={categoryTagClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<h3 className={cls(
|
|
||||||
"text-3xl md:text-4xl font-medium leading-tight line-clamp-2",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
cardTitleClassName
|
|
||||||
)}>
|
|
||||||
{blog.title}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<p className={cls(
|
|
||||||
"text-base leading-tight line-clamp-2",
|
|
||||||
shouldUseLightText ? "text-background/75" : "text-foreground/75",
|
|
||||||
excerptClassName
|
|
||||||
)}>
|
|
||||||
{blog.excerpt}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{(blog.authorName || blog.date) && (
|
|
||||||
<div className={cls(
|
|
||||||
"flex",
|
|
||||||
blog.authorAvatar ? "items-center gap-3" : "flex-row justify-between items-center",
|
|
||||||
authorContainerClassName
|
|
||||||
)}>
|
|
||||||
{blog.authorAvatar && (
|
|
||||||
<Image
|
|
||||||
src={blog.authorAvatar}
|
|
||||||
alt={blog.authorName || "Author"}
|
|
||||||
width={40}
|
|
||||||
height={40}
|
|
||||||
className={cls("h-9 w-auto aspect-square rounded-theme object-cover", authorAvatarClassName)}
|
|
||||||
unoptimized={blog.authorAvatar.startsWith('http') || blog.authorAvatar.startsWith('//')}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{blog.authorAvatar ? (
|
|
||||||
<div className="flex flex-col">
|
|
||||||
{blog.authorName && (
|
|
||||||
<p className={cls("text-sm font-medium", shouldUseLightText ? "text-background" : "text-foreground", authorNameClassName)}>
|
|
||||||
{blog.authorName}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
{blog.date && (
|
|
||||||
<p className={cls("text-xs", shouldUseLightText ? "text-background/75" : "text-foreground/75", dateClassName)}>
|
|
||||||
{blog.date}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
{blog.authorName && (
|
|
||||||
<p className={cls("text-sm font-medium", shouldUseLightText ? "text-background" : "text-foreground", authorNameClassName)}>
|
|
||||||
{blog.authorName}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
{blog.date && (
|
|
||||||
<p className={cls("text-xs", shouldUseLightText ? "text-background/75" : "text-foreground/75", dateClassName)}>
|
|
||||||
{blog.date}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={cls("relative z-1 w-full aspect-square", mediaWrapperClassName)}>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={blog.imageSrc}
|
|
||||||
imageAlt={blog.imageAlt || blog.title}
|
|
||||||
imageClassName={cls("absolute inset-0 w-full h-full object-cover", mediaClassName)}
|
|
||||||
/>
|
|
||||||
<OverlayArrowButton ariaLabel={`Read ${blog.title}`} />
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
BlogCardItem.displayName = "BlogCardItem";
|
|
||||||
|
|
||||||
const BlogCardThree = ({
|
|
||||||
blogs = [],
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses = "min-h-none",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Blog section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
cardContentClassName = "",
|
|
||||||
categoryTagClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
excerptClassName = "",
|
|
||||||
authorContainerClassName = "",
|
|
||||||
authorAvatarClassName = "",
|
|
||||||
authorNameClassName = "",
|
|
||||||
dateClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: BlogCardThreeProps) => {
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{blogs.map((blog) => (
|
|
||||||
<BlogCardItem
|
|
||||||
key={blog.id}
|
|
||||||
blog={blog}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
cardContentClassName={cardContentClassName}
|
|
||||||
categoryTagClassName={categoryTagClassName}
|
|
||||||
cardTitleClassName={cardTitleClassName}
|
|
||||||
excerptClassName={excerptClassName}
|
|
||||||
authorContainerClassName={authorContainerClassName}
|
|
||||||
authorAvatarClassName={authorAvatarClassName}
|
|
||||||
authorNameClassName={authorNameClassName}
|
|
||||||
dateClassName={dateClassName}
|
|
||||||
mediaWrapperClassName={mediaWrapperClassName}
|
|
||||||
mediaClassName={mediaClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
BlogCardThree.displayName = "BlogCardThree";
|
export default BlogCardThree;
|
||||||
|
|
||||||
export default BlogCardThree;
|
|
||||||
@@ -1,241 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type BlogCardTwoProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import Image from "next/image";
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import Badge from "@/components/shared/Badge";
|
|
||||||
import OverlayArrowButton from "@/components/shared/OverlayArrowButton";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { BlogPost } from "@/lib/api/blog";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type BlogCard = Omit<BlogPost, 'category'> & {
|
export const BlogCardTwo: React.FC<BlogCardTwoProps> = (props) => {
|
||||||
category: string | string[];
|
return <CardStack {...props} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
interface BlogCardTwoProps {
|
export default BlogCardTwo;
|
||||||
blogs: BlogCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
imageWrapperClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
authorAvatarClassName?: string;
|
|
||||||
authorDateClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
excerptClassName?: string;
|
|
||||||
categoryClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BlogCardItemProps {
|
|
||||||
blog: BlogCard;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageWrapperClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
authorAvatarClassName?: string;
|
|
||||||
authorDateClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
excerptClassName?: string;
|
|
||||||
categoryClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const BlogCardItem = memo(({
|
|
||||||
blog,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
imageWrapperClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
authorAvatarClassName = "",
|
|
||||||
authorDateClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
excerptClassName = "",
|
|
||||||
categoryClassName = "",
|
|
||||||
}: BlogCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls("relative h-full card group flex flex-col gap-4 cursor-pointer p-4 rounded-theme-capped", cardClassName)}
|
|
||||||
onClick={blog.onBlogClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={`${blog.title} by ${blog.authorName}`}
|
|
||||||
>
|
|
||||||
<div className={cls("relative z-1 w-full aspect-[4/3] overflow-hidden rounded-theme-capped", imageWrapperClassName)}>
|
|
||||||
<Image
|
|
||||||
src={blog.imageSrc}
|
|
||||||
alt={blog.imageAlt || blog.title}
|
|
||||||
fill
|
|
||||||
className={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", imageClassName)}
|
|
||||||
unoptimized={blog.imageSrc.startsWith('http') || blog.imageSrc.startsWith('//')}
|
|
||||||
/>
|
|
||||||
<OverlayArrowButton ariaLabel={`Read ${blog.title}`} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex flex-col justify-between gap-6 flex-1">
|
|
||||||
<div className="flex flex-col gap-2">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
{blog.authorAvatar && (
|
|
||||||
<Image
|
|
||||||
src={blog.authorAvatar}
|
|
||||||
alt={blog.authorName}
|
|
||||||
width={24}
|
|
||||||
height={24}
|
|
||||||
className={cls("h-[var(--text-xs)] w-auto aspect-square rounded-theme object-cover bg-background-accent", authorAvatarClassName)}
|
|
||||||
unoptimized={blog.authorAvatar.startsWith('http') || blog.authorAvatar.startsWith('//')}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<p className={cls("text-xs", shouldUseLightText ? "text-background" : "text-foreground", authorDateClassName)}>
|
|
||||||
{blog.authorName} • {blog.date}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-[1.25]", shouldUseLightText ? "text-background" : "text-foreground", cardTitleClassName)}>
|
|
||||||
{blog.title}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<p className={cls("text-base leading-[1.25]", shouldUseLightText ? "text-background" : "text-foreground", excerptClassName)}>
|
|
||||||
{blog.excerpt}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex flex-wrap gap-2">
|
|
||||||
{Array.isArray(blog.category) ? (
|
|
||||||
blog.category.map((cat, index) => (
|
|
||||||
<Badge key={`${cat}-${index}`} text={cat} variant="primary" className={categoryClassName} />
|
|
||||||
))
|
|
||||||
) : (
|
|
||||||
<Badge text={blog.category} variant="primary" className={categoryClassName} />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
BlogCardItem.displayName = "BlogCardItem";
|
|
||||||
|
|
||||||
const BlogCardTwo = ({
|
|
||||||
blogs = [],
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Blog section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
imageWrapperClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
authorAvatarClassName = "",
|
|
||||||
authorDateClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
excerptClassName = "",
|
|
||||||
categoryClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: BlogCardTwoProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{blogs.map((blog) => (
|
|
||||||
<BlogCardItem
|
|
||||||
key={blog.id}
|
|
||||||
blog={blog}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageWrapperClassName={imageWrapperClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
authorAvatarClassName={authorAvatarClassName}
|
|
||||||
authorDateClassName={authorDateClassName}
|
|
||||||
cardTitleClassName={cardTitleClassName}
|
|
||||||
excerptClassName={excerptClassName}
|
|
||||||
categoryClassName={categoryClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
BlogCardTwo.displayName = "BlogCardTwo";
|
|
||||||
|
|
||||||
export default BlogCardTwo;
|
|
||||||
@@ -1,188 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import { useState, Fragment } from "react";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import Accordion from "@/components/Accordion";
|
|
||||||
import Button from "@/components/button/Button";
|
|
||||||
import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
import type { CardAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { ButtonConfig } from "@/types/button";
|
|
||||||
|
|
||||||
interface FaqItem {
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
content: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ContactFaqProps {
|
interface ContactFaqProps {
|
||||||
faqs: FaqItem[];
|
children?: React.ReactNode;
|
||||||
ctaTitle: string;
|
|
||||||
ctaDescription: string;
|
|
||||||
ctaButton: ButtonConfig;
|
|
||||||
ctaIcon: LucideIcon;
|
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
animationType: CardAnimationType;
|
|
||||||
accordionAnimationType?: "smooth" | "instant";
|
|
||||||
showCard?: boolean;
|
|
||||||
ariaLabel?: string;
|
|
||||||
className?: string;
|
className?: string;
|
||||||
containerClassName?: string;
|
|
||||||
ctaPanelClassName?: string;
|
|
||||||
ctaIconClassName?: string;
|
|
||||||
ctaTitleClassName?: string;
|
|
||||||
ctaDescriptionClassName?: string;
|
|
||||||
ctaButtonClassName?: string;
|
|
||||||
ctaButtonTextClassName?: string;
|
|
||||||
faqsPanelClassName?: string;
|
|
||||||
faqsContainerClassName?: string;
|
|
||||||
accordionClassName?: string;
|
|
||||||
accordionTitleClassName?: string;
|
|
||||||
accordionIconContainerClassName?: string;
|
|
||||||
accordionIconClassName?: string;
|
|
||||||
accordionContentClassName?: string;
|
|
||||||
separatorClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ContactFaq = ({
|
export const ContactFaq: React.FC<ContactFaqProps> = ({ children, className }) => {
|
||||||
faqs,
|
return <div className={className}>{children}</div>;
|
||||||
ctaTitle,
|
|
||||||
ctaDescription,
|
|
||||||
ctaButton,
|
|
||||||
ctaIcon: CtaIcon,
|
|
||||||
useInvertedBackground,
|
|
||||||
animationType,
|
|
||||||
accordionAnimationType = "smooth",
|
|
||||||
showCard = true,
|
|
||||||
ariaLabel = "Contact and FAQ section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
ctaPanelClassName = "",
|
|
||||||
ctaIconClassName = "",
|
|
||||||
ctaTitleClassName = "",
|
|
||||||
ctaDescriptionClassName = "",
|
|
||||||
ctaButtonClassName = "",
|
|
||||||
ctaButtonTextClassName = "",
|
|
||||||
faqsPanelClassName = "",
|
|
||||||
faqsContainerClassName = "",
|
|
||||||
accordionClassName = "",
|
|
||||||
accordionTitleClassName = "",
|
|
||||||
accordionIconContainerClassName = "",
|
|
||||||
accordionIconClassName = "",
|
|
||||||
accordionContentClassName = "",
|
|
||||||
separatorClassName = "",
|
|
||||||
}: ContactFaqProps) => {
|
|
||||||
const [activeIndex, setActiveIndex] = useState<number | null>(null);
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
const { itemRefs } = useCardAnimation({ animationType, itemCount: 2 });
|
|
||||||
|
|
||||||
const handleToggle = (index: number) => {
|
|
||||||
setActiveIndex(activeIndex === index ? null : index);
|
|
||||||
};
|
|
||||||
|
|
||||||
const getButtonConfigProps = () => {
|
|
||||||
if (theme.defaultButtonVariant === "hover-bubble") {
|
|
||||||
return { bgClassName: "w-full" };
|
|
||||||
}
|
|
||||||
if (theme.defaultButtonVariant === "icon-arrow") {
|
|
||||||
return { className: "justify-between" };
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
className={cls("relative py-20 w-full", useInvertedBackground && "bg-foreground", className)}
|
|
||||||
>
|
|
||||||
<div className={cls("w-content-width mx-auto", containerClassName)}>
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-12 gap-6 md:gap-8">
|
|
||||||
<div
|
|
||||||
ref={(el) => { itemRefs.current[0] = el; }}
|
|
||||||
className={cls(
|
|
||||||
"md:col-span-4 card rounded-theme-capped p-6 md:p-8 flex flex-col items-center justify-center gap-6 text-center",
|
|
||||||
ctaPanelClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className={cls("h-16 w-auto aspect-square rounded-theme primary-button flex items-center justify-center", ctaIconClassName)}>
|
|
||||||
<CtaIcon className="h-4/10 w-4/10 text-primary-cta-text" strokeWidth={1.5} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex flex-col" >
|
|
||||||
<h2 className={cls(
|
|
||||||
"text-2xl md:text-3xl font-medium",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
ctaTitleClassName
|
|
||||||
)}>
|
|
||||||
{ctaTitle}
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<p className={cls(
|
|
||||||
"text-base",
|
|
||||||
shouldUseLightText ? "text-background/70" : "text-foreground/70",
|
|
||||||
ctaDescriptionClassName
|
|
||||||
)}>
|
|
||||||
{ctaDescription}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
{...getButtonProps(
|
|
||||||
{ ...ctaButton, props: { ...ctaButton.props, ...getButtonConfigProps() } },
|
|
||||||
0,
|
|
||||||
theme.defaultButtonVariant,
|
|
||||||
cls("w-full", ctaButtonClassName),
|
|
||||||
ctaButtonTextClassName
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
ref={(el) => { itemRefs.current[1] = el; }}
|
|
||||||
className={cls(
|
|
||||||
"md:col-span-8 flex flex-col gap-4",
|
|
||||||
faqsPanelClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className={cls("flex flex-col gap-4", faqsContainerClassName)}>
|
|
||||||
{faqs.map((faq, index) => (
|
|
||||||
<Fragment key={faq.id}>
|
|
||||||
<Accordion
|
|
||||||
index={index}
|
|
||||||
isActive={activeIndex === index}
|
|
||||||
onToggle={handleToggle}
|
|
||||||
title={faq.title}
|
|
||||||
content={faq.content}
|
|
||||||
animationType={accordionAnimationType}
|
|
||||||
showCard={showCard}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={accordionClassName}
|
|
||||||
titleClassName={accordionTitleClassName}
|
|
||||||
iconContainerClassName={accordionIconContainerClassName}
|
|
||||||
iconClassName={accordionIconClassName}
|
|
||||||
contentClassName={accordionContentClassName}
|
|
||||||
/>
|
|
||||||
{!showCard && index < faqs.length - 1 && (
|
|
||||||
<div className={cls(
|
|
||||||
"w-full border-b",
|
|
||||||
shouldUseLightText ? "border-background/10" : "border-foreground/10",
|
|
||||||
separatorClassName
|
|
||||||
)} />
|
|
||||||
)}
|
|
||||||
</Fragment>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ContactFaq.displayName = "ContactFaq";
|
export default ContactFaq;
|
||||||
|
|
||||||
export default ContactFaq;
|
|
||||||
@@ -1,300 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
type FeatureBentoProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import Button from "@/components/button/Button";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import { BentoGlobe } from "@/components/bento/BentoGlobe";
|
|
||||||
import BentoIconInfoCards from "@/components/bento/BentoIconInfoCards";
|
|
||||||
import BentoAnimatedBarChart from "@/components/bento/BentoAnimatedBarChart";
|
|
||||||
import Bento3DStackCards from "@/components/bento/Bento3DStackCards";
|
|
||||||
import Bento3DTaskList, { type TaskItem } from "@/components/bento/Bento3DTaskList";
|
|
||||||
import BentoOrbitingIcons, { type OrbitingItem } from "@/components/bento/BentoOrbitingIcons";
|
|
||||||
import BentoMap from "@/components/bento/BentoMap";
|
|
||||||
import BentoMarquee from "@/components/bento/BentoMarquee";
|
|
||||||
import BentoLineChart from "@/components/bento/BentoLineChart/BentoLineChart";
|
|
||||||
import BentoPhoneAnimation, { type PhoneApp, type PhoneApps8 } from "@/components/bento/BentoPhoneAnimation";
|
|
||||||
import BentoChatAnimation, { type ChatExchange } from "@/components/bento/BentoChatAnimation";
|
|
||||||
import Bento3DCardGrid from "@/components/bento/Bento3DCardGrid";
|
|
||||||
import BentoRevealIcon from "@/components/bento/BentoRevealIcon";
|
|
||||||
import BentoTimeline, { type TimelineItem } from "@/components/bento/BentoTimeline";
|
|
||||||
import BentoMediaStack, { type MediaStackItem } from "@/components/bento/BentoMediaStack";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
|
|
||||||
export type { PhoneApp, PhoneApps8, ChatExchange, TimelineItem, MediaStackItem };
|
export const FeatureBento: React.FC<FeatureBentoProps> = (props) => {
|
||||||
import type { ButtonConfig, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
return <CardStack {...props} />;
|
||||||
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type BentoAnimationType = Exclude<CardAnimationTypeWith3D, "depth-3d" | "scale-rotate">;
|
|
||||||
|
|
||||||
export type BentoInfoItem = {
|
|
||||||
icon: LucideIcon;
|
|
||||||
label: string;
|
|
||||||
value: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Bento3DItem = {
|
export default FeatureBento;
|
||||||
icon: LucideIcon;
|
|
||||||
title: string;
|
|
||||||
subtitle: string;
|
|
||||||
detail: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type BaseFeatureCard = {
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
button?: ButtonConfig;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type FeatureCard = BaseFeatureCard & (
|
|
||||||
| {
|
|
||||||
bentoComponent: "icon-info-cards";
|
|
||||||
items: BentoInfoItem[];
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "3d-stack-cards";
|
|
||||||
items: [Bento3DItem, Bento3DItem, Bento3DItem];
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "3d-task-list";
|
|
||||||
title: string;
|
|
||||||
items: TaskItem[];
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "orbiting-icons";
|
|
||||||
centerIcon: LucideIcon;
|
|
||||||
items: OrbitingItem[];
|
|
||||||
}
|
|
||||||
| ({
|
|
||||||
bentoComponent: "marquee";
|
|
||||||
centerIcon: LucideIcon;
|
|
||||||
} & (
|
|
||||||
| { variant: "text"; texts: string[] }
|
|
||||||
| { variant: "icon"; icons: LucideIcon[] }
|
|
||||||
))
|
|
||||||
| {
|
|
||||||
bentoComponent: "globe" | "animated-bar-chart" | "map" | "line-chart";
|
|
||||||
items?: never;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "3d-card-grid";
|
|
||||||
items: [{ name: string; icon: LucideIcon }, { name: string; icon: LucideIcon }, { name: string; icon: LucideIcon }, { name: string; icon: LucideIcon }];
|
|
||||||
centerIcon: LucideIcon;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "phone";
|
|
||||||
statusIcon: LucideIcon;
|
|
||||||
alertIcon: LucideIcon;
|
|
||||||
alertTitle: string;
|
|
||||||
alertMessage: string;
|
|
||||||
apps: PhoneApps8;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "chat";
|
|
||||||
aiIcon: LucideIcon;
|
|
||||||
userIcon: LucideIcon;
|
|
||||||
exchanges: ChatExchange[];
|
|
||||||
placeholder: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "reveal-icon";
|
|
||||||
icon: LucideIcon;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "timeline";
|
|
||||||
heading: string;
|
|
||||||
subheading: string;
|
|
||||||
items: [TimelineItem, TimelineItem, TimelineItem];
|
|
||||||
completedLabel: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
bentoComponent: "media-stack";
|
|
||||||
items: [MediaStackItem, MediaStackItem, MediaStackItem];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
interface FeatureBentoProps {
|
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
animationType: BentoAnimationType;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
cardButtonClassName?: string;
|
|
||||||
cardButtonTextClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureBento = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Feature section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureBentoProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const getBentoComponent = (feature: FeatureCard) => {
|
|
||||||
switch (feature.bentoComponent) {
|
|
||||||
case "globe":
|
|
||||||
return (
|
|
||||||
<div className="relative w-full h-full min-h-0" style={{
|
|
||||||
maskImage: "linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%), linear-gradient(to bottom, black 40%, transparent 100%)",
|
|
||||||
WebkitMaskImage: "linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%), linear-gradient(to bottom, black 40%, transparent 100%)",
|
|
||||||
maskComposite: "intersect",
|
|
||||||
WebkitMaskComposite: "source-in"
|
|
||||||
}}>
|
|
||||||
<BentoGlobe className="w-full scale-150 mt-[15%]" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
case "icon-info-cards":
|
|
||||||
return <BentoIconInfoCards items={feature.items} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "animated-bar-chart":
|
|
||||||
return <BentoAnimatedBarChart />;
|
|
||||||
case "3d-stack-cards":
|
|
||||||
return <Bento3DStackCards cards={feature.items.map(item => ({ Icon: item.icon, title: item.title, subtitle: item.subtitle, detail: item.detail }))} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "3d-task-list":
|
|
||||||
return <Bento3DTaskList title={feature.title} items={feature.items} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "orbiting-icons":
|
|
||||||
return <BentoOrbitingIcons centerIcon={feature.centerIcon} items={feature.items} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "marquee":
|
|
||||||
return feature.variant === "text"
|
|
||||||
? <BentoMarquee centerIcon={feature.centerIcon} variant="text" texts={feature.texts} useInvertedBackground={useInvertedBackground} />
|
|
||||||
: <BentoMarquee centerIcon={feature.centerIcon} variant="icon" icons={feature.icons} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "map":
|
|
||||||
return <BentoMap useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "line-chart":
|
|
||||||
return <BentoLineChart useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "3d-card-grid":
|
|
||||||
return <Bento3DCardGrid items={feature.items} centerIcon={feature.centerIcon} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "phone":
|
|
||||||
return <BentoPhoneAnimation statusIcon={feature.statusIcon} alertIcon={feature.alertIcon} alertTitle={feature.alertTitle} alertMessage={feature.alertMessage} apps={feature.apps} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "chat":
|
|
||||||
return <BentoChatAnimation aiIcon={feature.aiIcon} userIcon={feature.userIcon} exchanges={feature.exchanges} placeholder={feature.placeholder} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "reveal-icon":
|
|
||||||
return <BentoRevealIcon icon={feature.icon} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "timeline":
|
|
||||||
return <BentoTimeline heading={feature.heading} subheading={feature.subheading} items={feature.items} completedLabel={feature.completedLabel} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
case "media-stack":
|
|
||||||
return <BentoMediaStack items={feature.items} useInvertedBackground={useInvertedBackground} />;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses="min-h-0"
|
|
||||||
animationType={animationType}
|
|
||||||
carouselThreshold={4}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={className}
|
|
||||||
containerClassName={containerClassName}
|
|
||||||
gridClassName={gridClassName}
|
|
||||||
carouselClassName={carouselClassName}
|
|
||||||
carouselItemClassName="w-carousel-item-3 xl:w-carousel-item-3!"
|
|
||||||
controlsClassName={controlsClassName}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
>
|
|
||||||
{features.map((feature, index) => (
|
|
||||||
<div
|
|
||||||
key={`${feature.title}-${index}`}
|
|
||||||
className={cls("card flex flex-col gap-4 p-5 rounded-theme-capped min-h-0 h-full", cardClassName)}
|
|
||||||
>
|
|
||||||
<div className="relative w-full h-70 min-h-0 overflow-hidden">
|
|
||||||
{getBentoComponent(feature)}
|
|
||||||
</div>
|
|
||||||
<div className="relative z-1 flex flex-col gap-1">
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight", shouldUseLightText && "text-background", cardTitleClassName)}>
|
|
||||||
{feature.title}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("text-sm leading-tight", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
|
|
||||||
{feature.description}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{feature.button && (
|
|
||||||
<Button {...getButtonProps(feature.button, 0, theme.defaultButtonVariant, cls("w-full", cardButtonClassName), cardButtonTextClassName)} />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
FeatureBento.displayName = "FeatureBento";
|
|
||||||
|
|
||||||
export default FeatureBento;
|
|
||||||
@@ -1,261 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type FeatureCardMediaProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import Tag from "@/components/shared/Tag";
|
|
||||||
import Button from "@/components/button/Button";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type FeatureCard = {
|
export const FeatureCardMedia: React.FC<FeatureCardMediaProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
tag: string;
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
buttons?: ButtonConfig[];
|
|
||||||
onCardClick?: () => void;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface FeatureCardMediaProps {
|
export default FeatureCardMedia;
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
itemClassName?: string;
|
|
||||||
mediaWrapperClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
tagClassName?: string;
|
|
||||||
contentClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
cardButtonContainerClassName?: string;
|
|
||||||
cardButtonClassName?: string;
|
|
||||||
cardButtonTextClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FeatureCardItemProps {
|
|
||||||
feature: FeatureCard;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
itemClassName?: string;
|
|
||||||
mediaWrapperClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
tagClassName?: string;
|
|
||||||
contentClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
cardButtonContainerClassName?: string;
|
|
||||||
cardButtonClassName?: string;
|
|
||||||
cardButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureCardItem = memo(({
|
|
||||||
feature,
|
|
||||||
shouldUseLightText,
|
|
||||||
useInvertedBackground,
|
|
||||||
itemClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
contentClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
cardButtonContainerClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
}: FeatureCardItemProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls("relative h-full flex flex-col gap-6 cursor-pointer group", itemClassName)}
|
|
||||||
onClick={feature.onCardClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={feature.title}
|
|
||||||
>
|
|
||||||
<div className={cls("relative w-full aspect-square overflow-hidden rounded-theme-capped", mediaWrapperClassName)}>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={feature.imageSrc}
|
|
||||||
videoSrc={feature.videoSrc}
|
|
||||||
imageAlt={feature.imageAlt || feature.title}
|
|
||||||
videoAriaLabel={feature.videoAriaLabel || feature.title}
|
|
||||||
imageClassName={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", mediaClassName)}
|
|
||||||
/>
|
|
||||||
<div className="absolute top-4 right-4">
|
|
||||||
<Tag
|
|
||||||
text={feature.tag}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={tagClassName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={cls("relative z-1 card rounded-theme-capped p-6 flex flex-col gap-2 flex-1", contentClassName)}>
|
|
||||||
<h3 className={cls(
|
|
||||||
"text-xl md:text-2xl font-medium leading-tight",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
cardTitleClassName
|
|
||||||
)}>
|
|
||||||
{feature.title}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<p className={cls(
|
|
||||||
"text-base leading-tight",
|
|
||||||
shouldUseLightText ? "text-background/75" : "text-foreground/75",
|
|
||||||
cardDescriptionClassName
|
|
||||||
)}>
|
|
||||||
{feature.description}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{feature.buttons && feature.buttons.length > 0 && (
|
|
||||||
<div className={cls("flex flex-wrap gap-4 max-md:justify-center mt-2", cardButtonContainerClassName)}>
|
|
||||||
{feature.buttons.slice(0, 2).map((button, index) => (
|
|
||||||
<Button
|
|
||||||
key={`${button.text}-${index}`}
|
|
||||||
{...getButtonProps(button, index, theme.defaultButtonVariant, cardButtonClassName, cardButtonTextClassName)}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
FeatureCardItem.displayName = "FeatureCardItem";
|
|
||||||
|
|
||||||
const FeatureCardMedia = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Features section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
itemClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
contentClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
cardButtonContainerClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureCardMediaProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{features.map((feature) => (
|
|
||||||
<FeatureCardItem
|
|
||||||
key={feature.id}
|
|
||||||
feature={feature}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
itemClassName={itemClassName}
|
|
||||||
mediaWrapperClassName={mediaWrapperClassName}
|
|
||||||
mediaClassName={mediaClassName}
|
|
||||||
tagClassName={tagClassName}
|
|
||||||
contentClassName={contentClassName}
|
|
||||||
cardTitleClassName={cardTitleClassName}
|
|
||||||
cardDescriptionClassName={cardDescriptionClassName}
|
|
||||||
cardButtonContainerClassName={cardButtonContainerClassName}
|
|
||||||
cardButtonClassName={cardButtonClassName}
|
|
||||||
cardButtonTextClassName={cardButtonTextClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
FeatureCardMedia.displayName = "FeatureCardMedia";
|
|
||||||
|
|
||||||
export default FeatureCardMedia;
|
|
||||||
@@ -1,196 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
type FeatureCardOneProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import Button from "@/components/button/Button";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
export const FeatureCardOne: React.FC<FeatureCardOneProps> = (props) => {
|
||||||
|
return <CardStack {...props} />;
|
||||||
type FeatureCard = {
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
button?: ButtonConfig;
|
|
||||||
} & (
|
|
||||||
| {
|
|
||||||
imageSrc: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoSrc?: never;
|
|
||||||
videoAriaLabel?: never;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
videoSrc: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
imageSrc?: never;
|
|
||||||
imageAlt?: never;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
interface FeatureCardOneProps {
|
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: GridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
mediaClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
cardButtonClassName?: string;
|
|
||||||
cardButtonTextClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureCardOne = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Feature section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureCardOneProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const getButtonConfigProps = () => {
|
|
||||||
if (theme.defaultButtonVariant === "hover-bubble") {
|
|
||||||
return { bgClassName: "w-full" };
|
|
||||||
}
|
|
||||||
if (theme.defaultButtonVariant === "icon-arrow") {
|
|
||||||
return { className: "justify-between" };
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{features.map((feature, index) => (
|
|
||||||
<div
|
|
||||||
key={`${feature.title}-${index}`}
|
|
||||||
className={cls("card flex flex-col gap-4 p-4 rounded-theme-capped min-h-0 h-full", cardClassName)}
|
|
||||||
>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={feature.imageSrc}
|
|
||||||
videoSrc={feature.videoSrc}
|
|
||||||
imageAlt={feature.imageAlt || "Feature image"}
|
|
||||||
videoAriaLabel={feature.videoAriaLabel || "Feature video"}
|
|
||||||
imageClassName={cls("relative z-1 min-h-0 h-full", mediaClassName)}
|
|
||||||
/>
|
|
||||||
<div className="relative z-1 flex flex-col gap-1">
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight", shouldUseLightText && "text-background", cardTitleClassName)}>
|
|
||||||
{feature.title}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("text-sm leading-tight", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
|
|
||||||
{feature.description}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{feature.button && (
|
|
||||||
<Button
|
|
||||||
{...getButtonProps(
|
|
||||||
{ ...feature.button, props: { ...feature.button.props, ...getButtonConfigProps() } },
|
|
||||||
0,
|
|
||||||
theme.defaultButtonVariant,
|
|
||||||
cls("w-full", cardButtonClassName),
|
|
||||||
cardButtonTextClassName
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureCardOne.displayName = "FeatureCardOne";
|
export default FeatureCardOne;
|
||||||
|
|
||||||
export default FeatureCardOne;
|
|
||||||
@@ -1,167 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import CardStackTextBox from "@/components/cardStack/CardStackTextBox";
|
|
||||||
import PricingFeatureList from "@/components/shared/PricingFeatureList";
|
|
||||||
import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation";
|
|
||||||
import { Check, X } from "lucide-react";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type ComparisonItem = {
|
|
||||||
items: string[];
|
|
||||||
};
|
|
||||||
|
|
||||||
interface FeatureCardSixteenProps {
|
interface FeatureCardSixteenProps {
|
||||||
negativeCard: ComparisonItem;
|
children?: React.ReactNode;
|
||||||
positiveCard: ComparisonItem;
|
className?: string;
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
title: string;
|
|
||||||
titleSegments?: TitleSegment[];
|
|
||||||
description: string;
|
|
||||||
textboxLayout: TextboxLayout;
|
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
tag?: string;
|
|
||||||
tagIcon?: LucideIcon;
|
|
||||||
tagAnimation?: ButtonAnimationType;
|
|
||||||
buttons?: ButtonConfig[];
|
|
||||||
buttonAnimation?: ButtonAnimationType;
|
|
||||||
ariaLabel?: string;
|
|
||||||
className?: string;
|
|
||||||
containerClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
titleImageWrapperClassName?: string;
|
|
||||||
titleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
cardClassName?: string;
|
|
||||||
itemsListClassName?: string;
|
|
||||||
itemClassName?: string;
|
|
||||||
itemIconClassName?: string;
|
|
||||||
itemTextClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const FeatureCardSixteen = ({
|
export const FeatureCardSixteen: React.FC<FeatureCardSixteenProps> = ({ children, className }) => {
|
||||||
negativeCard,
|
return <div className={className}>{children}</div>;
|
||||||
positiveCard,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
ariaLabel = "Feature comparison section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
titleImageWrapperClassName = "",
|
|
||||||
titleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
itemsListClassName = "",
|
|
||||||
itemClassName = "",
|
|
||||||
itemIconClassName = "",
|
|
||||||
itemTextClassName = "",
|
|
||||||
}: FeatureCardSixteenProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
const { itemRefs, containerRef, perspectiveRef } = useCardAnimation({
|
|
||||||
animationType,
|
|
||||||
itemCount: 2,
|
|
||||||
isGrid: true,
|
|
||||||
supports3DAnimation: true,
|
|
||||||
gridVariant: "uniform-all-items-equal"
|
|
||||||
});
|
|
||||||
|
|
||||||
const cards = [
|
|
||||||
{ ...negativeCard, variant: "negative" as const },
|
|
||||||
{ ...positiveCard, variant: "positive" as const },
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
ref={containerRef}
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
className={cls("relative py-20 w-full", useInvertedBackground && "bg-foreground", className)}
|
|
||||||
>
|
|
||||||
<div className={cls("w-content-width mx-auto flex flex-col gap-8", containerClassName)}>
|
|
||||||
<CardStackTextBox
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
titleImageWrapperClassName={titleImageWrapperClassName}
|
|
||||||
titleImageClassName={titleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div
|
|
||||||
ref={perspectiveRef}
|
|
||||||
className={cls(
|
|
||||||
"relative mx-auto w-full md:w-60 grid grid-cols-1 gap-6",
|
|
||||||
cards.length >= 2 ? "md:grid-cols-2" : "md:grid-cols-1",
|
|
||||||
gridClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{cards.map((card, index) => (
|
|
||||||
<div
|
|
||||||
key={card.variant}
|
|
||||||
ref={(el) => { itemRefs.current[index] = el; }}
|
|
||||||
className={cls(
|
|
||||||
"relative h-full card rounded-theme-capped p-6",
|
|
||||||
cardClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className={cls("flex flex-col gap-6", card.variant === "negative" && "opacity-50")}>
|
|
||||||
<PricingFeatureList
|
|
||||||
features={card.items}
|
|
||||||
icon={card.variant === "positive" ? Check : X}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
className={itemsListClassName}
|
|
||||||
featureItemClassName={itemClassName}
|
|
||||||
featureIconWrapperClassName=""
|
|
||||||
featureIconClassName={itemIconClassName}
|
|
||||||
featureTextClassName={cls("truncate", itemTextClassName)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureCardSixteen.displayName = "FeatureCardSixteen";
|
|
||||||
|
|
||||||
export default FeatureCardSixteen;
|
export default FeatureCardSixteen;
|
||||||
@@ -1,178 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
type FeatureCardTwentyFiveProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
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 { CardAnimationTypeWith3D, TitleSegment, ButtonConfig, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
export const FeatureCardTwentyFive: React.FC<FeatureCardTwentyFiveProps> = (props) => {
|
||||||
|
return <CardStack {...props} />;
|
||||||
interface MediaItem {
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type FeatureCard = {
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
icon: LucideIcon;
|
|
||||||
mediaItems: [MediaItem, MediaItem];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface FeatureCardTwentyFiveProps {
|
export default FeatureCardTwentyFive;
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
mediaClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
cardIconClassName?: string;
|
|
||||||
cardIconWrapperClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureCardTwentyFive = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Feature section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
cardIconClassName = "",
|
|
||||||
cardIconWrapperClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureCardTwentyFiveProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="two-items-per-row"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{features.map((feature, index) => {
|
|
||||||
const IconComponent = feature.icon;
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={`${feature.title}-${index}`}
|
|
||||||
className={cls("card flex flex-col gap-5 p-5 rounded-theme-capped min-h-0 h-full", cardClassName)}
|
|
||||||
>
|
|
||||||
<div className="relative z-1 flex flex-col gap-1">
|
|
||||||
<div className={cls("h-15 w-[3.75rem] mb-1 aspect-square rounded-theme primary-button flex items-center justify-center", cardIconWrapperClassName)}>
|
|
||||||
<IconComponent className={cls("h-4/10 w-4/10 text-primary-cta-text", cardIconClassName)} strokeWidth={1.5} />
|
|
||||||
</div>
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight", shouldUseLightText && "text-background", cardTitleClassName)}>
|
|
||||||
{feature.title}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("text-base leading-tight", shouldUseLightText ? "text-background" : "text-foreground", cardDescriptionClassName)}>
|
|
||||||
{feature.description}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="mt-auto flex-1 min-h-0 grid grid-cols-2 gap-5 overflow-hidden">
|
|
||||||
{feature.mediaItems.map((item, mediaIndex) => (
|
|
||||||
<div key={mediaIndex} className="overflow-hidden rounded-theme-capped">
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={item.imageSrc}
|
|
||||||
videoSrc={item.videoSrc}
|
|
||||||
imageAlt={item.imageAlt || "Feature image"}
|
|
||||||
videoAriaLabel={item.videoAriaLabel || "Feature video"}
|
|
||||||
imageClassName={cls("relative z-1 h-full w-full object-cover", mediaClassName)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
FeatureCardTwentyFive.displayName = "FeatureCardTwentyFive";
|
|
||||||
|
|
||||||
export default FeatureCardTwentyFive;
|
|
||||||
@@ -1,219 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { useState } from "react";
|
type FeatureCardTwentySevenProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import { Plus } from "lucide-react";
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type FeatureCard = {
|
export const FeatureCardTwentySeven: React.FC<FeatureCardTwentySevenProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface FeatureCardTwentySevenItemProps {
|
export default FeatureCardTwentySeven;
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
className?: string;
|
|
||||||
titleClassName?: string;
|
|
||||||
descriptionClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureCardTwentySevenItem = ({
|
|
||||||
title,
|
|
||||||
description,
|
|
||||||
imageSrc,
|
|
||||||
videoSrc,
|
|
||||||
imageAlt = "",
|
|
||||||
className = "",
|
|
||||||
titleClassName = "",
|
|
||||||
descriptionClassName = "",
|
|
||||||
}: FeatureCardTwentySevenItemProps) => {
|
|
||||||
const [isFlipped, setIsFlipped] = useState(false);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"relative w-full h-full min-h-0 group [perspective:3000px] cursor-pointer",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
onClick={() => setIsFlipped(!isFlipped)}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"relative w-full h-full transition-transform duration-500 [transform-style:preserve-3d]",
|
|
||||||
isFlipped && "[transform:rotateY(180deg)]"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className="relative w-full h-full card rounded-theme-capped p-6 gap-6 flex flex-col [backface-visibility:hidden]">
|
|
||||||
<div className="flex justify-between items-start">
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight", titleClassName)}>
|
|
||||||
{title}
|
|
||||||
</h3>
|
|
||||||
<div className="h-[calc(var(--text-2xl)*1.25)] w-[calc(var(--text-2xl)*1.25)] aspect-square rounded-theme primary-button flex items-center justify-center shrink-0">
|
|
||||||
<Plus className="h-1/2 w-1/2 text-primary-cta-text" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-full aspect-square md:aspect-[10/11] flex items-center justify-center rounded-theme-capped overflow-hidden">
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={imageSrc}
|
|
||||||
videoSrc={videoSrc}
|
|
||||||
imageAlt={imageAlt}
|
|
||||||
imageClassName="w-full h-full object-cover"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="absolute! inset-0 w-full h-full card rounded-theme-capped p-6 gap-6 flex flex-col justify-between [backface-visibility:hidden] [transform:rotateY(180deg)]">
|
|
||||||
<div className="flex justify-between items-start">
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight", titleClassName)}>
|
|
||||||
{title}
|
|
||||||
</h3>
|
|
||||||
<div className="h-[calc(var(--text-2xl)*1.25)] w-[calc(var(--text-2xl)*1.25)] aspect-square rounded-theme primary-button flex items-center justify-center shrink-0">
|
|
||||||
<Plus className="h-1/2 w-1/2 rotate-45 text-primary-cta-text" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-full">
|
|
||||||
<p className={cls("text-lg text-foreground/75 leading-tight", descriptionClassName)}>
|
|
||||||
{description}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
interface FeatureCardTwentySevenProps {
|
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: GridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureCardTwentySeven = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses = "min-h-none",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Feature section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureCardTwentySevenProps) => {
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{features.map((feature, index) => (
|
|
||||||
<FeatureCardTwentySevenItem
|
|
||||||
key={`${feature.id}-${index}`}
|
|
||||||
title={feature.title}
|
|
||||||
description={feature.description}
|
|
||||||
imageSrc={feature.imageSrc}
|
|
||||||
videoSrc={feature.videoSrc}
|
|
||||||
imageAlt={feature.imageAlt}
|
|
||||||
className={cardClassName}
|
|
||||||
titleClassName={cardTitleClassName}
|
|
||||||
descriptionClassName={cardDescriptionClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
FeatureCardTwentySeven.displayName = "FeatureCardTwentySeven";
|
|
||||||
|
|
||||||
export default FeatureCardTwentySeven;
|
|
||||||
@@ -1,241 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type FeatureCardTwentyThreeProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import { ArrowRight } from "lucide-react";
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import Tag from "@/components/shared/Tag";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type FeatureItem = {
|
export const FeatureCardTwentyThree: React.FC<FeatureCardTwentyThreeProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
title: string;
|
|
||||||
tags: string[];
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
onFeatureClick?: () => void;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface FeatureCardTwentyThreeProps {
|
export default FeatureCardTwentyThree;
|
||||||
features: FeatureItem[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
itemClassName?: string;
|
|
||||||
mediaWrapperClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
cardClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
tagsContainerClassName?: string;
|
|
||||||
tagClassName?: string;
|
|
||||||
arrowClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FeatureCardItemProps {
|
|
||||||
feature: FeatureItem;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
itemClassName?: string;
|
|
||||||
mediaWrapperClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
cardClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
tagsContainerClassName?: string;
|
|
||||||
tagClassName?: string;
|
|
||||||
arrowClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureCardItem = memo(({
|
|
||||||
feature,
|
|
||||||
shouldUseLightText,
|
|
||||||
useInvertedBackground,
|
|
||||||
itemClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
tagsContainerClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
arrowClassName = "",
|
|
||||||
}: FeatureCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls("relative h-full flex flex-col gap-6 cursor-pointer group", itemClassName)}
|
|
||||||
onClick={feature.onFeatureClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={feature.title}
|
|
||||||
>
|
|
||||||
<div className={cls("relative w-full aspect-square overflow-hidden rounded-theme-capped", mediaWrapperClassName)}>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={feature.imageSrc}
|
|
||||||
videoSrc={feature.videoSrc}
|
|
||||||
imageAlt={feature.imageAlt || feature.title}
|
|
||||||
videoAriaLabel={feature.videoAriaLabel || feature.title}
|
|
||||||
imageClassName={cls("w-full h-full object-cover transition-transform duration-500 ease-in-out group-hover:scale-105", mediaClassName)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={cls("relative z-1 card rounded-theme-capped p-5 flex-1 flex flex-col justify-between gap-4", cardClassName)}>
|
|
||||||
<h3 className={cls(
|
|
||||||
"text-xl md:text-2xl font-medium leading-tight",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
cardTitleClassName
|
|
||||||
)}>
|
|
||||||
{feature.title}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div className="flex items-center justify-between gap-4">
|
|
||||||
<div className={cls("flex items-center gap-2 flex-wrap", tagsContainerClassName)}>
|
|
||||||
{feature.tags.map((tag, index) => (
|
|
||||||
<Tag
|
|
||||||
key={index}
|
|
||||||
text={tag}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
className={tagClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<ArrowRight
|
|
||||||
className={cls(
|
|
||||||
"h-[var(--text-base)] w-auto shrink-0 transition-transform duration-300 group-hover:-rotate-45",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
arrowClassName
|
|
||||||
)}
|
|
||||||
strokeWidth={1.5}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
FeatureCardItem.displayName = "FeatureCardItem";
|
|
||||||
|
|
||||||
const FeatureCardTwentyThree = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Features section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
itemClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
tagsContainerClassName = "",
|
|
||||||
tagClassName = "",
|
|
||||||
arrowClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureCardTwentyThreeProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
ariaLabel={ariaLabel}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{features.map((feature) => (
|
|
||||||
<FeatureCardItem
|
|
||||||
key={feature.id}
|
|
||||||
feature={feature}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
itemClassName={itemClassName}
|
|
||||||
mediaWrapperClassName={mediaWrapperClassName}
|
|
||||||
mediaClassName={mediaClassName}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
cardTitleClassName={cardTitleClassName}
|
|
||||||
tagsContainerClassName={tagsContainerClassName}
|
|
||||||
tagClassName={tagClassName}
|
|
||||||
arrowClassName={arrowClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
FeatureCardTwentyThree.displayName = "FeatureCardTwentyThree";
|
|
||||||
|
|
||||||
export default FeatureCardTwentyThree;
|
|
||||||
@@ -1,155 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
type FeatureBorderGlowProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import FeatureBorderGlowItem from "./FeatureBorderGlowItem";
|
|
||||||
import { shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type {
|
|
||||||
ButtonConfig,
|
|
||||||
CardAnimationType,
|
|
||||||
TitleSegment,
|
|
||||||
ButtonAnimationType,
|
|
||||||
} from "@/components/cardStack/types";
|
|
||||||
import type {
|
|
||||||
TextboxLayout,
|
|
||||||
InvertedBackground,
|
|
||||||
} from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
interface FeatureCard {
|
export const FeatureBorderGlow: React.FC<FeatureBorderGlowProps> = (props) => {
|
||||||
icon: LucideIcon;
|
return <CardStack {...props} />;
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FeatureBorderGlowProps {
|
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
iconContainerClassName?: string;
|
|
||||||
iconClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureBorderGlow = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses = "min-h-75 2xl:min-h-85",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Feature section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
iconContainerClassName = "",
|
|
||||||
iconClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: FeatureBorderGlowProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(
|
|
||||||
useInvertedBackground,
|
|
||||||
theme.cardStyle
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{features.map((feature, index) => (
|
|
||||||
<FeatureBorderGlowItem
|
|
||||||
key={`${feature.title}-${index}`}
|
|
||||||
item={feature}
|
|
||||||
index={index}
|
|
||||||
className={cardClassName}
|
|
||||||
iconContainerClassName={iconContainerClassName}
|
|
||||||
iconClassName={iconClassName}
|
|
||||||
titleClassName={cardTitleClassName}
|
|
||||||
descriptionClassName={cardDescriptionClassName}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureBorderGlow.displayName = "FeatureBorderGlow";
|
export default FeatureBorderGlow;
|
||||||
|
|
||||||
export default FeatureBorderGlow;
|
|
||||||
@@ -1,182 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import "./FeatureCardThree.css";
|
type FeatureCardThreeProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import { useRef, useCallback, useState } from "react";
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import FeatureCardThreeItem from "./FeatureCardThreeItem";
|
|
||||||
import { useDynamicDimensions } from "./useDynamicDimensions";
|
|
||||||
import { useClickOutside } from "@/hooks/useClickOutside";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type FeatureCard = {
|
export const FeatureCardThree: React.FC<FeatureCardThreeProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
imageSrc: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface FeatureCardThreeProps {
|
export default FeatureCardThree;
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: GridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
itemContentClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureCardThree = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Feature section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
itemContentClassName = "",
|
|
||||||
}: FeatureCardThreeProps) => {
|
|
||||||
const featureCardThreeRefs = useRef<(HTMLDivElement | null)[]>([]);
|
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
|
||||||
const [activeIndex, setActiveIndex] = useState<number | null>(null);
|
|
||||||
|
|
||||||
|
|
||||||
const setRef = useCallback(
|
|
||||||
(index: number) => (el: HTMLDivElement | null) => {
|
|
||||||
if (featureCardThreeRefs.current) {
|
|
||||||
featureCardThreeRefs.current[index] = el;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Check if device supports hover (desktop) or not (mobile/touch)
|
|
||||||
const isTouchDevice = typeof window !== "undefined" && window.matchMedia("(hover: none)").matches;
|
|
||||||
|
|
||||||
// Handle click outside to deactivate on mobile
|
|
||||||
useClickOutside(
|
|
||||||
containerRef,
|
|
||||||
() => setActiveIndex(null),
|
|
||||||
activeIndex !== null && isTouchDevice
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleItemClick = useCallback((index: number) => {
|
|
||||||
if (typeof window !== "undefined" && !window.matchMedia("(hover: none)").matches) return;
|
|
||||||
setActiveIndex((prev) => (prev === index ? null : index));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useDynamicDimensions([featureCardThreeRefs], {
|
|
||||||
titleSelector: ".feature-card-three-title-row .feature-card-three-title",
|
|
||||||
descriptionSelector: ".feature-card-three-description-wrapper .feature-card-three-description",
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div ref={containerRef}>
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{features.map((feature, index) => (
|
|
||||||
<FeatureCardThreeItem
|
|
||||||
key={`${feature.id}-${index}`}
|
|
||||||
ref={setRef(index)}
|
|
||||||
item={feature}
|
|
||||||
isActive={activeIndex === index}
|
|
||||||
onItemClick={() => handleItemClick(index)}
|
|
||||||
className={cardClassName}
|
|
||||||
itemContentClassName={itemContentClassName}
|
|
||||||
itemTitleClassName={cardTitleClassName}
|
|
||||||
itemDescriptionClassName={cardDescriptionClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
FeatureCardThree.displayName = "FeatureCardThree";
|
|
||||||
|
|
||||||
export default FeatureCardThree;
|
|
||||||
@@ -1,165 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
type FeatureHoverPatternProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import FeatureHoverPatternItem from "./FeatureHoverPatternItem";
|
|
||||||
import { shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type {
|
|
||||||
ButtonConfig,
|
|
||||||
CardAnimationType,
|
|
||||||
TitleSegment,
|
|
||||||
ButtonAnimationType,
|
|
||||||
} from "@/components/cardStack/types";
|
|
||||||
import type {
|
|
||||||
TextboxLayout,
|
|
||||||
InvertedBackground,
|
|
||||||
} from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
interface FeatureCard {
|
export const FeatureHoverPattern: React.FC<FeatureHoverPatternProps> = (props) => {
|
||||||
icon: LucideIcon;
|
return <CardStack {...props} />;
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
button?: ButtonConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FeatureHoverPatternProps {
|
|
||||||
features: FeatureCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
iconContainerClassName?: string;
|
|
||||||
iconClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
gradientClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
cardButtonClassName?: string;
|
|
||||||
cardButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FeatureHoverPattern = ({
|
|
||||||
features,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses = "min-h-85 2xl:min-h-95",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Feature section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
iconContainerClassName = "",
|
|
||||||
iconClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
gradientClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
}: FeatureHoverPatternProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(
|
|
||||||
useInvertedBackground,
|
|
||||||
theme.cardStyle
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{features.map((feature, index) => (
|
|
||||||
<FeatureHoverPatternItem
|
|
||||||
key={`${feature.title}-${index}`}
|
|
||||||
item={feature}
|
|
||||||
index={index}
|
|
||||||
className={cardClassName}
|
|
||||||
iconContainerClassName={iconContainerClassName}
|
|
||||||
iconClassName={iconClassName}
|
|
||||||
titleClassName={cardTitleClassName}
|
|
||||||
descriptionClassName={cardDescriptionClassName}
|
|
||||||
gradientClassName={gradientClassName}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
buttonClassName={cardButtonClassName}
|
|
||||||
buttonTextClassName={cardButtonTextClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
FeatureHoverPattern.displayName = "FeatureHoverPattern";
|
export default FeatureHoverPattern;
|
||||||
|
|
||||||
export default FeatureHoverPattern;
|
|
||||||
@@ -1,274 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import { memo } from "react";
|
|
||||||
import CardStackTextBox from "@/components/cardStack/CardStackTextBox";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type MediaProps =
|
|
||||||
| {
|
|
||||||
imageSrc: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoSrc?: never;
|
|
||||||
videoAriaLabel?: never;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
videoSrc: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
imageSrc?: never;
|
|
||||||
imageAlt?: never;
|
|
||||||
};
|
|
||||||
|
|
||||||
type Metric = MediaProps & {
|
|
||||||
id: string;
|
|
||||||
value: string;
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface MetricCardElevenProps {
|
interface MetricCardElevenProps {
|
||||||
metrics: Metric[];
|
children?: React.ReactNode;
|
||||||
animationType: CardAnimationType;
|
className?: string;
|
||||||
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;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
cardClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
mediaCardClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MetricTextCardProps {
|
export const MetricCardEleven: React.FC<MetricCardElevenProps> = ({ children, className }) => {
|
||||||
metric: Metric;
|
return <div className={className}>{children}</div>;
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
cardDescriptionClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MetricMediaCardProps {
|
|
||||||
metric: Metric;
|
|
||||||
mediaCardClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MetricTextCard = memo(({
|
|
||||||
metric,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
}: MetricTextCardProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls(
|
|
||||||
"relative w-full min-w-0 max-w-full h-full card text-foreground rounded-theme-capped flex flex-col justify-between p-6 md:p-8",
|
|
||||||
cardClassName
|
|
||||||
)}>
|
|
||||||
<h3 className={cls(
|
|
||||||
"text-5xl md:text-6xl font-medium leading-tight truncate",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
valueClassName
|
|
||||||
)}>
|
|
||||||
{metric.value}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div className="w-full min-w-0 flex flex-col gap-2 mt-auto">
|
|
||||||
<p className={cls(
|
|
||||||
"text-xl md:text-2xl font-medium leading-tight truncate",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
cardTitleClassName
|
|
||||||
)}>
|
|
||||||
{metric.title}
|
|
||||||
</p>
|
|
||||||
<div className="w-full h-px bg-accent" />
|
|
||||||
<p className={cls(
|
|
||||||
"text-base truncate leading-tight",
|
|
||||||
shouldUseLightText ? "text-background/75" : "text-foreground/75",
|
|
||||||
cardDescriptionClassName
|
|
||||||
)}>
|
|
||||||
{metric.description}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
MetricTextCard.displayName = "MetricTextCard";
|
|
||||||
|
|
||||||
const MetricMediaCard = memo(({
|
|
||||||
metric,
|
|
||||||
mediaCardClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
}: MetricMediaCardProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls(
|
|
||||||
"relative h-full rounded-theme-capped overflow-hidden",
|
|
||||||
mediaCardClassName
|
|
||||||
)}>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={metric.imageSrc}
|
|
||||||
videoSrc={metric.videoSrc}
|
|
||||||
imageAlt={metric.imageAlt}
|
|
||||||
videoAriaLabel={metric.videoAriaLabel}
|
|
||||||
imageClassName={cls("w-full h-full object-cover", mediaClassName)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
MetricMediaCard.displayName = "MetricMediaCard";
|
|
||||||
|
|
||||||
const MetricCardEleven = ({
|
|
||||||
metrics,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Metrics section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
cardDescriptionClassName = "",
|
|
||||||
mediaCardClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
}: MetricCardElevenProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
// Inner grid for each metric item (text + media side by side)
|
|
||||||
const innerGridCols = "grid-cols-2";
|
|
||||||
|
|
||||||
const { itemRefs } = useCardAnimation({ animationType, itemCount: metrics.length });
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
className={cls("relative py-20 w-full", useInvertedBackground && "bg-foreground", className)}
|
|
||||||
>
|
|
||||||
<div className={cls("w-content-width mx-auto", containerClassName)}>
|
|
||||||
<CardStackTextBox
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={cls(
|
|
||||||
"grid gap-4 mt-8 md:mt-12",
|
|
||||||
metrics.length === 1 ? "grid-cols-1" : "grid-cols-1 md:grid-cols-2",
|
|
||||||
gridClassName
|
|
||||||
)}>
|
|
||||||
{metrics.map((metric, index) => {
|
|
||||||
const isLastItem = index === metrics.length - 1;
|
|
||||||
const isOddTotal = metrics.length % 2 !== 0;
|
|
||||||
const isSingleItem = metrics.length === 1;
|
|
||||||
const shouldSpanFull = isSingleItem || (isLastItem && isOddTotal);
|
|
||||||
// On mobile, even items (2nd, 4th, 6th - index 1, 3, 5) have media first
|
|
||||||
const isEvenItem = (index + 1) % 2 === 0;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={`${metric.id}-${index}`}
|
|
||||||
ref={(el) => { itemRefs.current[index] = el; }}
|
|
||||||
className={cls(
|
|
||||||
"grid gap-4",
|
|
||||||
innerGridCols,
|
|
||||||
shouldSpanFull && "md:col-span-2"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<MetricTextCard
|
|
||||||
metric={metric}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cls(
|
|
||||||
shouldSpanFull ? "aspect-square md:aspect-video" : "aspect-square",
|
|
||||||
isEvenItem && "order-2 md:order-1",
|
|
||||||
cardClassName
|
|
||||||
)}
|
|
||||||
valueClassName={valueClassName}
|
|
||||||
cardTitleClassName={cardTitleClassName}
|
|
||||||
cardDescriptionClassName={cardDescriptionClassName}
|
|
||||||
/>
|
|
||||||
<MetricMediaCard
|
|
||||||
metric={metric}
|
|
||||||
mediaCardClassName={cls(
|
|
||||||
shouldSpanFull ? "aspect-square md:aspect-video" : "aspect-square",
|
|
||||||
isEvenItem && "order-1 md:order-2",
|
|
||||||
mediaCardClassName
|
|
||||||
)}
|
|
||||||
mediaClassName={mediaClassName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MetricCardEleven.displayName = "MetricCardEleven";
|
|
||||||
|
|
||||||
export default MetricCardEleven;
|
export default MetricCardEleven;
|
||||||
@@ -1,212 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type MetricCardOneProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type MetricCardOneGridVariant = Extract<GridVariant, "uniform-all-items-equal" | "bento-grid" | "bento-grid-inverted">;
|
export const MetricCardOne: React.FC<MetricCardOneProps> = (props) => {
|
||||||
|
return <CardStack {...props} />;
|
||||||
type Metric = {
|
|
||||||
id: string;
|
|
||||||
value: string;
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
icon: LucideIcon;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface MetricCardOneProps {
|
export default MetricCardOne;
|
||||||
metrics: Metric[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: MetricCardOneGridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
titleClassName?: string;
|
|
||||||
descriptionClassName?: string;
|
|
||||||
iconContainerClassName?: string;
|
|
||||||
iconClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MetricCardItemProps {
|
|
||||||
metric: Metric;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
titleClassName?: string;
|
|
||||||
descriptionClassName?: string;
|
|
||||||
iconContainerClassName?: string;
|
|
||||||
iconClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MetricCardItem = memo(({
|
|
||||||
metric,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
titleClassName = "",
|
|
||||||
descriptionClassName = "",
|
|
||||||
iconContainerClassName = "",
|
|
||||||
iconClassName = "",
|
|
||||||
}: MetricCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative w-full min-w-0 h-full card text-foreground rounded-theme-capped p-6 flex flex-col items-center justify-center gap-0", cardClassName)}>
|
|
||||||
<h2
|
|
||||||
className={cls("relative z-1 w-full text-9xl font-foreground font-medium leading-[1.1] truncate text-center", valueClassName)}
|
|
||||||
style={{
|
|
||||||
backgroundImage: shouldUseLightText
|
|
||||||
? `linear-gradient(to bottom, var(--color-background) 0%, var(--color-background) 20%, transparent 72%, transparent 80%, transparent 100%)`
|
|
||||||
: `linear-gradient(to bottom, var(--color-foreground) 0%, var(--color-foreground) 20%, transparent 72%, transparent 80%, transparent 100%)`,
|
|
||||||
WebkitBackgroundClip: "text",
|
|
||||||
backgroundClip: "text",
|
|
||||||
WebkitTextFillColor: "transparent",
|
|
||||||
color: "transparent",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{metric.value}
|
|
||||||
</h2>
|
|
||||||
<p className={cls("relative w-full z-1 mt-[calc(var(--text-4xl)*-0.75)] md:mt-[calc(var(--text-4xl)*-1.15)] text-4xl font-medium text-center truncate", shouldUseLightText ? "text-background" : "text-foreground", titleClassName)}>
|
|
||||||
{metric.title}
|
|
||||||
</p>
|
|
||||||
<p className={cls("relative line-clamp-2 z-1 max-w-9/10 md:max-w-7/10 text-base text-center leading-[1.1] mt-2", shouldUseLightText ? "text-background" : "text-foreground", descriptionClassName)}>
|
|
||||||
{metric.description}
|
|
||||||
</p>
|
|
||||||
<div className={cls("absolute! z-1 left-6 bottom-6 h-10 aspect-square primary-button rounded-theme flex items-center justify-center", iconContainerClassName)}>
|
|
||||||
<metric.icon className={cls("h-4/10 text-primary-cta-text", iconClassName)} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
MetricCardItem.displayName = "MetricCardItem";
|
|
||||||
|
|
||||||
const MetricCardOne = ({
|
|
||||||
metrics,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Metrics section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
titleClassName = "",
|
|
||||||
descriptionClassName = "",
|
|
||||||
iconContainerClassName = "",
|
|
||||||
iconClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: MetricCardOneProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const customUniformHeight = gridVariant === "uniform-all-items-equal"
|
|
||||||
? "min-h-70 2xl:min-h-80"
|
|
||||||
: uniformGridCustomHeightClasses;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={customUniformHeight}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
carouselThreshold={4}
|
|
||||||
carouselItemClassName="w-carousel-item-3!"
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{metrics.map((metric, index) => (
|
|
||||||
<MetricCardItem
|
|
||||||
key={`${metric.id}-${index}`}
|
|
||||||
metric={metric}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
valueClassName={valueClassName}
|
|
||||||
titleClassName={titleClassName}
|
|
||||||
descriptionClassName={descriptionClassName}
|
|
||||||
iconContainerClassName={iconContainerClassName}
|
|
||||||
iconClassName={iconClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
MetricCardOne.displayName = "MetricCardOne";
|
|
||||||
|
|
||||||
export default MetricCardOne;
|
|
||||||
@@ -1,194 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type MetricCardSevenProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import PricingFeatureList from "@/components/shared/PricingFeatureList";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type Metric = {
|
export const MetricCardSeven: React.FC<MetricCardSevenProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
value: string;
|
|
||||||
title: string;
|
|
||||||
items: string[];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface MetricCardSevenProps {
|
export default MetricCardSeven;
|
||||||
metrics: Metric[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
metricTitleClassName?: string;
|
|
||||||
featuresClassName?: string;
|
|
||||||
featureItemClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MetricCardItemProps {
|
|
||||||
metric: Metric;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
metricTitleClassName?: string;
|
|
||||||
featuresClassName?: string;
|
|
||||||
featureItemClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MetricCardItem = memo(({
|
|
||||||
metric,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
metricTitleClassName = "",
|
|
||||||
featuresClassName = "",
|
|
||||||
featureItemClassName = "",
|
|
||||||
}: MetricCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full card text-foreground rounded-theme-capped p-6 flex flex-col justify-between gap-4", cardClassName)}>
|
|
||||||
<div className="flex flex-col gap-0" >
|
|
||||||
<h3 className={cls("relative z-1 text-9xl md:text-8xl font-medium truncate", shouldUseLightText ? "text-background" : "text-foreground", valueClassName)}>
|
|
||||||
{metric.value}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("relative z-1 text-2xl md:text-xl truncate", shouldUseLightText ? "text-background" : "text-foreground", metricTitleClassName)}>
|
|
||||||
{metric.title}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="pt-4 border-t border-t-accent" >
|
|
||||||
{metric.items.length > 0 && (
|
|
||||||
<PricingFeatureList
|
|
||||||
features={metric.items}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
className={cls("mt-1", featuresClassName)}
|
|
||||||
featureItemClassName={featureItemClassName}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
MetricCardItem.displayName = "MetricCardItem";
|
|
||||||
|
|
||||||
const MetricCardSeven = ({
|
|
||||||
metrics,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Metrics section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
metricTitleClassName = "",
|
|
||||||
featuresClassName = "",
|
|
||||||
featureItemClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: MetricCardSevenProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const customUniformHeight = uniformGridCustomHeightClasses || "min-h-70 2xl:min-h-80";
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={customUniformHeight}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{metrics.map((metric, index) => (
|
|
||||||
<MetricCardItem
|
|
||||||
key={`${metric.id}-${index}`}
|
|
||||||
metric={metric}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
valueClassName={valueClassName}
|
|
||||||
metricTitleClassName={metricTitleClassName}
|
|
||||||
featuresClassName={featuresClassName}
|
|
||||||
featureItemClassName={featureItemClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
MetricCardSeven.displayName = "MetricCardSeven";
|
|
||||||
|
|
||||||
export default MetricCardSeven;
|
|
||||||
@@ -1,245 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type MetricCardTenProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import Button from "@/components/button/Button";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
import type { CTAButtonVariant } from "@/components/button/types";
|
|
||||||
|
|
||||||
type Metric = {
|
export const MetricCardTen: React.FC<MetricCardTenProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
title: string;
|
|
||||||
subtitle: string;
|
|
||||||
category: string;
|
|
||||||
value: string;
|
|
||||||
buttons?: ButtonConfig[];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface MetricCardTenProps {
|
export default MetricCardTen;
|
||||||
metrics: Metric[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
subtitleClassName?: string;
|
|
||||||
categoryClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
footerClassName?: string;
|
|
||||||
cardButtonClassName?: string;
|
|
||||||
cardButtonTextClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MetricCardItemProps {
|
|
||||||
metric: Metric;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
defaultButtonVariant: CTAButtonVariant;
|
|
||||||
cardClassName?: string;
|
|
||||||
cardTitleClassName?: string;
|
|
||||||
subtitleClassName?: string;
|
|
||||||
categoryClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
footerClassName?: string;
|
|
||||||
cardButtonClassName?: string;
|
|
||||||
cardButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MetricCardItem = memo(({
|
|
||||||
metric,
|
|
||||||
shouldUseLightText,
|
|
||||||
defaultButtonVariant,
|
|
||||||
cardClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
subtitleClassName = "",
|
|
||||||
categoryClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
footerClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
}: MetricCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full card text-foreground rounded-theme-capped flex flex-col", cardClassName)}>
|
|
||||||
<div className="flex flex-col gap-6 p-6 flex-1">
|
|
||||||
<div className="flex flex-col gap-1">
|
|
||||||
<h3 className={cls(
|
|
||||||
"text-2xl md:text-3xl font-medium leading-tight truncate",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
cardTitleClassName
|
|
||||||
)}>
|
|
||||||
{metric.title}
|
|
||||||
</h3>
|
|
||||||
<p className={cls(
|
|
||||||
"text-base md:text-lg",
|
|
||||||
shouldUseLightText ? "text-background/75" : "text-foreground/75",
|
|
||||||
subtitleClassName
|
|
||||||
)}>
|
|
||||||
{metric.subtitle}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex items-center justify-between gap-2 mt-auto">
|
|
||||||
<div className="flex items-center gap-2 min-w-0 flex-1">
|
|
||||||
<span className="h-[var(--text-base)] w-auto aspect-square rounded-theme shrink-0 bg-accent" />
|
|
||||||
<span className={cls(
|
|
||||||
"text-base truncate",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
categoryClassName
|
|
||||||
)}>
|
|
||||||
{metric.category}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<span className={cls(
|
|
||||||
"text-xl md:text-2xl font-medium",
|
|
||||||
shouldUseLightText ? "text-background" : "text-foreground",
|
|
||||||
valueClassName
|
|
||||||
)}>
|
|
||||||
{metric.value}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{metric.buttons && metric.buttons.length > 0 && (
|
|
||||||
<div className={cls("bg-background-accent/50 p-4 rounded-b-theme-capped", footerClassName)}>
|
|
||||||
<div className="flex flex-wrap gap-4 max-md:justify-center">
|
|
||||||
{metric.buttons.slice(0, 2).map((button, index) => (
|
|
||||||
<Button key={`${button.text}-${index}`} {...getButtonProps(button, index, defaultButtonVariant, cardButtonClassName, cardButtonTextClassName)} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
MetricCardItem.displayName = "MetricCardItem";
|
|
||||||
|
|
||||||
const MetricCardTen = ({
|
|
||||||
metrics,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Metrics section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardTitleClassName = "",
|
|
||||||
subtitleClassName = "",
|
|
||||||
categoryClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
footerClassName = "",
|
|
||||||
cardButtonClassName = "",
|
|
||||||
cardButtonTextClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: MetricCardTenProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
carouselThreshold={4}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
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}
|
|
||||||
carouselItemClassName="!w-carousel-item-3"
|
|
||||||
>
|
|
||||||
{metrics.map((metric, index) => (
|
|
||||||
<MetricCardItem
|
|
||||||
key={`${metric.id}-${index}`}
|
|
||||||
metric={metric}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
defaultButtonVariant={theme.defaultButtonVariant}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
cardTitleClassName={cardTitleClassName}
|
|
||||||
subtitleClassName={subtitleClassName}
|
|
||||||
categoryClassName={categoryClassName}
|
|
||||||
valueClassName={valueClassName}
|
|
||||||
footerClassName={footerClassName}
|
|
||||||
cardButtonClassName={cardButtonClassName}
|
|
||||||
cardButtonTextClassName={cardButtonTextClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
MetricCardTen.displayName = "MetricCardTen";
|
|
||||||
|
|
||||||
export default MetricCardTen;
|
|
||||||
@@ -1,186 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type MetricCardThreeProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type Metric = {
|
export const MetricCardThree: React.FC<MetricCardThreeProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
icon: LucideIcon;
|
|
||||||
title: string;
|
|
||||||
value: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface MetricCardThreeProps {
|
|
||||||
metrics: Metric[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
iconContainerClassName?: string;
|
|
||||||
iconClassName?: string;
|
|
||||||
metricTitleClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MetricCardItemProps {
|
|
||||||
metric: Metric;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
iconContainerClassName?: string;
|
|
||||||
iconClassName?: string;
|
|
||||||
metricTitleClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MetricCardItem = memo(({
|
|
||||||
metric,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
iconContainerClassName = "",
|
|
||||||
iconClassName = "",
|
|
||||||
metricTitleClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
}: MetricCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full card text-foreground rounded-theme-capped p-6 flex flex-col items-center justify-center gap-3", cardClassName)}>
|
|
||||||
<div className="relative z-1 w-full flex items-center justify-center gap-2">
|
|
||||||
<div className={cls("h-8 primary-button aspect-square rounded-theme flex items-center justify-center", iconContainerClassName)}>
|
|
||||||
<metric.icon className={cls("h-4/10 text-primary-cta-text", iconClassName)} strokeWidth={1.5} />
|
|
||||||
</div>
|
|
||||||
<h3 className={cls("text-xl truncate", shouldUseLightText ? "text-background" : "text-foreground", metricTitleClassName)}>
|
|
||||||
{metric.title}
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<div className="relative z-1 w-full flex items-center justify-center">
|
|
||||||
<h4 className={cls("text-7xl font-medium truncate", shouldUseLightText ? "text-background" : "text-foreground", valueClassName)}>
|
|
||||||
{metric.value}
|
|
||||||
</h4>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
MetricCardItem.displayName = "MetricCardItem";
|
|
||||||
|
|
||||||
const MetricCardThree = ({
|
|
||||||
metrics,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses = "min-h-70 2xl:min-h-80",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Metrics section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
iconContainerClassName = "",
|
|
||||||
iconClassName = "",
|
|
||||||
metricTitleClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: MetricCardThreeProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{metrics.map((metric, index) => (
|
|
||||||
<MetricCardItem
|
|
||||||
key={`${metric.id}-${index}`}
|
|
||||||
metric={metric}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
iconContainerClassName={iconContainerClassName}
|
|
||||||
iconClassName={iconClassName}
|
|
||||||
metricTitleClassName={metricTitleClassName}
|
|
||||||
valueClassName={valueClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
MetricCardThree.displayName = "MetricCardThree";
|
|
||||||
|
|
||||||
export default MetricCardThree;
|
export default MetricCardThree;
|
||||||
@@ -1,183 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type MetricCardTwoProps = Omit<CardStackProps, 'gridRowsClassName'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type MetricCardTwoGridVariant = Extract<GridVariant, "uniform-all-items-equal" | "bento-grid" | "bento-grid-inverted">;
|
export const MetricCardTwo: React.FC<MetricCardTwoProps> = (props) => {
|
||||||
|
return <CardStack {...props} />;
|
||||||
type Metric = {
|
|
||||||
id: string;
|
|
||||||
value: string;
|
|
||||||
description: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface MetricCardTwoProps {
|
export default MetricCardTwo;
|
||||||
metrics: Metric[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: MetricCardTwoGridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
metricDescriptionClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MetricCardItemProps {
|
|
||||||
metric: Metric;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
valueClassName?: string;
|
|
||||||
metricDescriptionClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MetricCardItem = memo(({
|
|
||||||
metric,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
metricDescriptionClassName = "",
|
|
||||||
}: MetricCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full card text-foreground rounded-theme-capped p-6 flex flex-col justify-between", cardClassName)}>
|
|
||||||
<h3 className={cls("relative z-1 text-9xl md:text-7xl font-medium truncate", shouldUseLightText ? "text-background" : "text-foreground", valueClassName)}>
|
|
||||||
{metric.value}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("relative z-1 text-xl", shouldUseLightText ? "text-background" : "text-foreground", metricDescriptionClassName)}>
|
|
||||||
{metric.description}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
MetricCardItem.displayName = "MetricCardItem";
|
|
||||||
|
|
||||||
const MetricCardTwo = ({
|
|
||||||
metrics,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Metrics section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
valueClassName = "",
|
|
||||||
metricDescriptionClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: MetricCardTwoProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const customUniformHeight = gridVariant === "uniform-all-items-equal"
|
|
||||||
? "min-h-70 2xl:min-h-80"
|
|
||||||
: uniformGridCustomHeightClasses;
|
|
||||||
|
|
||||||
const customGridRows = (gridVariant === "bento-grid" || gridVariant === "bento-grid-inverted")
|
|
||||||
? "md:grid-rows-[14rem_14rem] 2xl:grid-rows-[17rem_17rem]"
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={customUniformHeight}
|
|
||||||
gridRowsClassName={customGridRows}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
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}
|
|
||||||
carouselThreshold={4}
|
|
||||||
carouselItemClassName="w-carousel-item-3!"
|
|
||||||
>
|
|
||||||
{metrics.map((metric, index) => (
|
|
||||||
<MetricCardItem
|
|
||||||
key={`${metric.id}-${index}`}
|
|
||||||
metric={metric}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
valueClassName={valueClassName}
|
|
||||||
metricDescriptionClassName={metricDescriptionClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
MetricCardTwo.displayName = "MetricCardTwo";
|
|
||||||
|
|
||||||
export default MetricCardTwo;
|
|
||||||
@@ -1,206 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type PricingCardOneProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import PricingBadge from "@/components/shared/PricingBadge";
|
|
||||||
import PricingFeatureList from "@/components/shared/PricingFeatureList";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type PricingPlan = {
|
export const PricingCardOne: React.FC<PricingCardOneProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
badge: string;
|
|
||||||
badgeIcon?: LucideIcon;
|
|
||||||
price: string;
|
|
||||||
subtitle: string;
|
|
||||||
features: string[];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface PricingCardOneProps {
|
export default PricingCardOne;
|
||||||
plans: PricingPlan[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
badgeClassName?: string;
|
|
||||||
priceClassName?: string;
|
|
||||||
subtitleClassName?: string;
|
|
||||||
featuresClassName?: string;
|
|
||||||
featureItemClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PricingCardItemProps {
|
|
||||||
plan: PricingPlan;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
badgeClassName?: string;
|
|
||||||
priceClassName?: string;
|
|
||||||
subtitleClassName?: string;
|
|
||||||
featuresClassName?: string;
|
|
||||||
featureItemClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const PricingCardItem = memo(({
|
|
||||||
plan,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
badgeClassName = "",
|
|
||||||
priceClassName = "",
|
|
||||||
subtitleClassName = "",
|
|
||||||
featuresClassName = "",
|
|
||||||
featureItemClassName = "",
|
|
||||||
}: PricingCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full card text-foreground rounded-theme-capped p-6 flex flex-col gap-6 md:gap-8", cardClassName)}>
|
|
||||||
<PricingBadge
|
|
||||||
badge={plan.badge}
|
|
||||||
badgeIcon={plan.badgeIcon}
|
|
||||||
className={badgeClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex flex-col gap-1">
|
|
||||||
<div className={cls("text-5xl font-medium", shouldUseLightText ? "text-background" : "text-foreground", priceClassName)}>
|
|
||||||
{plan.price}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p className={cls("text-base", shouldUseLightText ? "text-background" : "text-foreground", subtitleClassName)}>
|
|
||||||
{plan.subtitle}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative z-1 w-full h-px bg-foreground/20" />
|
|
||||||
|
|
||||||
<PricingFeatureList
|
|
||||||
features={plan.features}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
className={cls("mt-1", featuresClassName)}
|
|
||||||
featureItemClassName={featureItemClassName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
PricingCardItem.displayName = "PricingCardItem";
|
|
||||||
|
|
||||||
const PricingCardOne = ({
|
|
||||||
plans,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Pricing section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
badgeClassName = "",
|
|
||||||
priceClassName = "",
|
|
||||||
subtitleClassName = "",
|
|
||||||
featuresClassName = "",
|
|
||||||
featureItemClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: PricingCardOneProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
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}
|
|
||||||
featuresClassName={featuresClassName}
|
|
||||||
featureItemClassName={featureItemClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
PricingCardOne.displayName = "PricingCardOne";
|
|
||||||
|
|
||||||
export default PricingCardOne;
|
|
||||||
@@ -1,247 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type PricingCardThreeProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import PricingFeatureList from "@/components/shared/PricingFeatureList";
|
|
||||||
import Button from "@/components/button/Button";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type PricingPlan = {
|
export const PricingCardThree: React.FC<PricingCardThreeProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
badge?: string;
|
|
||||||
badgeIcon?: LucideIcon;
|
|
||||||
price: string;
|
|
||||||
name: string;
|
|
||||||
buttons: ButtonConfig[];
|
|
||||||
features: string[];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface PricingCardThreeProps {
|
export default PricingCardThree;
|
||||||
plans: PricingPlan[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
badgeClassName?: string;
|
|
||||||
priceClassName?: string;
|
|
||||||
nameClassName?: 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 {
|
|
||||||
plan: PricingPlan;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
badgeClassName?: string;
|
|
||||||
priceClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
planButtonContainerClassName?: string;
|
|
||||||
planButtonClassName?: string;
|
|
||||||
featuresClassName?: string;
|
|
||||||
featureItemClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const PricingCardItem = memo(({
|
|
||||||
plan,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
badgeClassName = "",
|
|
||||||
priceClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
planButtonContainerClassName = "",
|
|
||||||
planButtonClassName = "",
|
|
||||||
featuresClassName = "",
|
|
||||||
featureItemClassName = "",
|
|
||||||
}: PricingCardItemProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
const getButtonConfigProps = () => {
|
|
||||||
if (theme.defaultButtonVariant === "hover-bubble") {
|
|
||||||
return { bgClassName: "w-full" };
|
|
||||||
}
|
|
||||||
if (theme.defaultButtonVariant === "icon-arrow") {
|
|
||||||
return { className: "justify-between" };
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="relative h-full flex flex-col">
|
|
||||||
<div className={cls("px-4 py-3 primary-button rounded-t-theme-capped rounded-b-none text-base text-primary-cta-text whitespace-nowrap z-10 flex items-center justify-center gap-2", plan.badge ? "visible" : "invisible", badgeClassName)}>
|
|
||||||
{plan.badgeIcon && <plan.badgeIcon className="inline h-[1em] w-auto" />}
|
|
||||||
{plan.badge || "placeholder"}
|
|
||||||
</div>
|
|
||||||
<div className={cls("relative min-h-0 h-full card text-foreground p-6 flex flex-col justify-between items-center gap-6 md:gap-8", plan.badge ? "rounded-t-none rounded-b-theme-capped" : "rounded-theme-capped", cardClassName)}>
|
|
||||||
<div className="flex flex-col items-center gap-6 md:gap-8" >
|
|
||||||
<div className="relative z-1 flex flex-col gap-2 text-center">
|
|
||||||
<div className={cls("text-5xl font-medium", shouldUseLightText ? "text-background" : "text-foreground", priceClassName)}>
|
|
||||||
{plan.price}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3 className={cls("text-xl font-medium leading-[1.1]", shouldUseLightText ? "text-background" : "text-foreground", nameClassName)}>
|
|
||||||
{plan.name}
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative z-1 w-full h-px bg-foreground/10" />
|
|
||||||
|
|
||||||
<PricingFeatureList
|
|
||||||
features={plan.features}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
className={featuresClassName}
|
|
||||||
featureItemClassName={featureItemClassName}
|
|
||||||
/>
|
|
||||||
</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>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
PricingCardItem.displayName = "PricingCardItem";
|
|
||||||
|
|
||||||
const PricingCardThree = ({
|
|
||||||
plans,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Pricing section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
badgeClassName = "",
|
|
||||||
priceClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
planButtonContainerClassName = "",
|
|
||||||
planButtonClassName = "",
|
|
||||||
featuresClassName = "",
|
|
||||||
featureItemClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: PricingCardThreeProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
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}
|
|
||||||
nameClassName={nameClassName}
|
|
||||||
planButtonContainerClassName={planButtonContainerClassName}
|
|
||||||
planButtonClassName={planButtonClassName}
|
|
||||||
featuresClassName={featuresClassName}
|
|
||||||
featureItemClassName={featureItemClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
PricingCardThree.displayName = "PricingCardThree";
|
|
||||||
|
|
||||||
export default PricingCardThree;
|
|
||||||
@@ -1,246 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type PricingCardTwoProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import PricingBadge from "@/components/shared/PricingBadge";
|
|
||||||
import PricingFeatureList from "@/components/shared/PricingFeatureList";
|
|
||||||
import Button from "@/components/button/Button";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type PricingPlan = {
|
export const PricingCardTwo: React.FC<PricingCardTwoProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
badge: string;
|
|
||||||
badgeIcon?: LucideIcon;
|
|
||||||
price: string;
|
|
||||||
subtitle: string;
|
|
||||||
buttons: ButtonConfig[];
|
|
||||||
features: string[];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface PricingCardTwoProps {
|
export default PricingCardTwo;
|
||||||
plans: PricingPlan[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
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 {
|
|
||||||
plan: PricingPlan;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
badgeClassName?: string;
|
|
||||||
priceClassName?: string;
|
|
||||||
subtitleClassName?: string;
|
|
||||||
planButtonContainerClassName?: string;
|
|
||||||
planButtonClassName?: string;
|
|
||||||
featuresClassName?: string;
|
|
||||||
featureItemClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const PricingCardItem = memo(({
|
|
||||||
plan,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
badgeClassName = "",
|
|
||||||
priceClassName = "",
|
|
||||||
subtitleClassName = "",
|
|
||||||
planButtonContainerClassName = "",
|
|
||||||
planButtonClassName = "",
|
|
||||||
featuresClassName = "",
|
|
||||||
featureItemClassName = "",
|
|
||||||
}: PricingCardItemProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
const getButtonConfigProps = () => {
|
|
||||||
if (theme.defaultButtonVariant === "hover-bubble") {
|
|
||||||
return { bgClassName: "w-full" };
|
|
||||||
}
|
|
||||||
if (theme.defaultButtonVariant === "icon-arrow") {
|
|
||||||
return { className: "justify-between" };
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full card text-foreground rounded-theme-capped p-6 flex flex-col items-center gap-6 md:gap-8", cardClassName)}>
|
|
||||||
<PricingBadge
|
|
||||||
badge={plan.badge}
|
|
||||||
badgeIcon={plan.badgeIcon}
|
|
||||||
className={badgeClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex flex-col gap-1 text-center">
|
|
||||||
<div className={cls("text-5xl font-medium", shouldUseLightText ? "text-background" : "text-foreground", priceClassName)}>
|
|
||||||
{plan.price}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p className={cls("text-base", shouldUseLightText ? "text-background" : "text-foreground", subtitleClassName)}>
|
|
||||||
{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 className="relative z-1 w-full h-px bg-foreground/10 my-3" />
|
|
||||||
|
|
||||||
<PricingFeatureList
|
|
||||||
features={plan.features}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
className={featuresClassName}
|
|
||||||
featureItemClassName={featureItemClassName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
PricingCardItem.displayName = "PricingCardItem";
|
|
||||||
|
|
||||||
const PricingCardTwo = ({
|
|
||||||
plans,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
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 = "",
|
|
||||||
}: PricingCardTwoProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
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>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
PricingCardTwo.displayName = "PricingCardTwo";
|
|
||||||
|
|
||||||
export default PricingCardTwo;
|
|
||||||
@@ -1,238 +1,20 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo, useCallback } from "react";
|
export interface ProductCard {
|
||||||
import { useRouter } from "next/navigation";
|
id: string;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
name: string;
|
||||||
import ProductImage from "@/components/shared/ProductImage";
|
price: string;
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
imageSrc: string;
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
imageAlt?: string;
|
||||||
import { useProducts } from "@/hooks/useProducts";
|
rating?: number;
|
||||||
import type { Product } from "@/lib/api/product";
|
reviewCount?: string;
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type ProductCardFourGridVariant = Exclude<GridVariant, "timeline" | "items-top-row-full-width-bottom" | "full-width-top-items-bottom-row">;
|
|
||||||
|
|
||||||
type ProductCard = Product & {
|
|
||||||
variant: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface ProductCardFourProps {
|
|
||||||
products?: ProductCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: ProductCardFourGridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
imageClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardNameClassName?: string;
|
|
||||||
cardPriceClassName?: string;
|
|
||||||
cardVariantClassName?: string;
|
|
||||||
actionButtonClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ProductCardItemProps {
|
type ProductCardFourProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
product: ProductCard;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
cardNameClassName?: string;
|
|
||||||
cardPriceClassName?: string;
|
|
||||||
cardVariantClassName?: string;
|
|
||||||
actionButtonClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ProductCardItem = memo(({
|
export const ProductCardFour: React.FC<ProductCardFourProps> = (props) => {
|
||||||
product,
|
return <CardStack {...props} />;
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
cardNameClassName = "",
|
|
||||||
cardPriceClassName = "",
|
|
||||||
cardVariantClassName = "",
|
|
||||||
actionButtonClassName = "",
|
|
||||||
}: ProductCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls("card group relative h-full flex flex-col gap-4 cursor-pointer p-4 rounded-theme-capped", cardClassName)}
|
|
||||||
onClick={product.onProductClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={`${product.name} - ${product.price}`}
|
|
||||||
>
|
|
||||||
<ProductImage
|
|
||||||
imageSrc={product.imageSrc}
|
|
||||||
imageAlt={product.imageAlt || product.name}
|
|
||||||
isFavorited={product.isFavorited}
|
|
||||||
onFavoriteToggle={product.onFavorite}
|
|
||||||
showActionButton={true}
|
|
||||||
actionButtonAriaLabel={`View ${product.name} details`}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
actionButtonClassName={actionButtonClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="flex flex-col gap-2">
|
|
||||||
<div className="flex items-center justify-between gap-4">
|
|
||||||
<div className="flex flex-col gap-0 flex-1 min-w-0">
|
|
||||||
<h3 className={cls("text-base font-medium leading-[1.3]", shouldUseLightText ? "text-background" : "text-foreground", cardNameClassName)}>
|
|
||||||
{product.name}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("text-sm leading-[1.3]", shouldUseLightText ? "text-background/60" : "text-foreground/60", cardVariantClassName)}>
|
|
||||||
{product.variant}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<p className={cls("text-base font-medium leading-[1.3] flex-shrink-0", shouldUseLightText ? "text-background" : "text-foreground", cardPriceClassName)}>
|
|
||||||
{product.price}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
ProductCardItem.displayName = "ProductCardItem";
|
|
||||||
|
|
||||||
const ProductCardFour = ({
|
|
||||||
products: productsProp,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Product section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardNameClassName = "",
|
|
||||||
cardPriceClassName = "",
|
|
||||||
cardVariantClassName = "",
|
|
||||||
actionButtonClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: ProductCardFourProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const router = useRouter();
|
|
||||||
const { products: fetchedProducts, isLoading } = useProducts();
|
|
||||||
const isFromApi = fetchedProducts.length > 0;
|
|
||||||
const products = (isFromApi ? fetchedProducts : productsProp) as ProductCard[];
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const handleProductClick = useCallback((product: ProductCard) => {
|
|
||||||
if (isFromApi) {
|
|
||||||
router.push(`/shop/${product.id}`);
|
|
||||||
} else {
|
|
||||||
product.onProductClick?.();
|
|
||||||
}
|
|
||||||
}, [isFromApi, router]);
|
|
||||||
|
|
||||||
|
|
||||||
if (isLoading && !productsProp) {
|
|
||||||
return (
|
|
||||||
<div className="w-content-width mx-auto py-20 text-center">
|
|
||||||
<p className="text-foreground">Loading products...</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!products || products.length === 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{products?.map((product, index) => (
|
|
||||||
<ProductCardItem
|
|
||||||
key={`${product.id}-${index}`}
|
|
||||||
product={{ ...product, onProductClick: () => handleProductClick(product) }}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
cardNameClassName={cardNameClassName}
|
|
||||||
cardPriceClassName={cardPriceClassName}
|
|
||||||
cardVariantClassName={cardVariantClassName}
|
|
||||||
actionButtonClassName={actionButtonClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ProductCardFour.displayName = "ProductCardFour";
|
export default ProductCardFour;
|
||||||
|
|
||||||
export default ProductCardFour;
|
|
||||||
@@ -1,226 +1,20 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo, useCallback } from "react";
|
export interface Product {
|
||||||
import { useRouter } from "next/navigation";
|
id: string;
|
||||||
import { ArrowUpRight } from "lucide-react";
|
name: string;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
price: string;
|
||||||
import ProductImage from "@/components/shared/ProductImage";
|
imageSrc: string;
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
imageAlt?: string;
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
rating?: number;
|
||||||
import { useProducts } from "@/hooks/useProducts";
|
reviewCount?: string;
|
||||||
import type { Product } from "@/lib/api/product";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type ProductCardOneGridVariant = Exclude<GridVariant, "timeline">;
|
|
||||||
|
|
||||||
type ProductCard = Product;
|
|
||||||
|
|
||||||
interface ProductCardOneProps {
|
|
||||||
products?: ProductCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: ProductCardOneGridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
imageClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardNameClassName?: string;
|
|
||||||
cardPriceClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ProductCardItemProps {
|
type ProductCardOneProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
product: ProductCard;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
cardNameClassName?: string;
|
|
||||||
cardPriceClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ProductCardItem = memo(({
|
export const ProductCardOne: React.FC<ProductCardOneProps> = (props) => {
|
||||||
product,
|
return <CardStack {...props} />;
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
cardNameClassName = "",
|
|
||||||
cardPriceClassName = "",
|
|
||||||
}: ProductCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls("card group relative h-full flex flex-col gap-4 cursor-pointer p-4 rounded-theme-capped", cardClassName)}
|
|
||||||
onClick={product.onProductClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={`${product.name} - ${product.price}`}
|
|
||||||
>
|
|
||||||
<ProductImage
|
|
||||||
imageSrc={product.imageSrc}
|
|
||||||
imageAlt={product.imageAlt || product.name}
|
|
||||||
isFavorited={product.isFavorited}
|
|
||||||
onFavoriteToggle={product.onFavorite}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex items-center justify-between gap-4">
|
|
||||||
<div className="flex-1 min-w-0">
|
|
||||||
<h3 className={cls("text-base font-medium truncate leading-[1.3]", shouldUseLightText ? "text-background" : "text-foreground", cardNameClassName)}>
|
|
||||||
{product.name}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("text-2xl font-medium leading-[1.3]", shouldUseLightText ? "text-background" : "text-foreground", cardPriceClassName)}>
|
|
||||||
{product.price}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button
|
|
||||||
className="relative cursor-pointer primary-button h-10 w-auto aspect-square rounded-theme flex items-center justify-center flex-shrink-0"
|
|
||||||
aria-label={`View ${product.name} details`}
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<ArrowUpRight className="h-4/10 text-primary-cta-text transition-transform duration-300 group-hover:rotate-45" strokeWidth={1.5} />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
ProductCardItem.displayName = "ProductCardItem";
|
|
||||||
|
|
||||||
const ProductCardOne = ({
|
|
||||||
products: productsProp,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Product section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardNameClassName = "",
|
|
||||||
cardPriceClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: ProductCardOneProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const router = useRouter();
|
|
||||||
const { products: fetchedProducts, isLoading } = useProducts();
|
|
||||||
const isFromApi = fetchedProducts.length > 0;
|
|
||||||
const products = isFromApi ? fetchedProducts : productsProp;
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const handleProductClick = useCallback((product: ProductCard) => {
|
|
||||||
if (isFromApi) {
|
|
||||||
router.push(`/shop/${product.id}`);
|
|
||||||
} else {
|
|
||||||
product.onProductClick?.();
|
|
||||||
}
|
|
||||||
}, [isFromApi, router]);
|
|
||||||
|
|
||||||
if (isLoading && !productsProp) {
|
|
||||||
return (
|
|
||||||
<div className="w-content-width mx-auto py-20 text-center">
|
|
||||||
<p className="text-foreground">Loading products...</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!products || products.length === 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{products?.map((product, index) => (
|
|
||||||
<ProductCardItem
|
|
||||||
key={`${product.id}-${index}`}
|
|
||||||
product={{ ...product, onProductClick: () => handleProductClick(product) }}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
cardNameClassName={cardNameClassName}
|
|
||||||
cardPriceClassName={cardPriceClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ProductCardOne.displayName = "ProductCardOne";
|
export default ProductCardOne;
|
||||||
|
|
||||||
export default ProductCardOne;
|
|
||||||
@@ -1,283 +1,20 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo, useState, useCallback } from "react";
|
export interface ProductCard {
|
||||||
import { useRouter } from "next/navigation";
|
id: string;
|
||||||
import { Plus, Minus } from "lucide-react";
|
name: string;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
price: string;
|
||||||
import ProductImage from "@/components/shared/ProductImage";
|
imageSrc: string;
|
||||||
import QuantityButton from "@/components/shared/QuantityButton";
|
imageAlt?: string;
|
||||||
import Button from "@/components/button/Button";
|
rating?: number;
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
reviewCount?: string;
|
||||||
import { useProducts } from "@/hooks/useProducts";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import type { Product } from "@/lib/api/product";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, ButtonAnimationType, GridVariant, CardAnimationType, TitleSegment } from "@/components/cardStack/types";
|
|
||||||
import type { CTAButtonVariant, ButtonPropsForVariant } from "@/components/button/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type ProductCardThreeGridVariant = Exclude<GridVariant, "timeline" | "items-top-row-full-width-bottom" | "full-width-top-items-bottom-row">;
|
|
||||||
|
|
||||||
type ProductCard = Product & {
|
|
||||||
onQuantityChange?: (quantity: number) => void;
|
|
||||||
initialQuantity?: number;
|
|
||||||
priceButtonProps?: Partial<ButtonPropsForVariant<CTAButtonVariant>>;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface ProductCardThreeProps {
|
|
||||||
products?: ProductCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: ProductCardThreeGridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
imageClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardNameClassName?: string;
|
|
||||||
quantityControlsClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ProductCardThreeProps = Omit<CardStackProps, 'titleSegments'>;
|
||||||
|
|
||||||
interface ProductCardItemProps {
|
export const ProductCardThree: React.FC<ProductCardThreeProps> = (props) => {
|
||||||
product: ProductCard;
|
return <CardStack {...props} />;
|
||||||
shouldUseLightText: boolean;
|
|
||||||
isFromApi: boolean;
|
|
||||||
onBuyClick?: (productId: string, quantity: number) => void;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
cardNameClassName?: string;
|
|
||||||
quantityControlsClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ProductCardItem = memo(({
|
|
||||||
product,
|
|
||||||
shouldUseLightText,
|
|
||||||
isFromApi,
|
|
||||||
onBuyClick,
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
cardNameClassName = "",
|
|
||||||
quantityControlsClassName = "",
|
|
||||||
}: ProductCardItemProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const [quantity, setQuantity] = useState(product.initialQuantity || 1);
|
|
||||||
|
|
||||||
const handleIncrement = useCallback((e: React.MouseEvent) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
const newQuantity = quantity + 1;
|
|
||||||
setQuantity(newQuantity);
|
|
||||||
product.onQuantityChange?.(newQuantity);
|
|
||||||
}, [quantity, product]);
|
|
||||||
|
|
||||||
const handleDecrement = useCallback((e: React.MouseEvent) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
if (quantity > 1) {
|
|
||||||
const newQuantity = quantity - 1;
|
|
||||||
setQuantity(newQuantity);
|
|
||||||
product.onQuantityChange?.(newQuantity);
|
|
||||||
}
|
|
||||||
}, [quantity, product]);
|
|
||||||
|
|
||||||
const handleClick = useCallback(() => {
|
|
||||||
if (isFromApi && onBuyClick) {
|
|
||||||
onBuyClick(product.id, quantity);
|
|
||||||
} else {
|
|
||||||
product.onProductClick?.();
|
|
||||||
}
|
|
||||||
}, [isFromApi, onBuyClick, product, quantity]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls("card group relative h-full flex flex-col gap-4 cursor-pointer p-4 rounded-theme-capped", cardClassName)}
|
|
||||||
onClick={handleClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={`${product.name} - ${product.price}`}
|
|
||||||
>
|
|
||||||
<ProductImage
|
|
||||||
imageSrc={product.imageSrc}
|
|
||||||
imageAlt={product.imageAlt || product.name}
|
|
||||||
isFavorited={product.isFavorited}
|
|
||||||
onFavoriteToggle={product.onFavorite}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex flex-col gap-3">
|
|
||||||
<h3 className={cls("text-xl font-medium leading-[1.15] truncate", shouldUseLightText ? "text-background" : "text-foreground", cardNameClassName)}>
|
|
||||||
{product.name}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div className="flex items-center justify-between gap-4">
|
|
||||||
<div className={cls("flex items-center gap-2", quantityControlsClassName)}>
|
|
||||||
<QuantityButton
|
|
||||||
onClick={handleDecrement}
|
|
||||||
ariaLabel="Decrease quantity"
|
|
||||||
Icon={Minus}
|
|
||||||
/>
|
|
||||||
<span className={cls("text-base font-medium min-w-[2ch] text-center leading-[1]", shouldUseLightText ? "text-background" : "text-foreground")}>
|
|
||||||
{quantity}
|
|
||||||
</span>
|
|
||||||
<QuantityButton
|
|
||||||
onClick={handleIncrement}
|
|
||||||
ariaLabel="Increase quantity"
|
|
||||||
Icon={Plus}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
{...getButtonProps(
|
|
||||||
{
|
|
||||||
text: product.price,
|
|
||||||
props: product.priceButtonProps,
|
|
||||||
},
|
|
||||||
0,
|
|
||||||
theme.defaultButtonVariant
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
ProductCardItem.displayName = "ProductCardItem";
|
|
||||||
|
|
||||||
const ProductCardThree = ({
|
|
||||||
products: productsProp,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Product section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardNameClassName = "",
|
|
||||||
quantityControlsClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: ProductCardThreeProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const router = useRouter();
|
|
||||||
const { products: fetchedProducts, isLoading } = useProducts();
|
|
||||||
const isFromApi = fetchedProducts.length > 0;
|
|
||||||
const products = (isFromApi ? fetchedProducts : productsProp) as ProductCard[];
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const handleProductClick = useCallback((product: ProductCard) => {
|
|
||||||
if (isFromApi) {
|
|
||||||
router.push(`/shop/${product.id}`);
|
|
||||||
} else {
|
|
||||||
product.onProductClick?.();
|
|
||||||
}
|
|
||||||
}, [isFromApi, router]);
|
|
||||||
|
|
||||||
if (isLoading && !productsProp) {
|
|
||||||
return (
|
|
||||||
<div className="w-content-width mx-auto py-20 text-center">
|
|
||||||
<p className="text-foreground">Loading products...</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!products || products.length === 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{products?.map((product, index) => (
|
|
||||||
<ProductCardItem
|
|
||||||
key={`${product.id}-${index}`}
|
|
||||||
product={{ ...product, onProductClick: () => handleProductClick(product) }}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
isFromApi={isFromApi}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
cardNameClassName={cardNameClassName}
|
|
||||||
quantityControlsClassName={quantityControlsClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ProductCardThree.displayName = "ProductCardThree";
|
export default ProductCardThree;
|
||||||
|
|
||||||
export default ProductCardThree;
|
|
||||||
@@ -1,267 +1,20 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo, useCallback } from "react";
|
export interface ProductCard {
|
||||||
import { useRouter } from "next/navigation";
|
id: string;
|
||||||
import { Star } from "lucide-react";
|
name: string;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
price: string;
|
||||||
import ProductImage from "@/components/shared/ProductImage";
|
imageSrc: string;
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
imageAlt?: string;
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
rating?: number;
|
||||||
import { useProducts } from "@/hooks/useProducts";
|
reviewCount?: string;
|
||||||
import type { Product } from "@/lib/api/product";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type ProductCardTwoGridVariant = Exclude<GridVariant, "timeline" | "one-large-right-three-stacked-left" | "items-top-row-full-width-bottom" | "full-width-top-items-bottom-row" | "one-large-left-three-stacked-right">;
|
|
||||||
|
|
||||||
type ProductCard = Product & {
|
|
||||||
brand: string;
|
|
||||||
rating: number;
|
|
||||||
reviewCount: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface ProductCardTwoProps {
|
|
||||||
products?: ProductCard[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: ProductCardTwoGridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
imageClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
cardBrandClassName?: string;
|
|
||||||
cardNameClassName?: string;
|
|
||||||
cardPriceClassName?: string;
|
|
||||||
cardRatingClassName?: string;
|
|
||||||
actionButtonClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ProductCardItemProps {
|
type ProductCardTwoProps = Omit<CardStackProps, 'gridRowsClassName'>;
|
||||||
product: ProductCard;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
cardBrandClassName?: string;
|
|
||||||
cardNameClassName?: string;
|
|
||||||
cardPriceClassName?: string;
|
|
||||||
cardRatingClassName?: string;
|
|
||||||
actionButtonClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ProductCardItem = memo(({
|
export const ProductCardTwo: React.FC<ProductCardTwoProps> = (props) => {
|
||||||
product,
|
return <CardStack {...props} />;
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
cardBrandClassName = "",
|
|
||||||
cardNameClassName = "",
|
|
||||||
cardPriceClassName = "",
|
|
||||||
cardRatingClassName = "",
|
|
||||||
actionButtonClassName = "",
|
|
||||||
}: ProductCardItemProps) => {
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={cls("card group relative h-full flex flex-col gap-4 cursor-pointer p-4 rounded-theme-capped", cardClassName)}
|
|
||||||
onClick={product.onProductClick}
|
|
||||||
role="article"
|
|
||||||
aria-label={`${product.brand} ${product.name} - ${product.price}`}
|
|
||||||
>
|
|
||||||
<ProductImage
|
|
||||||
imageSrc={product.imageSrc}
|
|
||||||
imageAlt={product.imageAlt || `${product.brand} ${product.name}`}
|
|
||||||
isFavorited={product.isFavorited}
|
|
||||||
onFavoriteToggle={product.onFavorite}
|
|
||||||
showActionButton={true}
|
|
||||||
actionButtonAriaLabel={`View ${product.name} details`}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
actionButtonClassName={actionButtonClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex-1 min-w-0 flex flex-col gap-2">
|
|
||||||
<p className={cls("text-sm leading-[1]", shouldUseLightText ? "text-background" : "text-foreground", cardBrandClassName)}>
|
|
||||||
{product.brand}
|
|
||||||
</p>
|
|
||||||
<div className="flex flex-col gap-1" >
|
|
||||||
<h3 className={cls("text-xl font-medium truncate leading-[1.15]", shouldUseLightText ? "text-background" : "text-foreground", cardNameClassName)}>
|
|
||||||
{product.name}
|
|
||||||
</h3>
|
|
||||||
<div className={cls("flex items-center gap-2", cardRatingClassName)}>
|
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
{[...Array(5)].map((_, i) => (
|
|
||||||
<Star
|
|
||||||
key={i}
|
|
||||||
className={cls(
|
|
||||||
"h-4 w-auto",
|
|
||||||
i < Math.floor(product.rating)
|
|
||||||
? "text-accent fill-accent"
|
|
||||||
: "text-accent opacity-20"
|
|
||||||
)}
|
|
||||||
strokeWidth={1.5}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<span className={cls("text-sm leading-[1.3]", shouldUseLightText ? "text-background" : "text-foreground")}>
|
|
||||||
({product.reviewCount})
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p className={cls("text-2xl font-medium leading-[1.3]", shouldUseLightText ? "text-background" : "text-foreground", cardPriceClassName)}>
|
|
||||||
{product.price}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
ProductCardItem.displayName = "ProductCardItem";
|
|
||||||
|
|
||||||
const ProductCardTwo = ({
|
|
||||||
products: productsProp,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Product section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
cardBrandClassName = "",
|
|
||||||
cardNameClassName = "",
|
|
||||||
cardPriceClassName = "",
|
|
||||||
cardRatingClassName = "",
|
|
||||||
actionButtonClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: ProductCardTwoProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const router = useRouter();
|
|
||||||
const { products: fetchedProducts, isLoading } = useProducts();
|
|
||||||
const isFromApi = fetchedProducts.length > 0;
|
|
||||||
const products = (fetchedProducts.length > 0 ? fetchedProducts : productsProp) as ProductCard[];
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
const handleProductClick = useCallback((product: ProductCard) => {
|
|
||||||
if (isFromApi) {
|
|
||||||
router.push(`/shop/${product.id}`);
|
|
||||||
} else {
|
|
||||||
product.onProductClick?.();
|
|
||||||
}
|
|
||||||
}, [isFromApi, router]);
|
|
||||||
|
|
||||||
const customGridRows = (gridVariant === "bento-grid" || gridVariant === "bento-grid-inverted")
|
|
||||||
? "md:grid-rows-[22rem_22rem] 2xl:grid-rows-[26rem_26rem]"
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
if (isLoading && !productsProp) {
|
|
||||||
return (
|
|
||||||
<div className="w-content-width mx-auto py-20 text-center">
|
|
||||||
<p className="text-foreground">Loading products...</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!products || products.length === 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
gridRowsClassName={customGridRows}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{products?.map((product, index) => (
|
|
||||||
<ProductCardItem
|
|
||||||
key={`${product.id}-${index}`}
|
|
||||||
product={{ ...product, onProductClick: () => handleProductClick(product) }}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
cardBrandClassName={cardBrandClassName}
|
|
||||||
cardNameClassName={cardNameClassName}
|
|
||||||
cardPriceClassName={cardPriceClassName}
|
|
||||||
cardRatingClassName={cardRatingClassName}
|
|
||||||
actionButtonClassName={actionButtonClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ProductCardTwo.displayName = "ProductCardTwo";
|
export default ProductCardTwo;
|
||||||
|
|
||||||
export default ProductCardTwo;
|
|
||||||
@@ -1,148 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import CardStackTextBox from "@/components/cardStack/CardStackTextBox";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation";
|
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type TeamMember = {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
role: string;
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface TeamCardFiveProps {
|
interface TeamCardFiveProps {
|
||||||
team: TeamMember[];
|
children?: React.ReactNode;
|
||||||
animationType: CardAnimationType;
|
|
||||||
title: string;
|
|
||||||
titleSegments?: TitleSegment[];
|
|
||||||
description: string;
|
|
||||||
textboxLayout: TextboxLayout;
|
|
||||||
useInvertedBackground: InvertedBackground;
|
|
||||||
tag?: string;
|
|
||||||
tagIcon?: LucideIcon;
|
|
||||||
tagAnimation?: ButtonAnimationType;
|
|
||||||
buttons?: ButtonConfig[];
|
|
||||||
buttonAnimation?: ButtonAnimationType;
|
|
||||||
ariaLabel?: string;
|
|
||||||
className?: string;
|
className?: string;
|
||||||
containerClassName?: string;
|
|
||||||
textBoxTitleClassName?: string;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
cardClassName?: string;
|
|
||||||
mediaWrapperClassName?: string;
|
|
||||||
mediaClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TeamCardFive = ({
|
export const TeamCardFive: React.FC<TeamCardFiveProps> = ({ children, className }) => {
|
||||||
team,
|
return <div className={className}>{children}</div>;
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
ariaLabel = "Team section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
mediaWrapperClassName = "",
|
|
||||||
mediaClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
}: TeamCardFiveProps) => {
|
|
||||||
const { itemRefs } = useCardAnimation({ animationType, itemCount: team.length });
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
className={cls("relative py-20 w-full", useInvertedBackground && "bg-foreground", className)}
|
|
||||||
>
|
|
||||||
<div className={cls("w-content-width mx-auto flex flex-col gap-8", containerClassName)}>
|
|
||||||
<CardStackTextBox
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
textBoxClassName={textBoxClassName}
|
|
||||||
titleClassName={textBoxTitleClassName}
|
|
||||||
titleImageWrapperClassName={textBoxTitleImageWrapperClassName}
|
|
||||||
titleImageClassName={textBoxTitleImageClassName}
|
|
||||||
descriptionClassName={textBoxDescriptionClassName}
|
|
||||||
tagClassName={textBoxTagClassName}
|
|
||||||
buttonContainerClassName={textBoxButtonContainerClassName}
|
|
||||||
buttonClassName={textBoxButtonClassName}
|
|
||||||
buttonTextClassName={textBoxButtonTextClassName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={cls("flex flex-row flex-wrap gap-y-6 md:gap-x-0 justify-center", gridClassName)}>
|
|
||||||
{team.map((member, index) => (
|
|
||||||
<div
|
|
||||||
key={member.id}
|
|
||||||
ref={(el) => { itemRefs.current[index] = el; }}
|
|
||||||
className={cls("relative flex flex-col items-center text-center w-[55%] md:w-[28%] -mx-[4%] md:-mx-[2%]", cardClassName)}
|
|
||||||
>
|
|
||||||
<div className={cls("relative card w-full aspect-square rounded-theme overflow-hidden p-2 mb-4", mediaWrapperClassName)}>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={member.imageSrc}
|
|
||||||
videoSrc={member.videoSrc}
|
|
||||||
imageAlt={member.imageAlt || member.name}
|
|
||||||
videoAriaLabel={member.videoAriaLabel || member.name}
|
|
||||||
imageClassName={cls("relative z-1 w-full h-full object-cover rounded-theme!", mediaClassName)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<h3 className={cls("relative z-1 w-8/10 text-2xl font-medium leading-tight truncate", useInvertedBackground ? "text-background" : "text-foreground", nameClassName)}>
|
|
||||||
{member.name}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("relative z-1 w-8/10 text-base leading-tight mt-1 truncate", useInvertedBackground ? "text-background/75" : "text-foreground/75", roleClassName)}>
|
|
||||||
{member.role}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TeamCardFive.displayName = "TeamCardFive";
|
export default TeamCardFive;
|
||||||
|
|
||||||
export default TeamCardFive;
|
|
||||||
@@ -1,194 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type TeamCardOneProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type TeamCardOneGridVariant = Exclude<GridVariant, "timeline">;
|
export const TeamCardOne: React.FC<TeamCardOneProps> = (props) => {
|
||||||
|
return <CardStack {...props} />;
|
||||||
type TeamMember = {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
role: string;
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface TeamCardOneProps {
|
export default TeamCardOne;
|
||||||
members: TeamMember[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: TeamCardOneGridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
overlayClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TeamMemberCardProps {
|
|
||||||
member: TeamMember;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
overlayClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TeamMemberCard = memo(({
|
|
||||||
member,
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
overlayClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
}: TeamMemberCardProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full w-full max-w-full card rounded-theme-capped p-4 aspect-[8/10]", cardClassName)}>
|
|
||||||
<div className="relative z-1 w-full h-full rounded-theme-capped overflow-hidden">
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={member.imageSrc}
|
|
||||||
videoSrc={member.videoSrc}
|
|
||||||
imageAlt={member.imageAlt || member.name}
|
|
||||||
videoAriaLabel={member.videoAriaLabel || member.name}
|
|
||||||
imageClassName={cls("w-full h-full object-cover", imageClassName)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={cls("!absolute z-1 bottom-4 left-4 right-4 card backdrop-blur-xs p-4 rounded-theme-capped flex items-center justify-between gap-3", overlayClassName)}>
|
|
||||||
<h3 className={cls("relative z-1 text-xl font-medium text-foreground leading-[1.1] truncate", nameClassName)}>
|
|
||||||
{member.name}
|
|
||||||
</h3>
|
|
||||||
<div className="min-w-0 max-w-full w-fit primary-button px-3 py-2 rounded-theme">
|
|
||||||
<p className={cls("text-sm text-primary-cta-text leading-[1.1] truncate", roleClassName)}>
|
|
||||||
{member.role}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
TeamMemberCard.displayName = "TeamMemberCard";
|
|
||||||
|
|
||||||
const TeamCardOne = ({
|
|
||||||
members,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses = "min-h-none",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Team section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
overlayClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: TeamCardOneProps) => {
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{members.map((member, index) => (
|
|
||||||
<TeamMemberCard
|
|
||||||
key={`${member.id}-${index}`}
|
|
||||||
member={member}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
overlayClassName={overlayClassName}
|
|
||||||
nameClassName={nameClassName}
|
|
||||||
roleClassName={roleClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
TeamCardOne.displayName = "TeamCardOne";
|
|
||||||
|
|
||||||
export default TeamCardOne;
|
|
||||||
@@ -1,200 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type TeamCardSixProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationTypeWith3D, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type TeamCardSixGridVariant = Exclude<GridVariant, "timeline" | "two-columns-alternating-heights" | "four-items-2x2-equal-grid">;
|
export const TeamCardSix: React.FC<TeamCardSixProps> = (props) => {
|
||||||
|
return <CardStack {...props} />;
|
||||||
const MASK_GRADIENT = "linear-gradient(to bottom, transparent, black 60%)";
|
|
||||||
|
|
||||||
type TeamMember = {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
role: string;
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface TeamCardSixProps {
|
|
||||||
members: TeamMember[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: TeamCardSixGridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
overlayClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TeamMemberCardProps {
|
|
||||||
member: TeamMember;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
overlayClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TeamMemberCard = memo(({
|
|
||||||
member,
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
overlayClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
}: TeamMemberCardProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full rounded-theme-capped", cardClassName)}>
|
|
||||||
<div className="relative w-full h-full rounded-theme-capped overflow-hidden">
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={member.imageSrc}
|
|
||||||
videoSrc={member.videoSrc}
|
|
||||||
imageAlt={member.imageAlt || member.name}
|
|
||||||
videoAriaLabel={member.videoAriaLabel || member.name}
|
|
||||||
imageClassName={cls("w-full h-full object-cover", imageClassName)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={cls("absolute z-10 bottom-4 left-4 right-4 p-4 flex flex-col gap-0 text-background", overlayClassName)}>
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-tight truncate", nameClassName)}>
|
|
||||||
{member.name}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("text-base leading-tight truncate", roleClassName)}>
|
|
||||||
{member.role}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
className="absolute z-0 backdrop-blur-xl opacity-100 w-full h-1/3 left-0 bottom-0"
|
|
||||||
style={{ maskImage: MASK_GRADIENT }}
|
|
||||||
aria-hidden="true"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
TeamMemberCard.displayName = "TeamMemberCard";
|
|
||||||
|
|
||||||
const TeamCardSix = ({
|
|
||||||
members,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Team section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
overlayClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: TeamCardSixProps) => {
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{members.map((member, index) => (
|
|
||||||
<TeamMemberCard
|
|
||||||
key={`${member.id}-${index}`}
|
|
||||||
member={member}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
overlayClassName={overlayClassName}
|
|
||||||
nameClassName={nameClassName}
|
|
||||||
roleClassName={roleClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
TeamCardSix.displayName = "TeamCardSix";
|
|
||||||
|
|
||||||
export default TeamCardSix;
|
export default TeamCardSix;
|
||||||
@@ -1,240 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type TeamCardTwoProps = Omit<CardStackProps, 'gridRowsClassName'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, GridVariant, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types";
|
|
||||||
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
|
|
||||||
|
|
||||||
type TeamCardTwoGridVariant = Exclude<GridVariant, "timeline">;
|
export const TeamCardTwo: React.FC<TeamCardTwoProps> = (props) => {
|
||||||
|
return <CardStack {...props} />;
|
||||||
type SocialLink = {
|
|
||||||
icon: LucideIcon;
|
|
||||||
url: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type TeamMember = {
|
export default TeamCardTwo;
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
role: string;
|
|
||||||
description: string;
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
socialLinks?: SocialLink[];
|
|
||||||
};
|
|
||||||
|
|
||||||
interface TeamCardTwoProps {
|
|
||||||
members: TeamMember[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
gridVariant: TeamCardTwoGridVariant;
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
overlayClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
memberDescriptionClassName?: string;
|
|
||||||
socialLinksClassName?: string;
|
|
||||||
socialIconClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TeamMemberCardProps {
|
|
||||||
member: TeamMember;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
overlayClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
memberDescriptionClassName?: string;
|
|
||||||
socialLinksClassName?: string;
|
|
||||||
socialIconClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TeamMemberCard = memo(({
|
|
||||||
member,
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
overlayClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
memberDescriptionClassName = "",
|
|
||||||
socialLinksClassName = "",
|
|
||||||
socialIconClassName = "",
|
|
||||||
}: TeamMemberCardProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full rounded-theme-capped overflow-hidden group", cardClassName)}>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={member.imageSrc}
|
|
||||||
videoSrc={member.videoSrc}
|
|
||||||
imageAlt={member.imageAlt || member.name}
|
|
||||||
videoAriaLabel={member.videoAriaLabel || member.name}
|
|
||||||
imageClassName={cls("relative z-1 w-full h-full object-cover", imageClassName)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={cls("!absolute z-10 bottom-6 left-6 right-6 card backdrop-blur-xs p-6 flex flex-col gap-2 rounded-theme-capped", overlayClassName)}>
|
|
||||||
<div className="relative z-1 flex items-start justify-between">
|
|
||||||
<h3 className={cls("text-2xl font-medium text-foreground leading-[1.1] truncate", nameClassName)}>
|
|
||||||
{member.name}
|
|
||||||
</h3>
|
|
||||||
<div className="relative z-1 secondary-button px-3 py-1 rounded-theme" >
|
|
||||||
<p className={cls("text-xs text-secondary-cta-text leading-[1.1] truncate", roleClassName)}>
|
|
||||||
{member.role}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p className={cls("relative z-1 text-base text-foreground leading-[1.1]", memberDescriptionClassName)}>
|
|
||||||
{member.description}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{member.socialLinks && member.socialLinks.length > 0 && (
|
|
||||||
<div className={cls("relative z-1 flex gap-3 mt-1", socialLinksClassName)}>
|
|
||||||
{member.socialLinks.map((link, index) => (
|
|
||||||
<a
|
|
||||||
key={index}
|
|
||||||
href={link.url}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
className={cls("primary-button h-9 aspect-square w-auto flex items-center justify-center rounded-theme", socialIconClassName)}
|
|
||||||
>
|
|
||||||
<link.icon className="h-4/10 text-primary-cta-text" strokeWidth={1.5} />
|
|
||||||
</a>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
TeamMemberCard.displayName = "TeamMemberCard";
|
|
||||||
|
|
||||||
const TeamCardTwo = ({
|
|
||||||
members,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
gridVariant,
|
|
||||||
uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Team section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
overlayClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
memberDescriptionClassName = "",
|
|
||||||
socialLinksClassName = "",
|
|
||||||
socialIconClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: TeamCardTwoProps) => {
|
|
||||||
const customGridRows = (gridVariant === "bento-grid" || gridVariant === "bento-grid-inverted")
|
|
||||||
? "md:grid-rows-[22rem_22rem] 2xl:grid-rows-[26rem_26rem]"
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
gridRowsClassName={customGridRows}
|
|
||||||
animationType={animationType}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{members.map((member, index) => (
|
|
||||||
<TeamMemberCard
|
|
||||||
key={`${member.id}-${index}`}
|
|
||||||
member={member}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
overlayClassName={overlayClassName}
|
|
||||||
nameClassName={nameClassName}
|
|
||||||
roleClassName={roleClassName}
|
|
||||||
memberDescriptionClassName={memberDescriptionClassName}
|
|
||||||
socialLinksClassName={socialLinksClassName}
|
|
||||||
socialIconClassName={socialIconClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
TeamCardTwo.displayName = "TeamCardTwo";
|
|
||||||
|
|
||||||
export default TeamCardTwo;
|
|
||||||
@@ -1,219 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type TestimonialCardOneProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import { Star } from "lucide-react";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, ButtonAnimationType, CardAnimationTypeWith3D, GridVariant, TitleSegment, TextboxLayout, InvertedBackground } from "@/components/cardStack/types";
|
|
||||||
|
|
||||||
type Testimonial = {
|
export const TestimonialCardOne: React.FC<TestimonialCardOneProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
name: string;
|
|
||||||
role: string;
|
|
||||||
company: string;
|
|
||||||
rating: number;
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface TestimonialCardOneProps {
|
export default TestimonialCardOne;
|
||||||
testimonials: Testimonial[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
gridVariant: GridVariant;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
overlayClassName?: string;
|
|
||||||
ratingClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
companyClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TestimonialCardProps {
|
|
||||||
testimonial: Testimonial;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
overlayClassName?: string;
|
|
||||||
ratingClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
companyClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TestimonialCard = memo(({
|
|
||||||
testimonial,
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
overlayClassName = "",
|
|
||||||
ratingClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
companyClassName = "",
|
|
||||||
}: TestimonialCardProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full rounded-theme-capped overflow-hidden group", cardClassName)}>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={testimonial.imageSrc}
|
|
||||||
videoSrc={testimonial.videoSrc}
|
|
||||||
imageAlt={testimonial.imageAlt || testimonial.name}
|
|
||||||
videoAriaLabel={testimonial.videoAriaLabel || testimonial.name}
|
|
||||||
imageClassName={cls("relative z-1 w-full h-full object-cover!", imageClassName)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={cls("!absolute z-1 bottom-6 left-6 right-6 card backdrop-blur-xs p-6 flex flex-col gap-3 rounded-theme-capped", overlayClassName)}>
|
|
||||||
<div className={cls("relative z-1 flex gap-1", ratingClassName)}>
|
|
||||||
{Array.from({ length: 5 }).map((_, index) => (
|
|
||||||
<Star
|
|
||||||
key={index}
|
|
||||||
className={cls(
|
|
||||||
"h-5 w-auto text-accent",
|
|
||||||
index < testimonial.rating ? "fill-accent" : "fill-transparent"
|
|
||||||
)}
|
|
||||||
strokeWidth={1.5}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3 className={cls("relative z-1 text-2xl font-medium text-foreground leading-[1.1] mt-1", nameClassName)}>
|
|
||||||
{testimonial.name}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex flex-col gap-1">
|
|
||||||
<p className={cls("text-base text-foreground leading-[1.1]", roleClassName)}>
|
|
||||||
{testimonial.role}
|
|
||||||
</p>
|
|
||||||
<p className={cls("text-base text-foreground leading-[1.1]", companyClassName)}>
|
|
||||||
{testimonial.company}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
TestimonialCard.displayName = "TestimonialCard";
|
|
||||||
|
|
||||||
const TestimonialCardOne = ({
|
|
||||||
testimonials,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses = "min-h-95 2xl:min-h-105",
|
|
||||||
gridVariant,
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Testimonials section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
overlayClassName = "",
|
|
||||||
ratingClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
companyClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: TestimonialCardOneProps) => {
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant={gridVariant}
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{testimonials.map((testimonial, index) => (
|
|
||||||
<TestimonialCard
|
|
||||||
key={`${testimonial.id}-${index}`}
|
|
||||||
testimonial={testimonial}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
overlayClassName={overlayClassName}
|
|
||||||
ratingClassName={ratingClassName}
|
|
||||||
nameClassName={nameClassName}
|
|
||||||
roleClassName={roleClassName}
|
|
||||||
companyClassName={companyClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
TestimonialCardOne.displayName = "TestimonialCardOne";
|
|
||||||
|
|
||||||
export default TestimonialCardOne;
|
|
||||||
@@ -1,240 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type TestimonialCardSixteenProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import { Star } from "lucide-react";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, ButtonAnimationType, CardAnimationTypeWith3D, TitleSegment, TextboxLayout, InvertedBackground } from "@/components/cardStack/types";
|
|
||||||
|
|
||||||
type Testimonial = {
|
export const TestimonialCardSixteen: React.FC<TestimonialCardSixteenProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
name: string;
|
|
||||||
role: string;
|
|
||||||
company: string;
|
|
||||||
rating: number;
|
|
||||||
imageSrc?: string;
|
|
||||||
videoSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
videoAriaLabel?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type KpiItem = {
|
export default TestimonialCardSixteen;
|
||||||
value: string;
|
|
||||||
label: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface TestimonialCardSixteenProps {
|
|
||||||
testimonials: Testimonial[];
|
|
||||||
kpiItems: [KpiItem, KpiItem, KpiItem];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
overlayClassName?: string;
|
|
||||||
ratingClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
companyClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TestimonialCardProps {
|
|
||||||
testimonial: Testimonial;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
overlayClassName?: string;
|
|
||||||
ratingClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
companyClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TestimonialCard = memo(({
|
|
||||||
testimonial,
|
|
||||||
cardClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
overlayClassName = "",
|
|
||||||
ratingClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
companyClassName = "",
|
|
||||||
}: TestimonialCardProps) => {
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full w-full max-w-full aspect-[8/10] rounded-theme-capped overflow-hidden group", cardClassName)}>
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={testimonial.imageSrc}
|
|
||||||
videoSrc={testimonial.videoSrc}
|
|
||||||
imageAlt={testimonial.imageAlt || testimonial.name}
|
|
||||||
videoAriaLabel={testimonial.videoAriaLabel || testimonial.name}
|
|
||||||
imageClassName={cls("relative z-1 w-full h-full object-cover!", imageClassName)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={cls("!absolute z-1 bottom-6 left-6 right-6 card backdrop-blur-xs p-6 flex flex-col gap-3 rounded-theme-capped", overlayClassName)}>
|
|
||||||
<div className={cls("relative z-1 flex gap-1", ratingClassName)}>
|
|
||||||
{Array.from({ length: 5 }).map((_, index) => (
|
|
||||||
<Star
|
|
||||||
key={index}
|
|
||||||
className={cls(
|
|
||||||
"h-5 w-auto text-accent",
|
|
||||||
index < testimonial.rating ? "fill-accent" : "fill-transparent"
|
|
||||||
)}
|
|
||||||
strokeWidth={1.5}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3 className={cls("relative z-1 text-2xl font-medium text-foreground leading-[1.1] mt-1", nameClassName)}>
|
|
||||||
{testimonial.name}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex flex-col gap-1">
|
|
||||||
<p className={cls("text-base text-foreground leading-[1.1]", roleClassName)}>
|
|
||||||
{testimonial.role}
|
|
||||||
</p>
|
|
||||||
<p className={cls("text-base text-foreground leading-[1.1]", companyClassName)}>
|
|
||||||
{testimonial.company}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
TestimonialCard.displayName = "TestimonialCard";
|
|
||||||
|
|
||||||
const TestimonialCardSixteen = ({
|
|
||||||
testimonials,
|
|
||||||
kpiItems,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses = "min-h-none",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Testimonials section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
overlayClassName = "",
|
|
||||||
ratingClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
companyClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: TestimonialCardSixteenProps) => {
|
|
||||||
const kpiSection = (
|
|
||||||
<div className="card rounded-theme-capped p-8 md:py-16 flex flex-col md:flex-row items-center justify-between">
|
|
||||||
{kpiItems.map((item, index) => (
|
|
||||||
<div key={index} className="flex flex-col md:flex-row items-center w-full md:flex-1">
|
|
||||||
<div className="flex flex-col items-center text-center flex-1 py-4 md:py-0 gap-1">
|
|
||||||
<h3 className="text-5xl font-medium text-foreground">{item.value}</h3>
|
|
||||||
<p className="text-base text-foreground">{item.label}</p>
|
|
||||||
</div>
|
|
||||||
{index < 2 && (
|
|
||||||
<div className="w-full h-px md:h-[calc(var(--text-5xl)+var(--text-base))] md:w-px bg-foreground" />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
bottomContent={kpiSection}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{testimonials.map((testimonial, index) => (
|
|
||||||
<TestimonialCard
|
|
||||||
key={`${testimonial.id}-${index}`}
|
|
||||||
testimonial={testimonial}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
overlayClassName={overlayClassName}
|
|
||||||
ratingClassName={ratingClassName}
|
|
||||||
nameClassName={nameClassName}
|
|
||||||
roleClassName={roleClassName}
|
|
||||||
companyClassName={companyClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
TestimonialCardSixteen.displayName = "TestimonialCardSixteen";
|
|
||||||
|
|
||||||
export default TestimonialCardSixteen;
|
|
||||||
@@ -1,240 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type TestimonialCardThirteenProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
import TestimonialAuthor from "@/components/shared/TestimonialAuthor";
|
|
||||||
import { cls, shouldUseInvertedText } from "@/lib/utils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import { Quote, Star } from "lucide-react";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import type { ButtonConfig, ButtonAnimationType, CardAnimationTypeWith3D, TitleSegment, TextboxLayout, InvertedBackground } from "@/components/cardStack/types";
|
|
||||||
|
|
||||||
type Testimonial = {
|
export const TestimonialCardThirteen: React.FC<TestimonialCardThirteenProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
name: string;
|
|
||||||
handle: string;
|
|
||||||
testimonial: string;
|
|
||||||
rating: number;
|
|
||||||
imageSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
icon?: LucideIcon;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface TestimonialCardThirteenProps {
|
export default TestimonialCardThirteen;
|
||||||
testimonials: Testimonial[];
|
|
||||||
showRating: boolean;
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
imageWrapperClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
iconClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
handleClassName?: string;
|
|
||||||
testimonialClassName?: string;
|
|
||||||
ratingClassName?: string;
|
|
||||||
contentWrapperClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TestimonialCardProps {
|
|
||||||
testimonial: Testimonial;
|
|
||||||
showRating: boolean;
|
|
||||||
useInvertedBackground: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageWrapperClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
iconClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
handleClassName?: string;
|
|
||||||
testimonialClassName?: string;
|
|
||||||
ratingClassName?: string;
|
|
||||||
contentWrapperClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TestimonialCard = memo(({
|
|
||||||
testimonial,
|
|
||||||
showRating,
|
|
||||||
useInvertedBackground,
|
|
||||||
cardClassName = "",
|
|
||||||
imageWrapperClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
iconClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
handleClassName = "",
|
|
||||||
testimonialClassName = "",
|
|
||||||
ratingClassName = "",
|
|
||||||
contentWrapperClassName = "",
|
|
||||||
}: TestimonialCardProps) => {
|
|
||||||
const Icon = testimonial.icon || Quote;
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full card rounded-theme-capped p-6 flex flex-col justify-between", showRating ? "gap-5" : "gap-16", cardClassName)}>
|
|
||||||
<div className={cls("flex flex-col gap-5 items-start", contentWrapperClassName)}>
|
|
||||||
{showRating ? (
|
|
||||||
<div className={cls("relative z-1 flex gap-1", ratingClassName)}>
|
|
||||||
{Array.from({ length: 5 }).map((_, index) => (
|
|
||||||
<Star
|
|
||||||
key={index}
|
|
||||||
className={cls(
|
|
||||||
"h-5 w-auto text-accent",
|
|
||||||
index < testimonial.rating ? "fill-accent" : "fill-transparent"
|
|
||||||
)}
|
|
||||||
strokeWidth={1.5}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<Quote className="h-6 w-auto text-accent fill-accent" strokeWidth={1.5} />
|
|
||||||
)}
|
|
||||||
|
|
||||||
<p className={cls("relative z-1 text-lg leading-[1.2]", shouldUseLightText ? "text-background" : "text-foreground", testimonialClassName)}>
|
|
||||||
{testimonial.testimonial}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<TestimonialAuthor
|
|
||||||
name={testimonial.name}
|
|
||||||
subtitle={testimonial.handle}
|
|
||||||
imageSrc={testimonial.imageSrc}
|
|
||||||
imageAlt={testimonial.imageAlt}
|
|
||||||
icon={Icon}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
imageWrapperClassName={imageWrapperClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
iconClassName={iconClassName}
|
|
||||||
nameClassName={nameClassName}
|
|
||||||
subtitleClassName={handleClassName}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
TestimonialCard.displayName = "TestimonialCard";
|
|
||||||
|
|
||||||
const TestimonialCardThirteen = ({
|
|
||||||
testimonials,
|
|
||||||
showRating,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses = "min-h-none",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Testimonials section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
imageWrapperClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
iconClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
handleClassName = "",
|
|
||||||
testimonialClassName = "",
|
|
||||||
ratingClassName = "",
|
|
||||||
contentWrapperClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: TestimonialCardThirteenProps) => {
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{testimonials.map((testimonial, index) => (
|
|
||||||
<TestimonialCard
|
|
||||||
key={`${testimonial.id}-${index}`}
|
|
||||||
testimonial={testimonial}
|
|
||||||
showRating={showRating}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageWrapperClassName={imageWrapperClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
iconClassName={iconClassName}
|
|
||||||
nameClassName={nameClassName}
|
|
||||||
handleClassName={handleClassName}
|
|
||||||
testimonialClassName={testimonialClassName}
|
|
||||||
ratingClassName={ratingClassName}
|
|
||||||
contentWrapperClassName={contentWrapperClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
TestimonialCardThirteen.displayName = "TestimonialCardThirteen";
|
|
||||||
|
|
||||||
export default TestimonialCardThirteen;
|
|
||||||
@@ -1,216 +1,10 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
import { CardStack, CardStackProps } from '@/components/cardStack/CardStack';
|
||||||
|
|
||||||
import { memo } from "react";
|
type TestimonialCardTwoProps = Omit<CardStackProps, 'supports3DAnimation'>;
|
||||||
import Image from "next/image";
|
|
||||||
import CardStack from "@/components/cardStack/CardStack";
|
|
||||||
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 { ButtonConfig, ButtonAnimationType, CardAnimationTypeWith3D, TitleSegment, TextboxLayout, InvertedBackground } from "@/components/cardStack/types";
|
|
||||||
|
|
||||||
type Testimonial = {
|
export const TestimonialCardTwo: React.FC<TestimonialCardTwoProps> = (props) => {
|
||||||
id: string;
|
return <CardStack {...props} />;
|
||||||
name: string;
|
|
||||||
role: string;
|
|
||||||
testimonial: string;
|
|
||||||
imageSrc?: string;
|
|
||||||
imageAlt?: string;
|
|
||||||
icon?: LucideIcon;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface TestimonialCardTwoProps {
|
export default TestimonialCardTwo;
|
||||||
testimonials: Testimonial[];
|
|
||||||
carouselMode?: "auto" | "buttons";
|
|
||||||
uniformGridCustomHeightClasses?: string;
|
|
||||||
animationType: CardAnimationTypeWith3D;
|
|
||||||
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;
|
|
||||||
textBoxTitleImageWrapperClassName?: string;
|
|
||||||
textBoxTitleImageClassName?: string;
|
|
||||||
textBoxDescriptionClassName?: string;
|
|
||||||
imageWrapperClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
iconClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
testimonialClassName?: string;
|
|
||||||
gridClassName?: string;
|
|
||||||
carouselClassName?: string;
|
|
||||||
controlsClassName?: string;
|
|
||||||
textBoxClassName?: string;
|
|
||||||
textBoxTagClassName?: string;
|
|
||||||
textBoxButtonContainerClassName?: string;
|
|
||||||
textBoxButtonClassName?: string;
|
|
||||||
textBoxButtonTextClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TestimonialCardProps {
|
|
||||||
testimonial: Testimonial;
|
|
||||||
shouldUseLightText: boolean;
|
|
||||||
cardClassName?: string;
|
|
||||||
imageWrapperClassName?: string;
|
|
||||||
imageClassName?: string;
|
|
||||||
iconClassName?: string;
|
|
||||||
nameClassName?: string;
|
|
||||||
roleClassName?: string;
|
|
||||||
testimonialClassName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TestimonialCard = memo(({
|
|
||||||
testimonial,
|
|
||||||
shouldUseLightText,
|
|
||||||
cardClassName = "",
|
|
||||||
imageWrapperClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
iconClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
testimonialClassName = "",
|
|
||||||
}: TestimonialCardProps) => {
|
|
||||||
const Icon = testimonial.icon || Quote;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={cls("relative h-full card rounded-theme-capped p-6 flex flex-col gap-6", cardClassName)}>
|
|
||||||
<div className={cls("relative z-1 h-30 w-fit aspect-square rounded-theme flex items-center justify-center primary-button overflow-hidden", imageWrapperClassName)}>
|
|
||||||
{testimonial.imageSrc ? (
|
|
||||||
<Image
|
|
||||||
src={testimonial.imageSrc}
|
|
||||||
alt={testimonial.imageAlt || testimonial.name}
|
|
||||||
width={800}
|
|
||||||
height={800}
|
|
||||||
className={cls("absolute inset-0 h-full w-full object-cover", imageClassName)}
|
|
||||||
unoptimized={testimonial.imageSrc.startsWith('http') || testimonial.imageSrc.startsWith('//')}
|
|
||||||
aria-hidden={testimonial.imageAlt === ""}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<Icon className={cls("h-1/2 w-1/2 text-primary-cta-text", iconClassName)} strokeWidth={1} />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative z-1 flex flex-col gap-1 mt-1">
|
|
||||||
<h3 className={cls("text-2xl font-medium leading-[1.1]", shouldUseLightText ? "text-background" : "text-foreground", nameClassName)}>
|
|
||||||
{testimonial.name}
|
|
||||||
</h3>
|
|
||||||
<p className={cls("text-base leading-[1.1]", shouldUseLightText ? "text-background" : "text-foreground", roleClassName)}>
|
|
||||||
{testimonial.role}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p className={cls("relative z-1 text-lg leading-[1.25]", shouldUseLightText ? "text-background" : "text-foreground", testimonialClassName)}>
|
|
||||||
{testimonial.testimonial}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
TestimonialCard.displayName = "TestimonialCard";
|
|
||||||
|
|
||||||
const TestimonialCardTwo = ({
|
|
||||||
testimonials,
|
|
||||||
carouselMode = "buttons",
|
|
||||||
uniformGridCustomHeightClasses = "min-h-none",
|
|
||||||
animationType,
|
|
||||||
title,
|
|
||||||
titleSegments,
|
|
||||||
description,
|
|
||||||
tag,
|
|
||||||
tagIcon,
|
|
||||||
tagAnimation,
|
|
||||||
buttons,
|
|
||||||
buttonAnimation,
|
|
||||||
textboxLayout,
|
|
||||||
useInvertedBackground,
|
|
||||||
ariaLabel = "Testimonials section",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
cardClassName = "",
|
|
||||||
textBoxTitleClassName = "",
|
|
||||||
textBoxTitleImageWrapperClassName = "",
|
|
||||||
textBoxTitleImageClassName = "",
|
|
||||||
textBoxDescriptionClassName = "",
|
|
||||||
imageWrapperClassName = "",
|
|
||||||
imageClassName = "",
|
|
||||||
iconClassName = "",
|
|
||||||
nameClassName = "",
|
|
||||||
roleClassName = "",
|
|
||||||
testimonialClassName = "",
|
|
||||||
gridClassName = "",
|
|
||||||
carouselClassName = "",
|
|
||||||
controlsClassName = "",
|
|
||||||
textBoxClassName = "",
|
|
||||||
textBoxTagClassName = "",
|
|
||||||
textBoxButtonContainerClassName = "",
|
|
||||||
textBoxButtonClassName = "",
|
|
||||||
textBoxButtonTextClassName = "",
|
|
||||||
}: TestimonialCardTwoProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
|
|
||||||
return (
|
|
||||||
<CardStack
|
|
||||||
mode={carouselMode}
|
|
||||||
gridVariant="uniform-all-items-equal"
|
|
||||||
uniformGridCustomHeightClasses={uniformGridCustomHeightClasses}
|
|
||||||
animationType={animationType}
|
|
||||||
supports3DAnimation={true}
|
|
||||||
|
|
||||||
title={title}
|
|
||||||
titleSegments={titleSegments}
|
|
||||||
description={description}
|
|
||||||
tag={tag}
|
|
||||||
tagIcon={tagIcon}
|
|
||||||
tagAnimation={tagAnimation}
|
|
||||||
buttons={buttons}
|
|
||||||
buttonAnimation={buttonAnimation}
|
|
||||||
textboxLayout={textboxLayout}
|
|
||||||
useInvertedBackground={useInvertedBackground}
|
|
||||||
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}
|
|
||||||
>
|
|
||||||
{testimonials.map((testimonial, index) => (
|
|
||||||
<TestimonialCard
|
|
||||||
key={`${testimonial.id}-${index}`}
|
|
||||||
testimonial={testimonial}
|
|
||||||
shouldUseLightText={shouldUseLightText}
|
|
||||||
cardClassName={cardClassName}
|
|
||||||
imageWrapperClassName={imageWrapperClassName}
|
|
||||||
imageClassName={imageClassName}
|
|
||||||
iconClassName={iconClassName}
|
|
||||||
nameClassName={nameClassName}
|
|
||||||
roleClassName={roleClassName}
|
|
||||||
testimonialClassName={testimonialClassName}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</CardStack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
TestimonialCardTwo.displayName = "TestimonialCardTwo";
|
|
||||||
|
|
||||||
export default TestimonialCardTwo;
|
|
||||||
7
src/components/shared/Dashboard.ts
Normal file
7
src/components/shared/Dashboard.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export const Dashboard = (props: any) => {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type DashboardSidebarItem = any;
|
||||||
|
export type DashboardStat = any;
|
||||||
|
export type DashboardListItem = any;
|
||||||
@@ -1,331 +1,12 @@
|
|||||||
"use client";
|
import React from 'react';
|
||||||
|
|
||||||
import React, { useState, useEffect } from "react";
|
|
||||||
import { cls } from "@/lib/utils";
|
|
||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import {
|
|
||||||
ArrowUpRight,
|
|
||||||
Bell,
|
|
||||||
ChevronLeft,
|
|
||||||
ChevronRight,
|
|
||||||
Plus,
|
|
||||||
Search,
|
|
||||||
} from "lucide-react";
|
|
||||||
import AnimationContainer from "@/components/sections/AnimationContainer";
|
|
||||||
import Button from "@/components/button/Button";
|
|
||||||
import { getButtonProps } from "@/lib/buttonUtils";
|
|
||||||
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
|
|
||||||
import MediaContent from "@/components/shared/MediaContent";
|
|
||||||
import BentoLineChart from "@/components/bento/BentoLineChart/BentoLineChart";
|
|
||||||
import type { ChartDataItem } from "@/components/bento/BentoLineChart/utils";
|
|
||||||
import type { ButtonConfig } from "@/types/button";
|
|
||||||
import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation";
|
|
||||||
import TextNumberCount from "@/components/text/TextNumberCount";
|
|
||||||
|
|
||||||
export interface DashboardSidebarItem {
|
|
||||||
icon: LucideIcon;
|
|
||||||
active?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DashboardStat {
|
|
||||||
title: string;
|
|
||||||
titleMobile?: string;
|
|
||||||
values: [number, number, number];
|
|
||||||
valuePrefix?: string;
|
|
||||||
valueSuffix?: string;
|
|
||||||
valueFormat?: Omit<Intl.NumberFormatOptions, "notation"> & {
|
|
||||||
notation?: Exclude<Intl.NumberFormatOptions["notation"], "scientific" | "engineering">;
|
|
||||||
};
|
|
||||||
description: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DashboardListItem {
|
|
||||||
icon: LucideIcon;
|
|
||||||
title: string;
|
|
||||||
status: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface DashboardProps {
|
interface DashboardProps {
|
||||||
title: string;
|
children?: React.ReactNode;
|
||||||
stats: [DashboardStat, DashboardStat, DashboardStat];
|
className?: string;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Dashboard = ({
|
export const Dashboard: React.FC<DashboardProps> = ({ children, className }) => {
|
||||||
title,
|
return <div className={className}>{children}</div>;
|
||||||
stats,
|
|
||||||
logoIcon: LogoIcon,
|
|
||||||
sidebarItems,
|
|
||||||
searchPlaceholder = "Search",
|
|
||||||
buttons,
|
|
||||||
chartTitle = "Revenue Overview",
|
|
||||||
chartData,
|
|
||||||
listItems,
|
|
||||||
listTitle = "Recent Transfers",
|
|
||||||
imageSrc,
|
|
||||||
videoSrc,
|
|
||||||
imageAlt = "",
|
|
||||||
videoAriaLabel = "Avatar video",
|
|
||||||
className = "",
|
|
||||||
containerClassName = "",
|
|
||||||
sidebarClassName = "",
|
|
||||||
statClassName = "",
|
|
||||||
chartClassName = "",
|
|
||||||
listClassName = "",
|
|
||||||
}: DashboardProps) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const [activeStatIndex, setActiveStatIndex] = useState(0);
|
|
||||||
const [statValueIndex, setStatValueIndex] = useState(0);
|
|
||||||
const { itemRefs: statRefs } = useCardAnimation({
|
|
||||||
animationType: "slide-up",
|
|
||||||
itemCount: 3,
|
|
||||||
});
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
setStatValueIndex((prev) => (prev + 1) % 3);
|
|
||||||
}, 3000);
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const statCard = (stat: DashboardStat, index: number, withRef = false) => (
|
|
||||||
<div
|
|
||||||
key={index}
|
|
||||||
ref={withRef ? (el) => { statRefs.current[index] = el; } : undefined}
|
|
||||||
className={cls(
|
|
||||||
"group rounded-theme-capped p-5 flex flex-col justify-between h-40 md:h-50 card shadow",
|
|
||||||
statClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<p className="text-base font-medium text-foreground">
|
|
||||||
{stat.title}
|
|
||||||
</p>
|
|
||||||
<div className="h-6 w-auto aspect-square rounded-theme secondary-button flex items-center justify-center transition-transform duration-300 hover:-translate-y-[3px]">
|
|
||||||
<ArrowUpRight className="h-1/2 w-1/2 text-secondary-cta-text transition-transform duration-300 group-hover:rotate-45" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<TextNumberCount
|
|
||||||
value={stat.values[statValueIndex]}
|
|
||||||
prefix={stat.valuePrefix}
|
|
||||||
suffix={stat.valueSuffix}
|
|
||||||
format={stat.valueFormat}
|
|
||||||
className="text-xl md:text-3xl font-medium text-foreground truncate"
|
|
||||||
/>
|
|
||||||
<p className="text-sm text-foreground/75 truncate">
|
|
||||||
{stat.description}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"w-content-width flex gap-5 p-5 rounded-theme-capped card shadow",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"hidden md:flex gap-5 shrink-0",
|
|
||||||
sidebarClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className="flex flex-col items-center gap-10" >
|
|
||||||
<div className="relative secondary-button h-9 w-auto aspect-square rounded-theme flex items-center justify-center transition-transform duration-300 hover:-translate-y-[3px]">
|
|
||||||
<LogoIcon className="h-4/10 w-4/10 text-secondary-cta-text" />
|
|
||||||
</div>
|
|
||||||
<nav className="flex flex-col gap-3">
|
|
||||||
{sidebarItems.map((item, index) => (
|
|
||||||
<div
|
|
||||||
key={index}
|
|
||||||
className={cls(
|
|
||||||
"h-9 w-auto aspect-square rounded-theme flex items-center justify-center transition-transform duration-300 hover:-translate-y-[3px]",
|
|
||||||
item.active
|
|
||||||
? "primary-button"
|
|
||||||
: "secondary-button"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<item.icon
|
|
||||||
className={cls(
|
|
||||||
"h-4/10 w-4/10",
|
|
||||||
item.active
|
|
||||||
? "text-primary-cta-text"
|
|
||||||
: "text-secondary-cta-text"
|
|
||||||
)}
|
|
||||||
strokeWidth={1.5}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
<div className="h-full w-px bg-background-accent" />
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"flex-1 flex flex-col gap-5 min-w-0",
|
|
||||||
containerClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className="flex items-center justify-between h-9">
|
|
||||||
<div className="h-9 px-6 rounded-theme card shadow flex items-center gap-3 transition-all duration-300 hover:px-8">
|
|
||||||
<Search className="h-(--text-sm) w-auto text-foreground" />
|
|
||||||
<p className="text-sm text-foreground">
|
|
||||||
{searchPlaceholder}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-5">
|
|
||||||
<div className="h-9 w-auto aspect-square secondary-button rounded-theme flex items-center justify-center transition-transform duration-300 hover:-translate-y-[3px]">
|
|
||||||
<Bell className="h-4/10 w-4/10 text-secondary-cta-text" />
|
|
||||||
</div>
|
|
||||||
<div className="h-9 w-auto aspect-square rounded-theme overflow-hidden transition-transform duration-300 hover:-translate-y-[3px]">
|
|
||||||
<MediaContent
|
|
||||||
imageSrc={imageSrc}
|
|
||||||
videoSrc={videoSrc}
|
|
||||||
imageAlt={imageAlt}
|
|
||||||
videoAriaLabel={videoAriaLabel}
|
|
||||||
imageClassName="w-full h-full object-cover"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-full h-px bg-background-accent" />
|
|
||||||
<div className="flex flex-col md:flex-row md:items-center justify-between gap-3">
|
|
||||||
<h2 className="text-xl md:text-3xl font-medium text-foreground">
|
|
||||||
{title}
|
|
||||||
</h2>
|
|
||||||
<div className="flex items-center gap-5">
|
|
||||||
{buttons.slice(0, 2).map((button, index) => (
|
|
||||||
<Button
|
|
||||||
key={`${button.text}-${index}`}
|
|
||||||
{...getButtonProps(
|
|
||||||
button,
|
|
||||||
index,
|
|
||||||
theme.defaultButtonVariant
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="hidden md:grid grid-cols-3 gap-5">
|
|
||||||
{stats.map((stat, index) => statCard(stat, index, true))}
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-3 md:hidden">
|
|
||||||
<AnimationContainer
|
|
||||||
key={activeStatIndex}
|
|
||||||
className="w-full"
|
|
||||||
animationType="fade"
|
|
||||||
>
|
|
||||||
{statCard(stats[activeStatIndex], activeStatIndex)}
|
|
||||||
</AnimationContainer>
|
|
||||||
<div className="w-full flex justify-end gap-3">
|
|
||||||
<button
|
|
||||||
onClick={() => setActiveStatIndex((prev) => (prev - 1 + 3) % 3)}
|
|
||||||
className="secondary-button h-8 aspect-square flex items-center justify-center rounded-theme cursor-pointer transition-transform duration-300 hover:-translate-y-[3px]"
|
|
||||||
type="button"
|
|
||||||
aria-label="Previous stat"
|
|
||||||
>
|
|
||||||
<ChevronLeft className="h-[40%] w-auto aspect-square text-secondary-cta-text" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
onClick={() => setActiveStatIndex((prev) => (prev + 1) % 3)}
|
|
||||||
className="secondary-button h-8 aspect-square flex items-center justify-center rounded-theme cursor-pointer transition-transform duration-300 hover:-translate-y-[3px]"
|
|
||||||
type="button"
|
|
||||||
aria-label="Next stat"
|
|
||||||
>
|
|
||||||
<ChevronRight className="h-[40%] w-auto aspect-square text-secondary-cta-text" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-5">
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"group/chart rounded-theme-capped p-3 md:p-4 flex flex-col h-80 card shadow",
|
|
||||||
chartClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className="flex items-center justify-between mb-2">
|
|
||||||
<p className="text-base font-medium text-foreground">
|
|
||||||
{chartTitle}
|
|
||||||
</p>
|
|
||||||
<div className="h-6 w-auto aspect-square rounded-theme secondary-button flex items-center justify-center transition-transform duration-300 hover:-translate-y-[3px]">
|
|
||||||
<ArrowUpRight className="h-1/2 w-1/2 text-secondary-cta-text transition-transform duration-300 group-hover/chart:rotate-45" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex-1 min-h-0">
|
|
||||||
<BentoLineChart
|
|
||||||
data={chartData}
|
|
||||||
metricLabel={chartTitle}
|
|
||||||
useInvertedBackground={false}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={cls(
|
|
||||||
"group/list rounded-theme-capped p-5 flex flex-col h-80 card shadow",
|
|
||||||
listClassName
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<p className="text-base font-medium text-foreground">
|
|
||||||
{listTitle}
|
|
||||||
</p>
|
|
||||||
<div className="h-6 w-auto aspect-square rounded-theme secondary-button flex items-center justify-center transition-transform duration-300 hover:-translate-y-[3px]">
|
|
||||||
<Plus className="h-1/2 w-1/2 text-secondary-cta-text transition-transform duration-300 group-hover/list:rotate-90" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="overflow-hidden mask-fade-y flex-1 min-h-0 mt-3">
|
|
||||||
<div className="flex flex-col animate-marquee-vertical px-px">
|
|
||||||
{[...listItems, ...listItems, ...listItems, ...listItems].map((item, index) => {
|
|
||||||
const ItemIcon = item.icon;
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={index}
|
|
||||||
className="flex items-center gap-2.5 p-2 rounded-theme bg-foreground/3 border border-foreground/5 flex-shrink-0 mb-2"
|
|
||||||
>
|
|
||||||
<div className="h-8 w-auto aspect-square rounded-theme shrink-0 flex items-center justify-center secondary-button">
|
|
||||||
<ItemIcon className="h-4/10 w-4/10 text-secondary-cta-text" />
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col flex-1 min-w-0">
|
|
||||||
<p className="text-xs truncate text-foreground">
|
|
||||||
{item.title}
|
|
||||||
</p>
|
|
||||||
<p className="text-xs text-foreground/75">
|
|
||||||
{item.status}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<ChevronRight className="h-(--text-xs) w-auto shrink-0 text-foreground/75" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Dashboard.displayName = "Dashboard";
|
export default Dashboard;
|
||||||
|
|
||||||
export default React.memo(Dashboard);
|
|
||||||
Reference in New Issue
Block a user