From 06a8454178ec31ee5a6f28d985356ec644c62b22 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Wed, 19 Mar 2025 09:26:56 -0700 Subject: [PATCH 01/10] set up .mdx --- src/components/HeroHeadline/HeroHeadline.mdx | 366 ++++++++++++++++++ ...es.svelte => HeroHeadline.stories..svelte} | 151 ++++---- .../{Hero.svelte => HeroHeadline.svelte} | 11 +- .../{stories => demo}/eurovis.jpeg | Bin .../graphics/CRASH_1-lg.jpeg | Bin .../graphics/CRASH_1-md.jpeg | Bin .../graphics/CRASH_1-sm.jpeg | Bin .../graphics/CRASH_1-xl.jpeg | Bin .../graphics/CRASH_1-xl_copy.jpeg | Bin .../graphics/CRASH_1-xs.jpeg | Bin .../{stories => demo}/graphics/crash.svelte | 0 .../graphics/quake-map-top-lg.jpeg | Bin .../graphics/quake-map-top-md.jpeg | Bin .../graphics/quake-map-top-sm.jpeg | Bin .../graphics/quake-map-top-xl.jpeg | Bin .../graphics/quake-map-top-xs.jpeg | Bin .../graphics/quakemap.svelte | 0 .../HeroHeadline/{stories => demo}/polar.jpg | Bin .../stories/docs/backgroundGraphic.md | 84 ---- .../stories/docs/backgroundVideo.md | 51 --- .../HeroHeadline/stories/docs/component.md | 20 - .../HeroHeadline/stories/docs/customHed.md | 43 -- .../stories/docs/inlineGraphic.md | 38 -- .../HeroHeadline/stories/docs/inlinePhoto.md | 34 -- .../HeroHeadline/stories/docs/inlineVideo.md | 34 -- .../stories/docs/transparentHeader.md | 17 - 26 files changed, 439 insertions(+), 410 deletions(-) create mode 100644 src/components/HeroHeadline/HeroHeadline.mdx rename src/components/HeroHeadline/{Hero.stories.svelte => HeroHeadline.stories..svelte} (66%) rename src/components/HeroHeadline/{Hero.svelte => HeroHeadline.svelte} (95%) rename src/components/HeroHeadline/{stories => demo}/eurovis.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/CRASH_1-lg.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/CRASH_1-md.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/CRASH_1-sm.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/CRASH_1-xl.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/CRASH_1-xl_copy.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/CRASH_1-xs.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/crash.svelte (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/quake-map-top-lg.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/quake-map-top-md.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/quake-map-top-sm.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/quake-map-top-xl.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/quake-map-top-xs.jpeg (100%) rename src/components/HeroHeadline/{stories => demo}/graphics/quakemap.svelte (100%) rename src/components/HeroHeadline/{stories => demo}/polar.jpg (100%) delete mode 100644 src/components/HeroHeadline/stories/docs/backgroundGraphic.md delete mode 100644 src/components/HeroHeadline/stories/docs/backgroundVideo.md delete mode 100644 src/components/HeroHeadline/stories/docs/component.md delete mode 100644 src/components/HeroHeadline/stories/docs/customHed.md delete mode 100644 src/components/HeroHeadline/stories/docs/inlineGraphic.md delete mode 100644 src/components/HeroHeadline/stories/docs/inlinePhoto.md delete mode 100644 src/components/HeroHeadline/stories/docs/inlineVideo.md delete mode 100644 src/components/HeroHeadline/stories/docs/transparentHeader.md diff --git a/src/components/HeroHeadline/HeroHeadline.mdx b/src/components/HeroHeadline/HeroHeadline.mdx new file mode 100644 index 00000000..b5336d58 --- /dev/null +++ b/src/components/HeroHeadline/HeroHeadline.mdx @@ -0,0 +1,366 @@ +import { Meta, Canvas } from '@storybook/blocks'; + +import * as HeroHeadlineStories from './HeroHeadline.stories.svelte'; + + + +# HeroHeadline + +The `HeroHeadline` component creates a Reuters Graphics headline with a Hero media. + +```svelte + + + +``` + + + +## Transparent site header + +Make the hero full bleed and under the header. + +```scss +// global.scss + +.nav-container { + background-color: transparent !important; +} +.nav-container .inner { + background-color: transparent !important; + border: none; +} + +.hero-wrapper { + margin-top: -64px; +} +``` + + + +## With background graphic + +Reuters Graphics headline with ai2svelte graphic as background. + +```svelte + + + +
+ + + +
+
+ + +``` + + + +## With background video + +Add a cover video and position the title with ease. + +```svelte + + + +
+
+
+ + +``` + + + +## With inline photo + +Reuters Graphics headline followed by a graphic or any media block. + +```svelte + + + +
+ +
+
+``` + + + +## With inline graphic + +Reuters Graphics headline followed by a graphic or any media block. + +```svelte + + + +
+ + + +
+
+``` + + + +## With inline video + +Add a cover video and position the title with ease. + +```svelte + + + +
+
+
+``` + + + +## Custom hed + +Add a custom styled headline. + +```svelte + + + +

+
A visual guide to
+
EUROVISION
+

+
+ + +``` + + diff --git a/src/components/HeroHeadline/Hero.stories.svelte b/src/components/HeroHeadline/HeroHeadline.stories..svelte similarity index 66% rename from src/components/HeroHeadline/Hero.stories.svelte rename to src/components/HeroHeadline/HeroHeadline.stories..svelte index 91b9e59a..ca03867f 100644 --- a/src/components/HeroHeadline/Hero.stories.svelte +++ b/src/components/HeroHeadline/HeroHeadline.stories..svelte @@ -1,31 +1,10 @@ - - - +{/snippet} + }} +> + {@render template({ + section: 'World News', + hed: 'Reuters Graphics Interactive', + dek: 'The beginning of a beautiful page', + authors: ['Simon Scarr', 'Vijdan Mohammad Kawoosa'], + publishTime: new Date('2022-03-04').toISOString(), + img: polarImgSrc, + })} + - + -``` diff --git a/src/components/HeroHeadline/stories/docs/backgroundVideo.md b/src/components/HeroHeadline/stories/docs/backgroundVideo.md deleted file mode 100644 index 49de9a18..00000000 --- a/src/components/HeroHeadline/stories/docs/backgroundVideo.md +++ /dev/null @@ -1,51 +0,0 @@ -Add a cover video and position the title with ease. - -```svelte - - - -
-
-
- - -``` diff --git a/src/components/HeroHeadline/stories/docs/component.md b/src/components/HeroHeadline/stories/docs/component.md deleted file mode 100644 index a70548c1..00000000 --- a/src/components/HeroHeadline/stories/docs/component.md +++ /dev/null @@ -1,20 +0,0 @@ -Reuters Graphics headline with a Hero media - -```svelte - - - -``` diff --git a/src/components/HeroHeadline/stories/docs/customHed.md b/src/components/HeroHeadline/stories/docs/customHed.md deleted file mode 100644 index 65ae17da..00000000 --- a/src/components/HeroHeadline/stories/docs/customHed.md +++ /dev/null @@ -1,43 +0,0 @@ -Add a custom styled headline. - -```svelte - - - -

-
A visual guide to
-
EUROVISION
-

-
- - -``` diff --git a/src/components/HeroHeadline/stories/docs/inlineGraphic.md b/src/components/HeroHeadline/stories/docs/inlineGraphic.md deleted file mode 100644 index fef464a0..00000000 --- a/src/components/HeroHeadline/stories/docs/inlineGraphic.md +++ /dev/null @@ -1,38 +0,0 @@ -Reuters Graphics headline followed by a graphic or any media block. - -```svelte - - - -
- - - -
-
-``` diff --git a/src/components/HeroHeadline/stories/docs/inlinePhoto.md b/src/components/HeroHeadline/stories/docs/inlinePhoto.md deleted file mode 100644 index 69f8df9e..00000000 --- a/src/components/HeroHeadline/stories/docs/inlinePhoto.md +++ /dev/null @@ -1,34 +0,0 @@ -Reuters Graphics headline followed by a graphic or any media block. - -```svelte - - - -
- -
-
-``` diff --git a/src/components/HeroHeadline/stories/docs/inlineVideo.md b/src/components/HeroHeadline/stories/docs/inlineVideo.md deleted file mode 100644 index dcf7c745..00000000 --- a/src/components/HeroHeadline/stories/docs/inlineVideo.md +++ /dev/null @@ -1,34 +0,0 @@ -Add a cover video and position the title with ease. - -```svelte - - - -
-
-
-``` diff --git a/src/components/HeroHeadline/stories/docs/transparentHeader.md b/src/components/HeroHeadline/stories/docs/transparentHeader.md deleted file mode 100644 index 55761f94..00000000 --- a/src/components/HeroHeadline/stories/docs/transparentHeader.md +++ /dev/null @@ -1,17 +0,0 @@ -Make the hero full bleed and under the header. - -```scss -// global.scss - -.nav-container { - background-color: transparent !important; -} -.nav-container .inner { - background-color: transparent !important; - border: none; -} - -.hero-wrapper { - margin-top: -64px; -} -``` From 4f04bed5718d093c8225c8423972e0157fa5e608 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Wed, 19 Mar 2025 14:25:54 -0700 Subject: [PATCH 02/10] finished hero docs --- src/components/Byline/Byline.svelte | 4 +- src/components/Headline/Headline.svelte | 1 - src/components/HeroHeadline/HeroHeadline.mdx | 316 ++++++++---------- ...es..svelte => HeroHeadline.stories.svelte} | 240 ++++++------- .../HeroHeadline/HeroHeadline.svelte | 299 +++++++++-------- 5 files changed, 398 insertions(+), 462 deletions(-) rename src/components/HeroHeadline/{HeroHeadline.stories..svelte => HeroHeadline.stories.svelte} (54%) diff --git a/src/components/Byline/Byline.svelte b/src/components/Byline/Byline.svelte index fa8e2558..8b67574a 100644 --- a/src/components/Byline/Byline.svelte +++ b/src/components/Byline/Byline.svelte @@ -19,7 +19,7 @@ * Update time as a datetime string. * @type {string} */ - updateTime: string; + updateTime?: string; /** * Alignment of the byline. * @type {string} @@ -130,7 +130,7 @@
Published
{/snippet}
- - - -
``` - +Add styles in `global.scss`: + +```scss +// global.scss +.custom-hed { + h1 { + .body-note { + color: #ffffff; + } + .title { + color: #ffffff; + text-shadow: 1px 1px 8px #ff7c88; + filter: drop-shadow(0px 0px 12px #ff7c88); + } + } + + .dek { + margin-top: 1rem; + p { + color: #ffffff; + text-shadow: 1px 1px 8px #ff7c88; + filter: drop-shadow(0px 0px 12px #ff7c88); + } + } +} +``` + +{' '} From 9c7eaf3c4d52a985d7a2723063c5b6233ad66223 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Thu, 10 Apr 2025 09:38:46 -0700 Subject: [PATCH 07/10] fix stacked:true in docs to stacked:false --- src/components/HeroHeadline/HeroHeadline.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/HeroHeadline/HeroHeadline.mdx b/src/components/HeroHeadline/HeroHeadline.mdx index a8f0a4cb..d02805fd 100644 --- a/src/components/HeroHeadline/HeroHeadline.mdx +++ b/src/components/HeroHeadline/HeroHeadline.mdx @@ -8,7 +8,7 @@ import * as HeroHeadlineStories from './HeroHeadline.stories.svelte'; The `HeroHeadline` component creates a Reuters Graphics headline with a hero media, which can be a graphic, photo, video, or any other media. -By default, the hero is in the background, i.e. the headline and dek are stacked on top of the hero. You can unstack and insert the hero media inline -- i.e. before or after the headline -- by setting `stacked: true`. [Read more.](?/iframe.html?viewMode=docs&id=components-text-elements-heroheadline--docs&globals=&args=#inline-hero) +By default, the hero is in the background, i.e. the headline and dek are stacked on top of the hero. You can unstack and insert the hero media inline -- i.e. before or after the headline -- by setting `stacked: false`. [Read more.](?/iframe.html?viewMode=docs&id=components-text-elements-heroheadline--docs&globals=&args=#inline-hero) ## Photo hero From 7b1e56eec6bf94a699f1765127a30809a7cdc854 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Tue, 15 Apr 2025 13:55:23 -0700 Subject: [PATCH 08/10] deletes feature photo & stacked:true demo, defaults inline photo to feature photo not bg-img --- .../HeroHeadline/HeroHeadline.stories.svelte | 22 ------------------- .../HeroHeadline/HeroHeadline.svelte | 12 ++++++---- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/src/components/HeroHeadline/HeroHeadline.stories.svelte b/src/components/HeroHeadline/HeroHeadline.stories.svelte index 6a2d3c62..320f677f 100644 --- a/src/components/HeroHeadline/HeroHeadline.stories.svelte +++ b/src/components/HeroHeadline/HeroHeadline.stories.svelte @@ -33,7 +33,6 @@ import Block from '../Block/Block.svelte'; import SiteHeader from '../SiteHeader/SiteHeader.svelte'; import GraphicBlock from '../GraphicBlock/GraphicBlock.svelte'; - import FeaturePhoto from '../FeaturePhoto/FeaturePhoto.svelte'; import Video from '../Video/Video.svelte'; import CrashMap from './demo/graphics/crash.svelte'; @@ -56,27 +55,6 @@ /> - - - - - - - - -
diff --git a/src/components/HeroHeadline/HeroHeadline.svelte b/src/components/HeroHeadline/HeroHeadline.svelte index 6ff5695f..9f04c038 100644 --- a/src/components/HeroHeadline/HeroHeadline.svelte +++ b/src/components/HeroHeadline/HeroHeadline.svelte @@ -9,6 +9,7 @@ import PaddingReset from '../PaddingReset/PaddingReset.svelte'; import Headline from '../Headline/Headline.svelte'; import Byline from '../Byline/Byline.svelte'; + import FeaturePhoto from '../FeaturePhoto/FeaturePhoto.svelte'; export interface Props { /** Headline, parsed as an _inline_ markdown string in an `h1` element OR as a custom snippet. */ @@ -182,10 +183,13 @@ {notes} {ariaDescription} > -
+ {/if}
From f77abdd5714f3ccbb22ba2fa0c801f440cb9efe0 Mon Sep 17 00:00:00 2001 From: hobbes7878 Date: Wed, 16 Apr 2025 12:18:29 +0100 Subject: [PATCH 09/10] docs edits --- src/components/HeroHeadline/HeroHeadline.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/HeroHeadline/HeroHeadline.mdx b/src/components/HeroHeadline/HeroHeadline.mdx index d02805fd..31cdc513 100644 --- a/src/components/HeroHeadline/HeroHeadline.mdx +++ b/src/components/HeroHeadline/HeroHeadline.mdx @@ -6,9 +6,9 @@ import * as HeroHeadlineStories from './HeroHeadline.stories.svelte'; # HeroHeadline -The `HeroHeadline` component creates a Reuters Graphics headline with a hero media, which can be a graphic, photo, video, or any other media. +The `HeroHeadline` component creates a Reuters Graphics headline with a hero media, which can be a graphic, photo, video or other media. -By default, the hero is in the background, i.e. the headline and dek are stacked on top of the hero. You can unstack and insert the hero media inline -- i.e. before or after the headline -- by setting `stacked: false`. [Read more.](?/iframe.html?viewMode=docs&id=components-text-elements-heroheadline--docs&globals=&args=#inline-hero) +By default, the hero is in the background, i.e., the headline and dek are stacked on top of the hero. You can unstack and insert the hero media inline -- i.e., before or after the headline -- by setting `stacked: false`. [Read more.](?/iframe.html?viewMode=docs&id=components-text-elements-heroheadline--docs&globals=&args=#inline-hero) ## Photo hero @@ -39,7 +39,7 @@ To use a photo as the hero, simply pass the image source to the `img` prop. ## Transparent site header -In the Graphics Kit, set styles in `global.scss` to make the Reuters site header transparent and make the hero go all the way to the top of the page: +In the graphics kit, set styles in `global.scss` to make the Reuters site header transparent and make the hero go all the way to the top of the page: ```scss // global.scss @@ -215,7 +215,7 @@ Add styles in `global.scss`: ## Inline hero -To use a photo, graphic, video, etc. as an inline hero -- i.e. to make the hero appear _after_ the headline and dek, instead of stacked underneath -- set `stacked` to `false`. Otherwise, add your hero media in the same way as documented above. +To use a photo, graphic, video, etc. as an inline hero -- i.e., to make the hero appear _after_ the headline and dek, instead of stacked underneath -- set `stacked` to `false`. Otherwise, add your hero media in the same way as documented above. ```svelte From 42d4de2396d4133c1fcde979ffd28fa3cd3db60a Mon Sep 17 00:00:00 2001 From: hobbes7878 Date: Fri, 18 Apr 2025 14:46:22 +0100 Subject: [PATCH 10/10] unwrap FeaturePhoto from GraphicBlock --- .../HeroHeadline/HeroHeadline.svelte | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/components/HeroHeadline/HeroHeadline.svelte b/src/components/HeroHeadline/HeroHeadline.svelte index 9f04c038..7f782581 100644 --- a/src/components/HeroHeadline/HeroHeadline.svelte +++ b/src/components/HeroHeadline/HeroHeadline.svelte @@ -175,22 +175,13 @@ {:else if img} - - - + src={img} + caption={notes} + altText={ariaDescription || ''} + /> {/if}