diff --git a/src/app/components/design-patterns/design-patterns.component.ts b/src/app/components/design-patterns/design-patterns.component.ts index 9eac5934b9..8a82e029d6 100644 --- a/src/app/components/design-patterns/design-patterns.component.ts +++ b/src/app/components/design-patterns/design-patterns.component.ts @@ -28,6 +28,11 @@ export class DesignPatternsComponent { icon: 'kitchen', route: 'navigation-drawer', title: 'Navigation Drawer Patterns', + }, { + description: 'Wizard-like pattern', + icon: 'looks_one', + route: 'steppers', + title: 'Stepper Patterns', }, { description: 'Feedback for empty elements', icon: 'space_bar', diff --git a/src/app/components/design-patterns/design-patterns.module.ts b/src/app/components/design-patterns/design-patterns.module.ts index 1a33cc2519..2713467e04 100644 --- a/src/app/components/design-patterns/design-patterns.module.ts +++ b/src/app/components/design-patterns/design-patterns.module.ts @@ -9,6 +9,7 @@ import { CardsComponent } from './cards/cards.component'; import { AlertsComponent } from './alerts/alerts.component'; import { ManagementListComponent } from './management-list/management-list.component'; import { NavigationDrawerComponent } from './navigation-drawer/navigation-drawer.component'; +import { SteppersComponent } from './steppers/steppers.component'; import { EmptyStatesComponent } from './empty-states/empty-states.component'; import { MatButtonModule } from '@angular/material/button'; @@ -41,6 +42,7 @@ import { ToolbarModule } from '../../components/toolbar/toolbar.module'; AlertsComponent, ManagementListComponent, NavigationDrawerComponent, + SteppersComponent, EmptyStatesComponent, ], imports: [ diff --git a/src/app/components/design-patterns/design-patterns.routes.ts b/src/app/components/design-patterns/design-patterns.routes.ts index c3817a8a21..16e5514d2d 100644 --- a/src/app/components/design-patterns/design-patterns.routes.ts +++ b/src/app/components/design-patterns/design-patterns.routes.ts @@ -5,6 +5,7 @@ import { CardsComponent } from './cards/cards.component'; import { AlertsComponent } from './alerts/alerts.component'; import { ManagementListComponent } from './management-list/management-list.component'; import { NavigationDrawerComponent } from './navigation-drawer/navigation-drawer.component'; +import { SteppersComponent } from './steppers/steppers.component'; import { EmptyStatesComponent } from './empty-states/empty-states.component'; const routes: Routes = [{ @@ -20,6 +21,9 @@ const routes: Routes = [{ }, { component: NavigationDrawerComponent, path: 'navigation-drawer', + }, { + component: SteppersComponent, + path: 'steppers', }, { component: EmptyStatesComponent, path: 'empty-states', diff --git a/src/app/components/design-patterns/steppers/steppers.component.html b/src/app/components/design-patterns/steppers/steppers.component.html new file mode 100644 index 0000000000..974cd690ed --- /dev/null +++ b/src/app/components/design-patterns/steppers/steppers.component.html @@ -0,0 +1,113 @@ +
+ + Steppers Patterns + + +

When to use

+

The stepper provides a wizard-like workflow by dividing content into logical steps. This approach is most useful when each step is linear and complete before moving to the next step.

+
+
+ + +
+ Example + + + launch + +
+
+ +
+
+

Usage

+

Stepper Component

+

Follow component guidelines. Vertical mode prefered.

+ +

Label

+

Follow Material Design guidelines.

+ +

Sublabel

+

Follow Material Design guidelines.

+ +

Step Contents

+

Each step should be fully self-contained and complete before moving to the next step.

+ +

Step Summary

+

Optional summary displayed when step is complete.

+ +

Guidelines

+ + + launch + Material Design +

Stepper Guidelines

+
+ + + launch + Angular Material +

Stepper Guidelines

+
+
+
+
+ +
+
+
+
+
+ + + Do. + + + + + looks_one +

Group logical fields together

+
+ + looks_two +

Use Continue & Cancel buttons

+
+ + looks_3 +

Save asynchronously when possible

+
+ + looks_3 +

Use raised Continue buttons

+
+
+
+
+
+ + + Don't. + + + + + looks_one +

Don't include nested steppers

+
+ + looks_two +

Don't use overly complex steppers

+
+ + looks_two +

Don't use outside a card

+
+ + looks_two +

Don't use horizontal for more than 3 steps

+
+
+
+
+
+
diff --git a/src/app/components/design-patterns/steppers/steppers.component.scss b/src/app/components/design-patterns/steppers/steppers.component.scss new file mode 100644 index 0000000000..993a28fb3e --- /dev/null +++ b/src/app/components/design-patterns/steppers/steppers.component.scss @@ -0,0 +1,3 @@ +iframe { + border: none; +} diff --git a/src/app/components/design-patterns/steppers/steppers.component.ts b/src/app/components/design-patterns/steppers/steppers.component.ts new file mode 100644 index 0000000000..7277be004f --- /dev/null +++ b/src/app/components/design-patterns/steppers/steppers.component.ts @@ -0,0 +1,23 @@ +import { Component, HostBinding } from '@angular/core'; +import { BrowserModule, DomSanitizer } from '@angular/platform-browser'; +import { slideInDownAnimation } from '../../../app.animations'; + +@Component({ + selector: 'steppers', + styleUrls: ['./steppers.component.scss'], + templateUrl: './steppers.component.html', + animations: [ + slideInDownAnimation, + ], +}) +export class SteppersComponent { + + @HostBinding('@routeAnimation') routeAnimation: boolean = true; + @HostBinding('class.td-route-animation') classAnimation: boolean = true; + + source: any = ''; + + constructor(private sanitizer: DomSanitizer) { + this.source = sanitizer.bypassSecurityTrustResourceUrl('https://stepper-patterns.stackblitz.io/'); + } +}