Skip to content

Commit

Permalink
Adds all files necessary for GoIconButtonComponent (#57)
Browse files Browse the repository at this point in the history
* Adds all files necessary for GoIconButtonComponent

Creates a component for button with icons with no text.
  • Loading branch information
jaredami authored and AlexOverbeck committed Jul 24, 2019
1 parent 27abdc9 commit 2102797
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<button
class="go-icon-button"
(click)="clicked()"
[disabled]="buttonDisabled"
type="button"
>
<go-icon
[icon]="buttonIcon"
iconClass="go-icon--small"
></go-icon>
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@import '~@tangoe/gosheets/base/variables';
@import '~@tangoe/gosheets/base/mixins';

.go-icon-button {
@include transition(background-color);

background: $theme-light-bg;
border: 0;
border-radius: $global-radius--round;
box-shadow: $global-box-shadow;
color: $theme-light-color;
cursor: pointer;
display: inline-flex;
padding: .5rem;

&:hover {
background-color: $theme-light-bg-hover;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';

@Component({
selector: 'go-icon-button',
templateUrl: './go-icon-button.component.html'
})
export class GoIconButtonComponent {
@Input() buttonDisabled: boolean;
@Input() buttonIcon: string;

@Output() handleClick = new EventEmitter();

public clicked(): void {
this.handleClick.emit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { GoIconModule } from '../go-icon/go-icon.module';

import { GoIconButtonComponent } from './go-icon-button.component';

@NgModule({
declarations: [
GoIconButtonComponent
],
imports: [
CommonModule,
GoIconModule
],
exports: [
GoIconButtonComponent
]
})
export class GoIconButtonModule { }
3 changes: 3 additions & 0 deletions projects/go-lib/src/lib/go-shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import { GoSearchModule } from './components/go-search/go-search.module';
import { GoSideNavModule } from './components/go-side-nav/go-side-nav.module';
import { GoTableModule } from './components/go-table/go-table.module';
import { GoToastModule } from './components/go-toast/go-toast.module';
import { GoIconButtonModule } from './components/go-icon-button/go-icon-button.module';
import { GoToasterModule } from './components/go-toaster/go-toaster.module';

@NgModule({
imports: [
GoAccordionModule,
GoButtonModule,
GoCardModule,
GoIconButtonModule,
GoIconModule,
GoLoaderModule,
GoModalModule,
Expand All @@ -29,6 +31,7 @@ import { GoToasterModule } from './components/go-toaster/go-toaster.module';
GoAccordionModule,
GoButtonModule,
GoCardModule,
GoIconButtonModule,
GoIconModule,
GoLoaderModule,
GoModalModule,
Expand Down
4 changes: 4 additions & 0 deletions projects/go-lib/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export * from './lib/components/go-card/go-card.module';
export * from './lib/components/go-icon/go-icon.component'
export * from './lib/components/go-icon/go-icon.module';

// Icon Button
export * from './lib/components/go-icon-button/go-icon-button.component'
export * from './lib/components/go-icon-button/go-icon-button.module';

// Loader
export * from './lib/components/go-loader/go-loader.component';
export * from './lib/components/go-loader/go-loader.module';
Expand Down
4 changes: 4 additions & 0 deletions projects/go-tester/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ <h4>Buttons</h4>
Dark
</go-button>
</div>
<div class="go-column go-column--100">
<h4>Icon Button</h4>
<go-icon-button buttonIcon="home" (handleClick)="openThing()"></go-icon-button>
</div>

<div class="go-column go-column--100">
<h4>Off Canvas</h4>
Expand Down
2 changes: 2 additions & 0 deletions projects/go-tester/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
GoButtonComponent,
GoButtonModule,
GoIconComponent,
GoIconButtonModule,
GoIconModule,
GoLoaderModule,
GoOffCanvasModule,
Expand All @@ -35,6 +36,7 @@ import { SearchTestComponent } from './components/search-test.component';
HttpClientModule,
GoButtonModule,
GoIconModule,
GoIconButtonModule,
GoLoaderModule,
GoOffCanvasModule,
GoSearchModule,
Expand Down

0 comments on commit 2102797

Please sign in to comment.