Skip to content

Commit 7f77511

Browse files
committed
issue #163: add light style to input component
1 parent dad486a commit 7f77511

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/input/input.directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Directive, HostBinding } from "@angular/core";
1+
import { Directive, HostBinding, Input } from "@angular/core";
22

33
/**
44
* A directive for applying styling to an input element.
@@ -16,4 +16,5 @@ import { Directive, HostBinding } from "@angular/core";
1616
})
1717
export class TextInput {
1818
@HostBinding("class.bx--text-input") inputClass = true;
19+
@HostBinding("class.bx--text-input--light") @Input() light = false;
1920
}

src/input/input.stories.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { storiesOf, moduleMetadata } from "@storybook/angular";
22
import { action } from "@storybook/addon-actions";
3-
import { withKnobs, boolean } from "@storybook/addon-knobs/angular";
3+
import { withKnobs } from "@storybook/addon-knobs/angular";
44

55
import { InputModule } from "../";
66

@@ -22,8 +22,19 @@ storiesOf("Input", module).addDecorator(
2222
template: `
2323
<input ibmText aria-label="input" placeholder="Optional placeholder text"/>
2424
`
25-
})).add("TextArea", () => ({
25+
}))
26+
.add("Light Input", () => ({
27+
template: `
28+
<input ibmText [light]="true" aria-label="input" placeholder="Optional placeholder text"/>
29+
`
30+
}))
31+
.add("TextArea", () => ({
2632
template: `
2733
<textarea ibmTextArea aria-label="textarea" placeholder="Optional placeholder text" rows="4" cols="50"></textarea>
2834
`
35+
}))
36+
.add("Light TextArea", () => ({
37+
template: `
38+
<textarea ibmTextArea [light]="true" aria-label="textarea" placeholder="Optional placeholder text" rows="4" cols="50"></textarea>
39+
`
2940
}));

src/input/text-area.directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Directive, HostBinding } from "@angular/core";
1+
import { Directive, HostBinding, Input } from "@angular/core";
22

33
/**
44
* A directive for applying styling to a textarea element.
@@ -16,4 +16,5 @@ import { Directive, HostBinding } from "@angular/core";
1616
})
1717
export class TextArea {
1818
@HostBinding("class.bx--text-area") baseClass = true;
19+
@HostBinding("class.bx--text-area--light") @Input() light = false;
1920
}

0 commit comments

Comments
 (0)