diff --git a/src/components/BodyText/BodyText.mdx b/src/components/BodyText/BodyText.mdx index 9cd25312..483c6b0e 100644 --- a/src/components/BodyText/BodyText.mdx +++ b/src/components/BodyText/BodyText.mdx @@ -30,7 +30,7 @@ Venison shoulder *ham hock ham leberkas*. Flank beef ribs fatback, jerky meatbal ## Using with ArchieML docs -With the graphics kit, you'll likely get your text value from an ArchieML doc. +With the Graphics Kit, you'll likely get your text value from an ArchieML doc... ```yaml # Archie ML doc diff --git a/src/components/InfoBox/InfoBox.mdx b/src/components/InfoBox/InfoBox.mdx new file mode 100644 index 00000000..9c23d192 --- /dev/null +++ b/src/components/InfoBox/InfoBox.mdx @@ -0,0 +1,122 @@ +import { Meta, Canvas } from '@storybook/blocks'; + +import * as InfoBoxStories from './InfoBox.stories.svelte'; + + + +# InfoBox + +The `InfoBox` component creates a stylised text box that provides additional information that needs to be visually separate from the main content flow, such as methodology, detailed notes about data and extra context. + +```svelte + + + +``` + + + +## Using with ArchieML docs + +With the graphics kit, you'll likely get your text value from an ArchieML doc... + +```yaml +# Archie ML doc +[blocks] + +type: info-box +title: What you need to know about the war +text: Reuters is collecting daily COVID-19 infections and deaths data for 240 countries and territories around the world, updated regularly throughout each day. + +Every country reports those figures a little differently and, inevitably, misses undiagnosed infections and deaths. With this project we are focusing on the trends within countries as they try to contain the virus’ spread, whether they are approaching or past peak infection rates, or if they are seeing a resurgence of infections or deaths. +:end +notes: [Read more about our methodology](https://www.reuters.com/world-coronavirus-tracker-and-maps/en/methodology/) +[] +``` + +... which you'll parse out of a ArchieML block object before passing to the `InfoBox` component. + +```svelte + + + +# Graphics Kit +{#each content.blocks as block} + {#if block.type === 'info-box'} + + + {/if} +{/each} +``` + + + +## Lists + +Use markdown to add lists to `InfoBox`. + +```svelte + + + +``` + + +## Customisation + +Use [snippets](https://svelte.dev/docs/svelte/snippet) to customise the `InfoBox`, such as adding tables, icons and thumbnail images. + +```svelte + + + {#snippet header()} +

Global video game market

+ {/snippet} + + {#snippet body()} + + + + + + + + + + + + + + + + + + + + + +
YearMarket size ($bln)
2024274.63
2023281.77
2022249.55
+ {/snippet} + + {#snippet updated()} +
Source: Precedence Research
+ {/snippet} +
+``` + + diff --git a/src/components/InfoBox/InfoBox.stories.svelte b/src/components/InfoBox/InfoBox.stories.svelte index 6ccd3d47..f07fc990 100644 --- a/src/components/InfoBox/InfoBox.stories.svelte +++ b/src/components/InfoBox/InfoBox.stories.svelte @@ -1,15 +1,12 @@ - - - - - + + + + + {#snippet header()} +

Global video game market

+ {/snippet} + {#snippet body()} + + + + + + + + + + + + + + + + + + + + + +
YearMarket size ($bln)
2024274.63
2023281.77
2022249.55
+ {/snippet} + {#snippet footer()} +
Source: Precedence Research
+ {/snippet} +
+
- - - + diff --git a/src/components/InfoBox/InfoBox.svelte b/src/components/InfoBox/InfoBox.svelte index 98ddbd0a..52d915a8 100644 --- a/src/components/InfoBox/InfoBox.svelte +++ b/src/components/InfoBox/InfoBox.svelte @@ -1,47 +1,59 @@ - - - -```