Skip to content

Commit fcea0ef

Browse files
authored
Merge branch 'master' into master
2 parents a6d0770 + a3ced8b commit fcea0ef

File tree

4 files changed

+98
-0
lines changed

4 files changed

+98
-0
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ export * from "./radio/radio.module";
2121
export * from "./input/input.module";
2222
export * from "./select/select.module";
2323
export * from "./tiles/tiles.module";
24+
export * from "./progress-indicator/progress-indicator.module";
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Component, Input } from "@angular/core";
2+
3+
@Component({
4+
selector: "ibm-progress-indicator",
5+
template: `
6+
<ul data-progress data-progress-current class="bx--progress">
7+
<li
8+
class="bx--progress-step bx--progress-step--{{step.state}}"
9+
*ngFor="let step of steps; let i = index">
10+
<svg *ngIf="step.state == 'complete'" width="16" height="16" viewBox="0 0 16 16">
11+
<g fill-rule="nonzero">
12+
<path d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"/>
13+
<path d="M11.646 5.146l.708.708-5.604 5.603-3.104-3.103.708-.708 2.396 2.397z"/>
14+
</g>
15+
</svg>
16+
<svg *ngIf="step.state == 'current'">
17+
<circle cx="12" cy="12" r="12"></circle>
18+
<circle cx="12" cy="12" r="6"></circle>
19+
</svg>
20+
<svg *ngIf="step.state == 'incomplete'">
21+
<circle cx="12" cy="12" r="12"></circle>
22+
</svg>
23+
<p class="bx--progress-label">{{step.text}}</p>
24+
<span class="bx--progress-line"></span>
25+
</li>
26+
</ul>
27+
`
28+
})
29+
export class ProgressIndicator {
30+
@Input() steps = [];
31+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { NgModule } from "@angular/core";
2+
import { CommonModule } from "@angular/common";
3+
4+
import { ProgressIndicator } from "./progress-indicator.component";
5+
6+
7+
@NgModule({
8+
declarations: [
9+
ProgressIndicator
10+
],
11+
exports: [
12+
ProgressIndicator
13+
],
14+
imports: [CommonModule]
15+
})
16+
export class ProgressIndicatorModule { }
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { storiesOf, moduleMetadata } from "@storybook/angular";
2+
import { withNotes } from "@storybook/addon-notes";
3+
import { action } from "@storybook/addon-actions";
4+
import { withKnobs, boolean, object } from "@storybook/addon-knobs/angular";
5+
6+
import { ProgressIndicatorModule } from "../";
7+
8+
storiesOf("ProgressIndicator", module)
9+
.addDecorator(
10+
moduleMetadata({
11+
imports: [
12+
ProgressIndicatorModule
13+
]
14+
})
15+
)
16+
.addDecorator(withKnobs)
17+
.add("Basic", () => ({
18+
template: `
19+
<ibm-progress-indicator [steps]="steps">
20+
</ibm-progress-indicator>
21+
`,
22+
props: {
23+
steps : [
24+
{
25+
text: "1. ONE",
26+
state: ["complete"]
27+
},
28+
{
29+
text: "2. TWO",
30+
state: ["complete"]
31+
},
32+
{
33+
text: "3. THREE",
34+
state: ["current"]
35+
},
36+
{
37+
text: "4. FOUR",
38+
state: ["incomplete"]
39+
},
40+
{
41+
text: "5. FIVE",
42+
state: ["incomplete"]
43+
},
44+
{
45+
text: "6. SIX",
46+
state: ["incomplete"]
47+
}
48+
]
49+
}
50+
}));

0 commit comments

Comments
 (0)