Skip to content

Commit

Permalink
feat(storybook): add stories for the component
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayakkulkarni committed May 18, 2020
1 parent 72dfddf commit 8b24f34
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Vue from 'vue';
import VueCompositionApi from '@vue/composition-api';

Vue.use(VueCompositionApi);
3 changes: 3 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
stories: ['../src/**/*.stories.[tj]s'],
};
32 changes: 32 additions & 0 deletions src/VGithubIcon.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import VGithubIcon from './index';

export default { title: 'GitHub Icon' };

export const withUrlProp = () => ({
components: { VGithubIcon },
template: '<v-github-icon url="https://vinayakkulkarni.dev" />',
});

export const withTopLeftPosition = () => ({
components: { VGithubIcon },
template:
'<v-github-icon url="https://vinayakkulkarni.dev" position="top-left" />',
});

export const withBgColorProp = () => ({
components: { VGithubIcon },
template:
'<v-github-icon url="https://vinayakkulkarni.dev" bg-color="red" />',
});

export const withFillColorProp = () => ({
components: { VGithubIcon },
template:
'<v-github-icon url="https://vinayakkulkarni.dev" fill-color="red" />',
});

export const withBgAndFillColorProp = () => ({
components: { VGithubIcon },
template:
'<v-github-icon url="https://vinayakkulkarni.dev" bg-color="rgba(10, 150, 200)" fill-color="rgba(255, 150, 20)" />',
});

0 comments on commit 8b24f34

Please sign in to comment.