@reuters-graphics/graphics-components 0.1.6 → 0.1.7--canary.99.331bdb0.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 (206) hide show
  1. package/dist/@types/components/@types/global.d.ts +4 -0
  2. package/dist/@types/components/Block/Block.svelte.d.ts +1 -1
  3. package/dist/@types/components/BodyText/BodyText.svelte.d.ts +1 -0
  4. package/dist/@types/components/DocumentCloud/DocumentCloud.svelte.d.ts +1 -1
  5. package/dist/@types/components/FeaturePhoto/FeaturePhoto.svelte.d.ts +8 -0
  6. package/dist/@types/components/GraphicBlock/GraphicBlock.svelte.d.ts +1 -1
  7. package/dist/@types/components/Headline/Headline.svelte.d.ts +5 -0
  8. package/dist/@types/components/PhotoCarousel/PhotoCarousel.svelte.d.ts +1 -1
  9. package/dist/@types/components/PhotoPack/PhotoPack.svelte.d.ts +1 -1
  10. package/dist/@types/components/ReferralBlock/ReferralBlock.svelte.d.ts +1 -1
  11. package/dist/@types/components/SimpleTimeline/SimpleTimeline.svelte.d.ts +1 -1
  12. package/dist/@types/components/SiteHeadline/SiteHeadline.svelte.d.ts +6 -1
  13. package/dist/@types/components/Table/Table.svelte.d.ts +1 -1
  14. package/dist/@types/components/Theme/@types/component.d.ts +29 -9
  15. package/dist/@types/components/Theme/Theme.svelte.d.ts +1 -21
  16. package/dist/@types/components/Theme/themes/common.d.ts +2 -0
  17. package/dist/@types/components/Theme/themes/light.d.ts +1 -21
  18. package/dist/@types/components/ToolsHeader/ToolsHeader.svelte.d.ts +1 -1
  19. package/dist/components/Article/Article.svelte +1 -1
  20. package/dist/components/BeforeAfter/BeforeAfter.svelte +23 -41
  21. package/dist/components/Block/Block.svelte +3 -81
  22. package/dist/components/BodyText/BodyText.svelte +4 -179
  23. package/dist/components/DocumentCloud/DocumentCloud.svelte +3 -2
  24. package/dist/components/FeaturePhoto/FeaturePhoto.svelte +26 -28
  25. package/dist/components/Framer/Typeahead/index.svelte +4 -4
  26. package/dist/components/GraphicBlock/GraphicBlock.svelte +18 -148
  27. package/dist/components/GraphicBlock/TextBlock.svelte +1 -1
  28. package/dist/components/Headline/Headline.svelte +54 -43
  29. package/dist/components/NoteText/NoteText.svelte +12 -100
  30. package/dist/components/PhotoCarousel/PhotoCarousel.svelte +18 -39
  31. package/dist/components/PhotoPack/PhotoPack.svelte +20 -43
  32. package/dist/components/ReferralBlock/ReferralBlock.svelte +28 -46
  33. package/dist/components/Scroller/Background.svelte +1 -3
  34. package/dist/components/Scroller/Embedded/Background.svelte +1 -1
  35. package/dist/components/Scroller/Embedded/Foreground.svelte +2 -192
  36. package/dist/components/Scroller/Foreground.svelte +8 -101
  37. package/dist/components/Scroller/Scroller.svelte +11 -43
  38. package/dist/components/SearchInput/MagnifyingGlass.svelte +1 -1
  39. package/dist/components/SearchInput/SearchInput.svelte +11 -6
  40. package/dist/components/SearchInput/X.svelte +2 -2
  41. package/dist/components/SimpleTimeline/SimpleTimeline.svelte +36 -46
  42. package/dist/components/SiteFooter/CompanyLinks.svelte +6 -6
  43. package/dist/components/SiteFooter/LegalLinks.svelte +5 -5
  44. package/dist/components/SiteFooter/QuickLinks.svelte +4 -4
  45. package/dist/components/SiteFooter/Referrals/Link.svelte +1 -1
  46. package/dist/components/SiteFooter/SiteFooter.svelte +1 -0
  47. package/dist/components/SiteFooter/svgs/Facebook.svelte +1 -1
  48. package/dist/components/SiteFooter/svgs/Graphics.svelte +1 -1
  49. package/dist/components/SiteFooter/svgs/Instagram.svelte +1 -1
  50. package/dist/components/SiteFooter/svgs/LinkedIn.svelte +1 -1
  51. package/dist/components/SiteFooter/svgs/Pictures.svelte +1 -1
  52. package/dist/components/SiteFooter/svgs/Twitter.svelte +1 -1
  53. package/dist/components/SiteFooter/svgs/Videos.svelte +1 -1
  54. package/dist/components/SiteFooter/svgs/YouTube.svelte +1 -1
  55. package/dist/components/SiteHeader/MobileMenu/index.svelte +3 -3
  56. package/dist/components/SiteHeader/NavBar/DownArrow.svelte +1 -1
  57. package/dist/components/SiteHeader/NavBar/NavDropdown/MoreDropdown.svelte +2 -2
  58. package/dist/components/SiteHeader/NavBar/NavDropdown/SectionDropdown.svelte +3 -3
  59. package/dist/components/SiteHeader/NavBar/NavDropdown/Spinner/index.svelte +1 -1
  60. package/dist/components/SiteHeader/NavBar/NavDropdown/StoryCard/index.svelte +4 -4
  61. package/dist/components/SiteHeader/NavBar/NavDropdown/index.svelte +5 -5
  62. package/dist/components/SiteHeader/NavBar/index.svelte +6 -6
  63. package/dist/components/SiteHeader/SiteHeader.svelte +2 -1
  64. package/dist/components/SiteHeader/svgs/Close.svelte +1 -1
  65. package/dist/components/SiteHeader/svgs/Menu.svelte +1 -1
  66. package/dist/components/SiteHeadline/SiteHeadline.svelte +44 -97
  67. package/dist/components/Spinner/Spinner.svelte +3 -12
  68. package/dist/components/Table/Pagination.svelte +7 -7
  69. package/dist/components/Table/Select.svelte +4 -4
  70. package/dist/components/Table/SortArrow.svelte +2 -2
  71. package/dist/components/Table/Table.svelte +18 -17
  72. package/dist/components/Theme/themes/common.js +28 -0
  73. package/dist/components/Theme/themes/dark.js +4 -12
  74. package/dist/components/Theme/themes/light.js +4 -11
  75. package/dist/components/ToolsHeader/ToolsHeader.svelte +3 -2
  76. package/dist/components/Video/Video.svelte +15 -48
  77. package/dist/scss/_mixins.scss +6 -6
  78. package/dist/scss/colours/_main.scss +3 -0
  79. package/dist/scss/colours/primary/_amber.scss +13 -0
  80. package/dist/scss/colours/primary/_blue.scss +13 -0
  81. package/dist/scss/colours/primary/_cyan.scss +13 -0
  82. package/dist/scss/colours/primary/_emerald.scss +13 -0
  83. package/dist/scss/colours/primary/_fuchsia.scss +13 -0
  84. package/dist/scss/colours/primary/_green.scss +13 -0
  85. package/dist/scss/colours/primary/_grey.scss +13 -0
  86. package/dist/scss/colours/primary/_indigo.scss +13 -0
  87. package/dist/scss/colours/primary/_lime.scss +13 -0
  88. package/dist/scss/colours/primary/_neutral.scss +13 -0
  89. package/dist/scss/colours/primary/_orange.scss +13 -0
  90. package/dist/scss/colours/primary/_pink.scss +13 -0
  91. package/dist/scss/colours/primary/_purple.scss +13 -0
  92. package/dist/scss/colours/primary/_red.scss +13 -0
  93. package/dist/scss/colours/primary/_rose.scss +13 -0
  94. package/dist/scss/colours/primary/_sky.scss +13 -0
  95. package/dist/scss/colours/primary/_slate.scss +13 -0
  96. package/dist/scss/colours/primary/_stone.scss +13 -0
  97. package/dist/scss/colours/primary/_teal.scss +13 -0
  98. package/dist/scss/colours/primary/_violet.scss +13 -0
  99. package/dist/scss/colours/primary/_yellow.scss +13 -0
  100. package/dist/scss/colours/primary/_zinc.scss +13 -0
  101. package/dist/scss/colours/thematic/_grey.scss +13 -0
  102. package/dist/scss/colours/thematic/_nord.scss +42 -40
  103. package/dist/scss/colours/thematic/_tr.scss +27 -25
  104. package/dist/scss/fonts/_font-faces.scss +194 -66
  105. package/dist/scss/main.scss +15 -16
  106. package/dist/scss/mixins/_main.scss +1 -0
  107. package/dist/scss/reset/_main.scss +12 -0
  108. package/dist/scss/reset/_typography.scss +138 -0
  109. package/dist/scss/token-classes.scss +8 -0
  110. package/dist/scss/tokens/accessibility/_main.scss +1 -0
  111. package/dist/scss/tokens/accessibility/_visibility.scss +5 -0
  112. package/dist/scss/tokens/accessibility/mixins/_main.scss +1 -0
  113. package/dist/scss/{mixins/_visually-hidden.scss → tokens/accessibility/mixins/_visibility.scss} +1 -2
  114. package/dist/scss/tokens/backgrounds/_background-color.scss +26 -0
  115. package/dist/scss/tokens/backgrounds/_main.scss +1 -0
  116. package/dist/scss/tokens/backgrounds/mixins/_background-color.scss +24 -0
  117. package/dist/scss/tokens/backgrounds/mixins/_main.scss +1 -0
  118. package/dist/scss/tokens/borders/_border-color.scss +15 -0
  119. package/dist/scss/tokens/borders/_border-radius.scss +279 -0
  120. package/dist/scss/tokens/borders/_border-style.scss +18 -0
  121. package/dist/scss/tokens/borders/_border-width.scss +115 -0
  122. package/dist/scss/tokens/borders/_main.scss +3 -0
  123. package/dist/scss/tokens/interactivity/_cursor.scss +72 -0
  124. package/dist/scss/tokens/interactivity/_main.scss +2 -0
  125. package/dist/scss/tokens/interactivity/_pointer-events.scss +12 -0
  126. package/dist/scss/tokens/layout/_box-sizing.scss +12 -0
  127. package/dist/scss/tokens/layout/_display.scss +126 -0
  128. package/dist/scss/tokens/layout/_floats.scss +18 -0
  129. package/dist/scss/tokens/layout/_main.scss +8 -0
  130. package/dist/scss/tokens/layout/_object-fit.scss +30 -0
  131. package/dist/scss/tokens/layout/_object-position.scss +54 -0
  132. package/dist/scss/tokens/layout/_overflow.scss +90 -0
  133. package/dist/scss/tokens/layout/_position.scss +30 -0
  134. package/dist/scss/tokens/layout/flex/_align-content.scss +54 -0
  135. package/dist/scss/tokens/layout/flex/_align-items.scss +30 -0
  136. package/dist/scss/tokens/layout/flex/_align-self.scss +36 -0
  137. package/dist/scss/tokens/layout/flex/_flex-direction.scss +24 -0
  138. package/dist/scss/tokens/layout/flex/_flex-grow.scss +12 -0
  139. package/dist/scss/tokens/layout/flex/_flex-shrink.scss +12 -0
  140. package/dist/scss/tokens/layout/flex/_flex-wrap.scss +18 -0
  141. package/dist/scss/tokens/layout/flex/_flex.scss +24 -0
  142. package/dist/scss/tokens/layout/flex/_justify-content.scss +48 -0
  143. package/dist/scss/tokens/layout/flex/_justify-items.scss +24 -0
  144. package/dist/scss/tokens/layout/flex/_justify-self.scss +30 -0
  145. package/dist/scss/tokens/layout/flex/_main.scss +11 -0
  146. package/dist/scss/tokens/sizing/_height.scss +168 -0
  147. package/dist/scss/tokens/sizing/_main.scss +6 -0
  148. package/dist/scss/tokens/sizing/_max-height.scss +12 -0
  149. package/dist/scss/tokens/sizing/_max-width.scss +12 -0
  150. package/dist/scss/tokens/sizing/_min-height.scss +12 -0
  151. package/dist/scss/tokens/sizing/_min-width.scss +6 -0
  152. package/dist/scss/tokens/sizing/_width.scss +176 -0
  153. package/dist/scss/tokens/spacers/_fluid-margin.scss +68 -0
  154. package/dist/scss/tokens/spacers/_fluid-padding.scss +49 -0
  155. package/dist/scss/tokens/spacers/_main.scss +4 -0
  156. package/dist/scss/tokens/spacers/_margin.scss +109 -0
  157. package/dist/scss/tokens/spacers/_padding.scss +86 -0
  158. package/dist/scss/tokens/spacers/mixins/_fluid-margin.scss +85 -0
  159. package/dist/scss/tokens/spacers/mixins/_fluid-padding.scss +85 -0
  160. package/dist/scss/tokens/spacers/mixins/_main.scss +2 -0
  161. package/dist/scss/tokens/text/_color.scss +20 -0
  162. package/dist/scss/tokens/text/_font-family.scss +68 -0
  163. package/dist/scss/tokens/text/_font-size.scss +68 -0
  164. package/dist/scss/tokens/text/_font-style.scss +12 -0
  165. package/dist/scss/tokens/text/_font-weight.scss +56 -0
  166. package/dist/scss/tokens/text/_letter-spacing.scss +38 -0
  167. package/dist/scss/tokens/text/_line-height.scss +38 -0
  168. package/dist/scss/tokens/text/_main.scss +14 -0
  169. package/dist/scss/tokens/text/_text-align.scss +36 -0
  170. package/dist/scss/tokens/text/_text-decoration.scss +24 -0
  171. package/dist/scss/tokens/text/_text-stroke.scss +74 -0
  172. package/dist/scss/{typography/_transform.scss → tokens/text/_text-transform.scss} +7 -2
  173. package/dist/scss/tokens/text/_vertical-align.scss +48 -0
  174. package/dist/scss/tokens/text/_white-space.scss +12 -0
  175. package/dist/scss/tokens/text/_word-break.scss +14 -0
  176. package/dist/scss/tokens/text/mixins/_color.scss +18 -0
  177. package/dist/scss/tokens/text/mixins/_font-family.scss +66 -0
  178. package/dist/scss/tokens/text/mixins/_font-size.scss +66 -0
  179. package/dist/scss/tokens/text/mixins/_font-weight.scss +54 -0
  180. package/dist/scss/tokens/text/mixins/_letter-spacing.scss +36 -0
  181. package/dist/scss/tokens/text/mixins/_line-height.scss +36 -0
  182. package/dist/scss/tokens/text/mixins/_main.scss +7 -0
  183. package/dist/scss/tokens/text/mixins/_text-stroke.scss +8 -0
  184. package/dist/scss/tokens/variables/_main.scss +1 -0
  185. package/dist/scss/tokens/variables/_theme.scss +8 -0
  186. package/package.json +142 -41
  187. package/dist/scss/_variables.scss +0 -2
  188. package/dist/scss/bootstrap/_main.scss +0 -34
  189. package/dist/scss/bootstrap/_variables.scss +0 -10
  190. package/dist/scss/components/_hero-title.scss +0 -118
  191. package/dist/scss/fonts/_mixins.scss +0 -25
  192. package/dist/scss/fonts/_rules.scss +0 -19
  193. package/dist/scss/fonts/_variables.scss +0 -26
  194. package/dist/scss/mixins/_body-text.scss +0 -113
  195. package/dist/scss/mixins/_graphic.scss +0 -66
  196. package/dist/scss/mixins/_note-text.scss +0 -34
  197. package/dist/scss/spacers/_rules.scss +0 -65
  198. package/dist/scss/spacers/_variables.scss +0 -19
  199. package/dist/scss/typography/_box-shadow.scss +0 -11
  200. package/dist/scss/typography/_font-size.scss +0 -81
  201. package/dist/scss/typography/_letter-spacing.scss +0 -15
  202. package/dist/scss/typography/_main.scss +0 -5
  203. package/dist/scss/typography/_mixins.scss +0 -26
  204. package/dist/scss/typography/_rules.scss +0 -83
  205. package/dist/scss/typography/_text-shadow.scss +0 -13
  206. package/dist/scss/typography/_variables.scss +0 -39
