@financial-times/cp-content-pipeline-ui 6.14.1 → 6.15.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 (238) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/lib/components/ArticleBody/index.d.ts +2 -1
  3. package/lib/components/ArticleBody/index.js +2 -2
  4. package/lib/components/ArticleBody/index.js.map +1 -1
  5. package/lib/components/ArticleInfo/index.d.ts +3 -3
  6. package/lib/components/ArticleInfo/index.js +2 -2
  7. package/lib/components/ArticleInfo/index.js.map +1 -1
  8. package/lib/components/BackToTopButton/client/index.d.ts +4 -2
  9. package/lib/components/BackToTopButton/client/index.js +2 -11
  10. package/lib/components/BackToTopButton/client/index.js.map +1 -1
  11. package/lib/components/BackToTopButton/client/utils.js +1 -2
  12. package/lib/components/BackToTopButton/client/utils.js.map +1 -1
  13. package/lib/components/BigNumber/index.d.ts +2 -1
  14. package/lib/components/BigNumber/index.js +2 -2
  15. package/lib/components/BigNumber/index.js.map +1 -1
  16. package/lib/components/Body/index.d.ts +2 -1
  17. package/lib/components/Body/index.js +2 -2
  18. package/lib/components/Body/index.js.map +1 -1
  19. package/lib/components/Byline/index.d.ts +2 -2
  20. package/lib/components/Byline/index.js +2 -2
  21. package/lib/components/Byline/index.js.map +1 -1
  22. package/lib/components/Clip/client/index.js.map +1 -1
  23. package/lib/components/Clip/client/progressBar.js.map +1 -1
  24. package/lib/components/Clip/client/utils.js +4 -5
  25. package/lib/components/Clip/client/utils.js.map +1 -1
  26. package/lib/components/Clip/components/Caption.d.ts +1 -1
  27. package/lib/components/Clip/components/Caption.js.map +1 -1
  28. package/lib/components/Clip/components/ClipTag.d.ts +1 -1
  29. package/lib/components/Clip/components/ClipTag.js.map +1 -1
  30. package/lib/components/Clip/components/ClosedCaptions.d.ts +2 -2
  31. package/lib/components/Clip/components/ClosedCaptions.js +1 -1
  32. package/lib/components/Clip/components/ClosedCaptions.js.map +1 -1
  33. package/lib/components/Clip/components/Container.d.ts +2 -3
  34. package/lib/components/Clip/components/Container.js +1 -1
  35. package/lib/components/Clip/components/Container.js.map +1 -1
  36. package/lib/components/Clip/components/ContentLayout.d.ts +2 -3
  37. package/lib/components/Clip/components/ContentLayout.js.map +1 -1
  38. package/lib/components/Clip/components/Credit.d.ts +1 -1
  39. package/lib/components/Clip/components/Credit.js.map +1 -1
  40. package/lib/components/Clip/components/VideoDescription.d.ts +1 -1
  41. package/lib/components/Clip/components/VideoDescription.js.map +1 -1
  42. package/lib/components/Clip/components/VideoInfoBox.d.ts +1 -1
  43. package/lib/components/Clip/components/VideoInfoBox.js.map +1 -1
  44. package/lib/components/Clip/template/component.d.ts +2 -2
  45. package/lib/components/Clip/template/component.js +2 -2
  46. package/lib/components/Clip/template/component.js.map +1 -1
  47. package/lib/components/Clip/template/index.js +1 -1
  48. package/lib/components/Clip/template/index.js.map +1 -1
  49. package/lib/components/Clip/test/fixtures.js.map +1 -1
  50. package/lib/components/Clip/test/index.spec.js.map +1 -1
  51. package/lib/components/Clip/test/snapshot.spec.js +2 -2
  52. package/lib/components/Clip/test/snapshot.spec.js.map +1 -1
  53. package/lib/components/ContentPackageBody/index.d.ts +2 -2
  54. package/lib/components/ContentPackageBody/index.js +9 -9
  55. package/lib/components/ContentPackageBody/index.js.map +1 -1
  56. package/lib/components/Expander/client/index.js.map +1 -1
  57. package/lib/components/Expander/test/client/index.spec.js.map +1 -1
  58. package/lib/components/FixedAspectRatio/FixedAspectRatio.d.ts +3 -1622
  59. package/lib/components/FixedAspectRatio/FixedAspectRatio.js +3 -3
  60. package/lib/components/FixedAspectRatio/FixedAspectRatio.js.map +1 -1
  61. package/lib/components/Flourish/client/index.js.map +1 -1
  62. package/lib/components/Flourish/index.d.ts +2 -2
  63. package/lib/components/Flourish/index.js +2 -2
  64. package/lib/components/Flourish/index.js.map +1 -1
  65. package/lib/components/Heading/index.d.ts +2 -5
  66. package/lib/components/Heading/index.js +2 -1
  67. package/lib/components/Heading/index.js.map +1 -1
  68. package/lib/components/Headshot/index.d.ts +2 -2
  69. package/lib/components/Headshot/index.js +2 -2
  70. package/lib/components/Headshot/index.js.map +1 -1
  71. package/lib/components/ImageSet/index.d.ts +8 -6
  72. package/lib/components/ImageSet/index.js +11 -11
  73. package/lib/components/ImageSet/index.js.map +1 -1
  74. package/lib/components/Layout/index.d.ts +4 -10
  75. package/lib/components/Layout/index.js +7 -7
  76. package/lib/components/Layout/index.js.map +1 -1
  77. package/lib/components/LiveBlogBody/index.d.ts +2 -2
  78. package/lib/components/LiveBlogBody/index.js +2 -2
  79. package/lib/components/LiveBlogBody/index.js.map +1 -1
  80. package/lib/components/LiveBlogPost/ShareButtons.d.ts +4 -3
  81. package/lib/components/LiveBlogPost/ShareButtons.js +2 -1
  82. package/lib/components/LiveBlogPost/ShareButtons.js.map +1 -1
  83. package/lib/components/LiveBlogPost/Timestamp.d.ts +2 -2
  84. package/lib/components/LiveBlogPost/Timestamp.js +2 -1
  85. package/lib/components/LiveBlogPost/Timestamp.js.map +1 -1
  86. package/lib/components/LiveBlogPost/index.d.ts +1 -1
  87. package/lib/components/LiveBlogPost/index.js +1 -1
  88. package/lib/components/LiveBlogPost/index.js.map +1 -1
  89. package/lib/components/LiveBlogPost/svgIcons.d.ts +3 -3
  90. package/lib/components/LiveBlogPost/svgIcons.js +6 -6
  91. package/lib/components/LiveBlogPost/svgIcons.js.map +1 -1
  92. package/lib/components/LiveBlogWrapper/dispatchEvent.js.map +1 -1
  93. package/lib/components/LiveBlogWrapper/index.js.map +1 -1
  94. package/lib/components/LiveBlogWrapper/normalisePost.js.map +1 -1
  95. package/lib/components/LiveBlogWrapper/post-tracker.js +2 -2
  96. package/lib/components/LiveBlogWrapper/post-tracker.js.map +1 -1
  97. package/lib/components/MainImage/index.d.ts +2 -2
  98. package/lib/components/MainImage/index.js +2 -2
  99. package/lib/components/MainImage/index.js.map +1 -1
  100. package/lib/components/Paragraph/index.d.ts +2 -1
  101. package/lib/components/Paragraph/index.js +3 -3
  102. package/lib/components/Paragraph/index.js.map +1 -1
  103. package/lib/components/PodcastBody/index.d.ts +4 -2
  104. package/lib/components/PodcastBody/index.js +2 -2
  105. package/lib/components/PodcastBody/index.js.map +1 -1
  106. package/lib/components/Pullquote/index.d.ts +2 -2
  107. package/lib/components/Pullquote/index.js +2 -1
  108. package/lib/components/Pullquote/index.js.map +1 -1
  109. package/lib/components/Recommended/index.d.ts +2 -1
  110. package/lib/components/Recommended/index.js +2 -2
  111. package/lib/components/Recommended/index.js.map +1 -1
  112. package/lib/components/RichText/BasicComponents.d.ts +13 -13
  113. package/lib/components/RichText/BasicComponents.js +2 -2
  114. package/lib/components/RichText/BasicComponents.js.map +1 -1
  115. package/lib/components/RichText/index.d.ts +2 -2
  116. package/lib/components/RichText/index.js +2 -2
  117. package/lib/components/RichText/index.js.map +1 -1
  118. package/lib/components/Scrollytelling/ScrollyImage.d.ts +1 -1
  119. package/lib/components/Scrollytelling/ScrollyImage.js +2 -2
  120. package/lib/components/Scrollytelling/ScrollyImage.js.map +1 -1
  121. package/lib/components/Scrollytelling/index.d.ts +5 -5
  122. package/lib/components/Scrollytelling/index.js +1 -1
  123. package/lib/components/Scrollytelling/index.js.map +1 -1
  124. package/lib/components/Table/TableBody.d.ts +2 -1
  125. package/lib/components/Table/TableBody.js +2 -2
  126. package/lib/components/Table/TableBody.js.map +1 -1
  127. package/lib/components/Table/TableCell.d.ts +4 -2
  128. package/lib/components/Table/TableCell.js.map +1 -1
  129. package/lib/components/Table/index.d.ts +2 -1
  130. package/lib/components/Table/index.js +2 -2
  131. package/lib/components/Table/index.js.map +1 -1
  132. package/lib/components/Topper/Columnist.d.ts +2 -2
  133. package/lib/components/Topper/Columnist.js +2 -2
  134. package/lib/components/Topper/Columnist.js.map +1 -1
  135. package/lib/components/Topper/FollowButtonSlot.d.ts +0 -1
  136. package/lib/components/Topper/Headline.d.ts +2 -2
  137. package/lib/components/Topper/Headline.js +2 -2
  138. package/lib/components/Topper/Headline.js.map +1 -1
  139. package/lib/components/Topper/Intro.d.ts +2 -1
  140. package/lib/components/Topper/Intro.js +2 -2
  141. package/lib/components/Topper/Intro.js.map +1 -1
  142. package/lib/components/Topper/LiveBlogIndicator.d.ts +2 -2
  143. package/lib/components/Topper/LiveBlogIndicator.js +2 -2
  144. package/lib/components/Topper/LiveBlogIndicator.js.map +1 -1
  145. package/lib/components/Topper/Picture.d.ts +2 -2
  146. package/lib/components/Topper/Picture.js +2 -2
  147. package/lib/components/Topper/Picture.js.map +1 -1
  148. package/lib/components/Topper/Tags.d.ts +2 -2
  149. package/lib/components/Topper/Tags.js +7 -7
  150. package/lib/components/Topper/Tags.js.map +1 -1
  151. package/lib/components/Topper/Wrapper.d.ts +3 -4
  152. package/lib/components/Topper/Wrapper.js +2 -2
  153. package/lib/components/Topper/Wrapper.js.map +1 -1
  154. package/lib/components/Topper/client/tracking.js.map +1 -1
  155. package/lib/components/Topper/index.d.ts +2 -1
  156. package/lib/components/Topper/index.js +2 -2
  157. package/lib/components/Topper/index.js.map +1 -1
  158. package/lib/components/Tweet/index.d.ts +2 -1
  159. package/lib/components/Tweet/index.js +2 -2
  160. package/lib/components/Tweet/index.js.map +1 -1
  161. package/lib/components/Video/index.d.ts +2 -1
  162. package/lib/components/Video/index.js +2 -2
  163. package/lib/components/Video/index.js.map +1 -1
  164. package/lib/components/YoutubeVideo/index.d.ts +2 -1
  165. package/lib/components/YoutubeVideo/index.js +2 -2
  166. package/lib/components/YoutubeVideo/index.js.map +1 -1
  167. package/lib/context.d.ts +0 -1
  168. package/lib/extensions/scrollIntoView.js +1 -1
  169. package/lib/extensions/scrollIntoView.js.map +1 -1
  170. package/lib/stories/BackToTop.stories.d.ts +5 -2
  171. package/lib/stories/BackToTop.stories.js.map +1 -1
  172. package/lib/stories/Clip.stories.d.ts +1 -2
  173. package/lib/stories/Clip.stories.js +1 -1
  174. package/lib/stories/Clip.stories.js.map +1 -1
  175. package/lib/stories/Expander.stories.d.ts +37 -25
  176. package/lib/stories/Expander.stories.js +207 -36
  177. package/lib/stories/Expander.stories.js.map +1 -1
  178. package/lib/stories/LiveBlogPost.stories.d.ts +1 -1
  179. package/lib/stories/LiveBlogPost.stories.js +6 -6
  180. package/lib/stories/LiveBlogPost.stories.js.map +1 -1
  181. package/lib/stories/Topper.stories.d.ts +2 -2
  182. package/package.json +1 -1
  183. package/src/components/ArticleBody/index.tsx +3 -4
  184. package/src/components/ArticleInfo/index.tsx +5 -3
  185. package/src/components/BackToTopButton/client/index.tsx +11 -6
  186. package/src/components/BigNumber/index.tsx +6 -9
  187. package/src/components/Body/index.tsx +4 -2
  188. package/src/components/Byline/index.tsx +3 -4
  189. package/src/components/Clip/components/Caption.tsx +1 -1
  190. package/src/components/Clip/components/ClipTag.tsx +2 -2
  191. package/src/components/Clip/components/ClosedCaptions.tsx +4 -2
  192. package/src/components/Clip/components/Container.tsx +5 -3
  193. package/src/components/Clip/components/ContentLayout.tsx +4 -3
  194. package/src/components/Clip/components/Credit.tsx +1 -1
  195. package/src/components/Clip/components/VideoDescription.tsx +2 -2
  196. package/src/components/Clip/components/VideoInfoBox.tsx +1 -1
  197. package/src/components/Clip/template/component.tsx +4 -2
  198. package/src/components/ContentPackageBody/index.tsx +9 -7
  199. package/src/components/Expander/client/main.scss +27 -17
  200. package/src/components/FixedAspectRatio/FixedAspectRatio.tsx +6 -5
  201. package/src/components/Flourish/index.tsx +4 -2
  202. package/src/components/Heading/index.tsx +5 -2
  203. package/src/components/Headshot/index.tsx +4 -2
  204. package/src/components/ImageSet/index.tsx +25 -21
  205. package/src/components/Layout/index.tsx +8 -15
  206. package/src/components/LiveBlogBody/index.tsx +4 -2
  207. package/src/components/LiveBlogPost/ShareButtons.tsx +10 -5
  208. package/src/components/LiveBlogPost/Timestamp.tsx +6 -1
  209. package/src/components/LiveBlogPost/index.tsx +6 -4
  210. package/src/components/LiveBlogPost/svgIcons.tsx +3 -3
  211. package/src/components/MainImage/index.tsx +3 -1
  212. package/src/components/Paragraph/index.tsx +5 -3
  213. package/src/components/PodcastBody/index.tsx +9 -2
  214. package/src/components/Pullquote/index.tsx +5 -3
  215. package/src/components/Recommended/index.tsx +5 -2
  216. package/src/components/RichText/BasicComponents.tsx +35 -30
  217. package/src/components/RichText/index.tsx +12 -8
  218. package/src/components/Scrollytelling/ScrollyImage.tsx +4 -4
  219. package/src/components/Scrollytelling/index.tsx +10 -10
  220. package/src/components/Table/TableBody.tsx +5 -3
  221. package/src/components/Table/TableCell.tsx +3 -3
  222. package/src/components/Table/index.tsx +6 -2
  223. package/src/components/Topper/Columnist.tsx +4 -2
  224. package/src/components/Topper/Headline.tsx +4 -2
  225. package/src/components/Topper/Intro.tsx +3 -1
  226. package/src/components/Topper/LiveBlogIndicator.tsx +4 -2
  227. package/src/components/Topper/Picture.tsx +8 -6
  228. package/src/components/Topper/Tags.tsx +6 -4
  229. package/src/components/Topper/Wrapper.tsx +5 -4
  230. package/src/components/Topper/index.tsx +4 -2
  231. package/src/components/Tweet/index.tsx +3 -1
  232. package/src/components/Video/index.tsx +4 -2
  233. package/src/components/YoutubeVideo/index.tsx +4 -2
  234. package/src/stories/Clip.stories.tsx +2 -6
  235. package/src/stories/Expander.stories.tsx +231 -51
  236. package/src/stories/article-page.scss +21 -1
  237. package/src/stories/tsconfig.json +7 -0
  238. package/tsconfig.tsbuildinfo +1 -1
