@reuters-graphics/graphics-components 1.0.1 → 1.0.3

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.
@@ -2,8 +2,8 @@ interface EndNote {
2
2
  Title: String;
3
3
  Text: String;
4
4
  }
5
- type Block = EndNote[];
6
- export declare const getEndNotesPropsFromDoc: (docBlock: Block) => {
5
+ type EndNotes = EndNote[];
6
+ export declare const getEndNotesPropsFromDoc: (endNotes: EndNotes) => {
7
7
  title: String;
8
8
  text: String;
9
9
  }[];
@@ -23,6 +23,9 @@ declare const __propDef: {
23
23
  * Add an id to the block tag to target it with custom CSS.
24
24
  * @type {string}
25
25
  */ id?: string;
26
+ /**
27
+ * Page theme
28
+ */ theme?: "light" | "dark";
26
29
  };
27
30
  events: {
28
31
  [evt: string]: CustomEvent<any>;
@@ -1,5 +1,5 @@
1
- export const getEndNotesPropsFromDoc = (docBlock) => {
2
- return docBlock.map((d) => {
1
+ export const getEndNotesPropsFromDoc = (endNotes) => {
2
+ return endNotes.map((d) => {
3
3
  return {
4
4
  title: d.Title,
5
5
  text: d.Text,
@@ -26,11 +26,15 @@ export { cls as class };
26
26
  * @type {string}
27
27
  */
28
28
  export let id = '';
29
+ /**
30
+ * Page theme
31
+ */
32
+ export let theme = 'light';
29
33
  import Block from '../Block/Block.svelte';
30
34
  import { marked } from 'marked';
31
35
  </script>
32
36
 
33
- <aside class="infobox">
37
+ <aside class="infobox {theme}">
34
38
  <Block
35
39
  width="{width}"
36
40
  id="{id}"
@@ -74,7 +78,12 @@ https://utopia.fyi/space/calculator/?c=320,18,1.125,1280,21,1.25,7,3,&s=0.75|0.5
74
78
  /* Scales by 1.125 */
75
79
  .infobox :global(.article-block) {
76
80
  border-color: var(--theme-colour-brand-rules);
77
- background-color: #fafafa;
81
+ }
82
+ .infobox.light :global(.article-block) {
83
+ background-color: rgb(250, 250, 250);
84
+ }
85
+ .infobox.dark :global(.article-block) {
86
+ background-color: rgba(250, 250, 250, 0.1);
78
87
  }
79
88
  .infobox :global(.header p) {
80
89
  font-family: var(--theme-font-family-subhed);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reuters-graphics/graphics-components",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://reuters-graphics.github.io/graphics-components",