@reuters-graphics/graphics-components 0.0.22 → 0.0.24

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.
@@ -0,0 +1,38 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ /**
5
+ * Section ID, which is often the URL path to the section page on reuters.com.
6
+ *
7
+ * Note that not all section pages will be available in the recent stories by section API.
8
+ * @required
9
+ */ section?: string;
10
+ /**
11
+ * Number of referrals to show.
12
+ * @required
13
+ */ number?: number;
14
+ /**
15
+ * Link [target](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target), e.g., `_blank` or `_parent`.
16
+ */ linkTarget?: string;
17
+ /**
18
+ * Add a heading to the referral block.
19
+ */ heading?: string;
20
+ /**
21
+ * Width of the component within the text well.
22
+ * @required
23
+ */ width?: "normal" | "wide" | "wider" | "widest" | "fluid";
24
+ /** Add an ID to target with SCSS. */ id?: string;
25
+ /** Add a class to target with SCSS. */ cls?: string;
26
+ };
27
+ events: {
28
+ [evt: string]: CustomEvent<any>;
29
+ };
30
+ slots: {};
31
+ };
32
+ export declare type ReferralBlockProps = typeof __propDef.props;
33
+ export declare type ReferralBlockEvents = typeof __propDef.events;
34
+ export declare type ReferralBlockSlots = typeof __propDef.slots;
35
+ /** `ReferralBlock` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-ReferralBlock--default) */
36
+ export default class ReferralBlock extends SvelteComponentTyped<ReferralBlockProps, ReferralBlockEvents, ReferralBlockSlots> {
37
+ }
38
+ export {};
@@ -0,0 +1 @@
1
+ export const referrals: import("svelte/store").Writable<any[]>;
@@ -0,0 +1,20 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ /** "Kinesis" colour */ logoColour?: string;
5
+ /** Primary text colour, i.e., "Reuters" */ primaryTextColour?: string;
6
+ /** Secondary text colour, i.e., "Graphics" */ secondaryTextColour?: string;
7
+ /** CSS width value */ width?: string;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {};
13
+ };
14
+ export declare type ReutersGraphicsLogoProps = typeof __propDef.props;
15
+ export declare type ReutersGraphicsLogoEvents = typeof __propDef.events;
16
+ export declare type ReutersGraphicsLogoSlots = typeof __propDef.slots;
17
+ /** `ReutersGraphicsLogo` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-ReutersGraphicsLogo--default) */
18
+ export default class ReutersGraphicsLogo extends SvelteComponentTyped<ReutersGraphicsLogoProps, ReutersGraphicsLogoEvents, ReutersGraphicsLogoSlots> {
19
+ }
20
+ export {};
@@ -0,0 +1,39 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ /** Add an ID to target with SCSS. */ id?: string;
5
+ /** Add a class to target with SCSS. */ cls?: string;
6
+ /**
7
+ * Make the header stick when user scrolls.
8
+ */ sticky?: boolean;
9
+ /**
10
+ * Background CSS
11
+ */ background?: string;
12
+ /**
13
+ * Border bottom CSS
14
+ */ borderBottom?: string;
15
+ /**
16
+ * Colour props passed to `ReutersGraphicsLogo` component.
17
+ */ logoProps?: {
18
+ logoColour?: string;
19
+ primaryTextColor?: string;
20
+ secondaryTextColor?: string;
21
+ };
22
+ /**
23
+ * Link the logo points to.
24
+ */ homeLink?: string;
25
+ };
26
+ events: {
27
+ [evt: string]: CustomEvent<any>;
28
+ };
29
+ slots: {
30
+ default: {};
31
+ };
32
+ };
33
+ export declare type ToolsHeaderProps = typeof __propDef.props;
34
+ export declare type ToolsHeaderEvents = typeof __propDef.events;
35
+ export declare type ToolsHeaderSlots = typeof __propDef.slots;
36
+ /** `ToolsHeader` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-ToolsHeader--default) */
37
+ export default class ToolsHeader extends SvelteComponentTyped<ToolsHeaderProps, ToolsHeaderEvents, ToolsHeaderSlots> {
38
+ }
39
+ export {};
@@ -14,6 +14,8 @@ export { default as PaddingReset } from "./components/PaddingReset/PaddingReset.
14
14
  export { default as PhotoPack } from "./components/PhotoPack/PhotoPack.svelte";
15
15
  export { default as PymChild } from "./components/PymChild/PymChild.svelte";
16
16
  export { pymChildStore } from "./components/PymChild/stores.js";
17
+ export { default as ReferralBlock } from "./components/ReferralBlock/ReferralBlock.svelte";
18
+ export { default as ReutersGraphicsLogo } from "./components/ReutersGraphicsLogo/ReutersGraphicsLogo.svelte";
17
19
  export { default as ReutersLogo } from "./components/ReutersLogo/ReutersLogo.svelte";
