Merge pull request #10713 from storybookjs/generator_ember

cli: ember stories homogenization
This commit is contained in:
Clément DUNGLER 2020-05-11 17:10:43 +02:00 committed by GitHub
commit 1bc5a0c81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 1 deletions

View File

@ -8,7 +8,7 @@ export default {
export const ToStorybook = () => ({
template: hbs`
<div>
<h3> Welcome to Storybook! </h3>
<h3> Welcome to storybook </h3>
<button {{action onClick}}> Checkout the button example </button>
</div>
`,

View File

@ -1,5 +1,6 @@
import { hbs } from 'ember-cli-htmlbars';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
export default {
title: 'Button',
@ -24,3 +25,40 @@ export const Emoji = () => ({
onClick: action('clicked'),
},
});
Emoji.story = {
parameters: { notes: 'My notes on a button with emojis' },
};
export const WithSomeEmojiAndAction = () => ({
template: hbs`
<button {{action onClick}}>
<span role="img" aria-label="so cool">
😀 😎 👍 💯
</span>
</button>
`,
context: {
onClick: action('This was clicked'),
},
});
WithSomeEmojiAndAction.story = {
name: 'with some emoji and action',
parameters: { notes: 'My notes on a button with emojis' },
};
export const ButtonWithLinkToAnotherStory = () => ({
template: hbs`
<button {{action onClick}}>
Go to Welcome Story
</button>
`,
context: {
onClick: linkTo('Welcome'),
},
});
ButtonWithLinkToAnotherStory.story = {
name: 'button with link to another story',
};