Skip to content

Commit 83a2e74

Browse files
committed
issue #163: light style for dropdown
1 parent dad486a commit 83a2e74

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

src/dropdown/dropdown.component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ import { I18n } from "./../i18n/i18n.module";
2828
@Component({
2929
selector: "ibm-dropdown",
3030
template: `
31-
<div class="bx--list-box">
31+
<div
32+
class="bx--list-box"
33+
[ngClass]="{'bx--dropdown--light': light}"
34+
>
3235
<button
3336
type="button"
3437
#dropdownButton
@@ -82,7 +85,11 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
8285
* item selection.
8386
*/
8487
@Input() type: "single" | "multi" = "single";
85-
88+
/**
89+
* Set to `true` to apply the light style to the dropdown.
90+
* @memberof Dropdown
91+
*/
92+
@Input() light = false;
8693
/**
8794
* Set to `true` to disable the dropdown.
8895
*/

src/dropdown/dropdown.stories.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,29 @@ storiesOf("Dropdown", module)
4141
onClose: action("Dropdown closed")
4242
}
4343
}))
44+
.add("Light", () => ({
45+
template: `
46+
<ibm-dropdown
47+
[light]="true"
48+
placeholder="Select"
49+
[disabled]="disabled"
50+
(selected)="selected($event)"
51+
(onClose)="onClose($event)">
52+
<ibm-dropdown-list [items]="items"></ibm-dropdown-list>
53+
</ibm-dropdown>
54+
`,
55+
props: {
56+
disabled: boolean("disabled", false),
57+
items: object("items", [
58+
{ content: "one" },
59+
{ content: "two" },
60+
{ content: "three" },
61+
{ content: "four" }
62+
]),
63+
selected: action("Selected fired for dropdown"),
64+
onClose: action("Dropdown closed")
65+
}
66+
}))
4467
.add("Multi-select", withNotes({ text: "Notes on multi select" })(() => ({
4568
template: `
4669
<ibm-dropdown

0 commit comments

Comments
 (0)