-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2128 from HealthCatalyst/dev
Cashmere Release
- Loading branch information
Showing
33 changed files
with
1,131 additions
and
31 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 5 additions & 2 deletions
7
projects/cashmere-examples/src/lib/input-required/input-required-example.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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
<form> | ||
<form [formGroup]="exampleFormGroup" #exampleForm="ngForm"> | ||
<div class="form-container"> | ||
<hc-form-field> | ||
<hc-label>Validate an email address:</hc-label> | ||
<input hcInput [formControl]="formDemo" required> | ||
<input hcInput formControlName="exampleInput" required> | ||
<hc-error>A valid email address is required</hc-error> | ||
</hc-form-field> | ||
</div> | ||
<button hc-button title="Reset Form" buttonStyle="secondary" type="reset">Form Reset</button> | ||
<button hc-button title="Submit Form" buttonStyle="primary" type="submit">Submit</button> | ||
</form> | ||
|
||
<button hc-button title="NgForm Reset" buttonStyle="secondary" (click)="resetForm()">NgForm Reset</button> |
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 |
---|---|---|
|
@@ -5,3 +5,8 @@ | |
.hc-form-field { | ||
width: 100%; | ||
} | ||
|
||
button { | ||
margin-right: 15px; | ||
margin-bottom: 20px; | ||
} |
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
23 changes: 23 additions & 0 deletions
23
...ts/cashmere-examples/src/lib/sidenav-projection/sidenav-projection-example.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,23 @@ | ||
<div class="sidenav-example-app-shell"> | ||
|
||
<hc-sidenav | ||
[tabs]="tabs" | ||
[canToggle]="false" | ||
[showFavorites]="false" | ||
> | ||
<!-- Projected header --> | ||
<div hcSidenavHeader class="example-sidenav-header"> | ||
<h2><span class="fa fa-bank hc-icon-left"></span>Weather Data Bank</h2> | ||
</div> | ||
|
||
<!-- Projected content --> | ||
<button hc-button buttonStyle="deep-red" class="example-report-widget"> | ||
<span class="fa fa-bullhorn hc-icon-left"></span>Report weather | ||
</button> | ||
|
||
</hc-sidenav> | ||
|
||
<div class="example-app-content"> | ||
<p>This example demonstrates using content projection to add a <strong>header</strong> and <strong>report widget.</strong></p> | ||
</div> | ||
</div> |
38 changes: 38 additions & 0 deletions
38
...ts/cashmere-examples/src/lib/sidenav-projection/sidenav-projection-example.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,38 @@ | ||
@import "@healthcatalyst/cashmere/scss/_colors"; | ||
|
||
.sidenav-example-app-shell { | ||
display: flex; | ||
height: 500px; | ||
|
||
::ng-deep .hc-sidenav { | ||
height: 100%; | ||
} | ||
|
||
.example-app-content { | ||
flex: 0 0 calc(100% - 260px);; | ||
padding: 16px; | ||
background-color: $slate-gray-100; | ||
} | ||
} | ||
|
||
.example-sidenav-header { | ||
background-color: $dark-blue; | ||
padding: 16px 18px; | ||
margin: 10px 16px 10px 0; | ||
border-top-right-radius: 4px; | ||
border-bottom-right-radius: 4px; | ||
|
||
h2 { | ||
color: $white; | ||
font-size: 18px; | ||
font-weight: 300; | ||
} | ||
} | ||
|
||
.example-report-widget { | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
margin: 16px; | ||
} |
19 changes: 19 additions & 0 deletions
19
...ects/cashmere-examples/src/lib/sidenav-projection/sidenav-projection-example.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,19 @@ | ||
import {Component} from '@angular/core'; | ||
import { SidenavLink } from '@healthcatalyst/cashmere'; | ||
|
||
/** | ||
* @title Sidenav w/ Content Projection | ||
*/ | ||
@Component({ | ||
selector: 'hc-sidenav-projection-example', | ||
templateUrl: 'sidenav-projection-example.component.html', | ||
styleUrls: ['sidenav-projection-example.component.scss'] | ||
}) | ||
export class SidenavProjectionExampleComponent { | ||
tabs: SidenavLink[] = [ | ||
new SidenavLink({title: 'Sunny', iconClass: 'fa fa-sun-o', description: 'Sunny with a high of 75'}), | ||
new SidenavLink({title: 'Cloudy', iconClass: 'fa fa-cloud', description: 'Clouds clouds clouds'}), | ||
new SidenavLink({title: 'Stormy', iconClass: 'fa fa-bolt', description: 'Thunder & Lightning'}), | ||
new SidenavLink({title: 'Snowy', iconClass: 'fa fa-snowflake-o', description: 'Let it snow'}) | ||
] | ||
} |
24 changes: 24 additions & 0 deletions
24
projects/cashmere-examples/src/lib/sidenav/sidenav-example.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,24 @@ | ||
<div class="sidenav-example-app-shell"> | ||
|
||
<hc-sidenav | ||
[tabs]="tabs" | ||
[isLoadingTabs]="isLoadingTabs.value" | ||
(tabClicked)="onTabClick($event)" | ||
[favorites]="favs" | ||
[isLoadingFavorites]="isLoadingFavs.value" | ||
(favoriteClicked)="onFavClick($event)" | ||
(favoriteItemIconClicked)="unfavorite($event)" | ||
> | ||
</hc-sidenav> | ||
|
||
<div class="example-app-content"> | ||
<hc-checkbox [formControl]="isLoadingTabs">Simulate tabs loading</hc-checkbox> | ||
<hc-checkbox [formControl]="isLoadingFavs">Simulate favorites loading</hc-checkbox> | ||
<h4>Events:</h4> | ||
<div class="event-log"> | ||
<div *ngFor="let event of eventsLog"> | ||
{{event}} | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
59 changes: 59 additions & 0 deletions
59
projects/cashmere-examples/src/lib/sidenav/sidenav-example.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,59 @@ | ||
@import "@healthcatalyst/cashmere/scss/_colors"; | ||
|
||
// Example skeleton layout | ||
.sidenav-example-app-shell { | ||
display: flex; | ||
height: 500px; | ||
|
||
::ng-deep .hc-sidenav { | ||
height: 100%; | ||
} | ||
|
||
.example-app-content { | ||
flex: 1 0 auto; | ||
padding: 16px; | ||
background-color: $slate-gray-100; | ||
} | ||
|
||
h4 { | ||
margin-bottom: 4px; | ||
} | ||
|
||
// logging output | ||
.event-log { | ||
border: 1px solid $gray-200; | ||
background-color: darken($slate-gray-100, 2%); | ||
width: 50%; | ||
min-width: 250px; | ||
height: 300px; | ||
overflow-y: auto; | ||
border-radius: 4px; | ||
padding: 8px; | ||
line-height: 1.3; | ||
font-family: monospace; | ||
} | ||
|
||
// custom styles for favorite icons | ||
::ng-deep .hc-sidenav-favs { | ||
.fav-travel-ico { | ||
border-radius: 4px; | ||
color: $white; | ||
width: 22px; | ||
height: 22px; | ||
font-size: 12px; | ||
align-items: center; | ||
} | ||
|
||
.fav-ico-blue { | ||
background-color: $dark-blue; | ||
} | ||
|
||
.fav-ico-teal { | ||
background-color: $teal; | ||
} | ||
|
||
.fav-ico-green { | ||
background-color: $green; | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
projects/cashmere-examples/src/lib/sidenav/sidenav-example.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,44 @@ | ||
import {Component} from '@angular/core'; | ||
import { FormControl } from '@angular/forms'; | ||
import { SidenavLink, SidenavLinkClickEvent } from '@healthcatalyst/cashmere'; | ||
|
||
/** | ||
* @title Sidenav | ||
*/ | ||
@Component({ | ||
selector: 'hc-sidenav-example', | ||
templateUrl: 'sidenav-example.component.html', | ||
styleUrls: ['sidenav-example.component.scss'] | ||
}) | ||
export class SidenavExampleComponent { | ||
isLoadingTabs: FormControl = new FormControl(false); | ||
isLoadingFavs: FormControl = new FormControl(false); | ||
eventsLog: string[] = []; | ||
tabs: SidenavLink[] = [ | ||
new SidenavLink({title: 'Home', iconClass: 'fa fa-home', description: 'User\'s home dashboard'}), | ||
new SidenavLink({title: 'Land', iconClass: 'fa fa-car', description: 'Travel by land', subText: "$"}), | ||
new SidenavLink({title: 'Sky', iconClass: 'fa fa-plane', description: 'Travel by sky', subText: "$$"}), | ||
new SidenavLink({title: 'Sea', iconClass: 'fa fa-ship', description: 'Travel by sea', subText: "$"}), | ||
new SidenavLink({title: 'Space', iconClass: 'fa fa-rocket', description: 'Travel amongst the stars', subText: "$$$"}), | ||
] | ||
favs: SidenavLink[] = [ | ||
new SidenavLink({title: 'Toyota Tacoma', iconClass: 'fa fa-car fav-travel-ico fav-ico-teal', description: 'Solid mid-size pickup'}), | ||
new SidenavLink({title: 'Land Rover', iconClass: 'fa fa-car fav-travel-ico fav-ico-green', description: 'Travel in style'}), | ||
new SidenavLink({title: 'S.S. TugsAlot', iconClass: 'fa fa-ship fav-travel-ico fav-ico-teal', description: 'Tugboat'}), | ||
new SidenavLink({title: 'Boeing 737', iconClass: 'fa fa-plane fav-travel-ico fav-ico-blue', description: 'Fly the friendly skies'}), | ||
new SidenavLink({title: 'Falcon Heavy', iconClass: 'fa fa-rocket fav-travel-ico fav-ico-blue', description: 'Fly me to the moon'}), | ||
] | ||
|
||
onTabClick(event: SidenavLinkClickEvent): void { | ||
this.eventsLog.push(`Tab "${event.link.title}" clicked`); | ||
} | ||
|
||
onFavClick(event: SidenavLinkClickEvent): void { | ||
this.eventsLog.push(`Favorite "${event.link.title}" clicked`); | ||
} | ||
|
||
unfavorite(event: SidenavLinkClickEvent): void { | ||
this.eventsLog.push(`Favorite "${event.link.title}" action icon clicked`); | ||
this.favs = this.favs.filter(fav => fav.key !== event.link.key); | ||
} | ||
} |
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
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
Oops, something went wrong.