import { defineComponent, h, ref, watch, computed, nextTick, shallowRef } from 'vue' import { CCollapse } from '../collapse' import type { StepperStepData } from './types' export const CStepper = defineComponent({ name: 'CStepper', inheritAttrs: false, props: { /** * The default active step index when not using `v-model`. */ activeStepNumber: { type: Number, default: 1, }, /** * Optional unique ID used for accessibility attributes like `aria-labelledby`. */ id: String, /** * Sets the layout direction of the Vue Stepper component. * * - `'horizontal'` – Steps are placed side-by-side. * - `'vertical'` – Steps are stacked vertically (ideal for mobile). * * This makes the Vue Form Wizard adaptable to various screen sizes. */ layout: { type: String as () => 'horizontal' | 'vertical', default: 'horizontal', }, /** * Enables linear step progression in the Vue Form Wizard. * * - `true`: Steps must be completed in order. * - `false`: Users can navigate freely between steps. * * Useful for enforcing validation and structured data entry in Vue multi-step forms. */ linear: { type: Boolean, default: true, }, /** * The current active step index of the Vue Stepper (used for controlled mode with `v-model`). * * If this prop is not provided, the Vue Form Wizard will use `activeStepNumber` as its initial value. */ modelValue: Number, /** * Defines the list of steps in the Vue Stepper. * * Each step should include: * - `label`: The title displayed in the step. * - `indicator` (optional): Custom icon, number, or marker. * - `formRef` (optional): A reference to the `