Skip to content

Commit f69cf89

Browse files
author
Stephen Carraway
committed
Add textarea directive and story. Fixes #153
1 parent 51fb95c commit f69cf89

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

src/input/input.directive.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,13 @@ import { Directive, HostBinding } from "@angular/core";
1717
export class TextInput {
1818
@HostBinding("class") inputClass = "bx--text-input";
1919
}
20+
21+
22+
@Directive({
23+
selector: "[ibmTextArea]"
24+
})
25+
export class TextAreaInput {
26+
@HostBinding("class.bx--text-area") baseClass = true;
27+
@HostBinding("class.bx--text-area--v2") secondaryClass = true;
28+
}
29+

src/input/input.module.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ import { CommonModule } from "@angular/common";
55

66
// imports
77
import { LabelComponent } from "./label.component";
8-
import { TextInput } from "./input.directive";
8+
import { TextInput, TextAreaInput } from "./input.directive";
99

1010
@NgModule({
1111
declarations: [
1212
LabelComponent,
13-
TextInput
13+
TextInput,
14+
TextAreaInput
1415
],
1516
exports: [
1617
LabelComponent,
17-
TextInput
18+
TextInput,
19+
TextAreaInput
1820
],
1921
imports: [
2022
CommonModule,

src/input/input.stories.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ storiesOf("Input", module).addDecorator(
2222
template: `
2323
<input ibmText placeholder="Optional placeholder text"/>
2424
`
25+
})).add("TextArea", () => ({
26+
template: `
27+
<textarea ibmTextArea placeholder="Optional placeholder text"></textarea>
28+
`
2529
}));

0 commit comments

Comments
 (0)