@@ -10,6 +10,10 @@ export type Option = {
10
10
  * Used for any props that restrict width of a container to one of pre-fab widths.
11
11
  */
12
12
  export type ContainerWidth = 'narrower' | 'narrow' | 'normal' | 'wide' | 'wider' | 'widest' | 'fluid';
13
+ /**
14
+ * Used to set headline class fluid size from text-2xl to text-6xl
15
+ */
16
+ export type HeadlineSize = 'small' | 'normal' | 'big' | 'bigger' | 'biggest';
13
17
  /**
14
18
  * A step in the Scroller component.
15
19
  */
@@ -4,7 +4,7 @@ declare const __propDef: {
4
4
  props: {
5
5
  /** Width of the block within the article well. */ width?: ContainerWidth;
6
6
  /** Add an id to the block tag to target it with custom CSS. */ id?: string;
7
- /** Add extra classes to the block tag to target it with custom CSS. */ cls?: string;
7
+ /** Add extra classes to the block tag to target it with custom CSS. */ class?: string;
8
8
  /** Snap block to column widths, rather than fluidly resizing them. */ snap?: boolean;
9
9
  /** ARIA [role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the block */ role?: string | null;
10
10
  /** ARIA [label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) for the block */ ariaLabel?: string | null;
@@ -6,6 +6,7 @@ declare const __propDef: {
6
6
  * @type {string}
7
7
  * @required
8
8
  */ text: string;
9
+ /** Add a class to target with SCSS. */ class?: string;
9
10
  };
10
11
  events: {
11
12
  [evt: string]: CustomEvent<any>;
@@ -14,7 +14,7 @@ declare const __propDef: {
14
14
  * @required
15
15
  */ altText: string;
16
16
  /** Add an ID to target with SCSS. */ id?: string;
17
- /** Add a class to target with SCSS. */ cls?: string;
17
+ /** Add a class to target with SCSS. */ class?: string;
18
18
  };
19
19
  events: {
20
20
  [evt: string]: CustomEvent<any>;
@@ -12,6 +12,14 @@ declare const __propDef: {
12
12
  * @type {string}
13
13
  * @required
14
14
  */ altText: string;
15
+ /**
16
+ * Add an id to target with custom CSS.
17
+ * @type {string}
18
+ */ id?: string;
19
+ /**
20
+ * Add extra classes to target with custom CSS.
21
+ * @type {string}
22
+ */ class?: string;
15
23
  /**
16
24
  * Caption below the photo
17
25
  * @type {string}
@@ -13,7 +13,7 @@ declare const __propDef: {
13
13
  /**
14
14
  * Add extra classes to the block tag to target it with custom CSS.
15
15
  * @type {string}
16
- */ cls?: string;
16
+ */ class?: string;
17
17
  /** Snap block to column widths, rather than fluidly resizing them. */ snap?: boolean;
18
18
  /**
19
19
  * ARIA [role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the block
@@ -1,10 +1,15 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import { HeadlineSize } from '../@types/global';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  /**
5
6
  * Headline, parsed as an _inline_ markdown string in an `h1` element.
6
7
  * @type {string}
7
8
  */ hed?: string;
9
+ /**
10
+ * Headline size
11
+ * @type {string}
12
+ */ hedSize?: HeadlineSize;
8
13
  /**
9
14
  * Dek, parsed as a markdown string.
10
15
  * @type {string}
@@ -4,7 +4,7 @@ declare const __propDef: {
4
4
  props: {
5
5
  /** Width of the component within the text well. */ width?: "normal" | "wide" | "wider" | "widest" | "fluid";
6
6
  /** Add an ID to target with SCSS. */ id?: string;
7
- /** Add a class to target with SCSS. */ cls?: string;
7
+ /** Add a class to target with SCSS. */ class?: string;
8
8
  /**
9
9
  * Array of photos.
10
10
  * @required
@@ -28,7 +28,7 @@ declare const __propDef: {
28
28
  /**
29
29
  * Add a class to target with SCSS.
30
30
  * @type {string}
31
- */ cls?: string;
31
+ */ class?: string;
32
32
  /** Width of the component within the text well. */ width?: "normal" | "wide" | "wider" | "widest" | "fluid";
33
33
  /**
34
34
  * Set a different width for captions within the text well, for example,
@@ -22,7 +22,7 @@ declare const __propDef: {
22
22
  * @required
23
23
  */ width?: "normal" | "wide" | "wider" | "widest" | "fluid";
24
24
  /** Add an ID to target with SCSS. */ id?: string;
25
- /** Add a class to target with SCSS. */ cls?: string;
25
+ /** Add a class to target with SCSS. */ class?: string;
26
26
  };
27
27
  events: {
28
28
  [evt: string]: CustomEvent<any>;
@@ -23,7 +23,7 @@ declare const __propDef: {
23
23
  /**
24
24
  * Set a class to target with SCSS.
25
25
  * @type {string}
26
- */ cls?: string;
26
+ */ class?: string;
27
27
  /**
28
28
  * Set an ID to target with SCSS.
29
29
  * @type {string}
@@ -1,4 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import { HeadlineSize } from '../@types/global';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  /**
@@ -6,6 +7,10 @@ declare const __propDef: {
6
7
  * @type {string}
7
8
  * @required
8
9
  */ hed?: string;
10
+ /**
11
+ * Headline size
12
+ * @type {string}
13
+ */ hedSize?: HeadlineSize;
9
14
  /**
10
15
  * Section title.
11
16
  * @type {string}
@@ -32,7 +37,7 @@ declare const __propDef: {
32
37
  /**
33
38
  * Add extra classes to target with custom CSS.
34
39
  * @type {string}
35
- */ cls?: string;
40
+ */ class?: string;
36
41
  };
37
42
  events: {
38
43
  [evt: string]: CustomEvent<any>;
@@ -77,7 +77,7 @@ declare const __propDef: {
77
77
  */ fieldFormatters?: object;
78
78
  width?: "normal" | "wide" | "wider" | "widest" | "fluid";
79
79
  /** Add an ID to target with SCSS. */ id?: string;
80
- /** Add a class to target with SCSS. */ cls?: string;
80
+ /** Add a class to target with SCSS. */ class?: string;
81
81
  };
82
82
  events: {
83
83
  [evt: string]: CustomEvent<any>;
@@ -7,15 +7,35 @@ interface Colour {
7
7
  'brand-rules': string;
8
8
  'brand-shadow': string;
9
9
  }
10
+ interface FontFamily {
11
+ 'serif': string;
12
+ 'sans-serif': string;
13
+ 'monospace': string;
14
+ hed: string;
15
+ subhed: string;
16
+ body: string;
17
+ note: string;
18
+ }
19
+ interface FontSize {
20
+ 'xxs': string;
21
+ 'xs': string;
22
+ 'sm': string;
23
+ 'base': string;
24
+ 'lg': string;
25
+ 'xl': string;
26
+ '2xl': string;
27
+ '3xl': string;
28
+ '4xl': string;
29
+ '5xl': string;
30
+ '6xl': string;
31
+ }
10
32
  interface Font {
11
- 'size-base': string;
12
- 'family-serif': string;
13
- 'family-sans-serif': string;
14
- 'family-monospace': string;
15
- 'family-hed': string;
16
- 'family-subhed': string;
17
- 'family-body': string;
18
- 'family-note': string;
33
+ family: FontFamily;
34
+ size: FontSize;
35
+ }
36
+ interface CustomFont {
37
+ family?: Partial<FontFamily>;
38
+ size?: Partial<FontSize>;
19
39
  }
20
40
  export interface Theme {
21
41
  colour: Colour;
@@ -23,6 +43,6 @@ export interface Theme {
23
43
  }
24
44
  export interface CustomTheme {
25
45
  colour?: Partial<Colour>;
26
- font?: Partial<Font>;
46
+ font?: Partial<CustomFont>;
27
47
  }
28
48
  export {};
@@ -4,27 +4,7 @@ import { SvelteComponentTyped } from "svelte";
4
4
  * @type {{ light, dark }}
5
5
  */
6
6
  export declare const themes: {
7
- light: {
8
- colour: {
9
- background: string;
10
- 'text-primary': string;
11
- 'text-secondary': string;
12
- accent: string;
13
- 'brand-logo': string;
14
- 'brand-rules': string;
15
- 'brand-shadow': string;
16
- };
17
- font: {
18
- 'size-base': string;
19
- 'family-serif': string;
20
- 'family-sans-serif': string;
21
- 'family-monospace': string;
22
- 'family-hed': string;
23
- 'family-subhed': string;
24
- 'family-body': string;
25
- 'family-note': string;
26
- };
27
- };
7
+ light: import("./@types/component").Theme;
28
8
  dark: import("./@types/component").Theme;
29
9
  };
30
10
  import type { CustomTheme } from './@types/component';
@@ -0,0 +1,2 @@
1
+ declare const _default: Omit<import('../@types/component').Theme, "colour">;
2
+ export default _default;
@@ -1,22 +1,2 @@
1
- declare namespace _default {
2
- let colour: {
3
- background: string;
4
- 'text-primary': string;
5
- 'text-secondary': string;
6
- accent: string;
7
- 'brand-logo': string;
8
- 'brand-rules': string;
9
- 'brand-shadow': string;
10
- };
11
- let font: {
12
- 'size-base': string;
13
- 'family-serif': string;
14
- 'family-sans-serif': string;
15
- 'family-monospace': string;
16
- 'family-hed': string;
17
- 'family-subhed': string;
18
- 'family-body': string;
19
- 'family-note': string;
20
- };
21
- }
1
+ declare const _default: import('../@types/component').Theme;
22
2
  export default _default;
@@ -2,7 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  /** Add an ID to target with SCSS. */ id?: string;
5
- /** Add a class to target with SCSS. */ cls?: string;
5
+ /** Add a class to target with SCSS. */ class?: string;
6
6
  /**
7
7
  * Make the header stick when user scrolls.
8
8
  */ sticky?: boolean;
@@ -26,7 +26,7 @@ $: columnWidthVars = {
26
26
  <main>
27
27
  <article
28
28
  id="{id}"
29
- class:embedded
29
+ class:embedded="{embedded}"
30
30
  role="{role}"
31
31
  use:cssVariables="{columnWidthVars}"
32
32
  >
@@ -138,14 +138,14 @@ onMount(() => {
138
138
  />
139
139
 
140
140
  {#if beforeSrc && beforeAlt && afterSrc && afterAlt}
141
- <Block width="{width}" id="{id}" cls="photo before-after">
141
+ <Block width="{width}" id="{id}" class="photo before-after">
142
142
  <div
143
143
  style="height: {containerHeight}px;"
144
144
  bind:clientWidth="{containerWidth}"
145
145
  >
146
146
  <figure
147
147
  style="{figStyle}"
148
- class="before-after-container"
148
+ class="before-after-container relative overflow-hidden my-0 mx-auto"
149
149
  on:touchstart="{start}"
150
150
  on:mousedown="{start}"
151
151
  bind:this="{figure}"
@@ -158,7 +158,7 @@ onMount(() => {
158
158
  on:load="{measureLoadedImage}"
159
159
  on:mousedown|preventDefault
160
160
  style="{imgStyle}"
161
- class="after"
161
+ class="after absolute block m-0 max-w-full object-cover"
162
162
  aria-describedby="{$$slots.beforeOverlay && `${id}-before`}"
163
163
  />
164
164
 
@@ -167,13 +167,13 @@ onMount(() => {
167
167
  alt="{beforeAlt}"
168
168
  on:mousedown|preventDefault
169
169
  style="clip: rect(0 {x}px {containerHeight}px 0);{imgStyle}"
170
- class="before"
170
+ class="before absolute block m-0 max-w-full object-cover"
171
171
  aria-describedby="{$$slots.afterOverlay && `${id}-after`}"
172
172
  />
173
173
  {#if $$slots.beforeOverlay}
174
174
  <div
175
175
  id="image-before-label"
176
- class="overlay-container before"
176
+ class="overlay-container before absolute"
177
177
  bind:clientWidth="{beforeOverlayWidth}"
178
178
  style="clip-path: inset(0 {beforeOverlayClip}px 0 0);"
179
179
  >
@@ -185,7 +185,7 @@ onMount(() => {
185
185
  </div>
186
186
  {/if}
187
187
  {#if $$slots.afterOverlay}
188
- <div id="image-after-label" class="overlay-container after">
188
+ <div id="image-after-label" class="overlay-container after absolute">
189
189
  <!-- Overlay for after image -->
190
190
  <slot
191
191
  name="afterOverlay"
@@ -195,6 +195,8 @@ onMount(() => {
195
195
  {/if}
196
196
  <div
197
197
  tabindex="0"
198
+ role="slider"
199
+ aria-valuenow="{Math.round(offset * 100)}"
198
200
  class="handle"
199
201
  style="left: calc({offset *
200
202
  100}% - 20px); --before-after-handle-colour: {handleColour}; --before-after-handle-inactive-opacity: {handleInactiveOpacity};"
@@ -208,7 +210,7 @@ onMount(() => {
208
210
  </div>
209
211
  {#if $$slots.caption}
210
212
  <PaddingReset containerIsFluid="{width === 'fluid'}">
211
- <aside class="before-after-caption" id="{`${id}-caption`}">
213
+ <aside class="before-after-caption my-0 mx-auto" id="{`${id}-caption`}">
212
214
  <!-- Caption for image credits -->
213
215
  <slot name="caption" />
214
216
  </aside>
@@ -218,24 +220,15 @@ onMount(() => {
218
220
  {/if}
219
221
 
220
222
  <style>figure.before-after-container {
221
- overflow: hidden;
222
- position: relative;
223
223
  box-sizing: content-box;
224
- margin: 0 auto;
225
224
  }
226
225
  figure.before-after-container img {
227
226
  top: 0;
228
227
  left: 0;
229
228
  z-index: 20;
230
- margin: 0;
231
- display: block;
232
- max-width: 100%;
233
229
  -webkit-user-select: none;
234
230
  -moz-user-select: none;
235
231
  user-select: none;
236
- -o-object-fit: cover;
237
- object-fit: cover;
238
- position: absolute;
239
232
  }
240
233
  figure.before-after-container img.after {
241
234
  z-index: 21;
@@ -246,14 +239,17 @@ figure.before-after-container img.before {
246
239
  figure.before-after-container .overlay-container {
247
240
  position: absolute;
248
241
  }
249
- figure.before-after-container .overlay-container :global(p) {
250
- font-family: var(--theme-font-family-note, "Knowledge", "Source Sans Pro", Arial, sans-serif);
251
- font-size: 1rem;
252
- line-height: 1.2rem;
242
+ figure.before-after-container .overlay-container :global(:first-child) {
243
+ margin-top: 0;
253
244
  }
254
- figure.before-after-container .overlay-container :global(p:last-child) {
245
+ figure.before-after-container .overlay-container :global(:last-child) {
255
246
  margin-bottom: 0;
256
247
  }
248
+ figure.before-after-container .overlay-container :global(p) {
249
+ font-family: var(--theme-font-family-note);
250
+ font-size: var(--theme-font-size-sm);
251
+ line-height: 1.25;
252
+ }
257
253
  figure.before-after-container .overlay-container.before {
258
254
  left: 0;
259
255
  z-index: 23;
@@ -317,29 +313,15 @@ figure.before-after-container .overlay-container.after {
317
313
  }
318
314
 
319
315
  aside.before-after-caption {
320
- margin: 0 auto;
321
- font-family: var(--theme-font-family-note, "Knowledge", "Source Sans Pro", Arial, sans-serif);
322
- color: var(--theme-colour-text-secondary, #666666);
316
+ font-family: var(--theme-font-family-note);
317
+ color: var(--theme-colour-text-secondary);
323
318
  }
324
319
  aside.before-after-caption :global(p) {
325
- font-family: var(--theme-font-family-note, "Knowledge", "Source Sans Pro", Arial, sans-serif);
326
- color: var(--theme-colour-text-secondary, #666666);
327
- font-size: 0.9rem;
328
- line-height: 1.2rem;
320
+ font-family: var(--theme-font-family-note);
321
+ color: var(--theme-colour-text-secondary);
322
+ font-size: var(--theme-font-size-xs);
323
+ line-height: 1.25;
329
324
  }
330
325
  aside.before-after-caption :global(p:last-of-type) {
331
326
  margin-bottom: 0;
332
- }
333
- @media (max-width: 540px) {
334
- aside.before-after-caption :global(p) {
335
- font-size: 0.8rem;
336
- line-height: 1.1rem;
337
- }
338
- }
339
- aside.before-after-caption :global(p) :global(a) {
340
- color: currentColor;
341
- text-decoration: underline;
342
- }
343
- aside.before-after-caption :global(p) :global(a:hover) {
344
- text-decoration: underline;
345
327
  }</style>
@@ -4,7 +4,8 @@ export let width = 'normal';
4
4
  /** Add an id to the block tag to target it with custom CSS. */
5
5
  export let id = '';
6
6
  /** Add extra classes to the block tag to target it with custom CSS. */
7
- export let cls = '';
7
+ let cls = '';
8
+ export { cls as class };
8
9
  /** Snap block to column widths, rather than fluidly resizing them. */
9
10
  export let snap = false;
10
11
  /** ARIA [role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the block */
@@ -24,86 +25,7 @@ export let ariaLabel = null;
24
25
  <slot />
25
26
  </div>
26
27
 
27
- <style>.paragraph-size {
28
- font-size: 1.3rem;
29
- line-height: 2.1rem;
30
- }
31
- .paragraph-size.font-sans {
32
- font-size: 1.1rem;
33
- line-height: 1.75rem;
34
- }
35
- @media (max-width: 540px) {
36
- .paragraph-size {
37
- font-size: 1.1rem;
38
- line-height: 1.8rem;
39
- }
40
- .paragraph-size.font-sans {
41
- font-size: 1rem;
42
- line-height: 1.6rem;
43
- }
44
- }
45
- .paragraph-size.important {
46
- font-size: 1.3rem !important;
47
- line-height: 2.1rem !important;
48
- }
49
- .paragraph-size.important.font-sans {
50
- font-size: 1.1rem !important;
51
- line-height: 1.8rem !important;
52
- }
53
- @media (max-width: 540px) {
54
- .paragraph-size.important {
55
- font-size: 1.1rem !important;
56
- line-height: 1.8rem !important;
57
- }
58
- .paragraph-size.important.font-sans {
59
- font-size: 1rem !important;
60
- line-height: 1.6rem !important;
61
- }
62
- }
63
-
64
- .small-size {
65
- font-size: 0.9rem;
66
- line-height: 1.2rem;
67
- }
68
- @media (max-width: 540px) {
69
- .small-size {
70
- font-size: 0.8rem;
71
- line-height: 1.1rem;
72
- }
73
- }
74
- .small-size.important {
75
- font-size: 0.9rem !important;
76
- line-height: 1.2rem !important;
77
- }
78
- @media (max-width: 540px) {
79
- .small-size.important {
80
- font-size: 0.8rem !important;
81
- line-height: 1.1rem !important;
82
- }
83
- }
84
-
85
- .blockquote-size {
86
- font-size: 1.6rem;
87
- line-height: 2.1rem;
88
- }
89
- @media (max-width: 540px) {
90
- .blockquote-size {
91
- font-size: 1.3rem;
92
- line-height: 1.9rem;
93
- }
94
- }
95
- .blockquote-size.important {
96
- font-size: 1.6rem !important;
97
- line-height: 2rem !important;
98
- }
99
- @media (max-width: 540px) {
100
- .blockquote-size.important {
101
- font-size: 1.3rem !important;
102
- line-height: 1.8rem !important;
103
- }
104
- }
105
-
106
- div.article-block {
28
+ <style>div.article-block {
107
29
  max-width: var(--normal-column-width, 660px);
108
30
  margin-left: auto;
109
31
  margin-right: auto;