Skip to content

Commit ee95dc5

Browse files
committed
issue #163: light input review feedback
1 parent 7f77511 commit ee95dc5

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

src/input/input.directive.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ import { Directive, HostBinding, Input } from "@angular/core";
1515
selector: "[ibmText]"
1616
})
1717
export class TextInput {
18+
/**
19+
* `light` or `dark` input theme
20+
*/
21+
@Input() theme: "light" | "dark" = "dark";
22+
1823
@HostBinding("class.bx--text-input") inputClass = true;
19-
@HostBinding("class.bx--text-input--light") @Input() light = false;
24+
@HostBinding("class.bx--text-input--light") get isLightTheme() {
25+
return this.theme === "light";
26+
}
2027
}

src/input/input.stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ storiesOf("Input", module).addDecorator(
2525
}))
2626
.add("Light Input", () => ({
2727
template: `
28-
<input ibmText [light]="true" aria-label="input" placeholder="Optional placeholder text"/>
28+
<input ibmText [theme]="'light'" aria-label="input" placeholder="Optional placeholder text"/>
2929
`
3030
}))
3131
.add("TextArea", () => ({
@@ -35,6 +35,6 @@ storiesOf("Input", module).addDecorator(
3535
}))
3636
.add("Light TextArea", () => ({
3737
template: `
38-
<textarea ibmTextArea [light]="true" aria-label="textarea" placeholder="Optional placeholder text" rows="4" cols="50"></textarea>
38+
<textarea ibmTextArea [theme]="'light'" aria-label="textarea" placeholder="Optional placeholder text" rows="4" cols="50"></textarea>
3939
`
4040
}));

src/input/text-area.directive.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ import { Directive, HostBinding, Input } from "@angular/core";
1515
selector: "[ibmTextArea]"
1616
})
1717
export class TextArea {
18+
/**
19+
* `light` or `dark` input theme
20+
*/
21+
@Input() theme: "light" | "dark" = "dark";
22+
1823
@HostBinding("class.bx--text-area") baseClass = true;
19-
@HostBinding("class.bx--text-area--light") @Input() light = false;
24+
@HostBinding("class.bx--text-area--light") get isLightTheme() {
25+
return this.theme === "light";
26+
}
2027
}

0 commit comments

Comments
 (0)