Skip to content

Commit f9f2701

Browse files
author
Stephen Carraway
committed
Addressing code review comments
1 parent f69cf89 commit f9f2701

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

src/input/input.directive.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,3 @@ export class TextInput {
1818
@HostBinding("class") inputClass = "bx--text-input";
1919
}
2020

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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ import { CommonModule } from "@angular/common";
55

66
// imports
77
import { LabelComponent } from "./label.component";
8-
import { TextInput, TextAreaInput } from "./input.directive";
8+
import { TextInput } from "./input.directive";
9+
import { TextArea } from "./text-area.directive";
910

1011
@NgModule({
1112
declarations: [
1213
LabelComponent,
1314
TextInput,
14-
TextAreaInput
15+
TextArea
1516
],
1617
exports: [
1718
LabelComponent,
1819
TextInput,
19-
TextAreaInput
20+
TextArea
2021
],
2122
imports: [
2223
CommonModule,

src/input/input.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ storiesOf("Input", module).addDecorator(
2424
`
2525
})).add("TextArea", () => ({
2626
template: `
27-
<textarea ibmTextArea placeholder="Optional placeholder text"></textarea>
27+
<textarea ibmTextArea placeholder="Optional placeholder text" rows="4" cols="50"></textarea>
2828
`
2929
}));

src/input/text-area.directive.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Directive, HostBinding } from "@angular/core";
2+
3+
/**
4+
* A directive for applying styling to a textarea element.
5+
*
6+
* Example:
7+
*
8+
* ```hmtl
9+
* <textarea ibmTextArea></textarea>
10+
* ```
11+
*
12+
* See the [vanilla carbon docs](http://www.carbondesignsystem.com/components/text-input/code) for more detail.
13+
*/
14+
@Directive({
15+
selector: "[ibmTextArea]"
16+
})
17+
export class TextArea {
18+
@HostBinding("class.bx--text-area") baseClass = true;
19+
}

0 commit comments

Comments
 (0)