Skip to content

Commit 3d28d3c

Browse files
committed
feat(button): Add skeleton state
1 parent aea73dc commit 3d28d3c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/button/button.directive.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class Button implements OnInit {
2424
/**
2525
* sets the button type
2626
*/
27-
@Input() ibmButton: "primary" | "secondary" | "tertiary" | "ghost" | "danger" | "danger--primary" = "primary";
27+
@Input() ibmButton: "primary" | "secondary" | "tertiary" | "ghost" | "danger" | "danger--primary" | "skeleton" = "primary";
2828
/**
2929
* Specify the size of the button
3030
*/
@@ -37,6 +37,7 @@ export class Button implements OnInit {
3737
@HostBinding("class.bx--btn--ghost") ghost = false;
3838
@HostBinding("class.bx--btn--danger") danger = false;
3939
@HostBinding("class.bx--btn--danger--primary") dangerPrimary = false;
40+
@HostBinding("class.bx--skeleton") skeleton = false;
4041
@HostBinding("class.bx--btn--sm") smallSize = false;
4142

4243
ngOnInit() {
@@ -51,6 +52,7 @@ export class Button implements OnInit {
5152
case "ghost": this.ghost = true; break;
5253
case "danger": this.danger = true; break;
5354
case "danger--primary": this.dangerPrimary = true; break;
55+
case "skeleton": this.skeleton = true; break;
5456
default: this.primary = true; break;
5557
}
5658
}

src/button/button.stories.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,12 @@ storiesOf("Button", module)
2929
props: {
3030
size: select("Size of the buttons", ["normal", "sm"], "normal")
3131
}
32+
}))
33+
.add("Skeleton", () => ({
34+
template: `
35+
<button ibmButton="skeleton" [size]="size"></button>
36+
`,
37+
props: {
38+
size: select("Size of the buttons", ["normal", "sm"], "normal")
39+
}
3240
}));

0 commit comments

Comments
 (0)