started scroller
19
src/components/Scroller/Scroller.mdx
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { Meta, Canvas } from '@storybook/blocks';
|
||||||
|
|
||||||
|
import * as ScrollerStories from './Scroller.stories.svelte';
|
||||||
|
|
||||||
|
<Meta of={ScrollerStories} />
|
||||||
|
|
||||||
|
# Scroller
|
||||||
|
|
||||||
|
The `Scroller` component TK
|
||||||
|
|
||||||
|
```svelte
|
||||||
|
<script>
|
||||||
|
import { Scroller } from '@reuters-graphics/graphics-components';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Scroller />
|
||||||
|
```
|
||||||
|
|
||||||
|
<Canvas of={ScrollerStories.Demo} />
|
||||||
|
|
@ -1,24 +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';
|
|
||||||
// @ts-ignore raw
|
|
||||||
import interactiveDocs from './stories/docs/interactive.md?raw';
|
|
||||||
// @ts-ignore raw
|
|
||||||
import ai2svelteDocs from './stories/docs/ai2svelte.md?raw';
|
|
||||||
// @ts-ignore raw
|
|
||||||
import archieMLDocs from './stories/docs/archieML.md?raw';
|
|
||||||
|
|
||||||
import Scroller from './Scroller.svelte';
|
import Scroller from './Scroller.svelte';
|
||||||
|
|
||||||
import {
|
const { Story } = defineMeta({
|
||||||
withComponentDocs,
|
|
||||||
withStoryDocs,
|
|
||||||
} from '$lib/docs/utils/withParams.js';
|
|
||||||
|
|
||||||
export const meta = {
|
|
||||||
title: 'Components/Graphics/Scroller',
|
title: 'Components/Graphics/Scroller',
|
||||||
component: Scroller,
|
component: Scroller,
|
||||||
...withComponentDocs(componentDocs),
|
|
||||||
argTypes: {
|
argTypes: {
|
||||||
steps: { control: false },
|
steps: { control: false },
|
||||||
backgroundWidth: {
|
backgroundWidth: {
|
||||||
|
|
@ -34,17 +20,15 @@
|
||||||
options: ['fb', 'bf'],
|
options: ['fb', 'bf'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Template, Story } from '@storybook/addon-svelte-csf';
|
import BasicStep from './demo/components/basic/Step.svelte';
|
||||||
|
import InteractiveForeground from './demo/components/basic/InteractiveForeground.svelte';
|
||||||
import BasicStep from './stories/components/basic/Step.svelte';
|
import AiMap1 from './demo/components/ai2svelte/ai-scroller-1.svelte';
|
||||||
import InteractiveForeground from './stories/components/basic/InteractiveForeground.svelte';
|
import AiMap2 from './demo/components/ai2svelte/ai-scroller-2.svelte';
|
||||||
import AiMap1 from './stories/components/ai2svelte/ai-scroller-1.svelte';
|
import AiMap3 from './demo/components/ai2svelte/ai-scroller-3.svelte';
|
||||||
import AiMap2 from './stories/components/ai2svelte/ai-scroller-2.svelte';
|
|
||||||
import AiMap3 from './stories/components/ai2svelte/ai-scroller-3.svelte';
|
|
||||||
|
|
||||||
const aiCharts = {
|
const aiCharts = {
|
||||||
AiMap1,
|
AiMap1,
|
||||||
|
|
@ -79,15 +63,9 @@
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Template >
|
|
||||||
{#snippet children({ args })}
|
|
||||||
<Scroller {...args} />
|
|
||||||
{/snippet}
|
|
||||||
</Template>
|
|
||||||
|
|
||||||
<Story
|
<Story
|
||||||
name="Default"
|
name="Demo"
|
||||||
args="{{
|
args={{
|
||||||
steps: [
|
steps: [
|
||||||
{
|
{
|
||||||
background: BasicStep,
|
background: BasicStep,
|
||||||
|
|
@ -112,14 +90,14 @@
|
||||||
backgroundWidth: 'fluid',
|
backgroundWidth: 'fluid',
|
||||||
embeddedLayout: 'fb',
|
embeddedLayout: 'fb',
|
||||||
embedded: false,
|
embedded: false,
|
||||||
}}"
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Story name="ArchieML" args="{docBlock}" {...withStoryDocs(archieMLDocs)} />
|
<Story name="ArchieML" args={docBlock} />
|
||||||
|
|
||||||
<Story
|
<Story
|
||||||
name="Foreground components"
|
name="Foreground components"
|
||||||
args="{{
|
args={{
|
||||||
steps: [
|
steps: [
|
||||||
{
|
{
|
||||||
background: BasicStep,
|
background: BasicStep,
|
||||||
|
|
@ -142,13 +120,12 @@
|
||||||
backgroundWidth: 'fluid',
|
backgroundWidth: 'fluid',
|
||||||
embeddedLayout: 'fb',
|
embeddedLayout: 'fb',
|
||||||
embedded: false,
|
embedded: false,
|
||||||
}}"
|
}}
|
||||||
{...withStoryDocs(interactiveDocs)}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Story
|
<Story
|
||||||
name="Ai2svelte"
|
name="Ai2svelte"
|
||||||
args="{{
|
args={{
|
||||||
steps: [
|
steps: [
|
||||||
{
|
{
|
||||||
background: AiMap1,
|
background: AiMap1,
|
||||||
|
|
@ -175,6 +152,5 @@
|
||||||
backgroundWidth: 'fluid',
|
backgroundWidth: 'fluid',
|
||||||
embeddedLayout: 'fb',
|
embeddedLayout: 'fb',
|
||||||
embedded: false,
|
embedded: false,
|
||||||
}}"
|
}}
|
||||||
{...withStoryDocs(ai2svelteDocs)}
|
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 481 KiB After Width: | Height: | Size: 481 KiB |
|
Before Width: | Height: | Size: 329 KiB After Width: | Height: | Size: 329 KiB |
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 657 KiB After Width: | Height: | Size: 657 KiB |
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 131 KiB |
|
Before Width: | Height: | Size: 488 KiB After Width: | Height: | Size: 488 KiB |
|
Before Width: | Height: | Size: 335 KiB After Width: | Height: | Size: 335 KiB |
|
Before Width: | Height: | Size: 218 KiB After Width: | Height: | Size: 218 KiB |
|
Before Width: | Height: | Size: 666 KiB After Width: | Height: | Size: 666 KiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 597 KiB After Width: | Height: | Size: 597 KiB |
|
Before Width: | Height: | Size: 434 KiB After Width: | Height: | Size: 434 KiB |
|
Before Width: | Height: | Size: 267 KiB After Width: | Height: | Size: 267 KiB |
|
Before Width: | Height: | Size: 776 KiB After Width: | Height: | Size: 776 KiB |
|
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |