@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.
Files changed (85) hide show
  1. package/dist/components/Analytics/GTM.svelte.d.ts +3 -3
  2. package/dist/components/BlogPost/BlogPost.svelte +6 -5
  3. package/dist/components/BlogPost/BlogPost.svelte.d.ts +3 -2
  4. package/dist/components/BlogPost/CopyLink.svelte +7 -4
  5. package/dist/components/BlogPost/CopyLink.svelte.d.ts +5 -2
  6. package/dist/components/BlogPost/PostHeadline.svelte +7 -4
  7. package/dist/components/BlogPost/PostHeadline.svelte.d.ts +5 -2
  8. package/dist/components/BlogPost/utils.d.ts +2 -1
  9. package/dist/components/BlogPost/utils.js +8 -2
  10. package/dist/components/BlogTOC/BlogTOC.svelte +7 -4
  11. package/dist/components/BlogTOC/BlogTOC.svelte.d.ts +8 -5
  12. package/dist/components/BlogTOC/TOCList.svelte.d.ts +3 -3
  13. package/dist/components/Headpile/Headpile.svelte +2 -2
  14. package/dist/components/Headpile/Headpile.svelte.d.ts +2 -2
  15. package/dist/components/LanguageButton/LanguageButton.svelte +10 -7
  16. package/dist/components/LanguageButton/LanguageButton.svelte.d.ts +5 -2
  17. package/dist/components/SEO/SEO.svelte.d.ts +3 -3
  18. package/dist/components/Video/Video.svelte +2 -2
  19. package/dist/llm-docs/components/AdSlot.md +11 -0
  20. package/dist/llm-docs/components/Analytics.md +89 -0
  21. package/dist/llm-docs/components/Article.md +183 -0
  22. package/dist/llm-docs/components/BeforeAfter.md +170 -0
  23. package/dist/llm-docs/components/BioBox.md +74 -0
  24. package/dist/llm-docs/components/Block.md +211 -0
  25. package/dist/llm-docs/components/BlogPost.md +66 -0
  26. package/dist/llm-docs/components/BlogTOC.md +89 -0
  27. package/dist/llm-docs/components/BodyText.md +143 -0
  28. package/dist/llm-docs/components/Byline.md +242 -0
  29. package/dist/llm-docs/components/ClockWall.md +48 -0
  30. package/dist/llm-docs/components/DatawrapperChart.md +87 -0
  31. package/dist/llm-docs/components/DocumentCloud.md +47 -0
  32. package/dist/llm-docs/components/EmbedPreviewerLink.md +35 -0
  33. package/dist/llm-docs/components/EndNotes.md +79 -0
  34. package/dist/llm-docs/components/FeaturePhoto.md +102 -0
  35. package/dist/llm-docs/components/Framer.md +44 -0
  36. package/dist/llm-docs/components/Geocoder.md +49 -0
  37. package/dist/llm-docs/components/GraphicBlock.md +319 -0
  38. package/dist/llm-docs/components/Headline.md +248 -0
  39. package/dist/llm-docs/components/Headpile.md +55 -0
  40. package/dist/llm-docs/components/HeroHeadline.md +515 -0
  41. package/dist/llm-docs/components/HorizontalScroller.md +523 -0
  42. package/dist/llm-docs/components/InfoBox.md +196 -0
  43. package/dist/llm-docs/components/KinesisLogo.md +34 -0
  44. package/dist/llm-docs/components/LanguageButton.md +170 -0
  45. package/dist/llm-docs/components/Legend.md +251 -0
  46. package/dist/llm-docs/components/Lottie.md +464 -0
  47. package/dist/llm-docs/components/PaddingReset.md +78 -0
  48. package/dist/llm-docs/components/PhotoPack.md +238 -0
  49. package/dist/llm-docs/components/PymChild.md +49 -0
  50. package/dist/llm-docs/components/ReferralBlock.md +119 -0
  51. package/dist/llm-docs/components/ReutersGraphicsLogo.md +37 -0
  52. package/dist/llm-docs/components/ReutersLogo.md +35 -0
  53. package/dist/llm-docs/components/SEO.md +113 -0
  54. package/dist/llm-docs/components/Scroller.md +350 -0
  55. package/dist/llm-docs/components/ScrollerBase.md +104 -0
  56. package/dist/llm-docs/components/ScrollerVideo.md +576 -0
  57. package/dist/llm-docs/components/SearchInput.md +44 -0
  58. package/dist/llm-docs/components/ShareBar.md +78 -0
  59. package/dist/llm-docs/components/SimpleTimeline.md +141 -0
  60. package/dist/llm-docs/components/SiteFooter.md +77 -0
  61. package/dist/llm-docs/components/SiteHeader.md +55 -0
  62. package/dist/llm-docs/components/SiteHeadline.md +111 -0
  63. package/dist/llm-docs/components/Spinner.md +43 -0
  64. package/dist/llm-docs/components/Table.md +298 -0
  65. package/dist/llm-docs/components/Theme.md +266 -0
  66. package/dist/llm-docs/components/TileMap.md +477 -0
  67. package/dist/llm-docs/components/ToolsHeader.md +46 -0
  68. package/dist/llm-docs/components/Video.md +254 -0
  69. package/dist/llm-docs/components/Visible.md +54 -0
  70. package/dist/llm-docs/components/cssVariables.md +40 -0
  71. package/dist/llm-docs/components/index.md +59 -0
  72. package/dist/llm-docs/components/resizeObserver.md +21 -0
  73. package/dist/llm-docs/guides/archieml.md +406 -0
  74. package/dist/llm-docs/guides/colours.md +443 -0
  75. package/dist/llm-docs/guides/customising-with-scss.md +61 -0
  76. package/dist/llm-docs/guides/graphics-kit.md +25 -0
  77. package/dist/llm-docs/guides/index.md +16 -0
  78. package/dist/llm-docs/guides/intro.md +21 -0
  79. package/dist/llm-docs/guides/layout.md +13 -0
  80. package/dist/llm-docs/guides/llm-docs.md +71 -0
  81. package/dist/llm-docs/guides/styles.md +16 -0
  82. package/dist/llm-docs/guides/theming.md +100 -0
  83. package/dist/llm-docs/guides/tokens.md +150 -0
  84. package/dist/llm-docs/index.md +36 -0
  85. package/package.json +18 -24
