From 769967559d6c8e1fadb6746ab03dd539bd9fc8ff Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Sat, 9 May 2020 11:27:20 +0200 Subject: [PATCH] cli: rax stories homogenization --- .../RAX/template-csf/.storybook/main.js | 1 + .../template-csf/stories/1-Button.stories.js | 50 +++++++++++++++++++ .../template-csf/stories/1-View.stories.js | 23 --------- 3 files changed, 51 insertions(+), 23 deletions(-) create mode 100644 lib/cli/src/generators/RAX/template-csf/stories/1-Button.stories.js delete mode 100644 lib/cli/src/generators/RAX/template-csf/stories/1-View.stories.js diff --git a/lib/cli/src/generators/RAX/template-csf/.storybook/main.js b/lib/cli/src/generators/RAX/template-csf/.storybook/main.js index 77857c48de3f..3036098563cc 100644 --- a/lib/cli/src/generators/RAX/template-csf/.storybook/main.js +++ b/lib/cli/src/generators/RAX/template-csf/.storybook/main.js @@ -1,3 +1,4 @@ module.exports = { stories: ['../stories/**/*.stories.js'], + addons: ['@storybook/addon-actions', '@storybook/addon-links'], }; diff --git a/lib/cli/src/generators/RAX/template-csf/stories/1-Button.stories.js b/lib/cli/src/generators/RAX/template-csf/stories/1-Button.stories.js new file mode 100644 index 000000000000..0835fe53e439 --- /dev/null +++ b/lib/cli/src/generators/RAX/template-csf/stories/1-Button.stories.js @@ -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 = () => ( + +); + +export const Emoji = () => ( + +); + +Emoji.story = { + parameters: { notes: 'My notes on a button with emojis' }, +}; + +export const WithSomeEmojiAndAction = () => ( + +); + +WithSomeEmojiAndAction.story = { + name: 'with some emoji and action', + parameters: { notes: 'My notes on a button with emojis' }, +}; + +export const ButtonWithLinkToAnotherStory = () => ( + +); + +ButtonWithLinkToAnotherStory.story = { + name: 'button with link to another story', +}; diff --git a/lib/cli/src/generators/RAX/template-csf/stories/1-View.stories.js b/lib/cli/src/generators/RAX/template-csf/stories/1-View.stories.js deleted file mode 100644 index 524da8884f88..000000000000 --- a/lib/cli/src/generators/RAX/template-csf/stories/1-View.stories.js +++ /dev/null @@ -1,23 +0,0 @@ -import { createElement } from 'rax'; -import { action } from '@storybook/addon-actions'; - -import Text from 'rax-text'; -import View from 'rax-view'; - -export default { - title: 'View', -}; - -export const text = () => ( - - Hello view - -); - -export const Emoji = () => ( - - - 😀 😎 👍 💯 - - -);