@reuters-graphics/graphics-components 3.10.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/llm-docs/components/AdSlot.md +11 -0
  2. package/dist/llm-docs/components/Analytics.md +89 -0
  3. package/dist/llm-docs/components/Article.md +183 -0
  4. package/dist/llm-docs/components/BeforeAfter.md +170 -0
  5. package/dist/llm-docs/components/BioBox.md +74 -0
  6. package/dist/llm-docs/components/Block.md +211 -0
  7. package/dist/llm-docs/components/BlogPost.md +68 -0
  8. package/dist/llm-docs/components/BlogTOC.md +91 -0
  9. package/dist/llm-docs/components/BodyText.md +143 -0
  10. package/dist/llm-docs/components/Byline.md +242 -0
  11. package/dist/llm-docs/components/ClockWall.md +48 -0
  12. package/dist/llm-docs/components/DatawrapperChart.md +87 -0
  13. package/dist/llm-docs/components/DocumentCloud.md +47 -0
  14. package/dist/llm-docs/components/EmbedPreviewerLink.md +35 -0
  15. package/dist/llm-docs/components/EndNotes.md +79 -0
  16. package/dist/llm-docs/components/FeaturePhoto.md +102 -0
  17. package/dist/llm-docs/components/Framer.md +44 -0
  18. package/dist/llm-docs/components/Geocoder.md +49 -0
  19. package/dist/llm-docs/components/GraphicBlock.md +319 -0
  20. package/dist/llm-docs/components/Headline.md +248 -0
  21. package/dist/llm-docs/components/Headpile.md +55 -0
  22. package/dist/llm-docs/components/HeroHeadline.md +515 -0
  23. package/dist/llm-docs/components/HorizontalScroller.md +523 -0
  24. package/dist/llm-docs/components/InfoBox.md +196 -0
  25. package/dist/llm-docs/components/KinesisLogo.md +34 -0
  26. package/dist/llm-docs/components/LanguageButton.md +171 -0
  27. package/dist/llm-docs/components/Legend.md +251 -0
  28. package/dist/llm-docs/components/Lottie.md +464 -0
  29. package/dist/llm-docs/components/PaddingReset.md +78 -0
  30. package/dist/llm-docs/components/PhotoPack.md +237 -0
  31. package/dist/llm-docs/components/PymChild.md +49 -0
  32. package/dist/llm-docs/components/ReferralBlock.md +119 -0
  33. package/dist/llm-docs/components/ReutersGraphicsLogo.md +37 -0
  34. package/dist/llm-docs/components/ReutersLogo.md +35 -0
  35. package/dist/llm-docs/components/SEO.md +113 -0
  36. package/dist/llm-docs/components/Scroller.md +350 -0
  37. package/dist/llm-docs/components/ScrollerBase.md +104 -0
  38. package/dist/llm-docs/components/ScrollerVideo.md +576 -0
  39. package/dist/llm-docs/components/SearchInput.md +44 -0
  40. package/dist/llm-docs/components/ShareBar.md +78 -0
  41. package/dist/llm-docs/components/SimpleTimeline.md +141 -0
  42. package/dist/llm-docs/components/SiteFooter.md +77 -0
  43. package/dist/llm-docs/components/SiteHeader.md +55 -0
  44. package/dist/llm-docs/components/SiteHeadline.md +111 -0
  45. package/dist/llm-docs/components/Spinner.md +43 -0
  46. package/dist/llm-docs/components/Table.md +298 -0
  47. package/dist/llm-docs/components/Theme.md +266 -0
  48. package/dist/llm-docs/components/TileMap.md +477 -0
  49. package/dist/llm-docs/components/ToolsHeader.md +46 -0
  50. package/dist/llm-docs/components/Video.md +254 -0
  51. package/dist/llm-docs/components/Visible.md +54 -0
  52. package/dist/llm-docs/components/cssVariables.md +40 -0
  53. package/dist/llm-docs/components/index.md +59 -0
  54. package/dist/llm-docs/components/resizeObserver.md +21 -0
  55. package/dist/llm-docs/guides/archieml.md +406 -0
  56. package/dist/llm-docs/guides/colours.md +443 -0
  57. package/dist/llm-docs/guides/customising-with-scss.md +61 -0
  58. package/dist/llm-docs/guides/graphics-kit.md +25 -0
  59. package/dist/llm-docs/guides/index.md +16 -0
  60. package/dist/llm-docs/guides/intro.md +21 -0
  61. package/dist/llm-docs/guides/layout.md +13 -0
  62. package/dist/llm-docs/guides/llm-docs.md +71 -0
  63. package/dist/llm-docs/guides/styles.md +16 -0
  64. package/dist/llm-docs/guides/theming.md +100 -0
  65. package/dist/llm-docs/guides/tokens.md +150 -0
  66. package/dist/llm-docs/index.md +36 -0
  67. package/package.json +1 -1
