import { cn } from '@/lib/utils/utils'; interface CircularStepperProps { isActive: boolean; currentStep: number; totalSteps: number; size?: number; } export function CircularStepper({ isActive, currentStep, totalSteps, size = 40, }: CircularStepperProps) { const radius = (size - 2) / 2; const circumference = 2 * Math.PI * radius; const progress = (currentStep / totalSteps) * circumference; return (
{/* Background circle */} {/* Progress circle */} {/* Step number */}
{currentStep}/{totalSteps}
); } import ActiveStep from '@/assets/icons/step_active.svg?react'; import InactiveStep from '@/assets/icons/step_inactive.svg?react'; import CheckedIcon from '@/assets/icons/checked.svg?react'; interface LinearStepperProps { currentStep: number; totalSteps: number; stepLabels: readonly string[]; className?: string; isCompleted: boolean; } export function LinearStepper({ currentStep, totalSteps, stepLabels, className, isCompleted, }: LinearStepperProps) { // Calculate progress percentage const progressPercentage = isCompleted ? 100 : Math.min(((currentStep - 1) / totalSteps) * 100 + currentStep, 100); return (
{/* Progress Bar */}
{/* Step Labels */}
{stepLabels.map((label, index) => { const stepNumber = index + 1; const stepIsCompleted = stepNumber < currentStep || isCompleted; const isCurrent = stepNumber === currentStep; return (
{/* Step Number */}
{stepIsCompleted ? ( ) : isCurrent ? ( ) : ( )}
{/* Step Label */} {label}
); })}
); } interface VerticalStepperProps { currentStep: number; stepLabels: readonly string[]; className?: string; } export function VerticalStepper({ currentStep, stepLabels, className }: VerticalStepperProps) { return (
{stepLabels.map((label, index) => { const stepNumber = index + 1; const isCurrent = stepNumber === currentStep; const isLast = index === stepLabels.length - 1; return (
{/* Step indicator column */}
{/* Circle with number */}
{stepNumber}
{/* Connecting line */} {!isLast &&
}
{/* Step label */}
{label}
); })}
); }