funky-framadate-front/src/stories/1-Button.stories.ts

53 lines
1016 B
TypeScript
Raw Normal View History

2020-02-18 13:52:22 +01:00
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { Button } from '@storybook/angular/demo';
export default {
2020-04-21 10:50:26 +02:00
title: 'Button',
component: Button,
2020-02-18 13:52:22 +01:00
};
export const Text = () => ({
2020-04-21 10:50:26 +02:00
component: Button,
props: {
text: 'Hello Button',
},
2020-02-18 13:52:22 +01:00
});
export const Emoji = () => ({
2020-04-21 10:50:26 +02:00
component: Button,
props: {
text: '😀 😎 👍 💯',
},
2020-02-18 13:52:22 +01:00
});
Emoji.story = {
2020-04-21 10:50:26 +02:00
parameters: { notes: 'My notes on a button with emojis' },
2020-02-18 13:52:22 +01:00
};
export const WithSomeEmojiAndAction = () => ({
2020-04-21 10:50:26 +02:00
component: Button,
props: {
text: '😀 😎 👍 💯',
onClick: action('This was clicked OMG'),
},
2020-02-18 13:52:22 +01:00
});
WithSomeEmojiAndAction.story = {
2020-04-21 10:50:26 +02:00
name: 'with some emoji and action',
parameters: { notes: 'My notes on a button with emojis' },
2020-02-18 13:52:22 +01:00
};
export const ButtonWithLinkToAnotherStory = () => ({
2020-04-21 10:50:26 +02:00
component: Button,
props: {
text: 'Go to Welcome Story',
onClick: linkTo('Welcome'),
},
2020-02-18 13:52:22 +01:00
});
ButtonWithLinkToAnotherStory.story = {
2020-04-21 10:50:26 +02:00
name: 'button with link to another story',
2020-02-18 13:52:22 +01:00
};