"use client"; import type { ReactNode } from "react"; import { ArrowDown } from "lucide-react"; import { motion, useReducedMotion } from "framer-motion"; import { Container } from "@/components/layout/container"; import { HeroMotionBackdrop } from "@/components/layout/hero-motion-backdrop"; import { cn } from "@/lib/utils"; type HeroTone = "default" | "accent" | "soft"; type HeroLineAlign = "start" | "center" | "end"; type HeroTitleSegment = { text: string; tone?: HeroTone; }; type HeroTitleLine = { text: string; segments?: HeroTitleSegment[]; tone?: HeroTone; align?: HeroLineAlign; }; type HeroShellProps = { children: ReactNode; className?: string; compactBackdrop?: boolean; containerClassName?: string; contentClassName?: string; showBridges?: boolean; size?: "default" | "narrow" | "wide"; variant?: "home" | "page"; }; type HeroTitleProps = { lines: HeroTitleLine[]; locale?: string; variant?: "home" | "page"; className?: string; }; type HeroScrollLinkProps = { href: string; label: string; className?: string; }; type HeroContentMotionProps = { children: ReactNode; className?: string; variant?: "home" | "page"; }; const toneClasses: Record = { default: "", accent: "hero-title-accent", soft: "hero-title-accent-soft", }; const lineAlignClasses: Record = { start: "self-center text-center lg:self-start lg:text-start", center: "self-center text-center", end: "self-center text-center lg:self-end lg:text-end", }; export type HeroTitleLineValue = HeroTitleLine; export function HeroShell({ children, className, compactBackdrop = false, containerClassName, contentClassName, showBridges = false, size = "default", variant = "home", }: HeroShellProps) { return (
{showBridges ?
: null} {showBridges ?
: null}
{children}
); } export function HeroContentMotion({ children, className, variant = "home", }: HeroContentMotionProps) { const reducedMotion = useReducedMotion(); if (reducedMotion) { return
{children}
; } return ( {children} ); } export function HeroMotionItem({ children, className, variant = "home", }: HeroContentMotionProps) { const reducedMotion = useReducedMotion(); return ( {children} ); } export function HeroTitle({ lines, locale = "en", variant = "home", className, }: HeroTitleProps) { const isArabic = locale === "ar"; const reducedMotion = useReducedMotion(); return ( {lines.map((line, index) => ( {line.segments?.length ? line.segments.map((segment, segmentIndex) => ( {segment.text} )) : ( {line.text} )} ))} ); } export function HeroScrollLink({ href, label, className, }: HeroScrollLinkProps) { const reducedMotion = useReducedMotion(); return ( ); }