Skip to content

Commit 1a03b01

Browse files
authored
Merge pull request #553 from cal-smith/master
feat(ui-shell): add panel and product switcher, refactor into modules
2 parents 10d83ff + 8e4b101 commit 1a03b01

24 files changed

+1550
-535
lines changed

package-lock.json

Lines changed: 1245 additions & 457 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ui-shell/header-action.component.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/ui-shell/hamburger.component.ts renamed to src/ui-shell/header/hamburger.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component } from "@angular/core";
2-
import { I18n } from "../i18n/i18n.module";
2+
import { I18n } from "../../i18n/i18n.module";
33

44
/**
55
* A slide-out hamburger menu
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import {
2+
Component,
3+
Input,
4+
Output,
5+
EventEmitter
6+
} from "@angular/core";
7+
8+
@Component({
9+
selector: "ibm-header-action",
10+
template: `
11+
<button
12+
class="bx--header__action"
13+
[ngClass]="{
14+
'bx--header__action--active': active
15+
}"
16+
[attr.aria-label]="title"
17+
[title]="title"
18+
(click)="onClick()">
19+
<ng-content></ng-content>
20+
<svg ibmIconClose20 class="bx--navigation-menu-panel-collapse-icon"></svg>
21+
</button>
22+
`
23+
})
24+
export class HeaderAction {
25+
@Input() title;
26+
@Input() active = false;
27+
@Output() selected = new EventEmitter<boolean>();
28+
29+
onClick() {
30+
this.active = !this.active;
31+
this.selected.emit(this.active);
32+
}
33+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/ui-shell/header.component.spec.ts renamed to src/ui-shell/header/header.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { Component } from "@angular/core";
22
import { ComponentFixture, TestBed } from "@angular/core/testing";
33
import { By } from "@angular/platform-browser";
44

5-
import { I18nModule } from "../i18n/i18n.module";
5+
import { I18nModule } from "../../i18n/i18n.module";
66
import { Header } from "./header.component";
7-
import { Hamburger } from "./ui-shell.module";
7+
import { Hamburger } from "../ui-shell.module";
88

99
/**
1010
* Testing component for projecting an ibm-hamburger component
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, Input, HostBinding } from "@angular/core";
2-
import { I18n } from "./../i18n/i18n.module";
2+
import { I18n } from "../../i18n/i18n.module";
33

44
/**
55
* [See demo](../../?path=/story/ui-shell--header)

0 commit comments

Comments
 (0)