"use client"; import { memo } from "react"; import SectionNumber from "./SectionNumber"; import { normalizeNumberCardSize } from "../../lib/propNormalization"; export type NumberCardSizeValue = | "Small" | "Medium" | "Large" | "XLarge" | "small" | "medium" | "large" | "xlarge"; interface NumberCardProps { number: number; text: string; /** * Number card size. Accepts both PascalCase (Figma default) and lowercase (case-insensitive). * Figma uses PascalCase, codebase uses PascalCase - both are supported. */ size?: NumberCardSizeValue; iconShape?: string; iconColor?: string; } const NumberCard = memo(({ number, text, size: sizeProp }) => { // Normalize props to handle both PascalCase (Figma) and lowercase (codebase) const size = normalizeNumberCardSize(sizeProp); // Base classes common to all sizes const baseClasses = "bg-[var(--color-surface-inverse-primary)] rounded-[12px] shadow-lg"; // If size prop is provided, use explicit size classes // Otherwise, use responsive breakpoints for backward compatibility if (size) { // Size-specific classes const sizeClasses = { Small: "flex flex-col items-end justify-center gap-4 p-5 relative", Medium: "flex flex-row items-center gap-8 p-8 relative", Large: "flex flex-col items-start justify-end gap-[22px] h-[238px] p-8 relative", XLarge: "flex flex-col items-start justify-end gap-[22px] h-[238px] p-8 relative", }; // Text size classes const textClasses = { Small: "font-bricolage-grotesque font-medium text-[24px] leading-[32px] text-[#141414]", Medium: "font-bricolage-grotesque font-medium text-[24px] leading-[24px] text-[#141414]", Large: "font-bricolage-grotesque font-medium text-[24px] leading-[24px] text-[#141414]", XLarge: "font-bricolage-grotesque font-medium text-[32px] leading-[32px] text-[#141414]", }; // Section number wrapper classes - Small doesn't need a wrapper const sectionNumberWrapperClasses = { Small: "relative shrink-0", Medium: "flex justify-start flex-shrink-0", Large: "absolute top-8 right-8", XLarge: "absolute top-8 right-8", }; // Content container classes const contentClasses = { Small: "min-w-full relative shrink-0", Medium: "flex-1", Large: "absolute bottom-8 left-8 right-16", XLarge: "absolute bottom-8 left-8 right-16", }; // Small variant has section number as direct child, others need wrapper if (size === "Small") { return (
{/* Section Number - Direct child for Small */} {/* Card Content */}

{text}

); } return (
{/* Section Number */}
{/* Card Content */}

{text}

); } // Responsive breakpoints for backward compatibility (matches original behavior) // Maps to: Small (mobile) -> Medium (sm) -> Large (lg) -> XLarge (xl) return (
{/* Section Number - Responsive positioning */}
{/* Card Content - Responsive positioning */}

{text}

); }); NumberCard.displayName = "NumberCard"; export default NumberCard;