18
20
  export { default as Scroller } from "./components/Scroller/Scroller.svelte";
19
21
  export { default as SEO } from "./components/SEO/SEO.svelte";
@@ -23,6 +25,7 @@ export { default as SiteFooter } from "./components/SiteFooter/SiteFooter.svelte
23
25
  export { default as SiteHeader } from "./components/SiteHeader/SiteHeader.svelte";
24
26
  export { default as SiteHeadline } from "./components/SiteHeadline/SiteHeadline.svelte";
25
27
  export { default as Spinner } from "./components/Spinner/Spinner.svelte";
28
+ export { default as ToolsHeader } from "./components/ToolsHeader/ToolsHeader.svelte";
26
29
  export { default as Video } from "./components/Video/Video.svelte";
27
30
  export { default as Visible } from "./components/Visible/Visible.svelte";
28
31
  export { getPhotoPackPropsFromDoc } from "./components/PhotoPack/docProps.js";
@@ -0,0 +1,212 @@
1
+ <!-- @component `ReferralBlock` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-ReferralBlock--default) -->
2
+ <script>/** ✏️ DOCUMENT your chart's props using TypeScript and JSDoc comments like below! */
3
+ /**
4
+ * Section ID, which is often the URL path to the section page on reuters.com.
5
+ *
6
+ * Note that not all section pages will be available in the recent stories by section API.
7
+ * @required
8
+ */
9
+ export let section = '/world/';
10
+ /**
11
+ * Number of referrals to show.
12
+ * @required
13
+ */
14
+ export let number = 4;
15
+ /**
16
+ * Link [target](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target), e.g., `_blank` or `_parent`.
17
+ */
18
+ export let linkTarget = '_self';
19
+ /**
20
+ * Add a heading to the referral block.
21
+ */
22
+ export let heading = '';
23
+ /**
24
+ * Width of the component within the text well.
25
+ * @required
26
+ */
27
+ export let width = 'wide';
28
+ /** Add an ID to target with SCSS. */
29
+ export let id = '';
30
+ /** Add a class to target with SCSS. */
31
+ export let cls = '';
32
+ import Block from '../Block/Block.svelte';
33
+ import { referrals } from './stores.js';
34
+ import { onMount } from 'svelte';
35
+ import { getTime } from '../SiteHeader/NavBar/NavDropdown/StoryCard/time';
36
+ let clientWidth;
37
+ onMount(async () => {
38
+ try {
39
+ const response = await fetch('https://www.reuters.com/pf/api/v3/content/fetch/recent-stories-by-sections-v1?' +
40
+ new URLSearchParams({
41
+ query: JSON.stringify({
42
+ section_ids: section,
43
+ size: 20,
44
+ website: 'reuters',
45
+ }),
46
+ }));
47
+ const articles = (await response.json()).result.articles
48
+ .filter((a) => { var _a; return (_a = a === null || a === void 0 ? void 0 : a.kicker) === null || _a === void 0 ? void 0 : _a.name; })
49
+ .filter((a) => { var _a, _b, _c; return (_c = (_b = (_a = a === null || a === void 0 ? void 0 : a.thumbnail) === null || _a === void 0 ? void 0 : _a.renditions) === null || _b === void 0 ? void 0 : _b.landscape) === null || _c === void 0 ? void 0 : _c['240w']; })
50
+ .filter((a) => { var _a; return !((_a = a === null || a === void 0 ? void 0 : a.content) === null || _a === void 0 ? void 0 : _a.third_party); })
51
+ .slice(0, number);
52
+ referrals.set(articles);
53
+ }
54
+ catch (e) {
55
+ console.warn('Unable to fetch referral links.');
56
+ }
57
+ });
58
+ getTime();
59
+ </script>
60
+
61
+ {#if $referrals.length === number}
62
+ <Block width="{width}" id="{id}" cls="referrals-block {cls}">
63
+ {#if heading}
64
+ <h4 class:stacked="{clientWidth && clientWidth < 750}">{heading}</h4>
65
+ {/if}
66
+ <div
67
+ class="referral-container"
68
+ class:stacked="{clientWidth && clientWidth < 750}"
69
+ class:xs="{clientWidth && clientWidth < 450}"
70
+ bind:clientWidth
71
+ >
72
+ {#each $referrals as referral}
73
+ <div class="referral">
74
+ <a
75
+ href="https://www.reuters.com{referral.canonical_url}"
76
+ target="{linkTarget}"
77
+ rel="{linkTarget === '_blank' ? 'noreferrer' : null}"
78
+ >
79
+ <div class="referral-pack">
80
+ <div
81
+ class="headline"
82
+ class:xs="{clientWidth && clientWidth < 450}"
83
+ >
84
+ <div class="kicker">{referral.kicker.name}</div>
85
+ <div class="title">{referral.title}</div>
86
+ <div class="publish-time">
87
+ {getTime(new Date(referral.display_time))}
88
+ </div>
89
+ </div>
90
+ <div
91
+ class="image-container"
92
+ class:xs="{clientWidth && clientWidth < 450}"
93
+ >
94
+ <img
95
+ src="{referral.thumbnail.renditions.landscape['240w']}"
96
+ alt="{referral.thumbnail.caption ||
97
+ referral.thumbnail.alt_text}"
98
+ />
99
+ </div>
100
+ </div>
101
+ </a>
102
+ </div>
103
+ {/each}
104
+ </div>
105
+ </Block>
106
+ {/if}
107
+
108
+ <style>h4 {
109
+ font-family: var(--theme-font-family-subhed);
110
+ color: var(--theme-colour-text-primary, #404040);
111
+ font-size: 1.1rem;
112
+ margin: 0 0 5px;
113
+ font-weight: bold;
114
+ }
115
+ h4.stacked {
116
+ max-width: 450px;
117
+ margin: 0 auto 5px;
118
+ }
119
+
120
+ .referral-container {
121
+ width: 100%;
122
+ display: inline-flex;
123
+ flex-wrap: wrap;
124
+ justify-content: center;
125
+ gap: 10px 40px;
126
+ }
127
+ .referral-container a {
128
+ text-decoration: none;
129
+ }
130
+ .referral-container.stacked .referral {
131
+ width: 100%;
132
+ }
133
+ .referral-container.stacked .referral .headline {
134
+ padding: 0 10px 0 0;
135
+ }
136
+ .referral-container .referral {
137
+ display: block;
138
+ width: calc(50% - 20px);
139
+ max-width: 450px;
140
+ }
141
+ .referral-container .referral:hover .title {
142
+ text-decoration: underline;
143
+ }
144
+ .referral-container .referral:hover img {
145
+ filter: brightness(85%);
146
+ }
147
+ .referral-container .referral div.referral-pack {
148
+ display: flex;
149
+ justify-content: space-around;
150
+ max-width: 450px;
151
+ margin: 0 auto;
152
+ }
153
+ .referral-container .referral .headline {
154
+ display: inline-block;
155
+ width: calc(100% - 140px);
156
+ padding: 0 10px 0 0;
157
+ }
158
+ .referral-container .referral .headline.xs {
159
+ width: calc(100% - 80px);
160
+ }
161
+ .referral-container .referral .headline.xs .kicker {
162
+ font-size: 0.85rem;
163
+ }
164
+ .referral-container .referral .headline.xs .title {
165
+ font-size: 0.9rem;
166
+ line-height: 1.1rem;
167
+ }
168
+ .referral-container .referral .headline .kicker {
169
+ font-family: var(--theme-font-family-subhed);
170
+ color: var(--theme-colour-text-secondary, #666666);
171
+ font-size: 0.9rem;
172
+ margin: 0;
173
+ font-weight: 400;
174
+ }
175
+ .referral-container .referral .headline .title {
176
+ font-family: var(--theme-font-family-subhed);
177
+ color: var(--theme-colour-text-primary, #404040);
178
+ font-size: 0.95rem;
179
+ line-height: 1.15rem;
180
+ font-weight: bold;
181
+ margin: 0;
182
+ }
183
+ .referral-container .referral .headline .publish-time {
184
+ font-family: var(--theme-font-family-subhed);
185
+ color: var(--theme-colour-text-secondary, #666666);
186
+ font-size: 0.75rem;
187
+ margin: 2px 0 0;
188
+ font-weight: 400;
189
+ }
190
+ .referral-container .referral .image-container {
191
+ margin: 0;
192
+ overflow: hidden;
193
+ border-radius: 10px;
194
+ border: 1px solid var(--theme-colour-brand-rules, #d0d0d0);
195
+ display: block;
196
+ position: relative;
197
+ width: 140px;
198
+ height: 90px;
199
+ }
200
+ .referral-container .referral .image-container.xs {
201
+ width: 80px;
202
+ height: 60px;
203
+ }
204
+ .referral-container .referral .image-container img {
205
+ transition: filter 0.1s;
206
+ display: block;
207
+ width: 100%;
208
+ height: inherit;
209
+ -o-object-fit: cover;
210
+ object-fit: cover;
211
+ margin: 0;
212
+ }</style>
@@ -0,0 +1,3 @@
1
+ import { writable } from 'svelte/store';
2
+
3
+ export const referrals = writable([]);
@@ -0,0 +1,50 @@
1
+ <!-- @component `ReutersGraphicsLogo` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-ReutersGraphicsLogo--default) -->
2
+ <script>/** "Kinesis" colour */
3
+ export let logoColour = '#FA6400';
4
+ /** Primary text colour, i.e., "Reuters" */
5
+ export let primaryTextColour = '#404040';
6
+ /** Secondary text colour, i.e., "Graphics" */
7
+ export let secondaryTextColour = '#666666';
8
+ /** CSS width value */
9
+ export let width = '100%';
10
+ </script>
11
+
12
+ <svg
13
+ aria-hidden="true"
14
+ focusable="false"
15
+ viewBox="0 0 219.32 32.43"
16
+ style="width: {width};"
17
+ >
18
+ <path
19
+ d="M30.72,16.3a1.57,1.57,0,1,1-1.56-1.57A1.56,1.56,0,0,1,30.72,16.3Zm-4.8-2.74a.94.94,0,1,0,.94.94A.94.94,0,0,0,25.92,13.56Zm-1.11-3.28a1.2,1.2,0,1,0,0,2.39,1.2,1.2,0,0,0,0-2.39ZM22.87,7.79A1.11,1.11,0,1,0,24,8.9,1.11,1.11,0,0,0,22.87,7.79ZM20.43,6.31a.95.95,0,1,0,.94.94A.94.94,0,0,0,20.43,6.31ZM17.85,5.7a.8.8,0,0,0,0,1.6.8.8,0,0,0,0-1.6Zm-2.53.11a.61.61,0,0,0-.61.62.61.61,0,0,0,.61.61.61.61,0,0,0,.62-.61A.62.62,0,0,0,15.32,5.81Zm-2.2.54a.53.53,0,1,0,.53.52A.52.52,0,0,0,13.12,6.35Zm-1.88.83a.46.46,0,0,0,0,.92.46.46,0,1,0,0-.92ZM9.58,8.27a.53.53,0,1,0,.53.53A.53.53,0,0,0,9.58,8.27ZM8,9.8a.61.61,0,1,0,.61.61A.61.61,0,0,0,8,9.8Zm-1.31,2a.73.73,0,1,0,.73.73A.73.73,0,0,0,6.7,11.84Zm-.76,2.63a.77.77,0,1,0,.77.77A.77.77,0,0,0,5.94,14.47Zm0,2.68a.94.94,0,1,0,.94.94A.94.94,0,0,0,6,17.15ZM7.1,19.92a1.2,1.2,0,0,0,0,2.39,1.2,1.2,0,1,0,0-2.39Zm2,2.66a1.11,1.11,0,1,0,1.11,1.1A1.1,1.1,0,0,0,9.05,22.58Zm2.36,1.77a.94.94,0,1,0,.94.93A.94.94,0,0,0,11.41,24.35Zm2.65.95a.8.8,0,0,0,0,1.59.8.8,0,1,0,0-1.59Zm2.53.25a.61.61,0,1,0,.61.61A.61.61,0,0,0,16.59,25.55Zm2.2-.36a.53.53,0,0,0,0,1.06.53.53,0,0,0,0-1.06Zm1.88-.7a.46.46,0,0,0-.45.46.45.45,0,0,0,.45.45.46.46,0,0,0,.46-.45A.47.47,0,0,0,20.67,24.49Zm1.66-1.23a.53.53,0,0,0-.53.53.53.53,0,1,0,1.06,0A.53.53,0,0,0,22.33,23.26Zm1.57-1.69a.61.61,0,0,0,0,1.22.61.61,0,1,0,0-1.22Zm1.31-2.28a.73.73,0,0,0-.72.73.72.72,0,0,0,.72.72.73.73,0,0,0,.73-.72A.73.73,0,0,0,25.21,19.29ZM26,16.58a.77.77,0,1,0,.77.77A.76.76,0,0,0,26,16.58Zm-3-.88a.73.73,0,1,0,0,1.45.73.73,0,1,0,0-1.45Zm-2.82-.65a.41.41,0,1,0,.41.41A.41.41,0,0,0,20.15,15.05Zm-.78-2a.57.57,0,0,0-.57.57.57.57,0,1,0,.57-.57Zm-1.86-1.64a.77.77,0,0,0,0,1.54.77.77,0,1,0,0-1.54ZM15,11.16a.87.87,0,1,0,.87.87A.88.88,0,0,0,15,11.16Zm-2.13,1.21a.83.83,0,1,0,.83.83A.83.83,0,0,0,12.87,12.37Zm-1.09,2.28a.57.57,0,0,0-.56.56.56.56,0,1,0,1.12,0A.57.57,0,0,0,11.78,14.65Zm0,2.14a.41.41,0,1,0,.41.41A.41.41,0,0,0,11.82,16.79Zm.74,1.63A.58.58,0,0,0,12,19a.57.57,0,0,0,1.14,0A.58.58,0,0,0,12.56,18.42Zm1.86,1.27a.77.77,0,0,0-.77.77.78.78,0,1,0,.77-.77Zm2.51.06a.88.88,0,1,0,.87.87A.87.87,0,0,0,16.93,19.75Zm2.14-1.13a.83.83,0,0,0-.83.83.84.84,0,0,0,.83.84.85.85,0,0,0,.84-.84A.84.84,0,0,0,19.07,18.62Zm1.09-1.73a.56.56,0,1,0,.56.56A.56.56,0,0,0,20.16,16.89Zm2.44-4.12a.94.94,0,1,0,.94.94A.94.94,0,0,0,22.6,12.77ZM21,10.14a1.12,1.12,0,1,0,1.12,1.12A1.12,1.12,0,0,0,21,10.14ZM18.62,8.67a1,1,0,1,0,1,1A1,1,0,0,0,18.62,8.67ZM16,8.38a.88.88,0,1,0,.88.88A.87.87,0,0,0,16,8.38Zm-2.66.85a.66.66,0,1,0,.66.66A.66.66,0,0,0,13.3,9.23Zm-2.24,1.56a.61.61,0,1,0,.61.61A.61.61,0,0,0,11.06,10.79ZM9.54,13a.61.61,0,0,0-.61.61.62.62,0,0,0,.61.61.61.61,0,0,0,.61-.61A.61.61,0,0,0,9.54,13ZM8.9,15.46a.72.72,0,0,0-.72.72.73.73,0,0,0,.72.73.73.73,0,0,0,.73-.73A.73.73,0,0,0,8.9,15.46ZM9.28,18a.94.94,0,1,0,.93.94A.94.94,0,0,0,9.28,18Zm1.58,2.27A1.12,1.12,0,1,0,12,21.34,1.12,1.12,0,0,0,10.86,20.22Zm2.41,1.7a1,1,0,1,0,1,1A1,1,0,0,0,13.27,21.92Zm2.65.53a.89.89,0,1,0,.89.89A.89.89,0,0,0,15.92,22.45Zm2.66-.39a.66.66,0,1,0,0,1.31.66.66,0,1,0,0-1.31Zm2.24-1.45a.6.6,0,0,0-.6.61.61.61,0,1,0,.6-.61Zm1.52-2.25a.61.61,0,0,0-.61.61A.61.61,0,0,0,23,19,.61.61,0,0,0,22.34,18.36Zm6.2-7.6a1.36,1.36,0,1,0,1.35,1.36A1.35,1.35,0,0,0,28.54,10.76Zm-1.72-3.1A1.15,1.15,0,1,0,28,8.81,1.15,1.15,0,0,0,26.82,7.66ZM24.27,5.22a1,1,0,1,0,1,1A1,1,0,0,0,24.27,5.22ZM21.41,3.75a.8.8,0,1,0,.8.8A.8.8,0,0,0,21.41,3.75ZM18.6,3a.69.69,0,1,0,.69.69A.69.69,0,0,0,18.6,3ZM16,2.79a.6.6,0,1,0,.6.6A.6.6,0,0,0,16,2.79ZM13.32,3a.69.69,0,1,0,.69.69A.69.69,0,0,0,13.32,3Zm-2.82.76a.8.8,0,1,0,.81.8A.8.8,0,0,0,10.5,3.75ZM7.64,5.22a1,1,0,1,0,1,1A1,1,0,0,0,7.64,5.22ZM5.09,7.66A1.15,1.15,0,1,0,6.24,8.81,1.15,1.15,0,0,0,5.09,7.66ZM3.37,10.77a1.35,1.35,0,1,0,1.36,1.35A1.35,1.35,0,0,0,3.37,10.77Zm-.62,4A1.57,1.57,0,1,0,4.32,16.3,1.56,1.56,0,0,0,2.75,14.73Zm.63,4.39a1.35,1.35,0,1,0,1.35,1.35A1.35,1.35,0,0,0,3.38,19.12Zm1.71,3.51a1.15,1.15,0,0,0,0,2.3,1.15,1.15,0,0,0,0-2.3Zm2.55,2.76a1,1,0,1,0,1,1A1,1,0,0,0,7.64,25.39Zm2.86,1.84a.81.81,0,1,0,.81.81A.8.8,0,0,0,10.5,27.23Zm2.82,1a.7.7,0,1,0,.69.7A.69.69,0,0,0,13.32,28.21ZM16,28.6a.6.6,0,0,0-.6.6.59.59,0,0,0,.6.59.58.58,0,0,0,.59-.59A.59.59,0,0,0,16,28.6Zm2.64-.39a.7.7,0,1,0,.69.7A.7.7,0,0,0,18.6,28.21Zm2.81-1a.81.81,0,1,0,.81.8A.81.81,0,0,0,21.41,27.24Zm2.86-1.86a1,1,0,1,0,1,1A1,1,0,0,0,24.27,25.38Zm2.55-2.75A1.15,1.15,0,1,0,28,23.78,1.15,1.15,0,0,0,26.82,22.63Zm1.72-3.51a1.36,1.36,0,1,0,1.35,1.35A1.35,1.35,0,0,0,28.54,19.12Z"
20
+ fill="{logoColour}"></path>
21
+ <path
22
+ d="M49,23H46.68c-.21,0-.29-.2-.38-.38L43.58,18h-.42c-.49,0-2-.05-2.46-.08v4.67a.37.37,0,0,1-.36.38H38.45a.39.39,0,0,1-.38-.38V10.23c0-.38.23-.51.61-.56a38.87,38.87,0,0,1,4.48-.25c2.91,0,5.6,1,5.6,4.27v.18a3.64,3.64,0,0,1-2.55,3.7l3,5.06a.23.23,0,0,1,0,.15A.21.21,0,0,1,49,23Zm-2.84-9.32c0-1.41-1.1-2-3-2-.4,0-2.12,0-2.46.08v4.1c.3,0,2.13.06,2.46.06,1.94,0,3-.38,3-2Zm8.11,5.59c0,1.58.06,1.63,1.49,1.63h4.79a.38.38,0,0,1,.37.38v1.2c0,.27-.09.37-.37.4a25.07,25.07,0,0,1-4.09.26c-3.14,0-4.8,0-4.8-3.87v-6c0-3.9,1.66-3.88,4.8-3.88a26.35,26.35,0,0,1,4.09.26c.28,0,.37.14.37.4v1.21a.38.38,0,0,1-.37.38H55.75c-1.43,0-1.49,0-1.49,1.63V15h6.05a.38.38,0,0,1,.38.38v1.36a.38.38,0,0,1-.38.38H54.26ZM69.4,23.15c-3,0-5.66-1.32-5.66-5.35V9.93a.36.36,0,0,1,.38-.36H66a.36.36,0,0,1,.38.36V17.8c0,2.16,1,3.18,3,3.18s3-1,3-3.18V9.93a.36.36,0,0,1,.38-.36h1.87a.36.36,0,0,1,.38.36V17.8C75.07,21.83,72.45,23.15,69.4,23.15ZM87.51,11.76H83.74V22.63a.4.4,0,0,1-.39.38H81.48a.39.39,0,0,1-.38-.38V11.76H77.33a.35.35,0,0,1-.38-.33V9.93a.36.36,0,0,1,.38-.36H87.51a.36.36,0,0,1,.37.36v1.5A.34.34,0,0,1,87.51,11.76ZM113.19,23h-2.31c-.21,0-.28-.2-.37-.38L107.78,18h-.42c-.49,0-2-.05-2.46-.08v4.67a.37.37,0,0,1-.35.38h-1.89a.39.39,0,0,1-.38-.38V10.23c0-.38.22-.51.6-.56a38.87,38.87,0,0,1,4.48-.25c2.92,0,5.6,1,5.6,4.27v.18a3.64,3.64,0,0,1-2.55,3.7l3,5.06a.23.23,0,0,1,0,.15A.22.22,0,0,1,113.19,23Zm-2.83-9.32c0-1.41-1.11-2-3-2-.39,0-2.12,0-2.46.08v4.1c.31,0,2.14.06,2.46.06,2,0,3-.38,3-2Zm10,9.48a20.58,20.58,0,0,1-4.28-.5.41.41,0,0,1-.35-.38V20.93a.36.36,0,0,1,.35-.36h0a35.51,35.51,0,0,0,4.28.34c1.68,0,2.19-.6,2.19-1.7,0-1.42-3.38-2.2-5-2.88A3.39,3.39,0,0,1,115.38,13c0-2.08,1.67-3.59,5.19-3.59a18.93,18.93,0,0,1,4.09.49.38.38,0,0,1,.34.36v1.4a.32.32,0,0,1-.32.34h0a41.56,41.56,0,0,0-4.19-.34c-1.4,0-2.45.49-2.45,1.34,0,.62.71,1.19,1.55,1.53l3.2,1.26c1.59.65,2.62,1.59,2.62,3.4S124.19,23.17,120.41,23.17Zm-28-3.89c0,1.58.06,1.63,1.49,1.63h4.79a.38.38,0,0,1,.38.38v1.2c0,.27-.1.37-.38.4a25.07,25.07,0,0,1-4.09.26c-3.14,0-4.8,0-4.8-3.87v-6c0-3.9,1.66-3.88,4.8-3.88a26.35,26.35,0,0,1,4.09.26c.28,0,.38.14.38.4v1.21a.38.38,0,0,1-.38.38H93.93c-1.43,0-1.49,0-1.49,1.63V15h6a.38.38,0,0,1,.38.38v1.36a.38.38,0,0,1-.38.38h-6Z"
23
+ fill="{primaryTextColour}"></path>
24
+ <g>
25
+ <path
26
+ d="M139.13,9.65a9.7,9.7,0,0,1,3.77.64l-.17.92a10.21,10.21,0,0,0-3.52-.6c-3.43,0-5.51,2.16-5.51,5.7s2,5.7,5.41,5.7a12.38,12.38,0,0,0,2.66-.31V17.14h1.06v5.28a13.27,13.27,0,0,1-3.74.52c-4.18,0-6.49-2.78-6.49-6.63S135,9.65,139.13,9.65Z"
27
+ fill="{secondaryTextColour}"></path>
28
+ <path
29
+ d="M151.69,17l3.75,5.67h-1.25l-3.67-5.59h-3.66v5.59h-1.1V9.88h5.06c2.68,0,4,1.58,4,3.6A3.57,3.57,0,0,1,151.69,17Zm-1-6.25h-3.85v5.43h3.85a2.66,2.66,0,0,0,3-2.74C153.67,11.81,152.63,10.79,150.71,10.79Z"
30
+ fill="{secondaryTextColour}"></path>
31
+ <path
32
+ d="M161.74,9.88h1.2l4.81,12.83h-1.09l-1.35-3.66h-6L158,22.71h-1.1Zm-2.06,8.22H165l-2.64-7.33Z"
33
+ fill="{secondaryTextColour}"></path>
34
+ <path
35
+ d="M169.84,9.88h4.83a3.59,3.59,0,0,1,3.93,3.7,3.63,3.63,0,0,1-3.93,3.7h-3.74v5.43h-1.09Zm4.73,6.47a2.62,2.62,0,0,0,2.91-2.77,2.65,2.65,0,0,0-2.93-2.79h-3.62v5.56Z"
36
+ fill="{secondaryTextColour}"></path>
37
+ <path
38
+ d="M180.89,9.88H182v5.76h7.28V9.88h1.12V22.71h-1.12V16.62H182v6.09h-1.1Z"
39
+ fill="{secondaryTextColour}"></path>
40
+ <path d="M193.76,9.88h1.1V22.71h-1.1Z" fill="{secondaryTextColour}"></path>
41
+ <path
42
+ d="M203.91,9.65a9.26,9.26,0,0,1,3.35.6l-.17.9a9.38,9.38,0,0,0-3-.54c-3.37,0-5.41,2.18-5.41,5.68s2,5.68,5.41,5.68a9.38,9.38,0,0,0,3-.54l.17.91a9.26,9.26,0,0,1-3.35.6c-4,0-6.35-2.68-6.35-6.65S199.92,9.65,203.91,9.65Z"
43
+ fill="{secondaryTextColour}"></path>
44
+ <path
45
+ d="M213.43,22.94A12.07,12.07,0,0,1,209,22l.27-.9a10.81,10.81,0,0,0,4.16.94c2,0,3.35-.81,3.35-2.46s-1.22-2.31-3.68-2.95c-3-.77-4.14-1.91-4.14-3.62,0-2.27,1.68-3.35,4.51-3.35a9.32,9.32,0,0,1,3.94.83l-.21.9a9.43,9.43,0,0,0-3.73-.82c-2.16,0-3.41.61-3.41,2.38,0,1.56,1.11,2.1,3.44,2.78,2.62.75,4.38,1.5,4.38,3.77S216.16,22.94,213.43,22.94Z"
46
+ fill="{secondaryTextColour}"></path>
47
+ </g>
48
+ </svg>
49
+
50
+ <style></style>
@@ -190,6 +190,7 @@ To handle overlapping borders within components (e.g., buttons and inputs in inp
190
190
  .section .section-link,
191
191
  .section .subsection-link {
192
192
  font-family: "Knowledge", "Source Sans Pro", Arial, sans-serif;
193
+ text-decoration: none;
193
194
  line-height: 1.2;
194
195
  color: var(--nav-primary);
195
196
  }
@@ -0,0 +1,75 @@
1
+ <!-- @component `ToolsHeader` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-ToolsHeader--default) -->
2
+ <script>/** Add an ID to target with SCSS. */
3
+ export let id = '';
4
+ /** Add a class to target with SCSS. */
5
+ export let cls = '';
6
+ /**
7
+ * Make the header stick when user scrolls.
8
+ */
9
+ export let sticky = false;
10
+ /**
11
+ * Background CSS
12
+ */
13
+ export let background = 'transparent';
14
+ /**
15
+ * Border bottom CSS
16
+ */
17
+ export let borderBottom = '1px solid #dedede';
18
+ /**
19
+ * Colour props passed to `ReutersGraphicsLogo` component.
20
+ */
21
+ export let logoProps = { logoColour: '#404040' };
22
+ /**
23
+ * Link the logo points to.
24
+ */
25
+ export let homeLink = '/';
26
+ import ReutersGraphicsLogo from '../ReutersGraphicsLogo/ReutersGraphicsLogo.svelte';
27
+ </script>
28
+
29
+ <header
30
+ id="{id}"
31
+ class="{cls}"
32
+ class:sticky
33
+ style:background="{background}"
34
+ style:border-bottom="{borderBottom}"
35
+ >
36
+ <div class="logo-container">
37
+ <a href="{homeLink}">
38
+ <ReutersGraphicsLogo {...{ ...logoProps, ...{ width: '100%' } }} />
39
+ </a>
40
+ </div>
41
+ <div class="menu-items-container">
42
+ <!-- Any additional content -->
43
+ <slot />
44
+ </div>
45
+ </header>
46
+
47
+ <style>header {
48
+ width: 100%;
49
+ padding: 10px 15px;
50
+ display: flex;
51
+ gap: 15px;
52
+ }
53
+ header.sticky {
54
+ position: -webkit-sticky;
55
+ position: sticky;
56
+ top: 0;
57
+ }
58
+ header div.logo-container {
59
+ width: 250px;
60
+ display: flex;
61
+ align-items: center;
62
+ }
63
+ @media (max-width: 1200px) {
64
+ header div.logo-container {
65
+ width: 200px;
66
+ }
67
+ }
68
+ header div.menu-items-container {
69
+ width: calc(100% - 265px);
70
+ }
71
+ @media (max-width: 1200px) {
72
+ header div.menu-items-container {
73
+ width: calc(100% - 215px);
74
+ }
75
+ }</style>
package/dist/index.js CHANGED
@@ -15,6 +15,8 @@ export { default as PaddingReset } from './components/PaddingReset/PaddingReset.
15
15
  export { default as PhotoPack } from './components/PhotoPack/PhotoPack.svelte';
16
16
  export { default as PymChild } from './components/PymChild/PymChild.svelte';
17
17
  export { pymChildStore } from './components/PymChild/stores.js';
18
+ export { default as ReferralBlock } from './components/ReferralBlock/ReferralBlock.svelte';
19
+ export { default as ReutersGraphicsLogo } from './components/ReutersGraphicsLogo/ReutersGraphicsLogo.svelte';
18
20
  export { default as ReutersLogo } from './components/ReutersLogo/ReutersLogo.svelte';
19
21
  export { default as Scroller } from './components/Scroller/Scroller.svelte';
20
22
  export { default as SEO } from './components/SEO/SEO.svelte';
@@ -29,6 +31,7 @@ export {
29
31
  // @ts-ignore
30
32
  themes
31
33
  } from './components/Theme/Theme.svelte';
34
+ export { default as ToolsHeader } from './components/ToolsHeader/ToolsHeader.svelte';
32
35
  export { default as Video } from './components/Video/Video.svelte';
33
36
  export { default as Visible } from './components/Visible/Visible.svelte';
34
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reuters-graphics/graphics-components",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://reuters-graphics.github.io/graphics-components",
@@ -123,6 +123,9 @@
123
123
  "./components/PhotoPack/docProps.ts": "./dist/components/PhotoPack/docProps.ts",
124
124
  "./components/PymChild/PymChild.svelte": "./dist/components/PymChild/PymChild.svelte",
125
125
  "./components/PymChild/stores": "./dist/components/PymChild/stores.js",
126
+ "./components/ReferralBlock/ReferralBlock.svelte": "./dist/components/ReferralBlock/ReferralBlock.svelte",
127
+ "./components/ReferralBlock/stores": "./dist/components/ReferralBlock/stores.js",
128
+ "./components/ReutersGraphicsLogo/ReutersGraphicsLogo.svelte": "./dist/components/ReutersGraphicsLogo/ReutersGraphicsLogo.svelte",
126
129
  "./components/ReutersLogo/ReutersLogo.svelte": "./dist/components/ReutersLogo/ReutersLogo.svelte",
127
130
  "./components/SEO/SEO.svelte": "./dist/components/SEO/SEO.svelte",
128
131
  "./components/SEO/analytics": "./dist/components/SEO/analytics.js",
@@ -184,6 +187,7 @@
184
187
  "./components/Theme/themes/light": "./dist/components/Theme/themes/light.js",
185
188
  "./components/Theme/utils/flatten": "./dist/components/Theme/utils/flatten.js",
186
189
  "./components/Theme/utils/merge": "./dist/components/Theme/utils/merge.js",
190
+ "./components/ToolsHeader/ToolsHeader.svelte": "./dist/components/ToolsHeader/ToolsHeader.svelte",
187
191
  "./components/Video/Controls.svelte": "./dist/components/Video/Controls.svelte",
188
192
  "./components/Video/Video.svelte": "./dist/components/Video/Video.svelte",
189
193
  "./components/Visible/Visible.svelte": "./dist/components/Visible/Visible.svelte",