Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: rax stories homogenization #10706

Merged
merged 1 commit into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/cli/src/generators/RAX/template-csf/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
stories: ['../stories/**/*.stories.js'],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { createElement } from 'rax';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';

import Text from 'rax-text';

export default {
title: 'Button',
};

export const text = () => (
<button type="button">
<Text>Hello Button</Text>
</button>
);

export const Emoji = () => (
<button onClick={action('clicked')} type="button">
<Text role="img" aria-label="so cool">
😀 😎 👍 💯
</Text>
</button>
);

Emoji.story = {
parameters: { notes: 'My notes on a button with emojis' },
};

export const WithSomeEmojiAndAction = () => (
<button onClick={action('This was clicked')} type="button">
<Text role="img" aria-label="so cool">
😀 😎 👍 💯
</Text>
</button>
);

WithSomeEmojiAndAction.story = {
name: 'with some emoji and action',
parameters: { notes: 'My notes on a button with emojis' },
};

export const ButtonWithLinkToAnotherStory = () => (
<button onClick={linkTo('Welcome')} type="button">
<Text>Go to Welcome Story</Text>
</button>
);

ButtonWithLinkToAnotherStory.story = {
name: 'button with link to another story',
};
23 changes: 0 additions & 23 deletions lib/cli/src/generators/RAX/template-csf/stories/1-View.stories.js

This file was deleted.