-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into build-storybook-watch-mode
- Loading branch information
Showing
6 changed files
with
132 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
examples/angular-cli/src/stories/__snapshots__/custom-styles.stories.storyshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Storyshots Custom Style Default 1`] = ` | ||
<storybook-dynamic-app-root | ||
cfr={[Function CodegenComponentFactoryResolver]} | ||
data={[Function Object]} | ||
target={[Function ViewContainerRef_]} | ||
> | ||
<ng-component> | ||
<storybook-button-component | ||
_nghost-c9="" | ||
ng-reflect-text="Button with custom styles" | ||
> | ||
|
||
|
||
<button | ||
_ngcontent-c9="" | ||
> | ||
Button with custom styles | ||
</button> | ||
|
||
|
||
</storybook-button-component> | ||
</ng-component> | ||
</storybook-dynamic-app-root> | ||
`; | ||
|
||
exports[`Storyshots Custom Style With Knobs 1`] = ` | ||
<storybook-dynamic-app-root | ||
cfr={[Function CodegenComponentFactoryResolver]} | ||
data={[Function Object]} | ||
target={[Function ViewContainerRef_]} | ||
> | ||
<ng-component | ||
_nghost-c10="" | ||
> | ||
<storybook-button-component | ||
_ngcontent-c10="" | ||
_nghost-c11="" | ||
ng-reflect-text="Button with custom styles" | ||
> | ||
|
||
|
||
<button | ||
_ngcontent-c11="" | ||
> | ||
Button with custom styles | ||
</button> | ||
|
||
|
||
</storybook-button-component> | ||
</ng-component> | ||
</storybook-dynamic-app-root> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { storiesOf } from '@storybook/angular'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { withKnobs, text } from '@storybook/addon-knobs/angular'; | ||
import { Button } from '@storybook/angular/demo'; | ||
|
||
storiesOf('Custom Style', module) | ||
.add('Default', () => ({ | ||
template: `<storybook-button-component [text]="text" (onClick)="onClick($event)"></storybook-button-component>`, | ||
moduleMetadata: { | ||
declarations: [Button], | ||
}, | ||
props: { | ||
text: 'Button with custom styles', | ||
onClick: action('log'), | ||
}, | ||
styles: [ | ||
` | ||
storybook-button-component { | ||
background-color: yellow; | ||
padding: 25px; | ||
} | ||
`, | ||
], | ||
})) | ||
.addDecorator(withKnobs) | ||
.add('With Knobs', () => ({ | ||
template: `<storybook-button-component [text]="text" (onClick)="onClick($event)"></storybook-button-component>`, | ||
moduleMetadata: { | ||
declarations: [Button], | ||
}, | ||
props: { | ||
text: text('text', 'Button with custom styles'), | ||
onClick: action('log'), | ||
}, | ||
styles: [ | ||
` | ||
storybook-button-component { | ||
background-color: red; | ||
padding: 25px; | ||
} | ||
`, | ||
], | ||
})); |