updates spinner

This commit is contained in:
MinamiFunakoshiTR 2025-03-25 09:44:27 -07:00
parent 5554b3083e
commit b67a0057a6
Failed to extract signature
3 changed files with 16 additions and 21 deletions

View file

@ -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 ```svelte
<script> <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> <p>The real deal is here.</p>
{/if} {/if}
``` ```
<Canvas of={SpinnerStories.Demo} />

View file

@ -1,15 +1,10 @@
<script module lang="ts"> <script module lang="ts">
// @ts-ignore raw import { defineMeta } from '@storybook/addon-svelte-csf';
import componentDocs from './stories/docs/component.md?raw';
import Spinner from './Spinner.svelte'; import Spinner from './Spinner.svelte';
import { withComponentDocs } from '$lib/docs/utils/withParams.js'; const { Story } = defineMeta({
export const meta = {
title: 'Components/Utilities/Spinner', title: 'Components/Utilities/Spinner',
component: Spinner, component: Spinner,
...withComponentDocs(componentDocs),
argTypes: { argTypes: {
colour: { control: 'color' }, colour: { control: 'color' },
ringWidth: { control: { type: 'range', min: 2, max: 20, step: 1 } }, ringWidth: { control: { type: 'range', min: 2, max: 20, step: 1 } },
@ -19,17 +14,7 @@
control: { type: 'range', min: 5, max: 100, step: 5 }, control: { type: 'range', min: 5, max: 100, step: 5 },
}, },
}, },
}; });
</script> </script>
<script> <Story name="Demo" />
import { Template, Story } from '@storybook/addon-svelte-csf';
</script>
<Template >
{#snippet children({ args })}
<Spinner {...args} />
{/snippet}
</Template>
<Story name="Default" />

View file

@ -32,7 +32,7 @@
<div <div
style:width="100%" style:width="100%"
style:height="{`${width + containerPadding * 2}px`}" style:height={`${width + containerPadding * 2}px`}
class="component-container flex items-center justify-center" class="component-container flex items-center justify-center"
> >
<div <div