From 2d0d0263e3e77db1e6ccc9039f29535fb67599cb Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Thu, 6 Mar 2025 13:45:17 -0800 Subject: [PATCH 1/5] updates infobox --- src/components/InfoBox/InfoBox.stories.mdx | 19 +++ src/components/InfoBox/InfoBox.stories.svelte | 33 ++---- src/components/InfoBox/InfoBox.svelte | 108 ++++++++++-------- .../InfoBox/stories/docs/component.md | 17 --- 4 files changed, 88 insertions(+), 89 deletions(-) create mode 100644 src/components/InfoBox/InfoBox.stories.mdx delete mode 100644 src/components/InfoBox/stories/docs/component.md diff --git a/src/components/InfoBox/InfoBox.stories.mdx b/src/components/InfoBox/InfoBox.stories.mdx new file mode 100644 index 00000000..ee571ae6 --- /dev/null +++ b/src/components/InfoBox/InfoBox.stories.mdx @@ -0,0 +1,19 @@ +# InfoBox + +InfoBox is used to provide additional information that needs to be visually set aside from the main content flowm, such as methodology, detailed notes about data, and extra context as text stories. + +Switch the theme prop to `dark` for a dark page infobox. + +Use [snippets](https://svelte.dev/docs/svelte/snippet) to customise the content as needed, e.g. adding icons and thumbnail images. + +```svelte + + + +``` diff --git a/src/components/InfoBox/InfoBox.stories.svelte b/src/components/InfoBox/InfoBox.stories.svelte index 6ccd3d47..2ebb2125 100644 --- a/src/components/InfoBox/InfoBox.stories.svelte +++ b/src/components/InfoBox/InfoBox.stories.svelte @@ -1,15 +1,12 @@ - - - - - + diff --git a/src/components/InfoBox/InfoBox.svelte b/src/components/InfoBox/InfoBox.svelte index 98ddbd0a..f52a6fe8 100644 --- a/src/components/InfoBox/InfoBox.svelte +++ b/src/components/InfoBox/InfoBox.svelte @@ -1,47 +1,59 @@ - - - -``` From cf1a18afaaa39ecd820c1b3d56d8228108da4c5c Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Thu, 6 Mar 2025 14:13:47 -0800 Subject: [PATCH 2/5] migrated infobox, working on documentation --- .../{InfoBox.stories.mdx => InfoBox.mdx} | 50 +++++++++++++++++-- src/components/InfoBox/InfoBox.stories.svelte | 15 +++--- 2 files changed, 54 insertions(+), 11 deletions(-) rename src/components/InfoBox/{InfoBox.stories.mdx => InfoBox.mdx} (51%) diff --git a/src/components/InfoBox/InfoBox.stories.mdx b/src/components/InfoBox/InfoBox.mdx similarity index 51% rename from src/components/InfoBox/InfoBox.stories.mdx rename to src/components/InfoBox/InfoBox.mdx index ee571ae6..85db0094 100644 --- a/src/components/InfoBox/InfoBox.stories.mdx +++ b/src/components/InfoBox/InfoBox.mdx @@ -1,11 +1,13 @@ +import { Meta, Canvas } from '@storybook/blocks'; + +import * as InfoBoxStories from './InfoBox.stories.svelte'; + + + # InfoBox InfoBox is used to provide additional information that needs to be visually set aside from the main content flowm, such as methodology, detailed notes about data, and extra context as text stories. -Switch the theme prop to `dark` for a dark page infobox. - -Use [snippets](https://svelte.dev/docs/svelte/snippet) to customise the content as needed, e.g. adding icons and thumbnail images. - ```svelte + +# Graphics Kit +{#each content.blocks as block} + {#if block.type === 'text'} + + + {/if} +{/each} +``` + +## List + +## Theme + +Switch the theme prop to `dark` for a dark page infobox. + +## Customisation + +Use [snippets](https://svelte.dev/docs/svelte/snippet) to customise the content as needed, e.g. adding icons and thumbnail images. diff --git a/src/components/InfoBox/InfoBox.stories.svelte b/src/components/InfoBox/InfoBox.stories.svelte index 2ebb2125..dcc39d58 100644 --- a/src/components/InfoBox/InfoBox.stories.svelte +++ b/src/components/InfoBox/InfoBox.stories.svelte @@ -33,10 +33,11 @@ text="In case you don't read Twitter, the news, or just can't get enough of The Apprentice host's legendary oration, try this Trump lorem ipsum generator on for size." /> - - - - + From b4bd717f09bd05767f220998113e1a212e7ec240 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Thu, 6 Mar 2025 15:59:19 -0800 Subject: [PATCH 3/5] finished infobox, adds docs --- src/components/InfoBox/InfoBox.mdx | 54 ++++++++++++++-- src/components/InfoBox/InfoBox.stories.svelte | 63 ++++++++++++++++++- src/components/InfoBox/InfoBox.svelte | 2 +- 3 files changed, 110 insertions(+), 9 deletions(-) diff --git a/src/components/InfoBox/InfoBox.mdx b/src/components/InfoBox/InfoBox.mdx index 85db0094..eaeef2de 100644 --- a/src/components/InfoBox/InfoBox.mdx +++ b/src/components/InfoBox/InfoBox.mdx @@ -1,4 +1,4 @@ -import { Meta, Canvas } from '@storybook/blocks'; +import { Meta } from '@storybook/blocks'; import * as InfoBoxStories from './InfoBox.stories.svelte'; @@ -20,10 +20,12 @@ InfoBox is used to provide additional information that needs to be visually set /> ``` -You can use InfoBoox as a list by creating a list with a **ArchieML doc** in the **Graphics Kit** like this: +## Lists + +You can use InfoBoox as a list by creating a list with a **ArchieML doc** in the **Graphics Kit** like in this [example](/story/components-text-elements-infobox--lists): ```yaml -# TEST THIS START HERE +# ArchieML [infoBox] title: What you need to know about the war text: @@ -50,12 +52,52 @@ text: {/each} ``` -## List - ## Theme Switch the theme prop to `dark` for a dark page infobox. ## Customisation -Use [snippets](https://svelte.dev/docs/svelte/snippet) to customise the content as needed, e.g. adding icons and thumbnail images. +Use [snippets](https://svelte.dev/docs/svelte/snippet), which are the Svelte 5 version of slots, to customise the content as needed, e.g. adding tables, icons and thumbnail images, like in this [example](/story/components-text-elements-infobox--customised). + +```svelte + + + {#snippet header()} +