@@ -2,54 +2,59 @@ import React from 'react'
2
2
  import type { ContentTree } from '@financial-times/content-tree'
3
3
  import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'
4
4
 
5
- export const List = (props: React.PropsWithChildren<ContentTree.List>) =>
6
- props.ordered ? <ol>{props.children}</ol> : <ul>{props.children}</ul>
5
+ export const List: React.FC<React.PropsWithChildren<ContentTree.List>> = (
6
+ props
7
+ ) => (props.ordered ? <ol>{props.children}</ol> : <ul>{props.children}</ul>)
7
8
 
8
- export const ListItem = (
9
- props: React.PropsWithChildren<ContentTree.ListItem>
10
- ) => <li>{props.children}</li>
9
+ export const ListItem: React.FC<
10
+ React.PropsWithChildren<ContentTree.ListItem>
11
+ > = (props) => <li>{props.children}</li>
11
12
 
12
- export const Link = (props: React.PropsWithChildren<ContentTree.Link>) => (
13
+ export const Link: React.FC<React.PropsWithChildren<ContentTree.Link>> = (
14
+ props
15
+ ) => (
13
16
  <a href={props.url} title={props.title}>
14
17
  {props.children}
15
18
  </a>
16
19
  )
17
20
 
18
- export const Blockquote = (
19
- props: React.PropsWithChildren<ContentTree.Blockquote>
20
- ) => {
21
+ export const Blockquote: React.FC<
22
+ React.PropsWithChildren<ContentTree.Blockquote>
23
+ > = (props) => {
21
24
  return (
22
25
  <blockquote className="n-content-blockquote">{props.children}</blockquote>
23
26
  )
24
27
  }
25
28
 
26
- export const Cite = (props: React.PropsWithChildren<ContentTree.Phrasing>) => {
29
+ export const Cite: React.FC<React.PropsWithChildren<ContentTree.Phrasing>> = (
30
+ props
31
+ ) => {
27
32
  return <cite>{props.children}</cite>
28
33
  }
29
34
 
30
- export const LineBreak = () => <br />
35
+ export const LineBreak: React.FC = () => <br />
31
36
 
32
- export const HorizontalRule = () => <hr />
37
+ export const HorizontalRule: React.FC = () => <hr />
33
38
 
34
- export const Emphasis = (
35
- props: React.PropsWithChildren<ContentTree.Emphasis>
36
- ) => <em>{props.children}</em>
39
+ export const Emphasis: React.FC<
40
+ React.PropsWithChildren<ContentTree.Emphasis>
41
+ > = (props) => <em>{props.children}</em>
37
42
 
38
- export const Strong = (props: React.PropsWithChildren<ContentTree.Strong>) => (
39
- <strong>{props.children}</strong>
40
- )
43
+ export const Strong: React.FC<React.PropsWithChildren<ContentTree.Strong>> = (
44
+ props
45
+ ) => <strong>{props.children}</strong>
41
46
 
42
- export const Strikethrough = (
43
- props: React.PropsWithChildren<ContentTree.Strikethrough>
44
- ) => <s>{props.children}</s>
47
+ export const Strikethrough: React.FC<
48
+ React.PropsWithChildren<ContentTree.Strikethrough>
49
+ > = (props) => <s>{props.children}</s>
45
50
 
46
- export const TableRow = (
47
- props: React.PropsWithChildren<ContentTreeWorkarounds.TableRow>
48
- ) => <tr>{props.children}</tr>
51
+ export const TableRow: React.FC<
52
+ React.PropsWithChildren<ContentTreeWorkarounds.TableRow>
53
+ > = (props) => <tr>{props.children}</tr>
49
54
 
50
- export const TableFooter = (
51
- props: React.PropsWithChildren<ContentTreeWorkarounds.TableFooter>
52
- ) => (
55
+ export const TableFooter: React.FC<
56
+ React.PropsWithChildren<ContentTreeWorkarounds.TableFooter>
57
+ > = (props) => (
53
58
  <tfoot>
54
59
  <tr>
55
60
  <td colSpan={1000} className="o-table-footnote">
@@ -59,9 +64,9 @@ export const TableFooter = (
59
64
  </tfoot>
60
65
  )
61
66
 
62
- export const TableCaption = (
63
- props: React.PropsWithChildren<ContentTreeWorkarounds.TableCaption>
64
- ) => (
67
+ export const TableCaption: React.FC<
68
+ React.PropsWithChildren<ContentTreeWorkarounds.TableCaption>
69
+ > = (props) => (
65
70
  <caption className="n-content-body__caption n-content-body__caption--auto">
66
71
  {props.children}
67
72
  </caption>
@@ -123,16 +123,18 @@ function isParentNode(
123
123
  return 'children' in node
124
124
  }
125
125
 
126
- const RichTextChild = ({
127
- node,
128
- components,
129
- references,
130
- parentIndex,
131
- }: {
126
+ type RichTextChildProps = {
132
127
  node: ContentTreeWorkarounds.AnyNode
133
128
  components: RichTextComponentMapRecord
134
129
  references: StructuredContentFragment['references']
135
130
  parentIndex: number
131
+ }
132
+
133
+ const RichTextChild: React.FC<RichTextChildProps> = ({
134
+ node,
135
+ components,
136
+ references,
137
+ parentIndex,
136
138
  }) => {
137
139
  if (node.type === 'text') {
138
140
  return <>{node.value}</>
@@ -175,10 +177,10 @@ const RichTextChild = ({
175
177
  return null
176
178
  }
177
179
 
178
- export default function RichText({
180
+ const RichText: React.FC<RichTextProps> = ({
179
181
  structuredContent,
180
182
  components,
181
- }: RichTextProps) {
183
+ }) => {
182
184
  if (!structuredContent) {
183
185
  return null
184
186
  }
@@ -205,3 +207,5 @@ export default function RichText({
205
207
  </>
206
208
  )
207
209
  }
210
+
211
+ export default RichText
@@ -25,9 +25,9 @@ const scrollyGetBreakpoints: BreakpointGetter = (image) => {
25
25
  }
26
26
  }
27
27
 
28
- export function ScrollyImage({
29
- picture,
30
- }: ContentTree.ScrollyImage & ScrollyImageFragment) {
28
+ export const ScrollyImage: React.FC<
29
+ ContentTree.ScrollyImage & ScrollyImageFragment
30
+ > = ({ picture }) => {
31
31
  const scrollyId = useContext(ScrollyIDContext)
32
32
 
33
33
  if (!picture?.images) {
@@ -61,4 +61,4 @@ export function ScrollyImage({
61
61
  )}
62
62
  </figure>
63
63
  )
64
- }
64
+ }
@@ -1,4 +1,4 @@
1
- import React, { FC, PropsWithChildren, createContext, useContext } from 'react'
1
+ import React, { createContext, useContext } from 'react'
2
2
  import type { ContentTree } from '@financial-times/content-tree'
3
3
  import classnames from 'classnames'
4
4
  import type scrollytelling from '@financial-times/n-scrollytelling-image/server'
@@ -6,8 +6,8 @@ import { ParagraphContext } from '../Paragraph'
6
6
 
7
7
  export const ScrollyIDContext = createContext<string | null>(null)
8
8
 
9
- export const ScrollyBlock: FC<
10
- PropsWithChildren<Omit<ContentTree.ScrollyBlock, 'children'>> & {
9
+ export const ScrollyBlock: React.FC<
10
+ React.PropsWithChildren<Omit<ContentTree.ScrollyBlock, 'children'>> & {
11
11
  parentIndex: number
12
12
  }
13
13
  > = ({ children, theme, parentIndex }) => (
@@ -42,8 +42,8 @@ type ScrollySectionOptions = Pick<
42
42
  const ScrollySectionOptionsContext =
43
43
  createContext<ScrollySectionOptions | null>(null)
44
44
 
45
- export const ScrollySection: FC<
46
- PropsWithChildren<ContentTree.ScrollySection>
45
+ export const ScrollySection: React.FC<
46
+ React.PropsWithChildren<ContentTree.ScrollySection>
47
47
  > = ({ children, display, noBox, position, transition }) => (
48
48
  <ScrollySectionOptionsContext.Provider
49
49
  value={{ display, noBox, position, transition }}
@@ -55,9 +55,9 @@ export const ScrollySection: FC<
55
55
  type ScrollytellingDisplaySuffix =
56
56
  scrollytelling.ScrollytellingOptionsMap['display'][keyof scrollytelling.ScrollytellingOptionsMap['display']]
57
57
 
58
- export const ScrollyCopy: FC<PropsWithChildren<ContentTree.ScrollyCopy>> = ({
59
- children,
60
- }) => {
58
+ export const ScrollyCopy: React.FC<
59
+ React.PropsWithChildren<ContentTree.ScrollyCopy>
60
+ > = ({ children }) => {
61
61
  const { display, noBox, position, transition } = useContext(
62
62
  ScrollySectionOptionsContext
63
63
  ) ?? {
@@ -100,8 +100,8 @@ export const ScrollyCopy: FC<PropsWithChildren<ContentTree.ScrollyCopy>> = ({
100
100
  )
101
101
  }
102
102
 
103
- export const ScrollyHeading: FC<
104
- PropsWithChildren<ContentTree.ScrollyHeading>
103
+ export const ScrollyHeading: React.FC<
104
+ React.PropsWithChildren<ContentTree.ScrollyHeading>
105
105
  > = ({ children, level }) => {
106
106
  const classNames = classnames(
107
107
  'n-scrollytelling__overlay-text',
@@ -1,9 +1,9 @@
1
1
  import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'
2
2
  import React from 'react'
3
3
 
4
- export default function TableBody({
5
- children,
6
- }: React.PropsWithChildren<ContentTreeWorkarounds.TableBody>) {
4
+ const TableBody: React.FC<
5
+ React.PropsWithChildren<ContentTreeWorkarounds.TableBody>
6
+ > = ({ children }) => {
7
7
  const [headerRow, ...bodyRows] = React.Children.toArray(children)
8
8
 
9
9
  return (
@@ -13,3 +13,5 @@ export default function TableBody({
13
13
  </>
14
14
  )
15
15
  }
16
+
17
+ export default TableBody
@@ -3,11 +3,11 @@ import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipelin
3
3
  import { ColumnSettingsContext } from '.'
4
4
  import classNames from 'classnames'
5
5
 
6
- export const TableCell = (
7
- props: React.PropsWithChildren<ContentTreeWorkarounds.TableCell> & {
6
+ type TableCellProps =
7
+ React.PropsWithChildren<ContentTreeWorkarounds.TableCell> & {
8
8
  parentIndex: number
9
9
  }
10
- ) => {
10
+ export const TableCell: React.FC<TableCellProps> = (props) => {
11
11
  const allColumnSettings = useContext(ColumnSettingsContext)
12
12
  const columnSettings: ContentTreeWorkarounds.TableColumnSettings =
13
13
  allColumnSettings[props.parentIndex] ?? {
@@ -6,7 +6,9 @@ export const ColumnSettingsContext = createContext<
6
6
  ContentTreeWorkarounds.TableColumnSettings[]
7
7
  >([])
8
8
 
9
- export default function Table({
9
+ const Table: React.FC<
10
+ React.PropsWithChildren<ContentTreeWorkarounds.Table>
11
+ > = ({
10
12
  children,
11
13
  compact,
12
14
  layoutWidth,
@@ -14,7 +16,7 @@ export default function Table({
14
16
  responsiveStyle,
15
17
  columnSettings,
16
18
  collapseAfterHowManyRows,
17
- }: React.PropsWithChildren<ContentTreeWorkarounds.Table>) {
19
+ }) => {
18
20
  return (
19
21
  <ColumnSettingsContext.Provider value={columnSettings}>
20
22
  <div
@@ -53,3 +55,5 @@ export default function Table({
53
55
  </ColumnSettingsContext.Provider>
54
56
  )
55
57
  }
58
+
59
+ export default Table
@@ -13,11 +13,11 @@ type ColumnistProps = {
13
13
  followButtonSlot?: FollowButtonSlot
14
14
  }
15
15
 
16
- export default function Columnist({
16
+ const Columnist: React.FC<ColumnistProps> = ({
17
17
  authorConcept,
18
18
  followButtonVariant,
19
19
  followButtonSlot,
20
- }: ColumnistProps) {
20
+ }) => {
21
21
  return (
22
22
  <div className="o-topper__columnist">
23
23
  <a
@@ -36,3 +36,5 @@ export default function Columnist({
36
36
  </div>
37
37
  )
38
38
  }
39
+
40
+ export default Columnist
@@ -7,11 +7,11 @@ type HeadlineProps = {
7
7
  isLargeHeadline?: boolean
8
8
  }
9
9
 
10
- export default function Headline({
10
+ const Headline: React.FC<HeadlineProps> = ({
11
11
  headline,
12
12
  showPremiumLabel = false,
13
13
  isLargeHeadline = false,
14
- }: HeadlineProps) {
14
+ }) => {
15
15
  if (!headline) {
16
16
  return <></>
17
17
  }
@@ -32,3 +32,5 @@ export default function Headline({
32
32
  </h1>
33
33
  )
34
34
  }
35
+
36
+ export default Headline
@@ -3,7 +3,7 @@ import RichText from '../RichText'
3
3
  import type { IntroFragment } from '@financial-times/cp-content-pipeline-client'
4
4
  import classNames from 'classnames'
5
5
 
6
- export default function Intro({ structured, source }: IntroFragment) {
6
+ const Intro: React.FC<IntroFragment> = ({ structured, source }) => {
7
7
  return (
8
8
  <div
9
9
  className={classNames(`o-topper__${source}`, {
@@ -14,3 +14,5 @@ export default function Intro({ structured, source }: IntroFragment) {
14
14
  </div>
15
15
  )
16
16
  }
17
+
18
+ export default Intro
@@ -13,10 +13,10 @@ type LiveBlogIndicatorProps = {
13
13
  realtime?: boolean
14
14
  lastUpdatedDateTime: string
15
15
  }
16
- export default function LiveBlogIndicator({
16
+ const LiveBlogIndicator: React.FC<LiveBlogIndicatorProps> = ({
17
17
  realtime,
18
18
  lastUpdatedDateTime,
19
- }: LiveBlogIndicatorProps) {
19
+ }) => {
20
20
  const liveBlogStatus = realtime ? 'live' : 'closed'
21
21
  const indicatorStatusClasses = classnames(
22
22
  'o-labels-indicator',
@@ -52,3 +52,5 @@ export default function LiveBlogIndicator({
52
52
  </div>
53
53
  )
54
54
  }
55
+
56
+ export default LiveBlogIndicator
@@ -4,11 +4,6 @@ import type { TopperFragment } from '@financial-times/cp-content-pipeline-client
4
4
 
5
5
  import { AliasedBreakpoints, BreakpointGetter, Sources } from '../ImageSet'
6
6
 
7
- type PictureProps = {
8
- topper: TopperFragment
9
- alt?: string
10
- }
11
-
12
7
  const topperGetBreakpointsMap: Partial<
13
8
  Record<TopperFragment['__typename'], BreakpointGetter>
14
9
  > = {
@@ -69,7 +64,12 @@ const topperGetBreakpointsMap: Partial<
69
64
  },
70
65
  }
71
66
 
72
- export default function Picture({ topper, alt = '' }: PictureProps) {
67
+ type PictureProps = {
68
+ topper: TopperFragment
69
+ alt?: string
70
+ }
71
+
72
+ const Picture: React.FC<PictureProps> = ({ topper, alt = '' }) => {
73
73
  if (!('images' in topper) || !topper.fallbackImage) {
74
74
  return null
75
75
  }
@@ -105,3 +105,5 @@ export default function Picture({ topper, alt = '' }: PictureProps) {
105
105
  </figure>
106
106
  )
107
107
  }
108
+
109
+ export default Picture
@@ -18,7 +18,7 @@ type TagsProps = {
18
18
  headshot?: string
19
19
  }
20
20
 
21
- export default function Tags({
21
+ const Tags: React.FC<TagsProps> = ({
22
22
  __typename,
23
23
  isPackage,
24
24
  displayConcept,
@@ -28,7 +28,7 @@ export default function Tags({
28
28
  followButtonVariant,
29
29
  headshot,
30
30
  FollowButtonSlot,
31
- }: TagsProps) {
31
+ }) => {
32
32
  const isOpinion = __typename === 'OpinionTopper'
33
33
  const concept = getConcept(displayConcept, genreConcept)
34
34
  const baseFollowButtonCondition = FollowButtonSlot && concept?.id
@@ -87,7 +87,7 @@ function getConcept(
87
87
  return null
88
88
  }
89
89
 
90
- function BrandConcept(concept: ConceptFragment) {
90
+ const BrandConcept: React.FC<ConceptFragment> = (concept) => {
91
91
  return (
92
92
  <a
93
93
  href={concept.relativeUrl ?? undefined}
@@ -100,7 +100,7 @@ function BrandConcept(concept: ConceptFragment) {
100
100
  )
101
101
  }
102
102
 
103
- function ConceptLabel(concept: ConceptFragment) {
103
+ const ConceptLabel: React.FC<ConceptFragment> = (concept) => {
104
104
  return (
105
105
  <a
106
106
  href={concept.relativeUrl}
@@ -113,3 +113,5 @@ function ConceptLabel(concept: ConceptFragment) {
113
113
  </a>
114
114
  )
115
115
  }
116
+
117
+ export default Tags
@@ -1,20 +1,19 @@
1
- import React, { ReactNode } from 'react'
1
+ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  type WrapperProps = {
5
- children: ReactNode
6
5
  isPackage?: boolean
7
6
  isBasic?: boolean
8
7
  modifiers: string[]
9
8
  backgroundColor?: string
10
9
  }
11
10
 
12
- export default function Wrapper({
11
+ const Wrapper: React.FC<React.PropsWithChildren<WrapperProps>> = ({
13
12
  children,
14
13
  isBasic,
15
14
  modifiers = [],
16
15
  backgroundColor,
17
- }: WrapperProps) {
16
+ }) => {
18
17
  const modifierClasses = modifiers.map((modifier) => `o-topper--${modifier}`)
19
18
  const modifierClassesString = modifierClasses.toString().replace(/,/g, ' ')
20
19
 
@@ -28,3 +27,5 @@ export default function Wrapper({
28
27
 
29
28
  return <div className={wrapperClassnames}>{children}</div>
30
29
  }
30
+
31
+ export default Wrapper
@@ -21,13 +21,13 @@ export type TopperProps = {
21
21
  readNextSlot?: () => ReactElement
22
22
  }
23
23
 
24
- export default function Topper({
24
+ const Topper: React.FC<TopperProps> = ({
25
25
  content,
26
26
  slot,
27
27
  followButtonSlot,
28
28
  showPremiumLabel = false,
29
29
  readNextSlot,
30
- }: TopperProps) {
30
+ }) => {
31
31
  const { topper } = content
32
32
 
33
33
  if (!topper) {
@@ -191,3 +191,5 @@ export default function Topper({
191
191
  </Fragment>
192
192
  )
193
193
  }
194
+
195
+ export default Topper
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import type { ContentTree } from '@financial-times/content-tree'
3
3
  import { TweetFragment } from '@financial-times/cp-content-pipeline-client'
4
4
 
5
- export default function Tweet(tweet: ContentTree.Tweet & TweetFragment) {
5
+ const Tweet: React.FC<ContentTree.Tweet & TweetFragment> = (tweet) => {
6
6
  if (tweet.html) {
7
7
  return (
8
8
  <div
@@ -19,3 +19,5 @@ export default function Tweet(tweet: ContentTree.Tweet & TweetFragment) {
19
19
  }
20
20
  return null
21
21
  }
22
+
23
+ export default Tweet
@@ -2,11 +2,11 @@ import React from 'react'
2
2
  import { VideoFragment } from '@financial-times/cp-content-pipeline-client'
3
3
  import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'
4
4
 
5
- export default function Video({
5
+ const Video: React.FC<VideoFragment & ContentTreeWorkarounds.Video> = ({
6
6
  id,
7
7
  embedded,
8
8
  title,
9
- }: VideoFragment & ContentTreeWorkarounds.Video) {
9
+ }) => {
10
10
  return (
11
11
  <div
12
12
  className="n-content-video n-content-video--internal"
@@ -29,3 +29,5 @@ export default function Video({
29
29
  </div>
30
30
  )
31
31
  }
32
+
33
+ export default Video
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
2
  import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'
3
3
 
4
- export default function YoutubeVideo({
4
+ const YoutubeVideo: React.FC<ContentTreeWorkarounds.YoutubeVideo> = ({
5
5
  url,
6
- }: ContentTreeWorkarounds.YoutubeVideo) {
6
+ }) => {
7
7
  try {
8
8
  const parsed = new URL(url)
9
9
  const id = parsed.searchParams.get('v')
@@ -32,3 +32,5 @@ export default function YoutubeVideo({
32
32
  return null
33
33
  }
34
34
  }
35
+
36
+ export default YoutubeVideo
@@ -1,6 +1,6 @@
1
+ import React, { useEffect } from 'react'
1
2
  import ClipServer from '../components/Clip'
2
3
  import ClipClient from '../components/Clip/client'
3
- import React, { useEffect, ReactNode } from 'react'
4
4
  import oTracking from '@financial-times/o-tracking/main'
5
5
  import './Clip.stories.scss'
6
6
  import { ClipProps } from '../components/Clip/template/component'
@@ -18,11 +18,7 @@ export default {
18
18
  },
19
19
  }
20
20
 
21
- interface ArticleWrapperProps {
22
- children: ReactNode
23
- }
24
-
25
- const ArticleWrapper: React.FC<ArticleWrapperProps> = ({ children }) => {
21
+ const ArticleWrapper: React.FC<React.PropsWithChildren> = ({ children }) => {
26
22
  return (
27
23
  <article
28
24
  id="site-content"