@ndla/ui 3.3.13 → 3.3.17

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 (410) hide show
  1. package/README.md +0 -3
  2. package/es/Article/Article.js +3 -3
  3. package/es/Article/ArticleByline.js +4 -5
  4. package/es/Article/ArticleNotions.js +5 -6
  5. package/es/Article/ArticleSideBar.js +11 -12
  6. package/es/AudioPlayer/AudioPlayer.js +15 -16
  7. package/es/AudioPlayer/SpeechControl.js +2 -3
  8. package/es/BlogPosts/BlogPost.js +6 -8
  9. package/es/BlogPosts/BlogPostWrapper.js +1 -1
  10. package/es/Breadcrumb/Breadcrumb.js +1 -2
  11. package/es/Breadcrumb/BreadcrumbItem.js +2 -3
  12. package/es/Breadcrumblist/Breadcrumblist.js +7 -8
  13. package/es/CompetenceGoalTab/CompetenceGoalTab.js +6 -7
  14. package/es/CompetenceGoalTab/CompetenceItem.js +11 -13
  15. package/es/ComponentCursor/ComponentCursor.js +8 -8
  16. package/es/CopyParagraphButton/CopyParagraphButton.js +3 -4
  17. package/es/CreatedBy/CreatedBy.js +5 -6
  18. package/es/Dialog/Dialog.js +1 -2
  19. package/es/Embedded/Twitter.js +5 -5
  20. package/es/ErrorMessage/ErrorMessage.js +5 -5
  21. package/es/Figure/Figure.js +3 -1
  22. package/es/Figure/FigureLicenseDialog.js +1 -2
  23. package/es/Filter/FilterButtons.js +11 -13
  24. package/es/Footer/Footer.js +8 -9
  25. package/es/Footer/FooterLinks.js +7 -8
  26. package/es/Footer/FooterPrivacy.js +2 -3
  27. package/es/Footer/FooterText.js +1 -1
  28. package/es/Frontpage/FrontpageAllSubjects.js +10 -11
  29. package/es/Frontpage/FrontpageFilm.js +6 -8
  30. package/es/Frontpage/FrontpageHeader.js +5 -6
  31. package/es/Frontpage/FrontpageInfo.js +1 -1
  32. package/es/Frontpage/FrontpageMultidisciplinarySubject.js +8 -9
  33. package/es/Frontpage/FrontpageSearch.js +4 -6
  34. package/es/Frontpage/FrontpageToolbox.js +5 -6
  35. package/es/Frontpage/illustrations/FrontpageSubjectIllustration.js +1 -1
  36. package/es/LanguageSelector/LanguageSelector.js +8 -9
  37. package/es/LearningPaths/LearningPathContent.js +1 -1
  38. package/es/LearningPaths/LearningPathInformation.js +1 -1
  39. package/es/LearningPaths/LearningPathLastStepNavigation.js +4 -4
  40. package/es/LearningPaths/LearningPathMenu.js +5 -7
  41. package/es/LearningPaths/LearningPathMenuAside.js +7 -8
  42. package/es/LearningPaths/LearningPathMenuAsideCopyright.js +1 -2
  43. package/es/LearningPaths/LearningPathMenuContent.js +6 -8
  44. package/es/LearningPaths/LearningPathMenuIntro.js +7 -8
  45. package/es/LearningPaths/LearningPathMenuModalWrapper.js +3 -5
  46. package/es/LearningPaths/LearningPathMobileHeader.js +4 -5
  47. package/es/LearningPaths/LearningPathMobileStepInfo.js +1 -1
  48. package/es/LearningPaths/LearningPathSticky.js +4 -5
  49. package/es/LearningPaths/LearningPathWrapper.js +2 -2
  50. package/es/Masthead/MastheadSearchModal.js +5 -7
  51. package/es/NDLAFilm/AboutNdlaFilm.js +6 -17
  52. package/es/NDLAFilm/AllMoviesAlphabetically.js +14 -15
  53. package/es/NDLAFilm/CategorySelect.js +17 -18
  54. package/es/NDLAFilm/FilmContentCard.js +8 -23
  55. package/es/NDLAFilm/FilmContentCardTags.js +4 -8
  56. package/es/NDLAFilm/FilmMovieList.js +6 -21
  57. package/es/NDLAFilm/FilmMovieSearch.js +18 -26
  58. package/es/NDLAFilm/FilmSlideshow.js +3 -3
  59. package/es/NDLAFilm/MovieGrid.js +10 -19
  60. package/es/NDLAFilm/VisualElement.js +22 -29
  61. package/es/Navigation/NavigationBox.js +19 -19
  62. package/es/Navigation/NavigationHeading.js +4 -4
  63. package/es/Navigation/NavigationTopicAbout.js +15 -16
  64. package/es/Notion/Notion.js +4 -4
  65. package/es/RelatedArticleList/RelatedArticleList.js +4 -4
  66. package/es/ResourceGroup/ResourceItem.js +12 -14
  67. package/es/ResourceGroup/ResourceList.js +3 -4
  68. package/es/ResourcesWrapper/ResourcesTopicTitle.js +5 -6
  69. package/es/Search/ContentTypeResult.js +4 -7
  70. package/es/Search/LoadingWrapper.js +2 -3
  71. package/es/Search/SearchFieldForm.js +3 -3
  72. package/es/Search/SearchPage.js +2 -2
  73. package/es/Search/SearchResultSleeve.js +8 -8
  74. package/es/SearchTypeResult/ActiveFilterContent.js +1 -2
  75. package/es/SearchTypeResult/ActiveFilters.js +6 -7
  76. package/es/SearchTypeResult/PopupFilter.js +9 -11
  77. package/es/SearchTypeResult/ResultNavigation.js +2 -3
  78. package/es/SearchTypeResult/SearchFieldHeader.js +7 -9
  79. package/es/SearchTypeResult/SearchItem.js +20 -24
  80. package/es/SearchTypeResult/SearchItems.js +4 -4
  81. package/es/SearchTypeResult/SearchNotionItem.js +16 -20
  82. package/es/SearchTypeResult/SearchNotionsResult.js +6 -8
  83. package/es/SearchTypeResult/SearchSubjectItem.js +3 -4
  84. package/es/SearchTypeResult/SearchTypeHeader.js +9 -10
  85. package/es/SearchTypeResult/SearchTypeResult.js +5 -6
  86. package/es/ToolboxPage/ToolboxInfo.js +2 -2
  87. package/es/Topic/Loader.js +1 -2
  88. package/es/Topic/Topic.js +21 -22
  89. package/es/TopicIntroductionList/TopicIntroduction.js +14 -33
  90. package/es/TopicIntroductionList/TopicIntroductionList.js +6 -23
  91. package/es/TopicIntroductionList/TopicIntroductionShortcuts.js +71 -110
  92. package/es/TopicIntroductionList/TopicShortcutItem.js +0 -9
  93. package/es/Translation/TranslationBox.js +1 -2
  94. package/es/User/AuthModal.js +9 -10
  95. package/es/all.css +1 -4
  96. package/es/index-javascript.js +1 -5
  97. package/es/index.js +4 -0
  98. package/es/shapes.js +0 -6
  99. package/lib/Article/Article.d.ts +2 -2
  100. package/lib/Article/Article.js +2 -4
  101. package/lib/Article/ArticleByline.d.ts +2 -2
  102. package/lib/Article/ArticleByline.js +4 -4
  103. package/lib/Article/ArticleNotions.d.ts +2 -2
  104. package/lib/Article/ArticleNotions.js +4 -4
  105. package/lib/Article/ArticleSideBar.d.ts +4 -4
  106. package/lib/Article/ArticleSideBar.js +10 -11
  107. package/lib/Aside/Aside.d.ts +2 -2
  108. package/lib/AudioPlayer/AudioPlayer.js +14 -14
  109. package/lib/AudioPlayer/SpeechControl.js +1 -2
  110. package/lib/BlogPosts/BlogPost.d.ts +1 -2
  111. package/lib/BlogPosts/BlogPost.js +4 -6
  112. package/lib/BlogPosts/BlogPostWrapper.d.ts +3 -3
  113. package/lib/BlogPosts/BlogPostWrapper.js +1 -1
  114. package/lib/Breadcrumb/Breadcrumb.d.ts +4 -4
  115. package/lib/Breadcrumb/Breadcrumb.js +0 -1
  116. package/lib/Breadcrumb/BreadcrumbBlock.d.ts +3 -3
  117. package/lib/Breadcrumb/BreadcrumbItem.d.ts +2 -2
  118. package/lib/Breadcrumb/BreadcrumbItem.js +1 -2
  119. package/lib/Breadcrumblist/Breadcrumblist.d.ts +4 -4
  120. package/lib/Breadcrumblist/Breadcrumblist.js +6 -6
  121. package/lib/CompetenceGoalTab/CompetenceGoalTab.js +5 -5
  122. package/lib/CompetenceGoalTab/CompetenceItem.js +10 -10
  123. package/lib/ComponentCursor/ComponentCursor.js +8 -8
  124. package/lib/CopyParagraphButton/CopyParagraphButton.js +2 -2
  125. package/lib/CreatedBy/CreatedBy.js +4 -4
  126. package/lib/Embedded/Twitter.js +5 -5
  127. package/lib/ErrorMessage/ErrorMessage.d.ts +2 -2
  128. package/lib/ErrorMessage/ErrorMessage.js +5 -5
  129. package/lib/Figure/Figure.js +3 -1
  130. package/lib/Filter/FilterButtons.js +9 -9
  131. package/lib/Footer/EditorName.d.ts +1 -2
  132. package/lib/Footer/Footer.d.ts +5 -5
  133. package/lib/Footer/Footer.js +7 -7
  134. package/lib/Footer/FooterLinks.d.ts +3 -3
  135. package/lib/Footer/FooterLinks.js +6 -6
  136. package/lib/Footer/FooterPrivacy.d.ts +1 -2
  137. package/lib/Footer/FooterPrivacy.js +2 -3
  138. package/lib/Footer/FooterText.d.ts +3 -3
  139. package/lib/Footer/FooterText.js +1 -1
  140. package/lib/Footer/privacy_en.d.ts +1 -2
  141. package/lib/Footer/privacy_nb.d.ts +1 -2
  142. package/lib/Footer/privacy_nn.d.ts +1 -2
  143. package/lib/Frontpage/FrontpageAllSubjects.js +15 -9
  144. package/lib/Frontpage/FrontpageFilm.d.ts +1 -1
  145. package/lib/Frontpage/FrontpageFilm.js +4 -6
  146. package/lib/Frontpage/FrontpageHeader.d.ts +3 -2
  147. package/lib/Frontpage/FrontpageHeader.js +4 -5
  148. package/lib/Frontpage/FrontpageInfo.d.ts +3 -3
  149. package/lib/Frontpage/FrontpageInfo.js +1 -1
  150. package/lib/Frontpage/FrontpageMultidisciplinarySubject.d.ts +1 -1
  151. package/lib/Frontpage/FrontpageMultidisciplinarySubject.js +7 -7
  152. package/lib/Frontpage/FrontpageSearch.d.ts +3 -3
  153. package/lib/Frontpage/FrontpageSearch.js +2 -4
  154. package/lib/Frontpage/FrontpageToolbox.d.ts +1 -1
  155. package/lib/Frontpage/FrontpageToolbox.js +4 -5
  156. package/lib/Frontpage/illustrations/Fellesfag.d.ts +1 -2
  157. package/lib/Frontpage/illustrations/FrontpageHeaderIllustration.d.ts +1 -2
  158. package/lib/Frontpage/illustrations/FrontpageSubjectIllustration.d.ts +1 -2
  159. package/lib/Frontpage/illustrations/FrontpageSubjectIllustration.js +1 -1
  160. package/lib/Frontpage/illustrations/MenuFellesfag.d.ts +1 -2
  161. package/lib/Frontpage/illustrations/MenuStudiespesialiserende.d.ts +1 -2
  162. package/lib/Frontpage/illustrations/MenuYrkesfag.d.ts +1 -2
  163. package/lib/Frontpage/illustrations/Studiespesialiserende.d.ts +1 -2
  164. package/lib/Frontpage/illustrations/Yrkesfag.d.ts +1 -2
  165. package/lib/Frontpage/illustrations/index.d.ts +6 -6
  166. package/lib/LanguageSelector/LanguageSelector.js +7 -7
  167. package/lib/LearningPaths/LearningPathContent.d.ts +3 -3
  168. package/lib/LearningPaths/LearningPathContent.js +1 -1
  169. package/lib/LearningPaths/LearningPathInformation.d.ts +1 -2
  170. package/lib/LearningPaths/LearningPathInformation.js +1 -1
  171. package/lib/LearningPaths/LearningPathLastStepNavigation.d.ts +3 -3
  172. package/lib/LearningPaths/LearningPathLastStepNavigation.js +4 -4
  173. package/lib/LearningPaths/LearningPathMenu.d.ts +1 -2
  174. package/lib/LearningPaths/LearningPathMenu.js +3 -3
  175. package/lib/LearningPaths/LearningPathMenuAside.d.ts +1 -1
  176. package/lib/LearningPaths/LearningPathMenuAside.js +6 -7
  177. package/lib/LearningPaths/LearningPathMenuAsideCopyright.d.ts +1 -2
  178. package/lib/LearningPaths/LearningPathMenuAsideCopyright.js +1 -2
  179. package/lib/LearningPaths/LearningPathMenuContent.d.ts +1 -2
  180. package/lib/LearningPaths/LearningPathMenuContent.js +5 -7
  181. package/lib/LearningPaths/LearningPathMenuIntro.d.ts +1 -2
  182. package/lib/LearningPaths/LearningPathMenuIntro.js +6 -6
  183. package/lib/LearningPaths/LearningPathMenuModalWrapper.d.ts +3 -3
  184. package/lib/LearningPaths/LearningPathMenuModalWrapper.js +1 -3
  185. package/lib/LearningPaths/LearningPathMobileHeader.d.ts +1 -1
  186. package/lib/LearningPaths/LearningPathMobileHeader.js +4 -5
  187. package/lib/LearningPaths/LearningPathMobileStepInfo.d.ts +1 -1
  188. package/lib/LearningPaths/LearningPathMobileStepInfo.js +1 -1
  189. package/lib/LearningPaths/LearningPathSticky.d.ts +11 -5
  190. package/lib/LearningPaths/LearningPathSticky.js +3 -4
  191. package/lib/LearningPaths/LearningPathWrapper.d.ts +3 -3
  192. package/lib/LearningPaths/LearningPathWrapper.js +2 -2
  193. package/lib/Masthead/MastheadSearchModal.d.ts +3 -3
  194. package/lib/Masthead/MastheadSearchModal.js +3 -5
  195. package/lib/NDLAFilm/AboutNdlaFilm.d.ts +15 -0
  196. package/lib/NDLAFilm/AboutNdlaFilm.js +6 -18
  197. package/lib/NDLAFilm/AllMoviesAlphabetically.d.ts +3 -4
  198. package/lib/NDLAFilm/AllMoviesAlphabetically.js +12 -13
  199. package/lib/NDLAFilm/CategorySelect.d.ts +11 -0
  200. package/lib/NDLAFilm/CategorySelect.js +20 -19
  201. package/lib/NDLAFilm/FilmContentCard.d.ts +11 -0
  202. package/lib/NDLAFilm/FilmContentCard.js +8 -24
  203. package/lib/NDLAFilm/FilmContentCardTags.d.ts +7 -0
  204. package/lib/NDLAFilm/FilmContentCardTags.js +4 -9
  205. package/lib/NDLAFilm/FilmMovieList.d.ts +19 -0
  206. package/lib/NDLAFilm/FilmMovieList.js +5 -21
  207. package/lib/NDLAFilm/FilmMovieSearch.d.ts +21 -0
  208. package/lib/NDLAFilm/FilmMovieSearch.js +25 -30
  209. package/lib/NDLAFilm/FilmSlideshow.d.ts +5 -5
  210. package/lib/NDLAFilm/FilmSlideshow.js +2 -1
  211. package/lib/NDLAFilm/MovieGrid.d.ts +13 -0
  212. package/lib/NDLAFilm/MovieGrid.js +9 -21
  213. package/lib/NDLAFilm/SlideshowIndicator.d.ts +2 -2
  214. package/lib/NDLAFilm/VisualElement.d.ts +16 -0
  215. package/lib/NDLAFilm/VisualElement.js +22 -30
  216. package/lib/NDLAFilm/index.d.ts +14 -0
  217. package/lib/NDLAFilm/types.d.ts +8 -6
  218. package/lib/Navigation/NavigationBox.d.ts +3 -3
  219. package/lib/Navigation/NavigationBox.js +19 -19
  220. package/lib/Navigation/NavigationHeading.d.ts +2 -2
  221. package/lib/Navigation/NavigationHeading.js +4 -4
  222. package/lib/Navigation/NavigationTopicAbout.d.ts +2 -2
  223. package/lib/Navigation/NavigationTopicAbout.js +14 -14
  224. package/lib/Notion/Notion.d.ts +4 -4
  225. package/lib/Notion/Notion.js +4 -4
  226. package/lib/RadioButtonGroup/RadioButtonGroup.d.ts +2 -2
  227. package/lib/RelatedArticleList/RelatedArticleList.js +3 -3
  228. package/lib/ResourceGroup/ResourceItem.js +11 -11
  229. package/lib/ResourceGroup/ResourceList.js +2 -2
  230. package/lib/ResourcesWrapper/ResourcesTopicTitle.js +4 -4
  231. package/lib/Search/ContentTypeResult.d.ts +1 -2
  232. package/lib/Search/ContentTypeResult.js +1 -1
  233. package/lib/Search/LoadingWrapper.d.ts +1 -2
  234. package/lib/Search/LoadingWrapper.js +1 -2
  235. package/lib/Search/SearchFieldForm.d.ts +4 -4
  236. package/lib/Search/SearchFieldForm.js +3 -3
  237. package/lib/Search/SearchPage.js +1 -1
  238. package/lib/Search/SearchResultSleeve.d.ts +1 -2
  239. package/lib/Search/SearchResultSleeve.js +8 -8
  240. package/lib/SearchTypeResult/ActiveFilterContent.js +1 -2
  241. package/lib/SearchTypeResult/ActiveFilters.d.ts +2 -2
  242. package/lib/SearchTypeResult/ActiveFilters.js +5 -5
  243. package/lib/SearchTypeResult/PopupFilter.js +8 -8
  244. package/lib/SearchTypeResult/ResultNavigation.js +2 -3
  245. package/lib/SearchTypeResult/SearchFieldHeader.d.ts +2 -2
  246. package/lib/SearchTypeResult/SearchFieldHeader.js +5 -5
  247. package/lib/SearchTypeResult/SearchItem.d.ts +2 -2
  248. package/lib/SearchTypeResult/SearchItem.js +17 -17
  249. package/lib/SearchTypeResult/SearchItems.js +10 -4
  250. package/lib/SearchTypeResult/SearchNotionItem.d.ts +4 -4
  251. package/lib/SearchTypeResult/SearchNotionItem.js +12 -12
  252. package/lib/SearchTypeResult/SearchNotionsResult.d.ts +2 -2
  253. package/lib/SearchTypeResult/SearchNotionsResult.js +4 -4
  254. package/lib/SearchTypeResult/SearchSubjectItem.js +3 -3
  255. package/lib/SearchTypeResult/SearchTypeHeader.js +14 -8
  256. package/lib/SearchTypeResult/SearchTypeResult.d.ts +2 -2
  257. package/lib/SearchTypeResult/SearchTypeResult.js +10 -5
  258. package/lib/ToolboxPage/ToolboxInfo.d.ts +2 -2
  259. package/lib/ToolboxPage/ToolboxInfo.js +2 -2
  260. package/lib/Topic/Loader.js +0 -1
  261. package/lib/Topic/Topic.d.ts +5 -5
  262. package/lib/Topic/Topic.js +20 -20
  263. package/lib/TopicIntroductionList/TopicIntroduction.d.ts +21 -0
  264. package/lib/TopicIntroductionList/TopicIntroduction.js +16 -36
  265. package/lib/TopicIntroductionList/TopicIntroductionList.d.ts +35 -0
  266. package/lib/TopicIntroductionList/TopicIntroductionList.js +6 -25
  267. package/lib/TopicIntroductionList/TopicIntroductionShortcuts.d.ts +8 -0
  268. package/lib/TopicIntroductionList/TopicIntroductionShortcuts.js +72 -110
  269. package/lib/TopicIntroductionList/TopicShortcutItem.d.ts +6 -0
  270. package/lib/TopicIntroductionList/TopicShortcutItem.js +0 -11
  271. package/lib/TopicIntroductionList/index.d.ts +9 -0
  272. package/lib/Translation/TranslationBox.js +0 -1
  273. package/lib/User/AuthModal.js +8 -8
  274. package/lib/all.css +1 -4
  275. package/lib/index-javascript.js +3 -137
  276. package/lib/index.d.ts +4 -0
  277. package/lib/index.js +155 -0
  278. package/lib/locale/LocaleProvider.d.ts +2 -2
  279. package/lib/shapes.js +1 -10
  280. package/lib/types.d.ts +2 -1
  281. package/package.json +15 -15
  282. package/src/Article/Article.tsx +3 -3
  283. package/src/Article/ArticleByline.tsx +2 -3
  284. package/src/Article/ArticleNotions.tsx +2 -4
  285. package/src/Article/ArticleSideBar.tsx +7 -8
  286. package/src/Aside/Aside.tsx +2 -2
  287. package/src/AudioPlayer/AudioPlayer.tsx +0 -1
  288. package/src/AudioPlayer/SpeechControl.tsx +0 -1
  289. package/src/BlogPosts/BlogPost.tsx +2 -4
  290. package/src/BlogPosts/BlogPostWrapper.tsx +3 -3
  291. package/src/Breadcrumb/Breadcrumb.tsx +4 -5
  292. package/src/Breadcrumb/BreadcrumbBlock.tsx +3 -3
  293. package/src/Breadcrumb/BreadcrumbItem.tsx +3 -4
  294. package/src/Breadcrumblist/Breadcrumblist.tsx +5 -6
  295. package/src/CompetenceGoalTab/CompetenceGoalTab.tsx +0 -1
  296. package/src/CompetenceGoalTab/CompetenceItem.tsx +1 -5
  297. package/src/ComponentCursor/ComponentCursor.tsx +2 -2
  298. package/src/CopyParagraphButton/CopyParagraphButton.tsx +2 -3
  299. package/src/CreatedBy/CreatedBy.tsx +0 -1
  300. package/src/Dialog/Dialog.tsx +0 -1
  301. package/src/Embedded/Twitter.jsx +3 -3
  302. package/src/ErrorMessage/ErrorMessage.tsx +2 -7
  303. package/src/Figure/Figure.tsx +2 -1
  304. package/src/Figure/FigureLicenseDialog.tsx +0 -1
  305. package/src/Figure/component.figure.scss +37 -3
  306. package/src/Filter/FilterButtons.tsx +0 -3
  307. package/src/Footer/EditorName.tsx +1 -1
  308. package/src/Footer/Footer.tsx +4 -5
  309. package/src/Footer/FooterLinks.tsx +4 -8
  310. package/src/Footer/FooterPrivacy.tsx +1 -2
  311. package/src/Footer/FooterText.tsx +3 -5
  312. package/src/Footer/privacy_en.tsx +1 -1
  313. package/src/Footer/privacy_nb.tsx +1 -1
  314. package/src/Footer/privacy_nn.tsx +1 -1
  315. package/src/Frontpage/FrontpageAllSubjects.tsx +5 -6
  316. package/src/Frontpage/FrontpageFilm.tsx +1 -3
  317. package/src/Frontpage/FrontpageHeader.tsx +3 -8
  318. package/src/Frontpage/FrontpageInfo.tsx +3 -3
  319. package/src/Frontpage/FrontpageMultidisciplinarySubject.tsx +1 -2
  320. package/src/Frontpage/FrontpageSearch.tsx +4 -6
  321. package/src/Frontpage/FrontpageToolbox.tsx +1 -2
  322. package/src/Frontpage/illustrations/Fellesfag.tsx +1 -1
  323. package/src/Frontpage/illustrations/FrontpageHeaderIllustration.tsx +1 -1
  324. package/src/Frontpage/illustrations/FrontpageSubjectIllustration.tsx +1 -1
  325. package/src/Frontpage/illustrations/MenuFellesfag.tsx +1 -1
  326. package/src/Frontpage/illustrations/MenuStudiespesialiserende.tsx +1 -1
  327. package/src/Frontpage/illustrations/MenuYrkesfag.tsx +1 -1
  328. package/src/Frontpage/illustrations/Studiespesialiserende.tsx +1 -1
  329. package/src/Frontpage/illustrations/Yrkesfag.tsx +1 -1
  330. package/src/LanguageSelector/LanguageSelector.tsx +0 -1
  331. package/src/LearningPaths/LearningPathContent.tsx +3 -5
  332. package/src/LearningPaths/LearningPathInformation.tsx +1 -6
  333. package/src/LearningPaths/LearningPathLastStepNavigation.tsx +3 -9
  334. package/src/LearningPaths/LearningPathMenu.tsx +2 -4
  335. package/src/LearningPaths/LearningPathMenuAside.tsx +2 -3
  336. package/src/LearningPaths/LearningPathMenuAsideCopyright.tsx +1 -2
  337. package/src/LearningPaths/LearningPathMenuContent.tsx +2 -4
  338. package/src/LearningPaths/LearningPathMenuIntro.tsx +1 -2
  339. package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +3 -5
  340. package/src/LearningPaths/LearningPathMobileHeader.tsx +2 -3
  341. package/src/LearningPaths/LearningPathMobileStepInfo.tsx +1 -1
  342. package/src/LearningPaths/LearningPathSticky.tsx +5 -14
  343. package/src/LearningPaths/LearningPathWrapper.tsx +3 -3
  344. package/src/Masthead/MastheadSearchModal.tsx +4 -6
  345. package/src/NDLAFilm/{AboutNdlaFilm.jsx → AboutNdlaFilm.tsx} +19 -18
  346. package/src/NDLAFilm/AllMoviesAlphabetically.tsx +6 -7
  347. package/src/NDLAFilm/{CategorySelect.jsx → CategorySelect.tsx} +23 -20
  348. package/src/NDLAFilm/{FilmContentCard.jsx → FilmContentCard.tsx} +21 -22
  349. package/src/NDLAFilm/{FilmContentCardTags.jsx → FilmContentCardTags.tsx} +7 -7
  350. package/src/NDLAFilm/{FilmMovieList.jsx → FilmMovieList.tsx} +17 -27
  351. package/src/NDLAFilm/FilmMovieSearch.tsx +71 -0
  352. package/src/NDLAFilm/FilmSlideshow.tsx +9 -10
  353. package/src/NDLAFilm/MovieGrid.tsx +76 -0
  354. package/src/NDLAFilm/SlideshowIndicator.tsx +2 -2
  355. package/src/NDLAFilm/VisualElement.tsx +40 -0
  356. package/src/NDLAFilm/{index.js → index.ts} +0 -0
  357. package/src/NDLAFilm/types.ts +9 -6
  358. package/src/Navigation/NavigationBox.tsx +4 -4
  359. package/src/Navigation/NavigationHeading.tsx +2 -2
  360. package/src/Navigation/NavigationTopicAbout.tsx +2 -3
  361. package/src/Notion/Notion.tsx +4 -4
  362. package/src/RadioButtonGroup/RadioButtonGroup.tsx +2 -2
  363. package/src/RelatedArticleList/RelatedArticleList.tsx +4 -4
  364. package/src/ResourceGroup/ResourceItem.tsx +0 -3
  365. package/src/ResourceGroup/ResourceList.tsx +0 -1
  366. package/src/ResourcesWrapper/ResourcesTopicTitle.tsx +0 -1
  367. package/src/Search/ContentTypeResult.tsx +4 -7
  368. package/src/Search/LoadingWrapper.tsx +1 -2
  369. package/src/Search/SearchFieldForm.tsx +4 -4
  370. package/src/Search/SearchPage.jsx +2 -2
  371. package/src/Search/SearchResultSleeve.tsx +2 -2
  372. package/src/SearchTypeResult/ActiveFilterContent.tsx +0 -1
  373. package/src/SearchTypeResult/ActiveFilters.tsx +2 -3
  374. package/src/SearchTypeResult/PopupFilter.tsx +0 -2
  375. package/src/SearchTypeResult/ResultNavigation.tsx +0 -1
  376. package/src/SearchTypeResult/SearchFieldHeader.tsx +1 -3
  377. package/src/SearchTypeResult/SearchItem.tsx +3 -8
  378. package/src/SearchTypeResult/SearchItems.tsx +2 -2
  379. package/src/SearchTypeResult/SearchNotionItem.tsx +4 -8
  380. package/src/SearchTypeResult/SearchNotionsResult.tsx +2 -4
  381. package/src/SearchTypeResult/SearchSubjectItem.tsx +0 -1
  382. package/src/SearchTypeResult/SearchTypeHeader.tsx +3 -4
  383. package/src/SearchTypeResult/SearchTypeResult.tsx +3 -4
  384. package/src/ToolboxPage/ToolboxInfo.tsx +2 -2
  385. package/src/Topic/Loader.tsx +0 -1
  386. package/src/Topic/Topic.tsx +5 -6
  387. package/src/TopicIntroductionList/{TopicIntroduction.jsx → TopicIntroduction.tsx} +22 -35
  388. package/src/TopicIntroductionList/{TopicIntroductionList.jsx → TopicIntroductionList.tsx} +32 -26
  389. package/src/TopicIntroductionList/TopicIntroductionShortcuts.tsx +71 -0
  390. package/src/TopicIntroductionList/{TopicShortcutItem.jsx → TopicShortcutItem.tsx} +5 -13
  391. package/src/TopicIntroductionList/{index.js → index.ts} +0 -0
  392. package/src/Translation/TranslationBox.tsx +0 -1
  393. package/src/User/AuthModal.tsx +0 -1
  394. package/src/index-javascript.js +0 -30
  395. package/src/index.ts +31 -0
  396. package/src/locale/LocaleProvider.tsx +2 -2
  397. package/src/shapes.js +0 -7
  398. package/src/types.ts +3 -1
  399. package/es/NDLAFilm/interfaces.js +0 -0
  400. package/es/NDLAFilm/shapes.js +0 -15
  401. package/lib/NDLAFilm/interfaces.d.ts +0 -10
  402. package/lib/NDLAFilm/interfaces.js +0 -1
  403. package/lib/NDLAFilm/shapes.d.ts +0 -15
  404. package/lib/NDLAFilm/shapes.js +0 -30
  405. package/src/NDLAFilm/FilmMovieSearch.jsx +0 -66
  406. package/src/NDLAFilm/MovieGrid.jsx +0 -75
  407. package/src/NDLAFilm/VisualElement.jsx +0 -48
  408. package/src/NDLAFilm/interfaces.ts +0 -10
  409. package/src/NDLAFilm/shapes.ts +0 -17
  410. package/src/TopicIntroductionList/TopicIntroductionShortcuts.jsx +0 -92
