Skip to content

Commit ce52dfd

Browse files
Merge pull request #701 from dxc-technology/setup-storybook
Adding config storybook chromatic
2 parents 54d857f + e495d06 commit ce52dfd

35 files changed

+13172
-1269
lines changed

.github/workflows/chromatic.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Chromatic"
2+
3+
on:
4+
push:
5+
branches:
6+
- storybook
7+
pull_request:
8+
9+
jobs:
10+
chromatic-deployment:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Install lib dependencies
19+
run: cd projects/dxc-ngx-cdk && npm install
20+
21+
- name: Publish to Chromatic
22+
uses: chromaui/action@v1
23+
with:
24+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
25+
exitOnceUploaded: true
26+
exitZeroOnChanges: true
27+
workingDir: projects/dxc-ngx-cdk

.vscode/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"workbench.colorCustomizations": {
3-
"activityBar.activeBackground": "#8cb761",
3+
"activityBar.activeBackground": "#073caf",
44
"activityBar.activeBorder": "#e9eff5",
5-
"activityBar.background": "#8cb761",
5+
"activityBar.background": "#ec5fa6",
66
"activityBar.foreground": "#15202b",
77
"activityBar.inactiveForeground": "#15202b99",
88
"activityBarBadge.background": "#e9eff5",
99
"activityBarBadge.foreground": "#15202b",
10-
"statusBar.background": "#739d48",
10+
"statusBar.background": "#ec5fa6",
1111
"statusBar.foreground": "#15202b",
1212
"statusBarItem.hoverBackground": "#597a38",
1313
"titleBar.activeBackground": "#739d48",

package-lock.json

Lines changed: 13 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { NgModule } from "@angular/core";
2+
import { CommonModule } from "@angular/common";
3+
import { ExampleContainerComponent } from "./example-container/example-container.component";
4+
import { TitleComponent } from "./title/title.component";
5+
import { DarkSectionComponent } from "./dark-section/dark-section.component";
6+
7+
@NgModule({
8+
declarations: [
9+
TitleComponent,
10+
ExampleContainerComponent,
11+
DarkSectionComponent,
12+
],
13+
imports: [CommonModule],
14+
exports: [TitleComponent, ExampleContainerComponent, DarkSectionComponent],
15+
})
16+
export class ComponentsModule {}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.dark-section{
2+
background-color: #333333;
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="dark-section">
2+
<ng-content></ng-content>
3+
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { DarkSectionComponent } from './dark-section.component';
4+
5+
describe('DarkSectionComponent', () => {
6+
let component: DarkSectionComponent;
7+
let fixture: ComponentFixture<DarkSectionComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [ DarkSectionComponent ]
12+
})
13+
.compileComponents();
14+
});
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(DarkSectionComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Component, OnInit } from "@angular/core";
2+
3+
@Component({
4+
selector: "sb-dark-container",
5+
templateUrl: "./dark-section.component.html",
6+
styleUrls: ["./dark-section.component.css"],
7+
})
8+
export class DarkSectionComponent implements OnInit {
9+
constructor() {}
10+
11+
ngOnInit(): void {}
12+
}

projects/dxc-ngx-cdk/.storybook/components/example-container/example-container.component.css

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="example-container">
2+
<ng-content></ng-content>
3+
</div>

0 commit comments

Comments
 (0)