@@ -0,0 +1,141 @@
1
+ # SimpleTimeline
2
+
3
+ **Category:** Components/Text elements/SimpleTimeline
4
+
5
+ **Import:** `import { SimpleTimeline } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `dates` | `EventDate[]` | — | ✓ | An array of dates with events. |
12
+ | `symbolColour` | `string` | `'var(--theme-colour-brand-rules)'` | | Set a colour for the timeline bullet symbols and line. |
13
+ | `dateColour` | `string` | `'var(--theme-colour-accent, red)'` | | Set a colour for the date headings in the timeline. |
14
+ | `class` | `string` | `''` | | Set a class to target with SCSS. |
15
+ | `id` | `string` | `''` | | Set an ID to target with SCSS. |
16
+
17
+ ## Examples
18
+
19
+ ### Demo
20
+
21
+ ```svelte
22
+ <SimpleTimeline dates={/* array — see Props/Types for full type */} />
23
+ ```
24
+
25
+ ### Multiple events
26
+
27
+ ```svelte
28
+ <SimpleTimeline dates={/* array — see Props/Types for full type */} />
29
+ ```
30
+
31
+ ## Documentation
32
+
33
+ # SimpleTimeline
34
+
35
+ The `SimpleTimeline` component creates a basic timeline with dates, titles and descriptions of events.
36
+
37
+ ```svelte
38
+ <script>
39
+ import { SimpleTimeline } from '@reuters-graphics/graphics-components';
40
+
41
+ const dates = [
42
+ {
43
+ date: 'May 18',
44
+ events: [
45
+ {
46
+ title: 'A title for the event',
47
+ titleLink: 'https://...', // optional
48
+ context: 'Lorem ipsum...', // optional
49
+ },
50
+ // More events...
51
+ ],
52
+ },
53
+ // More dates...
54
+ ];
55
+ </script>
56
+
57
+ <SimpleTimeline {dates} />
58
+ ```
59
+
60
+ ## Using with ArchieML docs
61
+
62
+ With the graphics kit, you'll likely get your text value from an ArchieML doc.
63
+
64
+ ```yaml
65
+ # Archie ML doc
66
+
67
+ type: timeline
68
+ # Optional
69
+ class: timeline
70
+ id: timeline-1
71
+ symbolColour: var(--theme-colour-brand-rules, grey)
72
+ dateColour: var(--theme-colour-accent, red)
73
+ [.dates]
74
+ # date object with events
75
+ date: May 10
76
+ [.events]
77
+ title: U.S. House passes $40 bln bill to bolster Ukraine against Russian invasion
78
+ context: The U.S. House of Representatives approved more than $40 billion more aid for Ukraine on Tuesday, as Congress races to keep military aid flowing and boost the government in Kyiv as it grapples with the Russian invasion.
79
+ titleLink: https://www.reuters.com/world/us-house-vote-40-billion-ukraine-aid-package-tuesday-pelosi-2022-05-10/
80
+ []
81
+
82
+ # More dates and events...
83
+ []
84
+ ```
85
+
86
+ ... which you'll pass to the `SimpleTimeline` component.
87
+
88
+ ```svelte
89
+ <!-- Graphics kit -->
90
+ <script>
91
+ import { SimpleTimeline } from '@reuters-graphics/graphics-components';
92
+ import content from '$locales/en/content.json';
93
+ </script>
94
+
95
+ <SimpleTimeline
96
+ dates={block.dates}
97
+ class={block.class}
98
+ symbolColour={block.symbolColour}
99
+ id={block.id}
100
+ dateColour={block.dateColour}
101
+ />
102
+ ```
103
+
104
+ # Multiple events
105
+
106
+ You can add multiple events to a single date by adding objects to the `events` array.
107
+
108
+ ```svelte
109
+ <script>
110
+ import { SimpleTimeline } from '@reuters-graphics/graphics-components';
111
+
112
+ const dates = [
113
+ {
114
+ date: 'Feb. 25',
115
+ // Multiple events for this date
116
+ events: [
117
+ {
118
+ title: 'NATO deploys more troops',
119
+ context:
120
+ 'NATO leaders said on Friday they were deploying more troops to eastern Europe after Russia invaded Ukraine, saying that Moscow had lied about its intentions.',
121
+ },
122
+ {
123
+ title: 'Invasion continues',
124
+ context:
125
+ 'Missiles pounded the Ukrainian capital as Russian forces pressed their advance and Ukrainian President Volodymyr Zelenskiy pleaded with the international community to do more, saying sanctions announced so far were not enough.\n\nRussian forces battered Ukrainian cities with artillery and cruise missiles but a defiant Zelenskiy said the capital Kyiv remained in Ukrainian hands.',
126
+ },
127
+ ],
128
+ },
129
+ {
130
+ date: 'Feb. 24',
131
+ events: [
132
+ {
133
+ title: 'Russia invades Ukraine',
134
+ },
135
+ ],
136
+ },
137
+ ];
138
+ </script>
139
+
140
+ <SimpleTimeline {dates} />
141
+ ```
@@ -0,0 +1,77 @@
1
+ # SiteFooter
2
+
3
+ **Category:** Components/Page furniture/SiteFooter
4
+
5
+ **Import:** `import { SiteFooter } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `includeReferrals` | `boolean` | `true` | | Set to `false` to remove graphics referrals |
12
+
13
+ ## Examples
14
+
15
+ ### Demo
16
+
17
+ ```svelte
18
+ <SiteFooter />
19
+ ```
20
+
21
+ ### Customised theme
22
+
23
+ ```svelte
24
+ <div>
25
+ <Theme base="dark">
26
+ <SiteFooter />
27
+ </Theme>
28
+ </div>
29
+ ```
30
+
31
+ ### Remove referrals
32
+
33
+ ```svelte
34
+ <SiteFooter includeReferrals={false} />
35
+ ```
36
+
37
+ ## Documentation
38
+
39
+ # SiteFooter
40
+
41
+ Reuters dotcom site footer with graphics referrals, ported from [Raptor UI components](https://github.com/tr/rcom-arc_raptor-ui/tree/develop/packages/rcom-raptor-ui_common/src/components/site-footer).
42
+
43
+ > **Note:** In the graphics kit, you can find this component in `pages/+page.svelte`. Customise it there for the default page.
44
+
45
+ ```svelte
46
+ <script>
47
+ import { SiteFooter } from '@reuters-graphics/graphics-components';
48
+ </script>
49
+
50
+ <SiteFooter />
51
+ ```
52
+
53
+ ## Dark theme
54
+
55
+ Colours are customised by the [`Theme`](?path=/docs/theming-theme--default) component. ([Demo](?path=/story/components-page-furniture-sitefooter--customised-theme))
56
+
57
+ ```svelte
58
+ <script>
59
+ import { SiteFooter, Theme } from '@reuters-graphics/graphics-components';
60
+ </script>
61
+
62
+ <Theme base="dark">
63
+ <SiteFooter />
64
+ </Theme>
65
+ ```
66
+
67
+ ## Removing referrals
68
+
69
+ Remove graphics referrals. ([Demo](?path=/story/components-page-furniture-sitefooter--remove-referrals))
70
+
71
+ ```svelte
72
+ <script>
73
+ import { SiteFooter } from '@reuters-graphics/graphics-components';
74
+ </script>
75
+
76
+ <SiteFooter includeReferrals={false} />
77
+ ```
@@ -0,0 +1,55 @@
1
+ # SiteHeader
2
+
3
+ **Category:** Components/Page furniture/SiteHeader
4
+
5
+ **Import:** `import { SiteHeader } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Examples
8
+
9
+ ### Demo
10
+
11
+ ```svelte
12
+ <div>
13
+ <SiteHeader />
14
+ </div>
15
+ ```
16
+
17
+ ### Customised theme
18
+
19
+ ```svelte
20
+ <div>
21
+ <Theme base="dark">
22
+ <SiteHeader />
23
+ </Theme>
24
+ </div>
25
+ ```
26
+
27
+ ## Documentation
28
+
29
+ # SiteHeader
30
+
31
+ Reuters dotcom site header, ported from [Raptor UI components](https://github.com/tr/rcom-arc_raptor-ui/tree/develop/packages/rcom-raptor-ui_common/src/components/site-header).
32
+
33
+ > **Note:** In the graphics kit, you can find this component in `pages/+page.svelte`. Customise it there for the default page.
34
+
35
+ ```svelte
36
+ <script>
37
+ import { SiteHeader } from '@reuters-graphics/graphics-components';
38
+ </script>
39
+
40
+ <SiteHeader />
41
+ ```
42
+
43
+ ## Dark theme
44
+
45
+ Colours are customised by the [`Theme`](?path=/docs/theming-theme--default) component. ([Demo](?path=/story/components-page-furniture-siteheader--customised-theme))
46
+
47
+ ```svelte
48
+ <script>
49
+ import { SiteHeader, Theme } from '@reuters-graphics/graphics-components';
50
+ </script>
51
+
52
+ <Theme base="dark">
53
+ <SiteHeader />
54
+ </Theme>
55
+ ```
@@ -0,0 +1,111 @@
1
+ # SiteHeadline
2
+
3
+ **Category:** Components/Text elements/SiteHeadline
4
+
5
+ **Import:** `import { SiteHeadline } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `hed` | `string` | — | | Headline |
12
+ | `hedSize` | `HeadlineSize` | `'normal'` | | Headline size Options: `small`, `normal`, `big` |
13
+ | `section` | `string` | `'Graphics'` | | Section title |
14
+ | `sectionUrl` | `string` | `'https://graphics.reuters.com'` | | Section URL, parsed as a string. Set to blank to remove link |
15
+ | `authors` | `string[]` | — | ✓ | Array of author names, which will be slugified to create links to Reuters author pages |
16
+ | `publishTime` | `string` | — | ✓ | Publish time as a datetime string |
17
+ | `updateTime` | `string` | `''` | | Update time as a datetime string |
18
+ | `id` | `string` | `''` | | Add an id to to target with custom CSS |
19
+ | `class` | `string` | `''` | | Add extra classes to target with custom CSS |
20
+ | `getAuthorPage` | `(author: string) => string` | — | | Custom function that returns an author page URL. |
21
+
22
+ ## Examples
23
+
24
+ ### Demo
25
+
26
+ ```svelte
27
+ <SiteHeadline
28
+ hed="Ukraine makes surprising gains in counteroffensive"
29
+ authors={[
30
+ 'Dea Bankova',
31
+ 'Michael Ovaska',
32
+ 'Samuel Granados',
33
+ 'Prasanta Kumar Dutta',
34
+ ]}
35
+ publishTime={new Date('2021-09-12').toISOString()}
36
+ updateTime={new Date('2021-09-12T13:57:00').toISOString()}
37
+ />
38
+ ```
39
+
40
+ ### ArchieML
41
+
42
+ ```svelte
43
+ <SiteHeadline
44
+ hed={content.hed}
45
+ section={content.section}
46
+ authors={content.authors.split(',')}
47
+ publishTime={content.published}
48
+ />
49
+ ```
50
+
51
+ ## Documentation
52
+
53
+ # SiteHeadline
54
+
55
+ The `SiteHeadline` component creates a simplified Reuters Graphics headline, loosely modelled off the Reuters.com styles.
56
+
57
+ Styles for this headline are intentionally restricted. It is meant to serve as a unifying style for quick-turnaround breaking news pages.
58
+
59
+ ```svelte
60
+ <script>
61
+ import { SiteHeadline } from '@reuters-graphics/graphics-components';
62
+ </script>
63
+
64
+ <SiteHeadline
65
+ hed="Ukraine makes suprising gains in swift counteroffensive"
66
+ authors={[
67
+ 'Dea Bankova',
68
+ 'Michael Ovaska',
69
+ 'Samuel Granados',
70
+ 'Prasanta Kumar Dutta',
71
+ ]}
72
+ publishTime="2021-09-12T00:00:00.000Z"
73
+ updateTime="2021-09-12T12:57:00.000Z"
74
+ />
75
+ ```
76
+
77
+ ## Using with ArchieML docs
78
+
79
+ With the graphics kit, you'll likely get your text value from an ArchieML doc...
80
+
81
+ ```yaml
82
+ # ArchieML doc
83
+ section: Global News # Optional
84
+ sectionUrl: https://www.reuters.com/graphics/ # Optional
85
+ hed: A beautiful page
86
+ [authors]
87
+ * Samuel Granados
88
+ * Dea Bankova
89
+ []
90
+ published: 2022-09-12T08:30:00.000Z
91
+ updated:
92
+ ```
93
+
94
+ ... which you'll pass to the `SiteHeadline` component.
95
+
96
+ ```svelte
97
+ <!-- App.svelte -->
98
+ <script>
99
+ import { SiteHeadline } from '@reuters-graphics/graphics-components';
100
+ import content from '$locales/en/content.json';
101
+ </script>
102
+
103
+ <SiteHeadline
104
+ section={content.section}
105
+ sectionUrl={content.sectionUrl}
106
+ hed={content.hed}
107
+ authors={content.authors.split(',')}
108
+ publishTime={content.publishTime}
109
+ updateTime={content.updatTime}
110
+ />
111
+ ```
@@ -0,0 +1,43 @@
1
+ # Spinner
2
+
3
+ **Category:** Components/Utilities/Spinner
4
+
5
+ **Import:** `import { Spinner } from '@reuters-graphics/graphics-components'`
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Required | Description |
10
+ |------|------|---------|:--------:|-------------|
11
+ | `colour` | `string` | `'#666'` | | Primary colour of the spinner. |
12
+ | `width` | `number` | `40` | | Outer width of the spinner |
13
+ | `ringWidth` | `number` | `6` | | Width of the spinner ring |
14
+ | `speed` | `number` | `0.8` | | How fast the spinner spins in seconds |
15
+ | `containerPadding` | `number` | `10` | | Vertical padding for the spinner's container |
16
+
17
+ ## Examples
18
+
19
+ ### Demo
20
+
21
+ ```svelte
22
+ <Spinner />
23
+ ```
24
+
25
+ ## Documentation
26
+
27
+ # Spinner
28
+
29
+ The `Spinner` component creates a simple loading spinner. Use it to hide long loading times for components that may be loading expensive media files or crunching through lots of data.
30
+
31
+ ```svelte
32
+ <script>
33
+ import { Spinner } from '@reuters-graphics/graphics-components';
34
+
35
+ let somethingsLoading = true;
36
+ </script>
37
+
38
+ {#if somethingsLoading}
39
+ <Spinner />
40
+ {:else}
41
+ <p>The real deal is here.</p>
42
+ {/if}
43
+ ```