Skip to content

Commit

Permalink
CLI: use CSF for svelete during initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
tooppaaa committed Mar 27, 2021
1 parent 6a937b6 commit e2fe77d
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 107 deletions.
46 changes: 0 additions & 46 deletions lib/cli/src/frameworks/svelte/Button.stories.js

This file was deleted.

52 changes: 52 additions & 0 deletions lib/cli/src/frameworks/svelte/Button.stories.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<script>
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
import Button from "./Button.svelte";
</script>

<Meta
title="Example/Button"
component={Button}
argTypes={{
label: { control: "text" },
primary: { control: "boolean" },
backgroundColor: { control: "color" },
size: {
control: { type: "select", options: ["small", "medium", "large"] },
},
onClick: { action: "onClick" },
}}
/>

<Template let:args>
<Button {...args} on:click={args.onClick} />
</Template>

<Story
name="Primary"
args={{
primary: true,
label: "Button",
}}
/>

<Story
name="Secondary"
args={{
label: "Button",
}}
/>
<Story
name="Large"
args={{
size: "large",
label: "Button",
}}
/>

<Story
name="Small"
args={{
size: "small",
label: "Button",
}}
/>
29 changes: 0 additions & 29 deletions lib/cli/src/frameworks/svelte/Header.stories.js

This file was deleted.

32 changes: 32 additions & 0 deletions lib/cli/src/frameworks/svelte/Header.stories.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script>
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
import Header from "./Header.svelte";
</script>

<Meta
title="Example/Header"
component={Header}
argTypes={{
onLogin: { action: "onLogin" },
onLogout: { action: "onLogout" },
onCreateAccount: { action: "onCreateAccount" },
}}
/>

<Template let:args>
<Header
{...args}
on:login={args.onLogin}
on:logout={args.onLogout}
on:createAccount={args.onCreateAccount}
/>
</Template>

<Story
name="LoggedIn"
args={{
user: {},
}}
/>

<Story name="LoggedOut" args={{}} />
32 changes: 0 additions & 32 deletions lib/cli/src/frameworks/svelte/Page.stories.js

This file was deleted.

32 changes: 32 additions & 0 deletions lib/cli/src/frameworks/svelte/Page.stories.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script>
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
import Page from "./Page.svelte";
</script>

<Meta
title="Example/Page"
component={Page}
argTypes={{
onLogin: { action: "onLogin" },
onLogout: { action: "onLogout" },
onCreateAccount: { action: "onCreateAccount" },
}}
/>

<Template let:args>
<Page
{...args}
on:login={args.onLogin}
on:logout={args.onLogout}
on:createAccount={args.onCreateAccount}
/>
</Template>

<Story
name="LoggedIn"
args={{
user: {},
}}
/>

<Story name="LoggedOut" args={{}} />

0 comments on commit e2fe77d

Please sign in to comment.