-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
49 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<script> | ||
/** | ||
* @component | ||
* @wrapper | ||
*/ | ||
import { createRenderContext } from './context'; | ||
/** | ||
* @component | ||
* @wrapper | ||
*/ | ||
import { createRenderContext } from './context'; | ||
export let Stories; | ||
export let Stories; | ||
createRenderContext($$props); | ||
createRenderContext($$props); | ||
</script> | ||
|
||
<svelte:component this={Stories}/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,3 @@ | |
{#if render} | ||
<slot args={context.args} {...context.args}/> | ||
{/if} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
examples/svelte-kitchen-sink/src/stories/svelte-format/addon-actions.stories.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
<script> | ||
import { Meta, Story } from '@storybook/svelte'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { Meta, Story } from '@storybook/svelte'; | ||
import { action } from '@storybook/addon-actions'; | ||
import Button from '../../components/Button.svelte'; | ||
console.log("in addon action stories"); | ||
import Button from '../../components/Button.svelte'; | ||
</script> | ||
|
||
<Meta title="Addon/Actions (Svelte)" component={Button}/> | ||
|
||
<Story name="Action on component method"> | ||
<Button text="Custom text" on:click={action('I am logging in the actions tab')}/> | ||
<Button text="Custom text" on:click={action('I am logging in the actions tab')}/> | ||
</Story> | ||
|
36 changes: 18 additions & 18 deletions
36
examples/svelte-kitchen-sink/src/stories/svelte-format/addon-knobs.stories.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
<script> | ||
import { Meta, Story } from '@storybook/svelte'; | ||
import { withKnobs, text, number } from '@storybook/addon-knobs'; | ||
import { Meta, Story } from '@storybook/svelte'; | ||
import { withKnobs, text, number } from '@storybook/addon-knobs'; | ||
const backgroundColor = text('Background', 'green'); | ||
const width = number('Width', 200, { | ||
range: true, | ||
min: 100, | ||
max: 1000, | ||
step: 100, | ||
}); | ||
const backgroundColor = text('Background', 'green'); | ||
const width = number('Width', 200, { | ||
range: true, | ||
min: 100, | ||
max: 1000, | ||
step: 100, | ||
}); | ||
const height = number('Height', 200, { | ||
range: true, | ||
min: 100, | ||
max: 1000, | ||
step: 100, | ||
}); | ||
const height = number('Height', 200, { | ||
range: true, | ||
min: 100, | ||
max: 1000, | ||
step: 100, | ||
}); | ||
</script> | ||
|
||
<Meta title="Addon/Knobs (Svelte)" decorators={[withKnobs]}/> | ||
|
||
<Story name="Simple" source> | ||
<div style="width: {width}px; height: {height}px; background-color: {backgroundColor}"> | ||
<p>I am interactive</p> | ||
</div> | ||
<div style="width: {width}px; height: {height}px; background-color: {backgroundColor}"> | ||
<p>I am interactive</p> | ||
</div> | ||
</Story> |
10 changes: 5 additions & 5 deletions
10
examples/svelte-kitchen-sink/src/stories/svelte-format/argstable.stories.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<script> | ||
import { Meta, Story } from '@storybook/svelte'; | ||
import { Meta, Story } from '@storybook/svelte'; | ||
import ArgsTableView from '../views/ArgsTableView.svelte'; | ||
// eslint-disable-next-line | ||
import srcArgsTableView from '!!raw-loader!../views/ArgsTableView.svelte'; | ||
import ArgsTableView from '../views/ArgsTableView.svelte'; | ||
// eslint-disable-next-line | ||
import srcArgsTableView from '!!raw-loader!../views/ArgsTableView.svelte'; | ||
</script> | ||
|
||
<Meta title="Args Table (Svelte)" component={ArgsTableView}/> | ||
|
||
<Story name="ArgsTable" let:args source={srcArgsTableView}> | ||
<ArgsTableView {...args}/> | ||
<ArgsTableView {...args}/> | ||
</Story> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters