updates spinner
This commit is contained in:
parent
5554b3083e
commit
b67a0057a6
3 changed files with 16 additions and 21 deletions
|
|
@ -1,4 +1,12 @@
|
|||
Simple loading spinner. Use it to help hide long loading times for components that may be loading expensive media files or crunching through lots of data.
|
||||
import { Meta, Canvas } from '@storybook/blocks';
|
||||
|
||||
import * as SpinnerStories from './Spinner.stories.svelte';
|
||||
|
||||
<Meta of={SpinnerStories} />
|
||||
|
||||
# Spinner
|
||||
|
||||
The `Spinner` component creates a simple loading spinner. Use it to hide long loading times for components that may be loading expensive media files or crunching through lots of data.
|
||||
|
||||
```svelte
|
||||
<script>
|
||||
|
|
@ -13,3 +21,5 @@ Simple loading spinner. Use it to help hide long loading times for components th
|
|||
<p>The real deal is here.</p>
|
||||
{/if}
|
||||
```
|
||||
|
||||
<Canvas of={SpinnerStories.Demo} />
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
<script module lang="ts">
|
||||
// @ts-ignore raw
|
||||
import componentDocs from './stories/docs/component.md?raw';
|
||||
|
||||
import { defineMeta } from '@storybook/addon-svelte-csf';
|
||||
import Spinner from './Spinner.svelte';
|
||||
|
||||
import { withComponentDocs } from '$lib/docs/utils/withParams.js';
|
||||
|
||||
export const meta = {
|
||||
const { Story } = defineMeta({
|
||||
title: 'Components/Utilities/Spinner',
|
||||
component: Spinner,
|
||||
...withComponentDocs(componentDocs),
|
||||
argTypes: {
|
||||
colour: { control: 'color' },
|
||||
ringWidth: { control: { type: 'range', min: 2, max: 20, step: 1 } },
|
||||
|
|
@ -19,17 +14,7 @@
|
|||
control: { type: 'range', min: 5, max: 100, step: 5 },
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
import { Template, Story } from '@storybook/addon-svelte-csf';
|
||||
</script>
|
||||
|
||||
<Template >
|
||||
{#snippet children({ args })}
|
||||
<Spinner {...args} />
|
||||
{/snippet}
|
||||
</Template>
|
||||
|
||||
<Story name="Default" />
|
||||
<Story name="Demo" />
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
<div
|
||||
style:width="100%"
|
||||
style:height="{`${width + containerPadding * 2}px`}"
|
||||
style:height={`${width + containerPadding * 2}px`}
|
||||
class="component-container flex items-center justify-center"
|
||||
>
|
||||
<div
|
||||
|
|
|
|||
Loading…
Reference in a new issue