-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
226 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
146 changes: 146 additions & 0 deletions
146
...guide/src/app/features/ui-kit/components/icon-button-docs/icon-button-docs.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,146 @@ | ||
<header class="go-page-title"> | ||
<h1 class="go-heading-3">{{ pageTitle }}</h1> | ||
</header> | ||
<div class="go-container"> | ||
<div class="go-column go-column--100"> | ||
<go-card [showHeader]="false" class="go-column go-column--100" id="description"> | ||
<ng-container go-card-content> | ||
<div class="go-container"> | ||
<div class="go-column go-column--100"> | ||
<!-- Intro --> | ||
<h2 class="go-heading-5">Usage</h2> | ||
<p class="go-body-copy"> | ||
The <code class="code-block--inline"><go-icon-button></code> | ||
component should be used for buttons that have no text. | ||
</p> | ||
|
||
<!-- Bindings --> | ||
<h2 class="go-heading-5">Bindings</h2> | ||
<code [highlight]="componentBindings"></code> | ||
</div> | ||
<div class="go-column go-column--100"> | ||
<h3 class="go-heading-6">buttonDisabled</h3> | ||
<p class="go-body-copy"> | ||
Disables the button. This should be handled by the parent | ||
component. | ||
</p> | ||
|
||
<h3 class="go-heading-6">buttonIcon</h3> | ||
<p class="go-body-copy"> | ||
Changes the icon that is displayed within the button. See the | ||
<a class="go-link" href="https://material.io/tools/icons/">Material Design System Icons</a> | ||
page for available icons. | ||
</p> | ||
|
||
<h3 class="go-heading-6">buttonSize</h3> | ||
<p class="go-body-copy"> | ||
Changes the <code class="code-block--inline">font-size</code> property of the icon. | ||
This attribute defaults to "small", and the size options are as follows: | ||
</p> | ||
<ol class="go-list go-list--ordered"> | ||
<li><code class="code-block--inline">small</code> (1 rem)</li> | ||
<li><code class="code-block--inline">medium</code> (1.5 rem)</li> | ||
<li><code class="code-block--inline">large</code> (2 rem)</li> | ||
</ol> | ||
|
||
<h3 class="go-heading-6">buttonTitle</h3> | ||
<p class="go-body-copy"> | ||
Changes the <code class="code-block--inline">title</code> attribute of the button, | ||
causing a tooltip to be displayed when hovering over the button. | ||
</p> | ||
</div> | ||
</div> | ||
</ng-container> | ||
</go-card> | ||
</div> | ||
|
||
<go-card class="go-column go-column--100" id="button-disabled"> | ||
<ng-container go-card-header> | ||
<h2 class="go-heading-5">Button Disabled</h2> | ||
</ng-container> | ||
<ng-container go-card-content> | ||
<section class="go-container"> | ||
<div class="go-column go-column--50"> | ||
<code [highlight]="disabledExample"></code> | ||
</div> | ||
<div class="go-column go-column--50"> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home" buttonDisabled="true"></go-icon-button> | ||
</div> | ||
</section> | ||
</ng-container> | ||
</go-card> | ||
|
||
<go-card class="go-column go-column--100" id="button-icon"> | ||
<ng-container go-card-header> | ||
<h2 class="go-heading-5">Button Icon</h2> | ||
</ng-container> | ||
<ng-container go-card-content> | ||
<section class="go-container"> | ||
<div class="go-column go-column--50"> | ||
<code [highlight]="iconExample"></code> | ||
</div> | ||
<div class="go-column go-column--50"> | ||
<div class="go-column"> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home"></go-icon-button> | ||
</div> | ||
<div class="go-column"> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="school"></go-icon-button> | ||
</div> | ||
<div class="go-column"> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="work"></go-icon-button> | ||
</div> | ||
</div> | ||
</section> | ||
</ng-container> | ||
</go-card> | ||
|
||
<go-card class="go-column go-column--100" id="button-size"> | ||
<ng-container go-card-header> | ||
<h2 class="go-heading-5">Button Size</h2> | ||
</ng-container> | ||
<ng-container go-card-content> | ||
<section class="go-container"> | ||
<div class="go-column go-column--50"> | ||
<code [highlight]="sizeExample"></code> | ||
</div> | ||
<div class="go-column go-column--50"> | ||
<div class="go-column"> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home" buttonSize="small"></go-icon-button> | ||
</div> | ||
<div class="go-column"> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home" buttonSize="medium"></go-icon-button> | ||
</div> | ||
<div class="go-column"> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home" buttonSize="large"></go-icon-button> | ||
</div> | ||
</div> | ||
</section> | ||
</ng-container> | ||
</go-card> | ||
|
||
<go-card class="go-column go-column--100" id="button-title"> | ||
<ng-container go-card-header> | ||
<h2 class="go-heading-5">Button Title</h2> | ||
</ng-container> | ||
<ng-container go-card-content> | ||
<p class="go-body-copy">Hover the icons to display their tooltips.</p> | ||
<section class="go-container"> | ||
<div class="go-column go-column--50"> | ||
<code [highlight]="titleExample"></code> | ||
</div> | ||
<div class="go-column go-column--50"> | ||
<div class="go-column"> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home" buttonTitle="Home"></go-icon-button> | ||
</div> | ||
<div class="go-column"> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="school" buttonTitle="School"></go-icon-button> | ||
</div> | ||
<div class="go-column"> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="work" buttonTitle="Work"></go-icon-button> | ||
</div> | ||
</div> | ||
</section> | ||
</ng-container> | ||
</go-card> | ||
</div> | ||
|
25 changes: 25 additions & 0 deletions
25
...de/src/app/features/ui-kit/components/icon-button-docs/icon-button-docs.component.spec.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { IconButtonDocsComponent } from './icon-button-docs.component'; | ||
|
||
describe('IconButtonDocsComponent', () => { | ||
let component: IconButtonDocsComponent; | ||
let fixture: ComponentFixture<IconButtonDocsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ IconButtonDocsComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(IconButtonDocsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
50 changes: 50 additions & 0 deletions
50
...e-guide/src/app/features/ui-kit/components/icon-button-docs/icon-button-docs.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,50 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-icon-button-docs', | ||
templateUrl: './icon-button-docs.component.html' | ||
}) | ||
export class IconButtonDocsComponent { | ||
pageTitle: string = 'Icon Button'; | ||
|
||
componentBindings: string = ` | ||
@Input() buttonDisabled: boolean; | ||
@Input() buttonIcon: string; | ||
@Input() buttonSize: string = 'small'; | ||
@Input() buttonTitle: string; | ||
@Output() handleClick: EventEmitter<void> = new EventEmitter(); | ||
`; | ||
|
||
disabledExample: string = ` | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home" buttonDisabled="true"></go-icon-button> | ||
`; | ||
|
||
iconExample: string = ` | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home"></go-icon-button> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="school"></go-icon-button> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="work"></go-icon-button> | ||
`; | ||
|
||
sizeExample: string = ` | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home" buttonSize="small"></go-icon-button> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home" buttonSize="medium"></go-icon-button> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home" buttonSize="large"></go-icon-button> | ||
`; | ||
|
||
titleExample: string = ` | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="home" buttonTitle="Home"></go-icon-button> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="school" buttonTitle="School"></go-icon-button> | ||
<go-icon-button (handleClick)="testClick()" buttonIcon="work" buttonTitle="Work"></go-icon-button> | ||
`; | ||
|
||
public testClick(): void { | ||
alert('Button clicked!'); | ||
} | ||
} |
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