@@ -3,7 +3,6 @@ import styled from '@emotion/styled';
3
3
  import { WithTranslation, withTranslation } from 'react-i18next';
4
4
  import { spacing, breakpoints, mq } from '@ndla/core';
5
5
  import { SafeLinkButton } from '@ndla/safelink';
6
- // @ts-ignore
7
6
  import SectionHeading from '../SectionHeading';
8
7
  import ComponentCursor from '../ComponentCursor';
9
8
  import { ToolboxIllustration as Illustration } from './illustrations/FrontpageIllustrations';
@@ -47,7 +46,7 @@ type Props = {
47
46
  urlTeachers: string;
48
47
  };
49
48
 
50
- const FrontpageToolbox: React.FunctionComponent<Props & WithTranslation> = ({ urlStudents, urlTeachers, t }) => (
49
+ const FrontpageToolbox = ({ urlStudents, urlTeachers, t }: Props & WithTranslation) => (
51
50
  <StyledSection>
52
51
  <ComponentCursor variant="left" text={t('frontPageToolbox.cursorText')} />
53
52
  <SectionHeading large>{t('frontPageToolbox.heading')}</SectionHeading>
@@ -8,7 +8,7 @@
8
8
 
9
9
  import React from 'react';
10
10
 
11
- const Illustration: React.FunctionComponent = () => (
11
+ const Illustration = () => (
12
12
  <svg width="90px" height="90px" viewBox="0 0 90 90" version="1.1" xmlns="http://www.w3.org/2000/svg">
13
13
  <g id="Artboard" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
14
14
  <path
@@ -8,7 +8,7 @@
8
8
 
9
9
  import React from 'react';
10
10
 
11
- const FrontpageHeaderIllustration: React.FunctionComponent = () => (
11
+ const FrontpageHeaderIllustration = () => (
12
12
  <svg width="482" height="68" viewBox="68 48 779 100" xmlns="http://www.w3.org/2000/svg">
13
13
  <style>
14
14
  {
@@ -14,7 +14,7 @@ const cssStyle = css`
14
14
  z-index: 1;
15
15
  `;
16
16
 
17
- const FrontpageSubjectIllustration: React.FunctionComponent = () => (
17
+ const FrontpageSubjectIllustration = () => (
18
18
  <svg css={cssStyle} viewBox="0 0 837 194" version="1.1" xmlns="http://www.w3.org/2000/svg">
19
19
  <g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
20
20
  <g transform="translate(12.000000, 22.000000)" stroke="#000000">
@@ -8,7 +8,7 @@
8
8
 
9
9
  import React from 'react';
10
10
 
11
- const Illustration: React.FunctionComponent = () => (
11
+ const Illustration = () => (
12
12
  <svg width="940px" height="175px" viewBox="0 0 940 175" version="1.1" xmlns="http://www.w3.org/2000/svg">
13
13
  <g id="MenuOpen3" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
14
14
  <g id="Group" transform="translate(-0.655172, 9.000000)" stroke="#000000">
@@ -8,7 +8,7 @@
8
8
 
9
9
  import React from 'react';
10
10
 
11
- const Illustration: React.FunctionComponent = () => (
11
+ const Illustration = () => (
12
12
  <svg width="940px" height="175px" viewBox="0 0 940 175" version="1.1" xmlns="http://www.w3.org/2000/svg">
13
13
  <g id="MenuOpen1" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
14
14
  <path
@@ -8,7 +8,7 @@
8
8
 
9
9
  import React from 'react';
10
10
 
11
- const Illustration: React.FunctionComponent = () => (
11
+ const Illustration = () => (
12
12
  <svg width="940px" height="175px" viewBox="0 0 940 175" version="1.1" xmlns="http://www.w3.org/2000/svg">
13
13
  <g id="MenuOpen2" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
14
14
  <path
@@ -8,7 +8,7 @@
8
8
 
9
9
  import React from 'react';
10
10
 
11
- const Illustration: React.FunctionComponent = () => (
11
+ const Illustration = () => (
12
12
  <svg width="90px" height="90px" viewBox="0 0 90 90" version="1.1" xmlns="http://www.w3.org/2000/svg">
13
13
  <g id="Artboard" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
14
14
  <path
@@ -8,7 +8,7 @@
8
8
 
9
9
  import React from 'react';
10
10
 
11
- const Illustration: React.FunctionComponent = () => (
11
+ const Illustration = () => (
12
12
  <svg width="90px" height="90px" viewBox="0 0 90 90" version="1.1" xmlns="http://www.w3.org/2000/svg">
13
13
  <g id="Artboard" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
14
14
  <path
@@ -13,7 +13,6 @@ import FocusTrapReact from 'focus-trap-react';
13
13
  // @ts-ignore
14
14
  import Button, { appearances } from '@ndla/button';
15
15
  import { spacing, misc, colors, mq, breakpoints, animations, fonts, spacingUnit } from '@ndla/core';
16
- // @ts-ignore
17
16
  import { ChevronDown } from '@ndla/icons/common';
18
17
  import { useTranslation } from 'react-i18next';
19
18
  import LanguageSelectorContent from './LanguageSelectorContent';
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
 
9
- import React from 'react';
9
+ import React, { ReactNode } from 'react';
10
10
  import styled from '@emotion/styled';
11
11
  import { mq, breakpoints, colors, spacing, spacingUnit } from '@ndla/core';
12
12
 
@@ -27,9 +27,7 @@ const StyledContent = styled.div`
27
27
  `;
28
28
 
29
29
  interface Props {
30
- children: React.ReactNode;
30
+ children: ReactNode;
31
31
  }
32
32
 
33
- export const LearningPathContent: React.FunctionComponent<Props> = ({ children }) => (
34
- <StyledContent>{children}</StyledContent>
35
- );
33
+ export const LearningPathContent = ({ children }: Props) => <StyledContent>{children}</StyledContent>;
@@ -61,12 +61,7 @@ interface Props {
61
61
  };
62
62
  }
63
63
 
64
- export const LearningPathInformation: React.FunctionComponent<Props> = ({
65
- description,
66
- title,
67
- license,
68
- invertedStyle,
69
- }) => (
64
+ export const LearningPathInformation = ({ description, title, license, invertedStyle }: Props) => (
70
65
  <section className="o-wrapper">
71
66
  <StyledWrapper invertedStyle={invertedStyle} className="c-article">
72
67
  <div>
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
 
9
- import React from 'react';
9
+ import React, { ReactNode } from 'react';
10
10
  import styled from '@emotion/styled';
11
11
  import { css } from '@emotion/core';
12
12
  import SafeLink from '@ndla/safelink';
@@ -39,7 +39,7 @@ const OneColumnCss = css`
39
39
  `;
40
40
 
41
41
  interface Props {
42
- children: React.ReactNode;
42
+ children: ReactNode;
43
43
  subject?: {
44
44
  name: string;
45
45
  url: string;
@@ -51,13 +51,7 @@ interface Props {
51
51
  learningPathName: string;
52
52
  }
53
53
 
54
- const LearningPathLastStepNavigation: React.FunctionComponent<Props & WithTranslation> = ({
55
- subject,
56
- topic,
57
- learningPathName,
58
- children,
59
- t,
60
- }) => (
54
+ const LearningPathLastStepNavigation = ({ subject, topic, learningPathName, children, t }: Props & WithTranslation) => (
61
55
  <OneColumn css={OneColumnCss}>
62
56
  <LayoutItem layout="center">
63
57
  <StyledHeader className="c-article__title">
@@ -10,11 +10,9 @@ import React, { useState } from 'react';
10
10
  import styled from '@emotion/styled';
11
11
  import { css } from '@emotion/core';
12
12
  import { useTranslation } from 'react-i18next';
13
- // @ts-ignore
14
13
  import Tooltip from '@ndla/tooltip';
15
14
  import { useWindowSize } from '@ndla/hooks';
16
15
  import { colors, spacing, misc, mq, breakpoints } from '@ndla/core';
17
- // @ts-ignore
18
16
  import { ArrowExpandRight, ArrowExpandLeft } from '@ndla/icons/action';
19
17
  import LearningPathMenuModalWrapper from './LearningPathMenuModalWrapper';
20
18
  import LearningPathMenuAside from './LearningPathMenuAside';
@@ -106,7 +104,7 @@ interface Props {
106
104
  showLearningPathButton: Object;
107
105
  }
108
106
 
109
- const LearningPathMenu: React.FunctionComponent<Props> = ({
107
+ const LearningPathMenu = ({
110
108
  learningsteps,
111
109
  currentIndex,
112
110
  name,
@@ -117,7 +115,7 @@ const LearningPathMenu: React.FunctionComponent<Props> = ({
117
115
  learningPathURL,
118
116
  invertedStyle,
119
117
  cookies,
120
- }) => {
118
+ }: Props) => {
121
119
  const { t } = useTranslation();
122
120
  const [isOpen, toggleOpenState] = useState(false);
123
121
  const { innerWidth } = useWindowSize(100);
@@ -9,7 +9,6 @@
9
9
  import React from 'react';
10
10
  import styled from '@emotion/styled';
11
11
  import { css } from '@emotion/core';
12
- // @ts-ignore
13
12
  import { Time } from '@ndla/icons/common';
14
13
  import { SafeLinkButton } from '@ndla/safelink';
15
14
  import { WithTranslation, withTranslation } from 'react-i18next';
@@ -110,14 +109,14 @@ type Props = {
110
109
  };
111
110
  };
112
111
 
113
- const LearningPathMenuAside: React.FunctionComponent<Props & WithTranslation> = ({
112
+ const LearningPathMenuAside = ({
114
113
  lastUpdated,
115
114
  learningPathURL,
116
115
  copyright,
117
116
  isOpen,
118
117
  invertedStyle,
119
118
  t,
120
- }) => (
119
+ }: Props & WithTranslation) => (
121
120
  <StyledAside isOpen={isOpen} invertedStyle={invertedStyle}>
122
121
  <div css={learningPathDetailsCSS}>
123
122
  <Time />
@@ -8,7 +8,6 @@
8
8
 
9
9
  import React from 'react';
10
10
  import styled from '@emotion/styled';
11
- // @ts-ignore
12
11
  import { User } from '@ndla/icons/common';
13
12
  import { spacing, fonts } from '@ndla/core';
14
13
 
@@ -43,7 +42,7 @@ type Props = {
43
42
  };
44
43
  };
45
44
 
46
- const LearningPathMenuAsideCopyright: React.FunctionComponent<Props> = ({ copyright }) => (
45
+ const LearningPathMenuAsideCopyright = ({ copyright }: Props) => (
47
46
  <StyledLearningPathDetails>
48
47
  <User />
49
48
  <p>
@@ -11,10 +11,8 @@ import styled from '@emotion/styled';
11
11
  import { css } from '@emotion/core';
12
12
  import { colors, spacing, spacingUnit, fonts, mq, breakpoints, animations } from '@ndla/core';
13
13
  import SafeLink from '@ndla/safelink';
14
- // @ts-ignore
15
14
  import { LearningPathRead } from '@ndla/icons/contentType';
16
15
  import { StepProps } from './LearningPathMenu';
17
- // @ts-ignore
18
16
  import ContentTypeBadge from '../ContentTypeBadge';
19
17
  import constants from '../model';
20
18
 
@@ -227,7 +225,7 @@ const hasRead = (
227
225
  },
228
226
  ) => !!cookies[id];
229
227
 
230
- const LearningPathMenuContent: React.FunctionComponent<Props> = ({
228
+ const LearningPathMenuContent = ({
231
229
  isOpen,
232
230
  currentIndex,
233
231
  cookies,
@@ -236,7 +234,7 @@ const LearningPathMenuContent: React.FunctionComponent<Props> = ({
236
234
  toLearningPathUrl,
237
235
  invertedStyle,
238
236
  onStepNavigate,
239
- }) => {
237
+ }: Props) => {
240
238
  const getContentTypeBadge = (type?: string) => {
241
239
  if (!type) {
242
240
  return <ContentTypeBadge type={constants.contentTypes.LEARNING_PATH} background size="small" />;
@@ -9,7 +9,6 @@
9
9
  import React from 'react';
10
10
  import styled from '@emotion/styled';
11
11
  import { css } from '@emotion/core';
12
- // @ts-ignore
13
12
  import { useTranslation } from 'react-i18next';
14
13
  import { colors, spacing, spacingUnit, fonts, typography, mq, breakpoints, animations } from '@ndla/core';
15
14
 
@@ -101,7 +100,7 @@ interface Props {
101
100
  name: string;
102
101
  }
103
102
 
104
- const LearningPathMenuIntro: React.FunctionComponent<Props> = ({ isOpen, name, invertedStyle }) => {
103
+ const LearningPathMenuIntro = ({ isOpen, name, invertedStyle }: Props) => {
105
104
  const { t } = useTranslation();
106
105
  return (
107
106
  <StyledMenuIntro isOpen={isOpen} invertedStyle={invertedStyle}>
@@ -6,14 +6,12 @@
6
6
  *
7
7
  */
8
8
 
9
- import React, { ReactChild, ReactChildren } from 'react';
9
+ import React, { ReactChild, ReactChildren, ReactNode } from 'react';
10
10
  import { spacing, mq, breakpoints } from '@ndla/core';
11
- // @ts-ignore
12
11
  import Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
13
12
  import { css } from '@emotion/core';
14
13
  // @ts-ignore
15
14
  import Button from '@ndla/button';
16
- // @ts-ignore
17
15
  import { LearningPath } from '@ndla/icons/contentType';
18
16
  import { useTranslation } from 'react-i18next';
19
17
 
@@ -34,10 +32,10 @@ const buttonToggleCss = css`
34
32
 
35
33
  type ModalWrapperProps = {
36
34
  innerWidth: number;
37
- children: (arg: VoidFunction) => ReactChild | ReactChildren | React.ReactNode;
35
+ children: (arg: VoidFunction) => ReactChild | ReactChildren | ReactNode;
38
36
  };
39
37
 
40
- const ModalWrapperComponent: React.FC<ModalWrapperProps> = ({ innerWidth, children }) => {
38
+ const ModalWrapperComponent = ({ innerWidth, children }: ModalWrapperProps) => {
41
39
  const { t } = useTranslation();
42
40
  if (innerWidth < 601) {
43
41
  return (
@@ -10,8 +10,7 @@ import styled from '@emotion/styled';
10
10
  import { colors, fonts, spacing } from '@ndla/core';
11
11
  import React from 'react';
12
12
  import { WithTranslation, withTranslation } from 'react-i18next';
13
- // @ts-ignore
14
- import { LearningPathBadge } from '../index-javascript';
13
+ import { LearningPathBadge } from '../';
15
14
 
16
15
  const StyledWrapper = styled.div`
17
16
  display: flex;
@@ -26,7 +25,7 @@ const StyledMiniHeader = styled.span`
26
25
  ${fonts.sizes(16, 1.1)};
27
26
  `;
28
27
 
29
- const LearningPathMobileHeader: React.FunctionComponent<WithTranslation> = ({ t }) => (
28
+ const LearningPathMobileHeader = ({ t }: WithTranslation) => (
30
29
  <StyledWrapper>
31
30
  <LearningPathBadge size="xx-small" background />
32
31
  <StyledMiniHeader>{t('learningPath.youAreInALearningPath')}</StyledMiniHeader>
@@ -24,7 +24,7 @@ type Props = {
24
24
  current: number;
25
25
  };
26
26
 
27
- const LearningPathMobileStepInfo: React.FunctionComponent<Props & WithTranslation> = ({ total, current, t }) => (
27
+ const LearningPathMobileStepInfo = ({ total, current, t }: Props & WithTranslation) => (
28
28
  <StyledInfo>
29
29
  {t('learningPath.mobileStepInfo', {
30
30
  totalPages: total,
@@ -6,12 +6,11 @@
6
6
  *
7
7
  */
8
8
 
9
- import React from 'react';
9
+ import React, { ReactNode } from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import styled from '@emotion/styled';
12
12
  import { css } from '@emotion/core';
13
13
  import { colors, spacing, animations, mq, breakpoints } from '@ndla/core';
14
- // @ts-ignore
15
14
  import { Back, Forward } from '@ndla/icons/common';
16
15
  import SafeLink from '@ndla/safelink';
17
16
 
@@ -42,12 +41,10 @@ const StyledFooter = styled.nav`
42
41
  `;
43
42
 
44
43
  interface Props {
45
- children: React.ReactNode;
44
+ children: ReactNode;
46
45
  }
47
46
 
48
- export const LearningPathSticky: React.FunctionComponent<Props> = ({ children }) => (
49
- <StyledFooter>{children}</StyledFooter>
50
- );
47
+ export const LearningPathSticky = ({ children }: Props) => <StyledFooter>{children}</StyledFooter>;
51
48
 
52
49
  LearningPathSticky.propTypes = {
53
50
  children: PropTypes.node,
@@ -122,13 +119,7 @@ type PropsSiblings = {
122
119
  stepId: number;
123
120
  };
124
121
 
125
- export const LearningPathStickySibling: React.FunctionComponent<PropsSiblings> = ({
126
- title,
127
- toLearningPathUrl,
128
- pathId,
129
- stepId,
130
- arrow,
131
- }) => (
122
+ export const LearningPathStickySibling = ({ title, toLearningPathUrl, pathId, stepId, arrow }: PropsSiblings) => (
132
123
  <SafeLink to={toLearningPathUrl(pathId, stepId)} css={SafeLinkCSS}>
133
124
  {arrow === 'left' && <Back className="c-icon--medium" />}
134
125
  <div>
@@ -138,4 +129,4 @@ export const LearningPathStickySibling: React.FunctionComponent<PropsSiblings> =
138
129
  </SafeLink>
139
130
  );
140
131
 
141
- export const LearningPathStickyPlaceholder: React.FunctionComponent = () => <div css={SafeLinkCSS} />;
132
+ export const LearningPathStickyPlaceholder = () => <div css={SafeLinkCSS} />;
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
 
9
- import React from 'react';
9
+ import React, { ReactNode } from 'react';
10
10
  import styled from '@emotion/styled';
11
11
  import { css } from '@emotion/core';
12
12
  import { spacing, spacingUnit, breakpoints, mq } from '@ndla/core';
@@ -41,10 +41,10 @@ const StyledWrapper = styled.section<PropStyledWrapper>`
41
41
  `;
42
42
 
43
43
  interface Props {
44
- children: React.ReactNode;
44
+ children: ReactNode;
45
45
  invertedStyle?: boolean;
46
46
  }
47
47
 
48
- export const LearningPathWrapper: React.FunctionComponent<Props> = ({ children, invertedStyle }) => (
48
+ export const LearningPathWrapper = ({ children, invertedStyle }: Props) => (
49
49
  <StyledWrapper invertedStyle={invertedStyle}>{children}</StyledWrapper>
50
50
  );
@@ -1,9 +1,7 @@
1
- import React, { ReactChild, ReactChildren } from 'react';
2
- // @ts-ignore
1
+ import React, { ReactChild, ReactChildren, ReactNode } from 'react';
3
2
  import Modal from '@ndla/modal';
4
3
  // @ts-ignore
5
4
  import Button from '@ndla/button';
6
- // @ts-ignore
7
5
  import { Cross } from '@ndla/icons/action';
8
6
  import { isFunction } from '@ndla/util';
9
7
  import styled from '@emotion/styled';
@@ -15,7 +13,7 @@ import ToggleSearchButton from '../Search/ToggleSearchButton';
15
13
 
16
14
  interface Props {
17
15
  onClose: VoidFunction;
18
- children: (arg: Function) => ReactChild | ReactChildren | React.ReactNode;
16
+ children: (arg: Function) => ReactChild | ReactChildren | ReactNode;
19
17
  hideOnNarrowScreen?: boolean;
20
18
  ndlaFilm?: boolean;
21
19
  }
@@ -112,13 +110,13 @@ const extraBackdrop = css`
112
110
  box-shadow: ${shadows.searchHeader};
113
111
  `;
114
112
 
115
- const MastheadSearchModal: React.FC<Props & WithTranslation> = ({
113
+ const MastheadSearchModal = ({
116
114
  onClose: onSearchClose,
117
115
  children,
118
116
  hideOnNarrowScreen,
119
117
  ndlaFilm,
120
118
  t,
121
- }) => (
119
+ }: Props & WithTranslation) => (
122
120
  <Modal
123
121
  backgroundColor="grey"
124
122
  animation="slide-down"
@@ -1,11 +1,11 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { OneColumn } from '@ndla/ui';
1
+ import React, { ReactNode } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import styled from '@emotion/styled';
4
4
  import Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
5
5
  import { colors, spacing, fonts, mq, breakpoints } from '@ndla/core';
6
+ //@ts-ignore
6
7
  import Button from '@ndla/button';
7
- import styled from '@emotion/styled';
8
- import { useTranslation } from 'react-i18next';
8
+ import { OneColumn } from '..';
9
9
  import VisualElement from './VisualElement';
10
10
 
11
11
  const StyledAside = styled.aside`
@@ -44,7 +44,20 @@ const StyledAside = styled.aside`
44
44
  }
45
45
  `;
46
46
 
47
- const AboutNdlaFilm = ({ aboutNDLAVideo, moreAboutNdlaFilm }) => {
47
+ interface Props {
48
+ aboutNDLAVideo: {
49
+ title: string;
50
+ description: string;
51
+ visualElement: {
52
+ alt?: string;
53
+ url: string;
54
+ type: string;
55
+ };
56
+ };
57
+ moreAboutNdlaFilm: ReactNode;
58
+ }
59
+
60
+ const AboutNdlaFilm = ({ aboutNDLAVideo, moreAboutNdlaFilm }: Props) => {
48
61
  const { t } = useTranslation();
49
62
  return (
50
63
  <div className="o-wrapper">
@@ -71,16 +84,4 @@ const AboutNdlaFilm = ({ aboutNDLAVideo, moreAboutNdlaFilm }) => {
71
84
  );
72
85
  };
73
86
 
74
- AboutNdlaFilm.propTypes = {
75
- aboutNDLAVideo: PropTypes.shape({
76
- title: PropTypes.string,
77
- description: PropTypes.string,
78
- visualElement: PropTypes.shape({
79
- url: PropTypes.string,
80
- alt: PropTypes.string,
81
- type: PropTypes.string,
82
- }),
83
- }),
84
- };
85
-
86
87
  export default AboutNdlaFilm;
@@ -6,16 +6,15 @@
6
6
  *
7
7
  */
8
8
 
9
- import React, { Fragment, useEffect, useState } from 'react';
9
+ import React, { Fragment, RefObject, useEffect, useRef, useState } from 'react';
10
10
  import { isIE, browserVersion } from 'react-device-detect';
11
11
  import styled from '@emotion/styled';
12
12
  import { css } from '@emotion/core';
13
13
  import throttle from 'lodash/throttle';
14
14
  import { breakpoints, mq, spacing, spacingUnit, colors, fonts, animations } from '@ndla/core';
15
15
  import SafeLink from '@ndla/safelink';
16
- // @ts-ignore
17
16
  import { makeSrcQueryString } from '../Image';
18
- import { movieType } from './types';
17
+ import { MovieType } from './types';
19
18
  import { isLetter } from './isLetter';
20
19
  const IMAGE_WIDTH = 143;
21
20
 
@@ -158,7 +157,7 @@ const StyledSafeLink = styled(SafeLink)<isIEProps>`
158
157
  `;
159
158
 
160
159
  interface Props {
161
- movies: movieType[];
160
+ movies: MovieType[];
162
161
  locale: string;
163
162
  }
164
163
 
@@ -178,11 +177,11 @@ const hasForEachPolyfill = () => {
178
177
  }
179
178
  };
180
179
 
181
- const AllMoviesAlphabetically: React.FunctionComponent<Props> = ({ movies, locale }) => {
180
+ const AllMoviesAlphabetically = ({ movies, locale }: Props) => {
182
181
  const isIE11 = isIE && parseInt(browserVersion) < 12;
183
182
  // Split into Letters.
184
183
  let previousLetter = '';
185
- const wrapperRef: React.RefObject<HTMLElement> = React.useRef(null);
184
+ const wrapperRef: RefObject<HTMLElement> = useRef(null);
186
185
  const [visibleImages, setVisibleImages] = useState<visibleImagesProps>({});
187
186
 
188
187
  const scrollEvent = () => {
@@ -231,7 +230,7 @@ const AllMoviesAlphabetically: React.FunctionComponent<Props> = ({ movies, local
231
230
 
232
231
  return (
233
232
  <StyledWrapper ref={wrapperRef}>
234
- {movies.map((movie: movieType, index: number) => {
233
+ {movies.map((movie: MovieType, index: number) => {
235
234
  const currentLetter = movie.title.substr(0, 1);
236
235
  const isNewLetter = currentLetter.localeCompare(previousLetter, locale) === 1 && isLetter(movie.title);
237
236
  previousLetter = currentLetter;
@@ -1,28 +1,40 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
1
+ import React, { Component } from 'react';
3
2
  import BEMHelper from 'react-bem-helper';
4
3
  import FocusTrapReact from 'focus-trap-react';
5
4
  import { ChevronDown } from '@ndla/icons/common';
6
- import { withTranslation } from 'react-i18next';
5
+ import { WithTranslation, withTranslation } from 'react-i18next';
6
+ import { MovieResourceType } from './types';
7
7
 
8
8
  const classes = new BEMHelper({
9
9
  name: 'film-moviesearch',
10
10
  prefix: 'c-',
11
11
  });
12
12
 
13
- class CategorySelect extends React.Component {
14
- constructor(props) {
13
+ interface Props extends WithTranslation {
14
+ resourceTypes: MovieResourceType[];
15
+ resourceTypeSelected?: MovieResourceType;
16
+ ariaControlId?: string;
17
+ onChangeResourceType: (resourceId?: string) => void;
18
+ }
19
+
20
+ interface State {
21
+ resourceTypesIsOpen: boolean;
22
+ }
23
+ class CategorySelect extends Component<Props, State> {
24
+ references: Record<string, HTMLButtonElement | null>;
25
+ constructor(props: Props) {
15
26
  super(props);
16
27
  this.state = {
17
28
  resourceTypesIsOpen: false,
18
29
  };
30
+ this.references = {};
19
31
  this.createRef = this.createRef.bind(this);
20
32
  this.openSelect = this.openSelect.bind(this);
21
33
  this.onSelect = this.onSelect.bind(this);
22
34
  }
23
35
 
24
- createRef(el, name) {
25
- this[name] = el;
36
+ createRef(el: HTMLButtonElement | null, name: string) {
37
+ this.references[name] = el;
26
38
  }
27
39
 
28
40
  openSelect() {
@@ -32,14 +44,14 @@ class CategorySelect extends React.Component {
32
44
  resourceTypesIsOpen: true,
33
45
  },
34
46
  () => {
35
- if (resourceTypeSelected && this[resourceTypeSelected.id]) {
36
- this[resourceTypeSelected.id].focus();
47
+ if (resourceTypeSelected && this.references[resourceTypeSelected.id]) {
48
+ this.references[resourceTypeSelected.id]?.focus();
37
49
  }
38
50
  },
39
51
  );
40
52
  }
41
53
 
42
- onSelect(val) {
54
+ onSelect(val?: string) {
43
55
  this.props.onChangeResourceType(val);
44
56
  this.setState({
45
57
  resourceTypesIsOpen: false,
@@ -97,7 +109,7 @@ class CategorySelect extends React.Component {
97
109
  ref={(el) => this.createRef(el, resourceType.id)}
98
110
  onClick={() => this.onSelect(resourceType.id)}
99
111
  {...classes('dropdown-button', {
100
- selected: resourceTypeSelected && resourceTypeSelected.id === resourceType.id,
112
+ selected: !!resourceTypeSelected && resourceTypeSelected.id === resourceType.id,
101
113
  })}
102
114
  data-id={resourceType.id}
103
115
  key={resourceType.id}>
@@ -112,13 +124,4 @@ class CategorySelect extends React.Component {
112
124
  }
113
125
  }
114
126
 
115
- CategorySelect.propTypes = {
116
- resourceTypes: PropTypes.arrayOf(PropTypes.object),
117
- resourceTypeSelected: PropTypes.shape({
118
- id: PropTypes.string,
119
- name: PropTypes.string,
120
- }),
121
- ariaControlId: PropTypes.string,
122
- };
123
-
124
127
  export default withTranslation()(CategorySelect);