{"version":3,"file":"Stepper.cjs","sources":["../../../../src/components/navigation/stepper/Stepper.tsx"],"sourcesContent":["import {\r\n    Children,\r\n    Fragment,\r\n    isValidElement,\r\n    memo,\r\n    type ReactElement,\r\n} from 'react'\r\n\r\nimport { Separator } from '@components/layout/separator'\r\nimport StepperItem from '@components/navigation/stepper/components/stepper-item/StepperItem.tsx'\r\nimport type { StepperItemProps } from '@components/navigation/stepper/components/stepper-item/types/StepperItem.props.ts'\r\nimport { StepperItemContext } from '@components/navigation/stepper/context/Stepper.context.ts'\r\nimport { STEPPER_ORIENTATIONS } from '@components/navigation/stepper/constants'\r\nimport { STEPPER_STYLES } from '@components/navigation/stepper/styles/Stepper.css.ts'\r\nimport type { StepperProps } from '@components/navigation/stepper/types/Stepper.props.ts'\r\nimport type { StepperCompound } from '@components/navigation/stepper/types/StepperCompound.ts'\r\nimport { cn } from '@utils/cn.ts'\r\n\r\n/**\r\n * Step-by-step progress navigator rendered as a `<nav>` with an ordered list.\r\n * Supports horizontal and vertical `orientation`. When `onStepChange` is\r\n * provided each step becomes interactive. Tracks `currentStep` to derive\r\n * completed and current states for slot rendering.\r\n *\r\n * Compound slot: `Stepper.Item`.\r\n */\r\nconst Stepper = memo(\r\n    ({\r\n        'aria-label': ariaLabel,\r\n        children,\r\n        currentStep,\r\n        onStepChange,\r\n        orientation = STEPPER_ORIENTATIONS.horizontal,\r\n        className,\r\n        ref,\r\n        ...props\r\n    }: StepperProps) => {\r\n        const items = Children.toArray(children).filter(\r\n            (child): child is ReactElement<StepperItemProps> =>\r\n                isValidElement<StepperItemProps>(child),\r\n        )\r\n\r\n        return (\r\n            <nav\r\n                ref={ref}\r\n                aria-label={ariaLabel}\r\n                className={cn(STEPPER_STYLES.root, className)}\r\n                {...props}\r\n            >\r\n                <ol\r\n                    className={cn(\r\n                        STEPPER_STYLES.list,\r\n                        orientation === STEPPER_ORIENTATIONS.horizontal\r\n                            ? STEPPER_STYLES.listHorizontal\r\n                            : STEPPER_STYLES.listVertical,\r\n                    )}\r\n                >\r\n                    {items.map((item, index) => {\r\n                        const stepNumber = index + 1\r\n                        const isCurrent = stepNumber === currentStep\r\n                        const isCompleted = stepNumber < currentStep\r\n\r\n                        return (\r\n                            <Fragment\r\n                                key={item.key ?? `${stepNumber}-${item.props.label}`}\r\n                            >\r\n                                <li\r\n                                    className={cn(\r\n                                        STEPPER_STYLES.item,\r\n                                        orientation === STEPPER_ORIENTATIONS.vertical &&\r\n                                            STEPPER_STYLES.itemVertical,\r\n                                    )}\r\n                                >\r\n                                    <StepperItemContext.Provider\r\n                                        value={{\r\n                                            stepNumber,\r\n                                            isCurrent,\r\n                                            isCompleted,\r\n                                            onStepChange,\r\n                                        }}\r\n                                    >\r\n                                        <StepperItem {...item.props} />\r\n                                    </StepperItemContext.Provider>\r\n                                </li>\r\n                                {index < items.length - 1 && (\r\n                                    <li\r\n                                        aria-hidden={'true'}\r\n                                        className={cn(\r\n                                            STEPPER_STYLES.connectorItem,\r\n                                            orientation === STEPPER_ORIENTATIONS.vertical &&\r\n                                                STEPPER_STYLES.connectorItemVertical,\r\n                                        )}\r\n                                    >\r\n                                        <Separator\r\n                                            orientation={\r\n                                                orientation === STEPPER_ORIENTATIONS.vertical\r\n                                                    ? 'vertical'\r\n                                                    : 'horizontal'\r\n                                            }\r\n                                            className={cn(\r\n                                                STEPPER_STYLES.connector,\r\n                                                orientation === STEPPER_ORIENTATIONS.vertical &&\r\n                                                    STEPPER_STYLES.connectorVertical,\r\n                                            )}\r\n                                        />\r\n                                    </li>\r\n                                )}\r\n                            </Fragment>\r\n                        )\r\n                    })}\r\n                </ol>\r\n            </nav>\r\n        )\r\n    },\r\n) as unknown as StepperCompound\r\n\r\nStepper.displayName = 'Stepper'\r\nStepper.Item = StepperItem\r\n\r\nexport default Stepper\r\n"],"names":["Stepper","memo","ariaLabel","children","currentStep","onStepChange","orientation","STEPPER_ORIENTATIONS","className","ref","props","items","Children","child","isValidElement","jsx","cn","STEPPER_STYLES","item","index","stepNumber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