-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(patterns): stepper design pattern (#1048)
* feature(): stepper pattern * chore(): update icon and description * chore(): update stackblitz and guidance - update guidance - update stackblitz links * chore(): update to covalent-ui account - move stackblitz demo from personal to covalent-ui account * chore(): update link - update link to plural * feature/add guidelines - add material and angular material guidelines * chore()/update iframe -wrap iframe in div * feat(patterns): update stepper Dos & Donts * feat(patterns): Continue & Cancel buttons for steppers * chore(stylelint)
- Loading branch information
1 parent
55cb101
commit 23dbc5f
Showing
6 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
src/app/components/design-patterns/steppers/steppers.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<div tdMediaToggle="gt-xs" [mediaClasses]="['push-sm']"> | ||
<mat-card tdMediaToggle="gt-xs" [mediaClasses]="['push-bottom']"> | ||
<mat-card-title>Steppers Patterns</mat-card-title> | ||
<mat-divider></mat-divider> | ||
<mat-card-content class="mat-typography"> | ||
<h3>When to use</h3> | ||
<p>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.</p> | ||
</mat-card-content> | ||
</mat-card> | ||
<mat-card> | ||
<mat-card-title> | ||
<div layout="row" layout-align="start center"> | ||
<span>Example</span> | ||
<span flex></span> | ||
<a href="https://stackblitz.com/edit/stepper-patterns" target="_blank" matTooltip="View Code" mat-icon-button> | ||
<mat-icon>launch</mat-icon> | ||
</a> | ||
</div> | ||
</mat-card-title> | ||
<mat-divider></mat-divider> | ||
<div layout-gt-sm="row"> | ||
<div flex-gt-sm="25" class="mat-typography pad"> | ||
<h2>Usage</h2> | ||
<h3>Stepper Component</h3> | ||
<p>Follow component guidelines. Vertical mode prefered.</p> | ||
<mat-divider class="push-bottom"></mat-divider> | ||
<h3>Label</h3> | ||
<p>Follow Material Design guidelines.</p> | ||
<mat-divider class="push-bottom"></mat-divider> | ||
<h3>Sublabel</h3> | ||
<p>Follow Material Design guidelines.</p> | ||
<mat-divider class="push-bottom"></mat-divider> | ||
<h3>Step Contents</h3> | ||
<p>Each step should be fully self-contained and complete before moving to the next step.</p> | ||
<mat-divider class="push-bottom"></mat-divider> | ||
<h3>Step Summary</h3> | ||
<p>Optional summary displayed when step is complete.</p> | ||
<mat-divider class="push-bottom"></mat-divider> | ||
<h2 class="push-bottom-none">Guidelines</h2> | ||
<mat-nav-list class="pull-left pull-right"> | ||
<a mat-list-item href="https://material.io/guidelines/components/steppers.html" target="_blank"> | ||
<mat-icon style="font-size: 15px">launch</mat-icon> | ||
<span matLine>Material Design</span> | ||
<p matLine>Stepper Guidelines</p> | ||
</a> | ||
<mat-divider></mat-divider> | ||
<a mat-list-item href="https://material.angular.io/components/stepper/overview" target="_blank"> | ||
<mat-icon style="font-size: 15px">launch</mat-icon> | ||
<span matLine>Angular Material</span> | ||
<p matLine>Stepper Guidelines</p> | ||
</a> | ||
</mat-nav-list> | ||
</div> | ||
<div layout="row" flex-gt-sm> | ||
<iframe flex class="iframe" [src]="source"></iframe> | ||
</div> | ||
</div> | ||
</mat-card> | ||
<div layout-gt-xs="row"> | ||
<div flex-gt-xs="50"> | ||
<mat-card> | ||
<mat-card-title> | ||
<span class="tc-green-600">Do.</span> | ||
</mat-card-title> | ||
<mat-divider></mat-divider> | ||
<mat-list> | ||
<mat-list-item> | ||
<mat-icon matListIcon>looks_one</mat-icon> | ||
<h3 matLine>Group logical fields together</h3> | ||
</mat-list-item> | ||
<mat-list-item> | ||
<mat-icon matListIcon>looks_two</mat-icon> | ||
<h3 matLine>Use Continue & Cancel buttons</h3> | ||
</mat-list-item> | ||
<mat-list-item> | ||
<mat-icon matListIcon>looks_3</mat-icon> | ||
<h3 matLine>Save asynchronously when possible</h3> | ||
</mat-list-item> | ||
<mat-list-item> | ||
<mat-icon matListIcon>looks_3</mat-icon> | ||
<h3 matLine>Use raised Continue buttons</h3> | ||
</mat-list-item> | ||
</mat-list> | ||
</mat-card> | ||
</div> | ||
<div flex-gt-xs="50"> | ||
<mat-card> | ||
<mat-card-title> | ||
<span class="tc-red-600">Don't.</span> | ||
</mat-card-title> | ||
<mat-divider></mat-divider> | ||
<mat-list> | ||
<mat-list-item> | ||
<mat-icon matListIcon>looks_one</mat-icon> | ||
<h3 matLine>Don't include nested steppers</h3> | ||
</mat-list-item> | ||
<mat-list-item> | ||
<mat-icon matListIcon>looks_two</mat-icon> | ||
<h3 matLine>Don't use overly complex steppers</h3> | ||
</mat-list-item> | ||
<mat-list-item> | ||
<mat-icon matListIcon>looks_two</mat-icon> | ||
<h3 matLine>Don't use outside a card</h3> | ||
</mat-list-item> | ||
<mat-list-item> | ||
<mat-icon matListIcon>looks_two</mat-icon> | ||
<h3 matLine>Don't use horizontal for more than 3 steps</h3> | ||
</mat-list-item> | ||
</mat-list> | ||
</mat-card> | ||
</div> | ||
</div> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
src/app/components/design-patterns/steppers/steppers.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
iframe { | ||
border: none; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/app/components/design-patterns/steppers/steppers.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/'); | ||
} | ||
} |