Skip to content

Commit

Permalink
fix(docs): example row helper (#1548)
Browse files Browse the repository at this point in the history
  • Loading branch information
yggg authored Jun 2, 2019
1 parent 870fe76 commit c0d404f
Show file tree
Hide file tree
Showing 29 changed files with 59 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

.component-icon {
margin-bottom: 1rem;
width: 4rem;
height: 4rem;
width: auto;
}

.component-name {
Expand Down
18 changes: 9 additions & 9 deletions src/playground/styles/example-helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@
justify-content: space-around;
}

.example-items-row {
margin-top: -1rem;
.example-items-rows {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: flex-start;
margin: -0.5rem;

> * {
margin-top: 1rem;
margin-right: 1rem;

&:last-child {
margin-right: 0;
}
margin: 0.5rem;
}
}

.example-last-child-no-b-margin > :last-child {
margin-bottom: 0;
}

.example-items-col {
display: flex;
flex-direction: column;
align-items: flex-start;

& > * {
margin-bottom: 1rem;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nb-card>
<nb-card-body>
<nb-card-body class="example-last-child-no-b-margin">
<nb-alert accent="primary">Primary. You have been successfully authenticated!</nb-alert>
<nb-alert accent="success">Success. You have been successfully authenticated!</nb-alert>
<nb-alert accent="info">Info. You have been successfully authenticated!</nb-alert>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nb-card>
<nb-card-body>
<nb-card-body class="example-last-child-no-b-margin">
<nb-alert status="primary">Primary. You have been successfully authenticated!</nb-alert>
<nb-alert status="success">Success. You have been successfully authenticated!</nb-alert>
<nb-alert status="info">Info. You have been successfully authenticated!</nb-alert>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nb-card>
<nb-card-body>
<nb-card-body class="example-last-child-no-b-margin">
<nb-alert outline="primary">Primary. You have been successfully authenticated!</nb-alert>
<nb-alert outline="success">Success. You have been successfully authenticated!</nb-alert>
<nb-alert outline="info">Info. You have been successfully authenticated!</nb-alert>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nb-card>
<nb-card-body>
<nb-card-body class="example-last-child-no-b-margin">
<nb-alert status="success" closable>You have been successfully authenticated!</nb-alert>
</nb-card-body>
</nb-card>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nb-card>
<nb-card-body>
<nb-card-body class="example-last-child-no-b-margin">
<nb-alert status="primary" size="tiny">Tiny. You have been successfully authenticated!</nb-alert>
<nb-alert status="primary" size="small">Small. You have been successfully authenticated!</nb-alert>
<nb-alert status="primary" size="medium">Medium. You have been successfully authenticated!</nb-alert>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nb-card>
<nb-card-header>Button Colors</nb-card-header>
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<button nbButton status="primary">Primary</button>
<button nbButton status="success">Success</button>
<button nbButton status="info">Info</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nb-card>
<nb-card-header>Button Full Width</nb-card-header>
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<button nbButton fullWidth status="primary">Primary</button>
<button nbButton fullWidth status="success">Success</button>
<button nbButton fullWidth status="info">Info</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nb-card>
<nb-card-header>Button Hero</nb-card-header>
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<button nbButton hero status="primary">Primary</button>
<button nbButton hero status="success">Success</button>
<button nbButton hero status="info">Info</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nb-card>
<nb-card-header>Button with Icon</nb-card-header>
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<button nbButton status="primary"><nb-icon icon="star"></nb-icon>Primary</button>
<button nbButton status="success">Success<nb-icon icon="star"></nb-icon></button>
<button nbButton status="danger"><nb-icon icon="star"></nb-icon></button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nb-card>
<nb-card-header>Button Outline</nb-card-header>
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<button nbButton outline status="primary">Primary</button>
<button nbButton outline status="success">Success</button>
<button nbButton outline status="info">Info</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nb-card>
<nb-card-header>Button Shapes</nb-card-header>
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<button nbButton shape="rectangle" status="primary">Rectangle Hero</button>
<button nbButton shape="semi-round" status="info">Semi-round Outline</button>
<button nbButton shape="round" size="small" status="success">Round Small</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nb-card>
<nb-card-header>Button</nb-card-header>
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<button nbButton>Active</button>
<button nbButton disabled>Disabled</button>
</nb-card-body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nb-card>
<nb-card-header>Button Sizes</nb-card-header>
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<button nbButton size="tiny">tiny</button>
<button nbButton size="small">small</button>
<button nbButton size="medium">medium</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nb-card>
<nb-card-header>Button Elements</nb-card-header>
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<button (click)="onClick()" nbButton>Button</button>
<input (click)="onClick()" nbButton type="submit" value="Input Submit"/>
<input (click)="onClick()" nbButton type="button" value="Input Button"/>
Expand Down
2 changes: 0 additions & 2 deletions src/playground/with-layout/button/button-types.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
templateUrl: './button-types.component.html',
})
export class ButtonTypesComponent {


onClick() {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/playground/with-layout/icon/icon-colors.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nb-card>
<nb-card-body>
<nb-card-body class="example-items-rows">
<nb-icon icon="heart-outline" status="primary"></nb-icon>
<nb-icon icon="heart-outline" status="info"></nb-icon>
<nb-icon icon="heart-outline" status="success"></nb-icon>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nb-card>
<nb-card-body>
<nb-card-body class="example-items-rows">
<nb-icon icon="heart-outline"></nb-icon>
<nb-icon icon="star"></nb-icon>
</nb-card-body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Component } from '@angular/core';
@Component({
template: `
<nb-card>
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<input type="text" nbInput placeholder="Text field">
<input type="text" nbInput placeholder="Disabled Text field" disabled>
</nb-card-body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<nb-card-body>
<div class="container">
<nb-actions size="medium">
<nb-action icon="arrowhead-down-outline" (click)="setValue(value - 25)"></nb-action>
<nb-action icon="minus-outline" (click)="setValue(value - 25)"></nb-action>
</nb-actions>
<nb-progress-bar [value]="value" [status]="status" [displayValue]="true"></nb-progress-bar>
<nb-actions size="medium">
<nb-action icon="arrowhead-up-outline" (click)="setValue(value + 25)"></nb-action>
<nb-action icon="plus-outline" (click)="setValue(value + 25)"></nb-action>
</nb-actions>
</div>
</nb-card-body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Component } from '@angular/core';
selector: 'nb-app-spinner-button',
template: `
<nb-card accent="primary">
<nb-card-body class="example-items-row">
<nb-card-body class="example-items-rows">
<button nbButton status="success" (click)="toggleLoadingAnimation()"
[nbSpinner]="loading" nbSpinnerStatus="success" nbSpinnerSize="large" nbSpinnerMessage="">
Download
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, HostBinding } from '@angular/core';
import { NbToastrService } from '@nebular/theme';

@Component({
Expand All @@ -12,17 +12,15 @@ import { NbToastrService } from '@nebular/theme';
::ng-deep nb-layout-column {
height: 80vw;
}
button {
margin: 1rem;
}
`,
],
})

export class ToastrDestroyByClickComponent {
private index: number = 0;

@HostBinding('class')
className = 'example-items-rows';

constructor(private toastrService: NbToastrService) {
}

Expand Down
10 changes: 4 additions & 6 deletions src/playground/with-layout/toastr/toastr-duration.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, HostBinding } from '@angular/core';
import { NbToastrService } from '@nebular/theme';

@Component({
Expand All @@ -13,17 +13,15 @@ import { NbToastrService } from '@nebular/theme';
::ng-deep nb-layout-column {
height: 80vw;
}
button {
margin: 1rem;
}
`,
],
})

export class ToastrDurationComponent {
private index: number = 0;

@HostBinding('class')
className = 'example-items-rows';

constructor(private toastrService: NbToastrService) {
}

Expand Down
10 changes: 4 additions & 6 deletions src/playground/with-layout/toastr/toastr-icon.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, HostBinding } from '@angular/core';
import { NbToastrService } from '@nebular/theme';

@Component({
Expand All @@ -13,17 +13,15 @@ import { NbToastrService } from '@nebular/theme';
::ng-deep nb-layout-column {
height: 80vw;
}
button {
margin: 1rem;
}
`,
],
})

export class ToastrIconComponent {
private index: number = 0;

@HostBinding('class')
className = 'example-items-rows';

constructor(private toastrService: NbToastrService) {
}

Expand Down
10 changes: 4 additions & 6 deletions src/playground/with-layout/toastr/toastr-positions.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, HostBinding } from '@angular/core';
import { NbToastrService } from '@nebular/theme';

@Component({
Expand All @@ -18,17 +18,15 @@ import { NbToastrService } from '@nebular/theme';
::ng-deep nb-layout-column {
height: 80vw;
}
button {
margin: 1rem;
}
`,
],
})

export class ToastrPositionsComponent {
private index: number = 0;

@HostBinding('class')
classes = 'example-items-rows';

constructor(private toastrService: NbToastrService) {
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, HostBinding } from '@angular/core';
import { NbToastrService } from '@nebular/theme';

@Component({
Expand All @@ -12,14 +12,14 @@ import { NbToastrService } from '@nebular/theme';
::ng-deep nb-layout-column {
height: 80vw;
}
button {
margin: 1rem;
}
`,
],
})
export class ToastrPreventDuplicatesComponent {

@HostBinding('class')
classes = 'example-items-rows';

constructor(private toastrService: NbToastrService) {
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, HostBinding } from '@angular/core';
import { NbToastrService } from '@nebular/theme';

@Component({
Expand All @@ -12,16 +12,15 @@ import { NbToastrService } from '@nebular/theme';
::ng-deep nb-layout-column {
height: 80vw;
}
button {
margin: 1rem;
}
`,
],
})
export class ToastrShowcaseComponent {
private index: number = 0;

@HostBinding('class')
classes = 'example-items-rows';

constructor(private toastrService: NbToastrService) {
}

Expand Down
10 changes: 4 additions & 6 deletions src/playground/with-layout/toastr/toastr-statuses.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, HostBinding } from '@angular/core';
import { NbToastrService } from '@nebular/theme';

@Component({
Expand All @@ -16,17 +16,15 @@ import { NbToastrService } from '@nebular/theme';
::ng-deep nb-layout-column {
height: 80vw;
}
button {
margin: 1rem;
}
`,
],
})

export class ToastrStatusesComponent {
private index: number = 0;

@HostBinding('class')
classes = 'example-items-rows';

constructor(private toastrService: NbToastrService) {
}

Expand Down

0 comments on commit c0d404f

Please sign in to comment.