chore(form): add stories for Form, FormItem, FormLabel

This commit is contained in:
Eric Liu 2019-12-30 16:14:16 -08:00
commit f366b7b948
18 changed files with 152 additions and 22 deletions

View file

@ -0,0 +1,17 @@
<script>
export let story = undefined;
import Layout from '../../internal/ui/Layout.svelte';
import Tooltip from '../Tooltip';
import FormLabel from './FormLabel.svelte';
</script>
<Layout>
{#if story === 'tooltip'}
<FormLabel>
<Tooltip triggerText="Label">This is the content of the tooltip.</Tooltip>
</FormLabel>
{:else}
<FormLabel>Label</FormLabel>
{/if}
</Layout>

View file

@ -0,0 +1,8 @@
import { withKnobs } from '@storybook/addon-knobs';
import Component from './FormLabel.Story.svelte';
export default { title: 'FormLabel', decorators: [withKnobs] };
export const Default = () => ({ Component });
export const WithTooltip = () => ({ Component, props: { story: 'tooltip' } });