From c9b4c7d86c95f7996f0a833481a440503b66111e Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Tue, 18 Mar 2025 14:06:36 -0700 Subject: [PATCH] sets up headline docs --- src/components/Headline/Headline.mdx | 137 ++++++++++++++++++ .../Headline/Headline.stories.svelte | 128 +++++++--------- src/components/Headline/Headline.svelte | 21 ++- .../Headline/{stories => demo}/crown.png | Bin .../Headline/{stories => demo}/graphic-lg.png | Bin .../Headline/{stories => demo}/graphic-md.png | Bin .../Headline/{stories => demo}/graphic-sm.png | Bin .../Headline/{stories => demo}/graphic-xl.png | Bin .../Headline/{stories => demo}/graphic-xs.png | Bin .../Headline/{stories => demo}/graphic.svelte | 12 +- .../Headline/stories/docs/component.md | 13 -- .../Headline/stories/docs/customHed.md | 31 ---- .../Headline/stories/docs/withByline.md | 13 -- .../Headline/stories/docs/withCrownGraphic.md | 24 --- .../Headline/stories/docs/withCrownImage.md | 21 --- .../Headline/stories/docs/withDek.md | 11 -- 16 files changed, 204 insertions(+), 207 deletions(-) create mode 100644 src/components/Headline/Headline.mdx rename src/components/Headline/{stories => demo}/crown.png (100%) rename src/components/Headline/{stories => demo}/graphic-lg.png (100%) rename src/components/Headline/{stories => demo}/graphic-md.png (100%) rename src/components/Headline/{stories => demo}/graphic-sm.png (100%) rename src/components/Headline/{stories => demo}/graphic-xl.png (100%) rename src/components/Headline/{stories => demo}/graphic-xs.png (100%) rename src/components/Headline/{stories => demo}/graphic.svelte (98%) delete mode 100644 src/components/Headline/stories/docs/component.md delete mode 100644 src/components/Headline/stories/docs/customHed.md delete mode 100644 src/components/Headline/stories/docs/withByline.md delete mode 100644 src/components/Headline/stories/docs/withCrownGraphic.md delete mode 100644 src/components/Headline/stories/docs/withCrownImage.md delete mode 100644 src/components/Headline/stories/docs/withDek.md diff --git a/src/components/Headline/Headline.mdx b/src/components/Headline/Headline.mdx new file mode 100644 index 00000000..afbdf0b8 --- /dev/null +++ b/src/components/Headline/Headline.mdx @@ -0,0 +1,137 @@ +import { Meta, Canvas } from '@storybook/blocks'; + +import * as HeadlineStories from './Headline.stories.svelte'; + + + +# Headline + +The `Headline` component creates the Reuters Graphics headline. + +```svelte + + + +``` + + + +## Dek + +```svelte + + + +``` + +## With byline + +```svelte + + + +``` + +## With custom hed +Use the `hed` and/or `dek` named slots to override those elements with completely custom markup. + +```svelte + + + +

+ The secret to + “The Nutcracker's” + success +

+

+ How “The Nutcracker” ballet became anAmerican holday stapleand a financial pillar of ballet companies across the country +

+
+ + +``` + +## With crown image + +Add a crown image in the `crown` named slot and override the headline in the `hed` named slot. + +```svelte + + + + + Illustration of Europe + +

Europa

+
+``` + +## With crown graphic + +Add a full graphic or any other component in the crown. + +```svelte + + + + +
+ +
+
+``` diff --git a/src/components/Headline/Headline.stories.svelte b/src/components/Headline/Headline.stories.svelte index 720d119b..76ff4ec0 100644 --- a/src/components/Headline/Headline.stories.svelte +++ b/src/components/Headline/Headline.stories.svelte @@ -1,28 +1,10 @@ - - - + - + - + {#snippet hed()} -

+

The secret to “The Nutcracker's” success

- {/snippet} + {/snippet} {#snippet dek()} -

+

How “The Nutcracker” ballet became anAmerican holday stapleand a financial pillar of ballet companies across the country

- {/snippet} + {/snippet}
-
- - + + > + {#snippet crown()} - Illustration of Europe - {/snippet} - + {/snippet} + {#snippet hed()} -

Europa

- {/snippet} +

Europa

+ {/snippet}
- + {#snippet crown()} -
+
- {/snippet} + {/snippet} + + diff --git a/src/components/Headline/Headline.svelte b/src/components/Headline/Headline.svelte index ef10aa1b..3a2e39b0 100644 --- a/src/components/Headline/Headline.svelte +++ b/src/components/Headline/Headline.svelte @@ -1,4 +1,3 @@ - -
+
{#if width && width >= 0 && width < 510}
@@ -22,7 +22,7 @@
- import { Headline } from '@reuters-graphics/graphics-components'; - - - -``` diff --git a/src/components/Headline/stories/docs/customHed.md b/src/components/Headline/stories/docs/customHed.md deleted file mode 100644 index 25228bd3..00000000 --- a/src/components/Headline/stories/docs/customHed.md +++ /dev/null @@ -1,31 +0,0 @@ -Use the `hed` and/or `dek` named slots to override those elements with completely custom markup. - -```svelte - - - -

- The secret to - “The Nutcracker's” - success -

-

- How “The Nutcracker” ballet became anAmerican holday stapleand a financial pillar of ballet companies across the country -

-
- - -``` diff --git a/src/components/Headline/stories/docs/withByline.md b/src/components/Headline/stories/docs/withByline.md deleted file mode 100644 index eff73515..00000000 --- a/src/components/Headline/stories/docs/withByline.md +++ /dev/null @@ -1,13 +0,0 @@ -```svelte - - - -``` diff --git a/src/components/Headline/stories/docs/withCrownGraphic.md b/src/components/Headline/stories/docs/withCrownGraphic.md deleted file mode 100644 index 48a7099a..00000000 --- a/src/components/Headline/stories/docs/withCrownGraphic.md +++ /dev/null @@ -1,24 +0,0 @@ -Add a full graphic or any other component in the crown. - -```svelte - - - - -
- -
-
-``` diff --git a/src/components/Headline/stories/docs/withCrownImage.md b/src/components/Headline/stories/docs/withCrownImage.md deleted file mode 100644 index f705d9cb..00000000 --- a/src/components/Headline/stories/docs/withCrownImage.md +++ /dev/null @@ -1,21 +0,0 @@ -Add a crown image in the `crown` named slot and override the headline in the `hed` named slot. - -```svelte - - - - - Illustration of Europe - -

Europa

-
-``` diff --git a/src/components/Headline/stories/docs/withDek.md b/src/components/Headline/stories/docs/withDek.md deleted file mode 100644 index 63b808c7..00000000 --- a/src/components/Headline/stories/docs/withDek.md +++ /dev/null @@ -1,11 +0,0 @@ -```svelte - - - -```