// Stepper (wizard) copy-paste examples. export /** * */ const STEPPER_LINEAR = `// Multi-step wizard with forward-blocking. Match africaniesStepDef keys to StepDefinition.key. // Drive isValid from real form state; wire your own Back/Next around canGoNext(). // This is wizard nav — not a shipment status timeline. import { Component, computed, signal } from '@angular/core'; import { ButtonComponent, StepDefDirective, StepperComponent, TextInputComponent, type StepDefinition, } from '@africanies/africanies-ui'; @Component({ selector: 'app-shipment-wizard', standalone: true, imports: [ StepperComponent, StepDefDirective, ButtonComponent, TextInputComponent, ], template: \`

Origin and destination for this shipment.

Describe what you are shipping.

Review

  • {{ origin() || '—' }} → {{ destination() || '—' }}
  • {{ commodity() || 'No commodity set' }}
\`, }) export class ShipmentWizardComponent { protected readonly activeIndex = signal(0); protected readonly routeValid = signal(false); protected readonly origin = signal('Lagos'); protected readonly destination = signal(''); protected readonly commodity = signal(''); protected readonly steps = computed(() => [ { key: 'route', label: 'Route', isValid: this.routeValid() }, { key: 'cargo', label: 'Cargo', isValid: true }, { key: 'review', label: 'Review' }, ]); protected canGoNext(): boolean { const current = this.steps()[this.activeIndex()]; return current?.isValid !== false; } } `; export /** * */ const STEPPER_FREE = `// Non-linear — users can jump to any step via the header. // isValid won't gate navigation here; use linear=true when order matters. import { Component, signal } from '@angular/core'; import { StepDefDirective, StepperComponent, type StepDefinition, } from '@africanies/africanies-ui'; @Component({ selector: 'app-account-setup', standalone: true, imports: [StepperComponent, StepDefDirective], template: \`

Account details step body.

Billing step body.

Confirmation step body.

\`, }) export class AccountSetupComponent { protected readonly activeIndex = signal(0); protected readonly steps: StepDefinition[] = [ { key: 'account', label: 'Account' }, { key: 'billing', label: 'Billing' }, { key: 'confirm', label: 'Confirm' }, ]; } `;