diff --git a/src/app/components/design-patterns/design-patterns.component.ts b/src/app/components/design-patterns/design-patterns.component.ts index a8d3d778a6..9eac5934b9 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: 'Feedback for empty elements', + icon: 'space_bar', + route: 'empty-states', + title: 'Empty State Patterns', }]; constructor(private _changeDetectorRef: ChangeDetectorRef, diff --git a/src/app/components/design-patterns/design-patterns.module.ts b/src/app/components/design-patterns/design-patterns.module.ts index 99a7b82094..1a33cc2519 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 { EmptyStatesComponent } from './empty-states/empty-states.component'; import { MatButtonModule } from '@angular/material/button'; import { MatListModule } from '@angular/material/list'; @@ -40,6 +41,7 @@ import { ToolbarModule } from '../../components/toolbar/toolbar.module'; AlertsComponent, ManagementListComponent, NavigationDrawerComponent, + EmptyStatesComponent, ], imports: [ /** Angular Modules */ diff --git a/src/app/components/design-patterns/design-patterns.routes.ts b/src/app/components/design-patterns/design-patterns.routes.ts index 020c8983aa..c3817a8a21 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 { EmptyStatesComponent } from './empty-states/empty-states.component'; const routes: Routes = [{ children: [{ @@ -19,6 +20,9 @@ const routes: Routes = [{ }, { component: NavigationDrawerComponent, path: 'navigation-drawer', + }, { + component: EmptyStatesComponent, + path: 'empty-states', }, ], component: DesignPatternsComponent, diff --git a/src/app/components/design-patterns/empty-states/empty-states.component.html b/src/app/components/design-patterns/empty-states/empty-states.component.html new file mode 100644 index 0000000000..dfaa0ce5b9 --- /dev/null +++ b/src/app/components/design-patterns/empty-states/empty-states.component.html @@ -0,0 +1,97 @@ +
+ + Empty States Patterns + + +

When to use

+

When no content is avaiable for a section and the user needs addtional instruction or feedback.

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

Usage

+

Icon

+

Use the content type icon if possible.

+ +

Language

+

Follow the Material Design spec for language & text.

+ +

Primary Action

+

Optionally include a primary action button (raised with accent color).

+ +

Secondary Action

+

Optionally include a secondary action button (not raised).

+ +

Guidelines

+ + + launch + Material Design +

Empty State Guidelines

+
+
+
+
+ +
+
+
+
+
+ + + Do + + + + + looks_one +

Use inside a card

+
+ + looks_two +

Use contextual icon & message

+
+ + looks_3 +

Use action buttons when possible

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

Don't change background color

+
+ + looks_two +

Don't use generic icon & message

+
+ + looks_3 +

Don't use more than 1 raised button

+
+
+
+
+
+
diff --git a/src/app/components/design-patterns/empty-states/empty-states.component.scss b/src/app/components/design-patterns/empty-states/empty-states.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/components/design-patterns/empty-states/empty-states.component.ts b/src/app/components/design-patterns/empty-states/empty-states.component.ts new file mode 100644 index 0000000000..5bf6ff3600 --- /dev/null +++ b/src/app/components/design-patterns/empty-states/empty-states.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: 'empty-states', + styleUrls: ['./empty-states.component.scss'], + templateUrl: './empty-states.component.html', + animations: [ + slideInDownAnimation, + ], +}) +export class EmptyStatesComponent { + + @HostBinding('@routeAnimation') routeAnimation: boolean = true; + @HostBinding('class.td-route-animation') classAnimation: boolean = true; + + source: any = ''; + + constructor(private sanitizer: DomSanitizer) { + this.source = sanitizer.bypassSecurityTrustResourceUrl('https://empty-state-patterns.stackblitz.io/'); + } +} diff --git a/src/styles.scss b/src/styles.scss index 0efa25962f..82db5e1798 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -14,4 +14,10 @@ html[dir="rtl"] & { direction: rtl; } +} + +// iframe styles +.iframe { + border: 0; + min-height: 700px; } \ No newline at end of file diff --git a/src/theme.scss b/src/theme.scss index 616601de22..fb88a92269 100644 --- a/src/theme.scss +++ b/src/theme.scss @@ -104,16 +104,18 @@ $theme: mat-light-theme($primary, $accent, $warn); .tc-primary { color: mat-color($primary-alt); } - .tc-accent, - a { + .tc-accent { color: mat-color($accent-alt); } - a:hover { - color: darken(mat-color($accent-alt), 10%); - } .tc-warn { color: mat-color($warn-alt); } + a:not(.mat-button, .mat-icon-button) { + color: mat-color($accent-alt); + &:hover { + color: darken(mat-color($accent-alt), 10%); + } + } } // Dark theme