diff --git a/src/components/FeaturePhoto/FeaturePhoto.svelte b/src/components/FeaturePhoto/FeaturePhoto.svelte index 2d002473..bb95123f 100644 --- a/src/components/FeaturePhoto/FeaturePhoto.svelte +++ b/src/components/FeaturePhoto/FeaturePhoto.svelte @@ -103,7 +103,7 @@ {/if} {#if caption} - +
{caption}
diff --git a/src/components/GraphicBlock/TextBlock.svelte b/src/components/GraphicBlock/TextBlock.svelte index 0e1cd96a..30a24982 100644 --- a/src/components/GraphicBlock/TextBlock.svelte +++ b/src/components/GraphicBlock/TextBlock.svelte @@ -7,7 +7,7 @@ {#if width} - + {:else} diff --git a/src/components/HeroHeadline/Hero.stories.svelte b/src/components/HeroHeadline/Hero.stories.svelte index f02e5c0f..bae2e2ab 100644 --- a/src/components/HeroHeadline/Hero.stories.svelte +++ b/src/components/HeroHeadline/Hero.stories.svelte @@ -8,6 +8,8 @@ // @ts-ignore import inlineGraphicDocs from './stories/docs/inlineGraphic.md?raw'; // @ts-ignore + import inlinePhotoDocs from './stories/docs/inlinePhoto.md?raw'; + // @ts-ignore import transparentHeaderDocs from './stories/docs/transparentHeader.md?raw'; // @ts-ignore import videoDocs from './stories/docs/backgroundVideo.md?raw'; @@ -23,6 +25,8 @@ import SiteHeader from '../SiteHeader/SiteHeader.svelte'; import HeroHeadline from './Hero.svelte'; import GraphicBlock from '../GraphicBlock/GraphicBlock.svelte'; + import FeaturePhoto from '../FeaturePhoto/FeaturePhoto.svelte'; + import Video from '../Video/Video.svelte'; import CrashMap from './stories/graphics/crash.svelte'; import QuakeMap from './stories/graphics/quakemap.svelte'; @@ -187,27 +191,17 @@ publishTime="{new Date('2020-12-18').toISOString()}" >
- - - - + />
+ + + + + + +
+ +
+
+
+ @@ -245,7 +265,7 @@
+ + + + + + +
+
+
+
+ - import { HeroHeadline } from '@reuters-graphics/graphics-components'; + import { + HeroHeadline, + GraphicBlock, + } from '@reuters-graphics/graphics-components'; import QuakeMap from './ai2svelte/graphic.svelte'; import { assets } from '$app/paths'; + + export let embedded = false; - import { HeroHeadline } from '@reuters-graphics/graphics-components'; + import { HeroHeadline, Video } from '@reuters-graphics/graphics-components'; import { assets } from '$app/paths'; + + export let embedded = false;
- - - - + />
diff --git a/src/components/HeroHeadline/stories/docs/component.md b/src/components/HeroHeadline/stories/docs/component.md index 8a8b07eb..a70548c1 100644 --- a/src/components/HeroHeadline/stories/docs/component.md +++ b/src/components/HeroHeadline/stories/docs/component.md @@ -4,9 +4,12 @@ Reuters Graphics headline with a Hero media import { HeroHeadline } from '@reuters-graphics/graphics-components'; import { assets } from '$app/paths'; // 👈 If using in the Graphics Kit... + + export let embedded = false; + import { + HeroHeadline, + FeaturePhoto, + } from '@reuters-graphics/graphics-components'; + import { assets } from '$app/paths'; + + export let embedded = false; + + + +
+ +
+
+``` diff --git a/src/components/HeroHeadline/stories/docs/inlineVideo.md b/src/components/HeroHeadline/stories/docs/inlineVideo.md new file mode 100644 index 00000000..dcf7c745 --- /dev/null +++ b/src/components/HeroHeadline/stories/docs/inlineVideo.md @@ -0,0 +1,34 @@ +Add a cover video and position the title with ease. + +```svelte + + + +
+
+
+``` diff --git a/src/components/Video/Video.svelte b/src/components/Video/Video.svelte index a34dd2d7..c6fb4f44 100644 --- a/src/components/Video/Video.svelte +++ b/src/components/Video/Video.svelte @@ -10,11 +10,31 @@ /// ////////////////////////////////// /** - * Video src. + * Video src + * @type {string} + * @required */ - export let src = ''; - export let ariaHidden = true; - export let ariaDescription = null; + export let src: string; + + /** + * Image to be shown while the video is downloading + */ + export let poster: string = ''; + + /** + * Whether to wrap the graphic with an aria hidden tag. + */ + export let hidden: boolean = true; + + /** + * ARIA description, passed in as a markdown string. + * @type {string} + */ + export let ariaDescription: string | null = null; + + /** Add extra classes to the block tag to target it with custom CSS. */ + let cls: string = ''; + export { cls as class }; /** * Title of the graphic @@ -136,9 +156,9 @@ }; // Warning to missing aria attributes - if (ariaHidden && !ariaDescription) { + if (hidden && !ariaDescription) { console.warn( - 'Must provide aria description for video components if ariaHidden is true.' + 'Must provide aria description for video components if hidden is true.' ); } @@ -154,7 +174,7 @@ description="{description}" notes="{notes}" width="{width}" - class="video-container" + class="video {cls}" >
- {#if (ariaHidden && ariaDescription) || !ariaHidden} + {#if (hidden && ariaDescription) || !hidden} {#if ariaDescription}

{ariaDescription}

{/if} @@ -187,7 +207,7 @@
@@ -221,6 +241,7 @@