@@ -0,0 +1,242 @@
1
+ # Byline
2
+
3
+ **Category:** Components/Text elements/Byline
4
+
5
+ **Import:** `import { Byline } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `authors` | `string[]` | `[]` | | Array of author names, which will be slugified to create links to Reuters author pages |
12
+ | `publishTime` | `string` | `''` | | Publish time as a datetime string. |
13
+ | `updateTime` | `string` | — | | Update time as a datetime string. |
14
+ | `align` | `'auto' \| 'center'` | `'auto'` | | Alignment of the byline. Options: `auto`, `center` |
15
+ | `id` | `string` | `''` | | Add an id to to target with custom CSS. |
16
+ | `cls` | `string` | `''` | | Add extra classes to target with custom CSS. |
17
+ | `getAuthorPage` | `(author: string) => string` | `getAuthorPageUrl` | | Custom function that returns an author page URL. |
18
+ | `byline` | `Snippet` | — | | Optional snippet for a custom byline. |
19
+ | `published` | `Snippet` | — | | Optional snippet for a custom published dateline. |
20
+ | `updated` | `Snippet` | — | | Optional snippet for a custom updated dateline. |
21
+
22
+ ## Examples
23
+
24
+ ### Demo
25
+
26
+ ```svelte
27
+ <Byline
28
+ authors={/* authors */}
29
+ publishTime={new Date('2021-09-12').toISOString()}
30
+ updateTime={new Date('2021-09-12T13:57:00').toISOString()}
31
+ />
32
+ ```
33
+
34
+ ### Customised
35
+
36
+ ```svelte
37
+ <Byline publishTime="2021-09-12T00:00:00Z" updateTime="2021-09-12T13:57:00Z">
38
+ {#snippet byline()}
39
+ <strong>BY REUTERS GRAPHICS</strong>
40
+ {/snippet}
41
+ {#snippet published()}
42
+ PUBLISHED on some custom date and time
43
+ {/snippet}
44
+ {#snippet updated()}
45
+ <em>Updated every 5 minutes</em>
46
+ {/snippet}
47
+ </Byline>
48
+ ```
49
+
50
+ ### Translation
51
+
52
+ ```svelte
53
+ In locale = `es`:
54
+ <Byline
55
+ publishTime="2021-09-12T00:00:00Z"
56
+ {authors}
57
+ byline={locale === 'es' ? esByline : undefined}
58
+ published={locale === 'es' ? esPublished : undefined}
59
+ ></Byline>
60
+
61
+ In locale = `en`:
62
+ <Byline
63
+ publishTime="2021-09-12T00:00:00Z"
64
+ {authors}
65
+ byline={undefined}
66
+ published={undefined}
67
+ />
68
+ ```
69
+
70
+ ### Custom author page
71
+
72
+ ```svelte
73
+ <Byline
74
+ authors={/* authors */}
75
+ publishTime="2021-09-12T00:00:00Z"
76
+ updateTime="2021-09-12T13:57:00Z"
77
+ getAuthorPage={(author: string) => {
78
+ return `mailto:${author.replace(' ', '')}@example.com`;
79
+ }}
80
+ />
81
+ ```
82
+
83
+ ## Documentation
84
+
85
+ # Byline
86
+
87
+ The `Byline` component adds a byline, published and updated datelines to your page.
88
+
89
+ ```svelte
90
+ <script>
91
+ import { Byline } from '@reuters-graphics/graphics-components';
92
+ </script>
93
+
94
+ <Byline
95
+ authors={[
96
+ 'Dea Bankova',
97
+ 'Prasanta Kumar Dutta',
98
+ 'Anurag Rao',
99
+ 'Mariano Zafra',
100
+ ]}
101
+ publishTime="2021-09-12T00:00:00.000Z"
102
+ updateTime="2021-09-12T12:57:00.000Z"
103
+ />
104
+ ```
105
+
106
+ ## Using with ArchieML docs
107
+
108
+ With the graphics kit, you'll likely get your text value from an ArchieML doc...
109
+
110
+ ```yaml
111
+ # ArchieML doc
112
+ [authors]
113
+ * Dea Bankova
114
+ * Prasanta Kumar Dutta
115
+ * Anurag Rao
116
+ * Mariano Zafra
117
+ []
118
+ publishTime: 2021-09-12T00:00:00.000Z
119
+ updateTime: 2021-09-12T12:57:00.000Z
120
+ ```
121
+
122
+ ... which you'll pass to the `Byline` component.
123
+
124
+ ```svelte
125
+ <script>
126
+ import { Byline } from '@reuters-graphics/graphics-components';
127
+ let { content }: Props = $props();
128
+ </script>
129
+
130
+ <Byline
131
+ authors={content.authors}
132
+ publishTime={content.publishTime}
133
+ updateTime={content.updateTime}
134
+ />
135
+ ```
136
+
137
+ ## Custom byline, published and updated datelines
138
+
139
+ Use [snippets](https://svelte.dev/docs/svelte/snippet) to customise the byline, published and updated datelines.
140
+
141
+ ```svelte
142
+ <Byline publishTime="2021-09-12T00:00:00Z" updateTime="2021-09-12T13:57:00Z">
143
+ <!-- Optional custom byline -->
144
+ {#snippet byline()}
145
+ <strong>BY REUTERS GRAPHICS</strong>
146
+ {/snippet}
147
+
148
+ <!-- Optional custom published dateline -->
149
+ {#snippet published()}
150
+ PUBLISHED on some custom date and time
151
+ {/snippet}
152
+
153
+ <!-- Optional custom updated dateline -->
154
+ {#snippet updated()}
155
+ <em>Updated every 5 minutes</em>
156
+ {/snippet}
157
+ </Byline>
158
+ ```
159
+
160
+ ## Translated byline and datelines
161
+
162
+ Use [snippets](https://svelte.dev/docs/svelte/snippet) to conditionally customise the byline, published and updated datelines for different languages.
163
+
164
+ ```svelte
165
+ <!-- In App.svelte -->
166
+ <script>
167
+ import {
168
+ Byline,
169
+ getAuthorPageUrl,
170
+ formatTime,
171
+ } from '@reuters-graphics/graphics-components';
172
+
173
+ let { content }: Props = $props();
174
+
175
+ // Note: In graphics kit, `locale` is already defined in `App.svelte`
176
+ </script>
177
+ ```
178
+
179
+ ```svelte
180
+ <!-- In App.svelte -->
181
+ <!-- Define custom translation snippets for different languages above the <Byline/> component -->
182
+ {#snippet esByline()}
183
+ Por
184
+ {#each content.authors as author, i}
185
+ <a
186
+ class="no-underline whitespace-nowrap text-primary font-bold"
187
+ href={getAuthorPageUrl(author)}
188
+ rel="author"
189
+ >
190
+ {author.trim()}</a
191
+ >{#if content.authors.length > 1 && i < content.authors.length - 2},{/if}
192
+ {#if content.authors.length > 1 && i === content.authors.length - 2}y&nbsp;{/if}
193
+ {/each}
194
+ {/snippet}
195
+
196
+ {#snippet esPublished()}
197
+ Publicado <time datetime="2026-04-08T10:00:00.000Z">
198
+ {new Date(content.publishTime).toLocaleDateString('es-ES', {
199
+ year: 'numeric',
200
+ month: 'long',
201
+ day: 'numeric',
202
+ })}&nbsp;&nbsp;{formatTime(content.publishTime)}</time
203
+ >
204
+ {/snippet}
205
+ ```
206
+
207
+ ```svelte
208
+ <!-- In App.svelte -->
209
+ <!-- Conditionally render custom translation snippets depending on the locale -->
210
+ <Byline
211
+ authors={content.authors}
212
+ publishTime={content.publishTime}
213
+ byline={locale === 'es' ? esByline : undefined}
214
+ published={locale === 'es' ? esPublished : undefined}
215
+ />
216
+ ```
217
+
218
+ ## Custom author page
219
+
220
+ By default, the `Byline` component will hyperlink each author's byline to their Reuters.com page, formatted `https://www.reuters.com/authors/{author-slug}/`.
221
+
222
+ To hyperlink to different pages or email addresses, pass a custom function to the `getAuthorPage` prop.
223
+
224
+ ```svelte
225
+ <!-- Pass a custom function as `getAuthorPage` -->
226
+ <Byline
227
+ authors={[
228
+ 'Dea Bankova',
229
+ 'Prasanta Kumar Dutta',
230
+ 'Anurag Rao',
231
+ 'Mariano Zafra',
232
+ ]}
233
+ publishTime="2021-09-12T00:00:00Z"
234
+ updateTime="2021-09-12T13:57:00Z"
235
+ getAuthorPage={(author) => {
236
+ return `mailto:${author.replace(' ', '')}@example.com`;
237
+ }}
238
+ />
239
+ ```
240
+
241
+ ```
242
+ ```
@@ -0,0 +1,48 @@
1
+ # ClockWall
2
+
3
+ **Category:** Components/Blog/ClockWall
4
+
5
+ **Import:** `import { ClockWall } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `cities` | `City[]` | `[
12
+ { name: 'Tehran', tzIdentifier: 'Asia/Tehran' },
13
+ { name: 'Tel Aviv', tzIdentifier: 'Asia/Tel_Aviv' },
14
+ { name: 'Washington D.C.', tzIdentifier: 'America/New_York' },
15
+ ]` | | — |
16
+ | `width` | `ContainerWidth` | `'normal'` | | — |
17
+ | `clockSize` | `ClockProps['clockSize']` | `'XS'` | | — Options: `XS`, `MD`, `LG`, `XL` |
18
+ | `clockWeight` | `ClockProps['clockWeight']` | `'Bold'` | | — Options: `Light`, `Normal`, `Bold` |
19
+
20
+ ## Examples
21
+
22
+ ### Demo
23
+
24
+ ```svelte
25
+ <ClockWall />
26
+ ```
27
+
28
+ ## Documentation
29
+
30
+ # ClockWall
31
+
32
+ The `ClockWall` component displays a row of analog clocks for different cities and timezones. Use it paired with the overall headline of a graphics blog page to show the time of multiple cities involved in a breaking news event.
33
+
34
+ Use the [IANA tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to find valid `tzIdentifier` strings.
35
+
36
+ ```svelte
37
+ <script>
38
+ import { ClockWall } from '@reuters-graphics/graphics-components';
39
+ </script>
40
+
41
+ <ClockWall
42
+ cities={[
43
+ { name: 'Tehran', tzIdentifier: 'Asia/Tehran' },
44
+ { name: 'Tel Aviv', tzIdentifier: 'Asia/Tel_Aviv' },
45
+ { name: 'Washington D.C.', tzIdentifier: 'America/New_York' },
46
+ ]}
47
+ />
48
+ ```
@@ -0,0 +1,87 @@
1
+ # DatawrapperChart
2
+
3
+ **Category:** Components/Graphics/DatawrapperChart
4
+
5
+ **Import:** `import { DatawrapperChart } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `title` | `string` | — | | Title of the graphic |
12
+ | `description` | `string` | — | | Description of the graphic, passed in as a markdown string. |
13
+ | `frameTitle` | `string` | `''` | | iframe title |
14
+ | `notes` | `string` | — | | Notes to the graphic, passed in as a markdown string. |
15
+ | `ariaLabel` | `string` | `''` | | iframe aria label |
16
+ | `id` | `string` | `''` | | — |
17
+ | `src` | `string` | — | ✓ | Datawrapper embed URL |
18
+ | `scrolling` | `ScrollingOption` | `'no'` | | iframe scrolling option |
19
+ | `width` | `ContainerWidth` | `'normal'` | | Width of the chart within the text well. Options: `normal`, `wide`, `wider`, `widest`, `fluid` |
20
+ | `textWidth` | `ContainerWidth` | `'normal'` | | Set a different width for the text within the text well, for example, "normal" to keep the title, description and notes inline with the rest of the text well. Can't ever be wider than `width`. |
21
+ | `titleSnippet` | `Snippet` | — | | Custom headline and chatter snippet |
22
+ | `notesSnippet` | `Snippet` | — | | Custom notes and source snippet |
23
+
24
+ ## Examples
25
+
26
+ ### Demo
27
+
28
+ ```svelte
29
+ <DatawrapperChart
30
+ src="https://reuters.com/graphics/USA-ABORTION/lgpdwggnwvo/media-embed.html"
31
+ id="abortion-rights-map"
32
+ ariaLabel="map"
33
+ frameTitle="Global abortion access"
34
+ />
35
+ ```
36
+
37
+ ### With chatter
38
+
39
+ ```svelte
40
+ <DatawrapperChart
41
+ frameTitle="Global abortion access"
42
+ ariaLabel="map"
43
+ id="abortion-rights-map"
44
+ src="https://reuters.com/graphics/USA-ABORTION/lgvdwemlbpo/media-embed.html"
45
+ title="Global abortion access"
46
+ description="A map of worldwide access to abortion."
47
+ notes={/* value — see Props/Types for full type */}
48
+ />
49
+ ```
50
+
51
+ ## Documentation
52
+
53
+ # DatawrapperChart
54
+
55
+ Easily add a responsive Datawrapper embed on your page.
56
+
57
+ ```svelte
58
+ <script>
59
+ import { DatawrapperChart } from '@reuters-graphics/graphics-components';
60
+ </script>
61
+
62
+ <DatawrapperChart
63
+ title="Global abortion access"
64
+ ariaLabel="map"
65
+ id="abortion-rights-map"
66
+ src="https://graphics.reuters.com/USA-ABORTION/lgpdwggnwvo/media-embed.html"
67
+ />
68
+ ```
69
+
70
+ ##### Getting the chart URL for `src`
71
+
72
+ Copy the source url for the Datawrapper chart in the `src` prop.
73
+ You can get this from the published url on Reuters Graphics.
74
+
75
+ - Publish the chart on Datawrapper.
76
+ - Go to the **Datawrapper charts** Teams channel, wait for the graphic to finish publishing.
77
+ - Inside **Embed code (for developers only)**, find and copy the url inside the `src` prop. (It ends in `media-embed.html`.)
78
+
79
+ **Note:** There is no need to update the url if you update the chart inside Datawrapper. Any changes will be automatically reflected.
80
+
81
+ ## With chatter
82
+
83
+ By default, Datawrapper will export your chart with the chart chatter like title, description and notes.
84
+
85
+ At the moment, these don't _exactly_ match our styles and can't be made to fit into the article well.
86
+
87
+ Instead, it's often better to remove all the text from your Datawrapper chart before publishing it and add that text back via the component props.
@@ -0,0 +1,47 @@
1
+ # DocumentCloud
2
+
3
+ **Category:** Components/Multimedia/DocumentCloud
4
+
5
+ **Import:** `import { DocumentCloud } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `slug` | `string` | — | ✓ | The unique identifier for the document. |
12
+ | `altText` | `string` | — | ✓ | Alt text for the document. |
13
+ | `width` | `ContainerWidth` | `'normal'` | | Width of the container, one of: normal, wide, wider, widest or fluid Options: `normal`, `wide`, `wider`, `widest`, `fluid` |
14
+ | `id` | `string` | `''` | | Add an ID to target with SCSS. |
15
+ | `class` | `string` | `''` | | Add a class to target with SCSS. |
16
+
17
+ ## Examples
18
+
19
+ ### Demo
20
+
21
+ ```svelte
22
+ <DocumentCloud
23
+ slug="3259984-Trump-Intelligence-Allegations"
24
+ altText="These Reports Allege Trump Has Deep Ties To Russia"
25
+ />
26
+ ```
27
+
28
+ ## Documentation
29
+
30
+ # DocumentCloud
31
+
32
+ The `DocumentCloud` component embeds a document hosted by [DocumentCloud](https://documentcloud.org).
33
+
34
+ The document must have its access level set to **public** before it can be embedded. The `slug` can be found after the final slash in the document's URL.
35
+
36
+ For instance, the document included in the example is found at [documentcloud.org/documents/3259984-Trump-Intelligence-Allegations](https://www.documentcloud.org/documents/3259984-Trump-Intelligence-Allegations). The `slug` is `3259984-Trump-Intelligence-Allegations`.
37
+
38
+ ```svelte
39
+ <script>
40
+ import { DocumentCloud } from '@reuters-graphics/graphics-components';
41
+ </script>
42
+
43
+ <DocumentCloud
44
+ slug="3259984-Trump-Intelligence-Allegations"
45
+ altText="These Reports Allege Trump Has Deep Ties To Russia"
46
+ />
47
+ ```
@@ -0,0 +1,35 @@
1
+ # EmbedPreviewerLink
2
+
3
+ **Category:** Components/Utilities/EmbedPreviewerLink
4
+
5
+ **Import:** `import { EmbedPreviewerLink } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `dev` | `boolean` | `false` | | — |
12
+
13
+ ## Examples
14
+
15
+ ### Demo
16
+
17
+ ```svelte
18
+ <EmbedPreviewerLink dev={true} />
19
+ ```
20
+
21
+ ## Documentation
22
+
23
+ # EmbedPreviewerLink
24
+
25
+ The `EmbedPreviewerLink` component is a tool for previewing the embeds in development. It adds an icon at the bottom of the page that, when clicked, opens a previewer with the embeds.
26
+
27
+ ```svelte
28
+ <script>
29
+ import { EmbedPreviewerLink } from '@reuters-graphics/graphics-components';
30
+
31
+ import { dev } from '$app/env';
32
+ </script>
33
+
34
+ <EmbedPreviewerLink {dev} />
35
+ ```
@@ -0,0 +1,79 @@
1
+ # EndNotes
2
+
3
+ **Category:** Components/Text elements/EndNotes
4
+
5
+ **Import:** `import { EndNotes } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `notes` | `EndNote[]` | — | ✓ | An array of endnote items. |
12
+
13
+ ## Examples
14
+
15
+ ### Demo
16
+
17
+ ```svelte
18
+ <EndNotes notes={/* array — see Props/Types for full type */} />
19
+ ```
20
+
21
+ ## Documentation
22
+
23
+ # EndNotes
24
+
25
+ The `EndNotes` component adds notes such as sources, clarifiying notes and minor corrections that come at the end of a story.
26
+
27
+ ```svelte
28
+ <script>
29
+ import { EndNotes } from '@reuters-graphics/graphics-components';
30
+
31
+ const notes = [
32
+ {
33
+ title: 'Note',
34
+ text: 'Data is current as of today.',
35
+ },
36
+ {
37
+ title: 'Sources',
38
+ text: 'Data, Inc.',
39
+ },
40
+ {
41
+ title: 'Edited by',
42
+ text: '<a href="https://www.reuters.com/graphics/">Editor</a>, Copyeditor',
43
+ },
44
+ ];
45
+ </script>
46
+
47
+ <EndNotes {notes} />
48
+ ```
49
+
50
+ ## Using with ArchieML docs
51
+
52
+ With the graphics kit, you'll likely get your text value from an ArchieML doc...
53
+
54
+ ```yaml
55
+ # ArchieML doc
56
+ [endNotes]
57
+ title: Note
58
+ text: Data is current as of today
59
+
60
+ title: Sources
61
+ text: Data, Inc.
62
+
63
+ title: Edited by
64
+ text: Editor, Copyeditor
65
+ []
66
+ ```
67
+
68
+ ... which you'll pass to the `EndNotes` component.
69
+
70
+ ```svelte
71
+ <!-- graphics kit -->
72
+ <script>
73
+ import { EndNotes } from '@reuters-graphics/graphics-components';
74
+
75
+ import content from '$locales/en/content.json';
76
+ </script>
77
+
78
+ <EndNotes notes={content.endNotes} />
79
+ ```
@@ -0,0 +1,102 @@
1
+ # FeaturePhoto
2
+
3
+ **Category:** Components/Multimedia/FeaturePhoto
4
+
5
+ **Import:** `import { FeaturePhoto } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `src` | `string` | — | ✓ | Photo source |
12
+ | `altText` | `string` | — | ✓ | Photo altText |
13
+ | `id` | `string` | `''` | | Add an id to target with custom CSS. |
14
+ | `class` | `string` | `''` | | Add classes to target with custom CSS. |
15
+ | `caption` | `string` | — | | Photo caption |
16
+ | `height` | `number` | `100` | | Height of the photo placeholder when lazy-loading |
17
+ | `width` | `ContainerWidth` | `'normal'` | | Width of the container: normal, wide, wider, widest or fluid Options: `normal`, `wide`, `wider`, `widest`, `fluid` |
18
+ | `textWidth` | `ContainerWidth` | `'normal'` | | Set a different width for the text vs the photo. For example, "normal" to keep the title, description and notes inline with the rest of the text well. Can't ever be wider than `width`. Options: `normal`, `wide`, `wider`, `widest`, `fluid` |
19
+ | `lazy` | `boolean` | `true` | | Whether to lazy load the photo using the [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) |
20
+ | `top` | `number` | `0` | | Set Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#rootmargin) `top` when lazy loading. |
21
+ | `bottom` | `number` | `0` | | Set Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#rootmargin) `bottom` when lazy loading. |
22
+ | `left` | `number` | `0` | | Set Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#rootmargin) `left` when lazy loading. |
23
+ | `right` | `number` | `0` | | Set Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#rootmargin) `right` when lazy loading. |
24
+
25
+ ## Examples
26
+
27
+ ### Demo
28
+
29
+ ```svelte
30
+ <FeaturePhoto src={/* sharkSrc */} altText="A shark!" caption="Carcharodon carcharias - REUTERS" />
31
+ ```
32
+
33
+ ### Missing altText
34
+
35
+ ```svelte
36
+ <FeaturePhoto src={/* sharkSrc */} caption="Carcharodon carcharias - REUTERS" />
37
+ ```
38
+
39
+ ## Documentation
40
+
41
+ # FeaturePhoto
42
+
43
+ The `FeaturePhoto` component adds a full-width photo.
44
+
45
+ ```svelte
46
+ <script>
47
+ import { FeaturePhoto } from '@reuters-graphics/graphics-components';
48
+ import { assets } from '$app/paths'; // 👈 If using in the graphics kit...
49
+ </script>
50
+
51
+ <FeaturePhoto
52
+ src={`${assets}/images/myImage.jpg`}
53
+ altText="Some alt text"
54
+ caption="A caption"
55
+ />
56
+ ```
57
+
58
+ ## Using with ArchieML docs
59
+
60
+ With the graphics kit, you'll likely get your text value from an ArchieML doc...
61
+
62
+ ```yaml
63
+ # ArchieML doc
64
+ [blocks]
65
+
66
+ type: photo
67
+ width: normal
68
+ src: images/shark.jpg
69
+ altText: The king of the sea
70
+ caption: Carcharodon carcharias - REUTERS
71
+
72
+ []
73
+ ```
74
+
75
+ ... which you'll parse out of a ArchieML block object before passing to the `FeaturePhoto` component.
76
+
77
+ ```svelte
78
+ <!-- App.svelte -->
79
+ <script>
80
+ import { FeaturePhoto } from '@reuters-graphics/graphics-components';
81
+
82
+ import content from '$locales/en/content.json';
83
+ import { assets } from '$app/paths';
84
+ </script>
85
+
86
+ {#each content.blocks as block}
87
+ {#if block.Type === 'text'}
88
+ <!-- ... -->
89
+ {:else if block.type === 'photo'}
90
+ <FeaturePhoto
91
+ width={block.width}
92
+ src={`${assets}/${block.src}`}
93
+ altText={block.altText}
94
+ caption={block.caption}
95
+ />
96
+ {/if}
97
+ {/each}
98
+ ```
99
+
100
+ ## Missing alt text
101
+
102
+ `altText` is required in this component. If your photo is missing it, a small red text box will overlay the image.
@@ -0,0 +1,44 @@
1
+ # Framer
2
+
3
+ **Category:** Components/Utilities/Framer
4
+
5
+ **Import:** `import { Framer } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `embeds` | `string[]` | `[]` | | — |
12
+ | `breakpoints` | `number[]` | `[330, 510, 660, 930, 1200]` | | — |
13
+ | `minFrameWidth` | `number` | `320` | | — |
14
+ | `maxFrameWidth` | `number` | `1200` | | — |
15
+ | `searchType` | `'dropdown' \| 'typeahead'` | `'dropdown'` | | — |
16
+
17
+ ## Examples
18
+
19
+ ### Demo
20
+
21
+ ```svelte
22
+ <Framer
23
+ embeds={[
24
+ 'https://graphics.reuters.com/USA-CONGRESS/FUNDRAISING/zjvqkawjlvx/embeds/en/embed/?zzz',
25
+ 'https://www.reuters.com/graphics/UKRAINE-CRISIS/MAP/klvymdzdrvg/embeds/en/map/',
26
+ ]}
27
+ />
28
+ ```
29
+
30
+ ## Documentation
31
+
32
+ # FeaturePhoto
33
+
34
+ An embed tool for development in the graphics kit.
35
+
36
+ ```svelte
37
+ <script>
38
+ import { Framer } from '@reuters-graphics/graphics-components';
39
+
40
+ const embeds = ['/embeds/my-chart/index.html'];
41
+ </script>
42
+
43
+ <Framer {embeds} />
44
+ ```