COVID-19 deaths

+ {/snippet} + + {#snippet body()} + + + + + + + + + + + + + + + + + + + + + + + + + +
CountryInfectionsDeaths
United States1,000,000100,000
United Kingdom500,00050,000
Italy250,00025,000
+ {/snippet} + + {#snippet updated()} + Note: This is dummy data + {/snippet} +
+``` diff --git a/src/components/InfoBox/InfoBox.stories.svelte b/src/components/InfoBox/InfoBox.stories.svelte index dcc39d58..34033a82 100644 --- a/src/components/InfoBox/InfoBox.stories.svelte +++ b/src/components/InfoBox/InfoBox.stories.svelte @@ -34,10 +34,69 @@ /> +/> + + + {#snippet header()} +

COVID-19 deaths

+ {/snippet} + {#snippet body()} + + + + + + + + + + + + + + + + + + + + + + + + + +
CountryInfectionsDeaths
United States1,000,000100,000
United Kingdom500,00050,000
Italy250,00025,000
+ {/snippet} + {#snippet footer()} + Note: This is dummy data + {/snippet} +
+
+ + diff --git a/src/components/InfoBox/InfoBox.svelte b/src/components/InfoBox/InfoBox.svelte index f52a6fe8..52d915a8 100644 --- a/src/components/InfoBox/InfoBox.svelte +++ b/src/components/InfoBox/InfoBox.svelte @@ -13,7 +13,7 @@ /** * Contents of the note as a markdown string */ - text: string; + text?: string; /** * Additional footnotes */ From d54a407a5b64c2b5900a97c79ee85c85f21d63bf Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Mon, 10 Mar 2025 10:59:13 -0700 Subject: [PATCH 4/5] updates dependencies, docs --- src/components/BodyText/BodyText.mdx | 2 +- src/components/InfoBox/InfoBox.mdx | 79 ++++++++++++------- src/components/InfoBox/InfoBox.stories.svelte | 28 +++---- 3 files changed, 62 insertions(+), 47 deletions(-) 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 index eaeef2de..6d58ae91 100644 --- a/src/components/InfoBox/InfoBox.mdx +++ b/src/components/InfoBox/InfoBox.mdx @@ -1,4 +1,4 @@ -import { Meta } from '@storybook/blocks'; +import { Meta, Canvas } from '@storybook/blocks'; import * as InfoBoxStories from './InfoBox.stories.svelte'; @@ -6,7 +6,7 @@ import * as InfoBoxStories from './InfoBox.stories.svelte'; # InfoBox -InfoBox is used to provide additional information that needs to be visually set aside from the main content flowm, such as methodology, detailed notes about data, and extra context as text stories. +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 # Graphics Kit {#each content.blocks as block} - {#if block.type === 'text'} - + {#if block.type === 'info-box'} + {/if} {/each} ``` -## Theme + -Switch the theme prop to `dark` for a dark page infobox. +## Lists +Use markdown to add lists to `InfoBox`. + +```svelte + + + +``` + + ## Customisation -Use [snippets](https://svelte.dev/docs/svelte/snippet), which are the Svelte 5 version of slots, to customise the content as needed, e.g. adding tables, icons and thumbnail images, like in this [example](/story/components-text-elements-infobox--customised). +Use [snippets](https://svelte.dev/docs/svelte/snippet) to customise the `InfoBox`, such as adding tables, icons and thumbnail images. ```svelte {#snippet header()} -

COVID-19 deaths

+

Global video game market

{/snippet} {#snippet body()} - - - + + - - - + + - - - + + - - - + +
CountryInfectionsDeathsYearMarket size ($bln)
United States1,000,000100,0002024274.63
United Kingdom500,00050,0002023281.77
Italy250,00025,0002022249.55
{/snippet} {#snippet updated()} - Note: This is dummy data + Source: Precedence Research {/snippet}
``` + + diff --git a/src/components/InfoBox/InfoBox.stories.svelte b/src/components/InfoBox/InfoBox.stories.svelte index 34033a82..fa8a23a5 100644 --- a/src/components/InfoBox/InfoBox.stories.svelte +++ b/src/components/InfoBox/InfoBox.stories.svelte @@ -35,47 +35,43 @@ - + {#snippet header()} -

COVID-19 deaths

+

Global video game market

{/snippet} {#snippet body()} - - - + + - - - + + - - - + + - - - + +
CountryInfectionsDeathsYearMarket size ($bln)
United States1,000,000100,0002024274.63
United Kingdom500,00050,0002023281.77
Italy250,00025,0002022249.55
{/snippet} {#snippet footer()} - Note: This is dummy data + Source: Precedence Research {/snippet}
From 6733906f59abe0bcf3fd8b6321f0401b13e2ee62 Mon Sep 17 00:00:00 2001 From: hobbes7878 Date: Wed, 12 Mar 2025 11:24:35 +0000 Subject: [PATCH 5/5] small cleanup for oxford comma and our standard lorem ipsum --- src/components/InfoBox/InfoBox.mdx | 6 +++--- src/components/InfoBox/InfoBox.stories.svelte | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/InfoBox/InfoBox.mdx b/src/components/InfoBox/InfoBox.mdx index 6d58ae91..9c23d192 100644 --- a/src/components/InfoBox/InfoBox.mdx +++ b/src/components/InfoBox/InfoBox.mdx @@ -6,7 +6,7 @@ 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. +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