From 5d5cac1abfce9fbcf516751e757172463810c9b9 Mon Sep 17 00:00:00 2001 From: Jenn Medellin <54321jenn@gmail.com> Date: Thu, 25 Jan 2018 15:34:04 -0800 Subject: [PATCH] feat(patterns): FAB design pattern (#1056) * feature()/fab pattern - add fab pattern - add stackblitz links * chore/fix error - fix error * feature(docs): fab pattern - add fab pattern - link to Stackblitz demo * chore()/update wording - modify guidance based on how we use it (per view, not application-wide) * chore()/fix lint fix lint error * feature(docs): fab pattern updates - remove unused CSS - fix dividers with [inset]="true" - update pattern description - fix iframe layout * feat(patterns): update FAB markup * chore(patterns): missing divider * fix(theme): lint issue --- .../design-patterns.component.ts | 5 + .../design-patterns/design-patterns.module.ts | 2 + .../design-patterns/design-patterns.routes.ts | 4 + .../design-patterns/fab/fab.component.html | 99 +++++++++++++++++++ .../design-patterns/fab/fab.component.scss | 0 .../design-patterns/fab/fab.component.ts | 23 +++++ .../steppers/steppers.component.html | 1 + src/theme.scss | 2 +- 8 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 src/app/components/design-patterns/fab/fab.component.html create mode 100644 src/app/components/design-patterns/fab/fab.component.scss create mode 100644 src/app/components/design-patterns/fab/fab.component.ts diff --git a/src/app/components/design-patterns/design-patterns.component.ts b/src/app/components/design-patterns/design-patterns.component.ts index db018875ed..49994fad4f 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: 'Floating action button', + icon: 'add_circle', + route: 'fab', + title: 'FAB Patterns', }, { description: 'Wizard-like pattern', icon: 'looks_one', diff --git a/src/app/components/design-patterns/design-patterns.module.ts b/src/app/components/design-patterns/design-patterns.module.ts index 4c62f32bf9..30607886b9 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 { FABComponent } from './fab/fab.component'; import { SteppersComponent } from './steppers/steppers.component'; import { EmptyStatesComponent } from './empty-states/empty-states.component'; @@ -42,6 +43,7 @@ import { ToolbarModule } from '../../components/toolbar/toolbar.module'; AlertsComponent, ManagementListComponent, NavigationDrawerComponent, + FABComponent, SteppersComponent, EmptyStatesComponent, ], diff --git a/src/app/components/design-patterns/design-patterns.routes.ts b/src/app/components/design-patterns/design-patterns.routes.ts index 16e5514d2d..c24241fc9a 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 { FABComponent } from './fab/fab.component'; import { SteppersComponent } from './steppers/steppers.component'; import { EmptyStatesComponent } from './empty-states/empty-states.component'; @@ -21,6 +22,9 @@ const routes: Routes = [{ }, { component: NavigationDrawerComponent, path: 'navigation-drawer', + }, { + component: FABComponent, + path: 'fab', }, { component: SteppersComponent, path: 'steppers', diff --git a/src/app/components/design-patterns/fab/fab.component.html b/src/app/components/design-patterns/fab/fab.component.html new file mode 100644 index 0000000000..01900b2fb2 --- /dev/null +++ b/src/app/components/design-patterns/fab/fab.component.html @@ -0,0 +1,99 @@ +
The floating action button (FAB) provides access to the primary action for the current view.
+Bottom right for lists
+Use theme accent color
+Include a tooltip for a11y
+FAB Guidelines
+ +Button Component
+ +Stepper Guidelines
+