@reuters-graphics/graphics-components 3.10.0 → 4.0.0
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.
- package/dist/components/Analytics/GTM.svelte.d.ts +3 -3
- package/dist/components/BlogPost/BlogPost.svelte +6 -5
- package/dist/components/BlogPost/BlogPost.svelte.d.ts +3 -2
- package/dist/components/BlogPost/CopyLink.svelte +7 -4
- package/dist/components/BlogPost/CopyLink.svelte.d.ts +5 -2
- package/dist/components/BlogPost/PostHeadline.svelte +7 -4
- package/dist/components/BlogPost/PostHeadline.svelte.d.ts +5 -2
- package/dist/components/BlogPost/utils.d.ts +2 -1
- package/dist/components/BlogPost/utils.js +8 -2
- package/dist/components/BlogTOC/BlogTOC.svelte +7 -4
- package/dist/components/BlogTOC/BlogTOC.svelte.d.ts +8 -5
- package/dist/components/BlogTOC/TOCList.svelte.d.ts +3 -3
- package/dist/components/Headpile/Headpile.svelte +2 -2
- package/dist/components/Headpile/Headpile.svelte.d.ts +2 -2
- package/dist/components/LanguageButton/LanguageButton.svelte +10 -7
- package/dist/components/LanguageButton/LanguageButton.svelte.d.ts +5 -2
- package/dist/components/SEO/SEO.svelte.d.ts +3 -3
- package/dist/components/Video/Video.svelte +2 -2
- package/dist/llm-docs/components/AdSlot.md +11 -0
- package/dist/llm-docs/components/Analytics.md +89 -0
- package/dist/llm-docs/components/Article.md +183 -0
- package/dist/llm-docs/components/BeforeAfter.md +170 -0
- package/dist/llm-docs/components/BioBox.md +74 -0
- package/dist/llm-docs/components/Block.md +211 -0
- package/dist/llm-docs/components/BlogPost.md +66 -0
- package/dist/llm-docs/components/BlogTOC.md +89 -0
- package/dist/llm-docs/components/BodyText.md +143 -0
- package/dist/llm-docs/components/Byline.md +242 -0
- package/dist/llm-docs/components/ClockWall.md +48 -0
- package/dist/llm-docs/components/DatawrapperChart.md +87 -0
- package/dist/llm-docs/components/DocumentCloud.md +47 -0
- package/dist/llm-docs/components/EmbedPreviewerLink.md +35 -0
- package/dist/llm-docs/components/EndNotes.md +79 -0
- package/dist/llm-docs/components/FeaturePhoto.md +102 -0
- package/dist/llm-docs/components/Framer.md +44 -0
- package/dist/llm-docs/components/Geocoder.md +49 -0
- package/dist/llm-docs/components/GraphicBlock.md +319 -0
- package/dist/llm-docs/components/Headline.md +248 -0
- package/dist/llm-docs/components/Headpile.md +55 -0
- package/dist/llm-docs/components/HeroHeadline.md +515 -0
- package/dist/llm-docs/components/HorizontalScroller.md +523 -0
- package/dist/llm-docs/components/InfoBox.md +196 -0
- package/dist/llm-docs/components/KinesisLogo.md +34 -0
- package/dist/llm-docs/components/LanguageButton.md +170 -0
- package/dist/llm-docs/components/Legend.md +251 -0
- package/dist/llm-docs/components/Lottie.md +464 -0
- package/dist/llm-docs/components/PaddingReset.md +78 -0
- package/dist/llm-docs/components/PhotoPack.md +238 -0
- package/dist/llm-docs/components/PymChild.md +49 -0
- package/dist/llm-docs/components/ReferralBlock.md +119 -0
- package/dist/llm-docs/components/ReutersGraphicsLogo.md +37 -0
- package/dist/llm-docs/components/ReutersLogo.md +35 -0
- package/dist/llm-docs/components/SEO.md +113 -0
- package/dist/llm-docs/components/Scroller.md +350 -0
- package/dist/llm-docs/components/ScrollerBase.md +104 -0
- package/dist/llm-docs/components/ScrollerVideo.md +576 -0
- package/dist/llm-docs/components/SearchInput.md +44 -0
- package/dist/llm-docs/components/ShareBar.md +78 -0
- package/dist/llm-docs/components/SimpleTimeline.md +141 -0
- package/dist/llm-docs/components/SiteFooter.md +77 -0
- package/dist/llm-docs/components/SiteHeader.md +55 -0
- package/dist/llm-docs/components/SiteHeadline.md +111 -0
- package/dist/llm-docs/components/Spinner.md +43 -0
- package/dist/llm-docs/components/Table.md +298 -0
- package/dist/llm-docs/components/Theme.md +266 -0
- package/dist/llm-docs/components/TileMap.md +477 -0
- package/dist/llm-docs/components/ToolsHeader.md +46 -0
- package/dist/llm-docs/components/Video.md +254 -0
- package/dist/llm-docs/components/Visible.md +54 -0
- package/dist/llm-docs/components/cssVariables.md +40 -0
- package/dist/llm-docs/components/index.md +59 -0
- package/dist/llm-docs/components/resizeObserver.md +21 -0
- package/dist/llm-docs/guides/archieml.md +406 -0
- package/dist/llm-docs/guides/colours.md +443 -0
- package/dist/llm-docs/guides/customising-with-scss.md +61 -0
- package/dist/llm-docs/guides/graphics-kit.md +25 -0
- package/dist/llm-docs/guides/index.md +16 -0
- package/dist/llm-docs/guides/intro.md +21 -0
- package/dist/llm-docs/guides/layout.md +13 -0
- package/dist/llm-docs/guides/llm-docs.md +71 -0
- package/dist/llm-docs/guides/styles.md +16 -0
- package/dist/llm-docs/guides/theming.md +100 -0
- package/dist/llm-docs/guides/tokens.md +150 -0
- package/dist/llm-docs/index.md +36 -0
- package/package.json +18 -24
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# Headline
|
|
2
|
+
|
|
3
|
+
**Category:** Components/Text elements/Headline
|
|
4
|
+
|
|
5
|
+
**Import:** `import { Headline } from '@reuters-graphics/graphics-components'`
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Default | Required | Description |
|
|
10
|
+
|------|------|---------|:--------:|-------------|
|
|
11
|
+
| `hed` | `string \| Snippet` | `'Reuters Graphics Interactive'` | | Headline, parsed as an _inline_ markdown string in an `h1` element OR as a custom snippet. |
|
|
12
|
+
| `class` | `string` | `''` | | Add extra classes to the block tag to target it with custom CSS. |
|
|
13
|
+
| `hedSize` | `HeadlineSize` | `'normal'` | | Headline size: small, normal, big, bigger, biggest Options: `small`, `normal`, `big`, `bigger`, `biggest` |
|
|
14
|
+
| `dek` | `string \| Snippet` | — | | Dek, parsed as a markdown string OR as a custom snippet. |
|
|
15
|
+
| `section` | `string` | — | | Section title |
|
|
16
|
+
| `authors` | `string[]` | `[]` | | Array of author names, which will be slugified to create links to Reuters author pages |
|
|
17
|
+
| `publishTime` | `string` | `''` | | Publish time as a datetime string. |
|
|
18
|
+
| `updateTime` | `string` | `''` | | Update time as a datetime string. |
|
|
19
|
+
| `width` | `'normal' \| 'wide' \| 'wider' \| 'widest'` | `'normal'` | | Width of the headline: normal, wide, wider, widest Options: `normal`, `wide`, `wider`, `widest` |
|
|
20
|
+
| `getAuthorPage` | `(author: string) => string` | — | | Custom function that returns an author page URL. |
|
|
21
|
+
| `crown` | `Snippet` | — | | Custom crown snippet |
|
|
22
|
+
| `byline` | `Snippet` | — | | Optional snippet for a custom byline. |
|
|
23
|
+
| `published` | `Snippet` | — | | Optional snippet for a custom published dateline. |
|
|
24
|
+
| `updated` | `Snippet` | — | | Optional snippet for a custom updated dateline. |
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
### Demo
|
|
29
|
+
|
|
30
|
+
```svelte
|
|
31
|
+
<Headline
|
|
32
|
+
hed="Reuters Graphics interactive"
|
|
33
|
+
dek="The beginning of a beautiful page"
|
|
34
|
+
section="World News"
|
|
35
|
+
/>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### With byline and dateline
|
|
39
|
+
|
|
40
|
+
```svelte
|
|
41
|
+
<Headline
|
|
42
|
+
hed={'Reuters Graphics Interactive'}
|
|
43
|
+
dek={'The beginning of a beautiful page'}
|
|
44
|
+
section={'Global news'}
|
|
45
|
+
authors={['Jane Doe']}
|
|
46
|
+
publishTime={new Date('2020-01-01').toISOString()}
|
|
47
|
+
getAuthorPage={(author: string) => {
|
|
48
|
+
return `mailto:${author.replace(' ', '')}@example.com`;
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Custom hed and dek
|
|
54
|
+
|
|
55
|
+
```svelte
|
|
56
|
+
<Headline width="wide">
|
|
57
|
+
{#snippet hed()}
|
|
58
|
+
<h1 class="custom-hed">
|
|
59
|
+
<span class="small block text-base">The secret to</span>
|
|
60
|
+
“The Nutcracker's”
|
|
61
|
+
<span class="small block text-base fpt-1">success</span>
|
|
62
|
+
</h1>
|
|
63
|
+
{/snippet}
|
|
64
|
+
{#snippet dek()}
|
|
65
|
+
<p class="custom-dek !fmt-3">
|
|
66
|
+
How “The Nutcracker” ballet became an<span
|
|
67
|
+
class="font-medium mx-1 px-1.5 py-1">American holday staple</span
|
|
68
|
+
>and a financial pillar of ballet companies across the country
|
|
69
|
+
</p>
|
|
70
|
+
{/snippet}
|
|
71
|
+
</Headline>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Crown image
|
|
75
|
+
|
|
76
|
+
```svelte
|
|
77
|
+
<Headline
|
|
78
|
+
class="!fmt-3"
|
|
79
|
+
hed="Europa"
|
|
80
|
+
publishTime={new Date('2020-01-01').toISOString()}
|
|
81
|
+
>
|
|
82
|
+
<!-- Add a crown -->
|
|
83
|
+
{#snippet crown()}
|
|
84
|
+
<img
|
|
85
|
+
src={crownImgSrc}
|
|
86
|
+
width="100"
|
|
87
|
+
class="mx-auto mb-0"
|
|
88
|
+
alt="Illustration of Europe"
|
|
89
|
+
/>
|
|
90
|
+
{/snippet}
|
|
91
|
+
</Headline>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Crown graphic
|
|
95
|
+
|
|
96
|
+
```svelte
|
|
97
|
+
<Headline
|
|
98
|
+
width="wider"
|
|
99
|
+
class="!fmt-1"
|
|
100
|
+
hed={'Unfriendly skies'}
|
|
101
|
+
dek={'How Russia’s invasion of Ukraine is redrawing air routes'}
|
|
102
|
+
section={'Ukraine Crisis'}
|
|
103
|
+
authors={['Simon Scarr', 'Vijdan Mohammad Kawoosa']}
|
|
104
|
+
publishTime={new Date('2022-03-04').toISOString()}
|
|
105
|
+
>
|
|
106
|
+
<!-- Add a crown graphic -->
|
|
107
|
+
{#snippet crown()}
|
|
108
|
+
<Map />
|
|
109
|
+
{/snippet}
|
|
110
|
+
</Headline>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Documentation
|
|
114
|
+
|
|
115
|
+
# Headline
|
|
116
|
+
|
|
117
|
+
The `Headline` component creates headlines in the legacy Reuters Graphics style, with the text centred on the page.
|
|
118
|
+
|
|
119
|
+
```svelte
|
|
120
|
+
<script>
|
|
121
|
+
import { Headline } from '@reuters-graphics/graphics-components';
|
|
122
|
+
</script>
|
|
123
|
+
|
|
124
|
+
<Headline
|
|
125
|
+
hed="Reuters Graphics Interactive"
|
|
126
|
+
dek="The beginning of a beautiful page"
|
|
127
|
+
section="World News"
|
|
128
|
+
/>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## With bylines and dateline
|
|
132
|
+
|
|
133
|
+
Optionally, you can add authors and a publish time to the headline, which the `Headline` component internally renders with the [Byline](./?path=/docs/components-text-elements-byline--docs) component.
|
|
134
|
+
|
|
135
|
+
> **Note**: Since `Headline` uses `Byline`, you can customise the author page hyperlink and bylines with the `getAuthorPage`, `byline`, `published` and `updated` props.
|
|
136
|
+
|
|
137
|
+
```svelte
|
|
138
|
+
<script>
|
|
139
|
+
import { Headline } from '@reuters-graphics/graphics-components';
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<Headline
|
|
143
|
+
hed={'Reuters Graphics Interactive'}
|
|
144
|
+
dek={'The beginning of a beautiful page'}
|
|
145
|
+
section={'Global news'}
|
|
146
|
+
authors={['Jane Doe']}
|
|
147
|
+
publishTime={new Date('2020-01-01').toISOString()}
|
|
148
|
+
getAuthorPage={(author) => `mailto:${author.replace(' ', '')}@example.com`}
|
|
149
|
+
/>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Custom hed and dek
|
|
153
|
+
|
|
154
|
+
Use the `hed` and/or `dek` [snippets](https://svelte.dev/docs/svelte/snippet) to override those elements with custom elements.
|
|
155
|
+
|
|
156
|
+
```svelte
|
|
157
|
+
<script>
|
|
158
|
+
import { Headline } from '@reuters-graphics/graphics-components';
|
|
159
|
+
</script>
|
|
160
|
+
|
|
161
|
+
<Headline width="wide">
|
|
162
|
+
<!-- Custom hed snippet -->
|
|
163
|
+
{#snippet hed()}
|
|
164
|
+
<h1 class="custom-hed">
|
|
165
|
+
<span class="small block text-base">The secret to</span>
|
|
166
|
+
“The Nutcracker's”
|
|
167
|
+
<span class="small block text-base fpt-1">success</span>
|
|
168
|
+
</h1>
|
|
169
|
+
{/snippet}
|
|
170
|
+
|
|
171
|
+
<!-- Custom dek snippet -->
|
|
172
|
+
{#snippet dek()}
|
|
173
|
+
<p class="custom-dek !fmt-3">
|
|
174
|
+
How “The Nutcracker” ballet became an<span
|
|
175
|
+
class="font-medium mx-1 px-1.5 py-1">American holday staple</span
|
|
176
|
+
>and a financial pillar of ballet companies across the country
|
|
177
|
+
</p>
|
|
178
|
+
{/snippet}
|
|
179
|
+
</Headline>
|
|
180
|
+
|
|
181
|
+
<!-- Custom styles -->
|
|
182
|
+
<style lang="scss">
|
|
183
|
+
.custom-hed {
|
|
184
|
+
line-height: 0.9;
|
|
185
|
+
}
|
|
186
|
+
.custom-dek {
|
|
187
|
+
span {
|
|
188
|
+
background-color: #fde68a;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
</style>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## With crown image
|
|
195
|
+
|
|
196
|
+
To add a crown image, use the `crown` [snippet](https://svelte.dev/docs/svelte/snippet).
|
|
197
|
+
|
|
198
|
+
```svelte
|
|
199
|
+
<script>
|
|
200
|
+
import { Headline } from '@reuters-graphics/graphics-components';
|
|
201
|
+
import { asset } from '$app/paths';
|
|
202
|
+
</script>
|
|
203
|
+
|
|
204
|
+
<Headline
|
|
205
|
+
class="!fmt-3"
|
|
206
|
+
hed="Europa"
|
|
207
|
+
publishTime={new Date('2020-01-01').toISOString()}
|
|
208
|
+
>
|
|
209
|
+
<!-- Add a crown -->
|
|
210
|
+
{#snippet crown()}
|
|
211
|
+
<img
|
|
212
|
+
src={crownImgSrc}
|
|
213
|
+
width="100"
|
|
214
|
+
class="mx-auto mb-0"
|
|
215
|
+
alt="Illustration of Europe"
|
|
216
|
+
/>
|
|
217
|
+
{/snippet}
|
|
218
|
+
</Headline>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## With crown graphic
|
|
222
|
+
|
|
223
|
+
Add a full graphic or any other component in the crown.
|
|
224
|
+
|
|
225
|
+
```svelte
|
|
226
|
+
<script>
|
|
227
|
+
import { Headline } from '@reuters-graphics/graphics-components';
|
|
228
|
+
import { asset } from '$app/paths'; // If in Graphis Kit
|
|
229
|
+
|
|
230
|
+
import Map from './ai2svelte/graphic.svelte'; // Import the crown graphic component
|
|
231
|
+
</script>
|
|
232
|
+
|
|
233
|
+
<Headline
|
|
234
|
+
width="wider"
|
|
235
|
+
class="!fmt-1"
|
|
236
|
+
hed={'Unfriendly skies'}
|
|
237
|
+
dek={'How Russia’s invasion of Ukraine is redrawing air routes'}
|
|
238
|
+
section={'Ukraine Crisis'}
|
|
239
|
+
authors={['Simon Scarr', 'Vijdan Mohammad Kawoosa']}
|
|
240
|
+
publishTime={new Date('2022-03-04').toISOString()}
|
|
241
|
+
>
|
|
242
|
+
<!-- Add a crown graphic -->
|
|
243
|
+
{#snippet crown()}
|
|
244
|
+
<!-- Pass `assetsPath` if in graphics kit -->
|
|
245
|
+
<Map assetsPath={asset('/').replace(/\/$/, '')} />
|
|
246
|
+
{/snippet}
|
|
247
|
+
</Headline>
|
|
248
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Headpile
|
|
2
|
+
|
|
3
|
+
**Category:** Components/Text elements/Headpile
|
|
4
|
+
|
|
5
|
+
**Import:** `import { Headpile } from '@reuters-graphics/graphics-components'`
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Default | Required | Description |
|
|
10
|
+
|------|------|---------|:--------:|-------------|
|
|
11
|
+
| `class` | `string` | — | ✓ | Add classes to target with custom CSS. |
|
|
12
|
+
| `id` | `string` | — | ✓ | Add an id to target with custom CSS. |
|
|
13
|
+
| `width` | `Extract<ContainerWidth, 'normal' \| 'wide'>` | `'normal'` | | Width of the container. |
|
|
14
|
+
| `colour` | `string` | `'#cccccc'` | | Default background colour to be used as a mount behind the headshot. |
|
|
15
|
+
| `figures` | `{ /** * Headshot image src. Be sure to prefix the image * * ```typescript * import { asset } from '$app/paths'; * * const imgSrc = asset('/images/my-image.jpg'); * ``` */ img: string; /** * Figure name. */ name: string; /** * Figure role or title. */ role?: string; /** * Text describing the person. */ text: string; /** * Background colour to be used as a mount behind the headshot. */ colour?: string; }[]` | — | ✓ | Individual figures -- i.e., people -- for the headpile. |
|
|
16
|
+
|
|
17
|
+
## Examples
|
|
18
|
+
|
|
19
|
+
### Demo
|
|
20
|
+
|
|
21
|
+
```svelte
|
|
22
|
+
<Headpile figures={/* defaultArgs */} />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Documentation
|
|
26
|
+
|
|
27
|
+
# Headpile
|
|
28
|
+
|
|
29
|
+
The `Headpile` component is a headshot-bulleted list of people, identifying them with their names, roles and a short description of their significance to a story.
|
|
30
|
+
|
|
31
|
+
It's designed to be used with headshots that have had their background removed, which can be done in the [Preview app](https://support.apple.com/en-gb/guide/preview/prvw15636/mac?#apd320b3b1b750a4) on macOS.
|
|
32
|
+
|
|
33
|
+
```svelte
|
|
34
|
+
<script>
|
|
35
|
+
import { Headpile } from '@reuters-graphics/graphics-components';
|
|
36
|
+
import { asset } from '$app/paths'; // 👈 If using in the graphics kit...
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<Headpile
|
|
40
|
+
figures={[
|
|
41
|
+
{
|
|
42
|
+
img: asset('/images/person-A.jpg'),
|
|
43
|
+
name: 'General Abdel Fattah al-Burhan',
|
|
44
|
+
role: "Sudan's Sovereign Council Chief and military commander",
|
|
45
|
+
text: 'Burhan was little known in public life until taking part in the coup ...',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
img: asset('/images/person-B.jpg'),
|
|
49
|
+
name: 'General Mohamed Hamdan Dagalo',
|
|
50
|
+
role: 'Leader of the Sudanese paramilitary Rapid Support Forces (RSF)',
|
|
51
|
+
text: 'Popularly known as Hemedti, Dagalo rose from lowly beginnings ...',
|
|
52
|
+
},
|
|
53
|
+
]}
|
|
54
|
+
/>
|
|
55
|
+
```
|