Skip to content

Commit

Permalink
Fix indentation in svelte files
Browse files Browse the repository at this point in the history
  • Loading branch information
j3rem1e committed Feb 2, 2021
1 parent c914fec commit 2b0593c
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 52 deletions.
4 changes: 2 additions & 2 deletions app/svelte/src/client/components/RegisterContext.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
export let Stories;
export let repositories;
createRegistrationContext(repositories);
</script>

<svelte:component this={Stories} />
14 changes: 7 additions & 7 deletions app/svelte/src/client/components/RenderContext.svelte
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}/>
1 change: 0 additions & 1 deletion app/svelte/src/client/components/Template.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@
{#if render}
<slot args={context.args} {...context.args}/>
{/if}

6 changes: 3 additions & 3 deletions docs/snippets/svelte/button-story-with-emojis.svelte.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<!-- Button.stories.svelte -->

<Story name="Primary">
<Button background="#ff0" label="Button"/>
<Button background="#ff0" label="Button"/>
</Story>

<Story name="Secondary">
<Button background="#ff0" label="😄👍😍💯"/>
<Button background="#ff0" label="😄👍😍💯"/>
</Story>

<Story name="Tertiary">
<Button background="#ff0" label="📚📕📈🤓"/>
<Button background="#ff0" label="📚📕📈🤓"/>
</Story>
```
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>

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>
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>
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<script>
import { Meta, Story, Template } from '@storybook/svelte';
import { Meta, Story, Template } from '@storybook/svelte';
import Button from '../../components/Button.svelte';
import Button from '../../components/Button.svelte';
let count = 0;
function handleClick(event) {
count += 1;
}
let count = 0;
function handleClick(event) {
count += 1;
}
</script>

<Meta title="Button (Svelte)" component={Button}/>

<Template let:args>
<Button {...args} on:click={handleClick}>
You clicked: {count}
</Button>
<Button {...args} on:click={handleClick}>
You clicked: {count}
</Button>
</Template>

<Story name="Rounded" args={{rounded: true}}/>
Expand All @@ -23,5 +23,5 @@

<!-- Dynamic snippet should be disabled for this story -->
<Story name="Button No Args">
<Button>Label</Button>
<Button>Label</Button>
</Story>

0 comments on commit 2b0593c

Please sign in to comment.