@ndla/ui 51.0.0 → 53.0.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 (558) hide show
  1. package/README.md +2 -2
  2. package/es/Article/Article.js +113 -120
  3. package/es/Article/ArticleHeaderWrapper.js +14 -20
  4. package/es/Article/ArticleParagraph.js +25 -0
  5. package/es/Article/index.js +1 -0
  6. package/es/AudioPlayer/AudioPlayer.js +13 -13
  7. package/es/AudioPlayer/Controls.js +22 -38
  8. package/es/Breadcrumb/Breadcrumb.js +2 -33
  9. package/es/Breadcrumb/BreadcrumbItem.js +16 -29
  10. package/es/Breadcrumb/index.js +0 -1
  11. package/es/CodeBlock/CodeBlock.js +115 -0
  12. package/es/CodeBlock/codeLanguageOptions.js +84 -0
  13. package/es/CodeBlock/index.js +10 -0
  14. package/es/CreatedBy/CreatedBy.js +4 -4
  15. package/es/Embed/BrightcoveEmbed.js +3 -3
  16. package/es/Embed/CodeEmbed.js +2 -2
  17. package/es/Embed/ConceptEmbed.js +37 -33
  18. package/es/Embed/ExternalEmbed.js +2 -2
  19. package/es/Embed/IframeEmbed.js +1 -1
  20. package/es/Embed/ImageEmbed.js +17 -14
  21. package/es/Embed/RelatedContentEmbed.js +3 -3
  22. package/es/Embed/UuDisclaimerEmbed.js +4 -3
  23. package/es/Embed/conceptComponents.js +10 -10
  24. package/es/Figure/Figure.js +32 -19
  25. package/es/FrontpageArticle/FrontpageArticle.js +3 -3
  26. package/es/Gloss/Gloss.js +12 -10
  27. package/es/Hero/Hero.js +1 -1
  28. package/es/Image/Image.js +3 -3
  29. package/es/LanguageSelector/LanguageSelector.js +5 -5
  30. package/es/Layout/LayoutItem.js +2 -1
  31. package/es/Layout/OneColumn.js +22 -28
  32. package/es/Layout/PageContainer.js +21 -17
  33. package/es/LicenseByline/LicenseLink.js +5 -6
  34. package/es/Messages/MessageBox.js +9 -7
  35. package/es/MyNdla/Resource/index.js +1 -2
  36. package/es/MyNdla/index.js +1 -2
  37. package/es/Notion/Notion.js +4 -4
  38. package/es/Resource/BlockResource.js +13 -15
  39. package/es/Resource/ListResource.js +13 -15
  40. package/es/Search/ContentTypeResult.js +4 -4
  41. package/es/Search/SearchResult.js +11 -11
  42. package/es/Search/SearchResultSleeve.js +16 -16
  43. package/es/TreeStructure/TreeStructure.js +6 -6
  44. package/es/all.css +1 -1
  45. package/es/index.js +5 -20
  46. package/es/locale/messages-en.js +15 -2
  47. package/es/locale/messages-nb.js +15 -2
  48. package/es/locale/messages-nn.js +16 -3
  49. package/es/locale/messages-se.js +14 -1
  50. package/es/locale/messages-sma.js +15 -2
  51. package/es/types.js +0 -9
  52. package/lib/Article/Article.d.ts +8 -11
  53. package/lib/Article/Article.js +111 -118
  54. package/lib/Article/ArticleHeaderWrapper.js +14 -20
  55. package/lib/Article/ArticleParagraph.d.ts +13 -0
  56. package/lib/Article/ArticleParagraph.js +32 -0
  57. package/lib/Article/index.d.ts +2 -0
  58. package/lib/Article/index.js +7 -0
  59. package/lib/AudioPlayer/AudioPlayer.js +13 -13
  60. package/lib/AudioPlayer/Controls.js +21 -37
  61. package/lib/Breadcrumb/Breadcrumb.d.ts +1 -2
  62. package/lib/Breadcrumb/Breadcrumb.js +2 -33
  63. package/lib/Breadcrumb/BreadcrumbItem.js +16 -29
  64. package/lib/Breadcrumb/index.d.ts +0 -1
  65. package/lib/Breadcrumb/index.js +0 -7
  66. package/lib/CodeBlock/CodeBlock.d.ts +18 -0
  67. package/lib/CodeBlock/CodeBlock.js +121 -0
  68. package/lib/{Navigation/index.d.ts → CodeBlock/codeLanguageOptions.d.ts} +5 -2
  69. package/lib/CodeBlock/codeLanguageOptions.js +90 -0
  70. package/lib/CodeBlock/index.d.ts +9 -0
  71. package/lib/CodeBlock/index.js +20 -0
  72. package/lib/CreatedBy/CreatedBy.js +4 -4
  73. package/lib/Embed/BrightcoveEmbed.js +3 -3
  74. package/lib/Embed/CodeEmbed.js +2 -2
  75. package/lib/Embed/ConceptEmbed.d.ts +1 -1
  76. package/lib/Embed/ConceptEmbed.js +36 -33
  77. package/lib/Embed/ExternalEmbed.js +2 -2
  78. package/lib/Embed/IframeEmbed.js +1 -1
  79. package/lib/Embed/ImageEmbed.js +17 -14
  80. package/lib/Embed/RelatedContentEmbed.js +3 -3
  81. package/lib/Embed/UuDisclaimerEmbed.js +4 -3
  82. package/lib/Embed/conceptComponents.js +10 -10
  83. package/lib/Figure/Figure.d.ts +2 -5
  84. package/lib/Figure/Figure.js +32 -23
  85. package/lib/FrontpageArticle/FrontpageArticle.js +3 -3
  86. package/lib/Gloss/Gloss.js +12 -10
  87. package/lib/Hero/Hero.js +1 -1
  88. package/lib/Image/Image.js +2 -2
  89. package/lib/LanguageSelector/LanguageSelector.js +5 -5
  90. package/lib/Layout/LayoutItem.js +2 -1
  91. package/lib/Layout/OneColumn.d.ts +3 -8
  92. package/lib/Layout/OneColumn.js +22 -30
  93. package/lib/Layout/PageContainer.d.ts +3 -7
  94. package/lib/Layout/PageContainer.js +21 -19
  95. package/lib/LicenseByline/LicenseLink.js +5 -6
  96. package/lib/Messages/MessageBox.d.ts +2 -1
  97. package/lib/Messages/MessageBox.js +9 -7
  98. package/lib/MyNdla/Resource/index.d.ts +1 -2
  99. package/lib/MyNdla/Resource/index.js +0 -7
  100. package/lib/MyNdla/index.d.ts +1 -2
  101. package/lib/MyNdla/index.js +0 -7
  102. package/lib/Notion/Notion.js +4 -4
  103. package/lib/Resource/BlockResource.js +13 -15
  104. package/lib/Resource/ListResource.js +13 -15
  105. package/lib/Search/ContentTypeResult.js +4 -4
  106. package/lib/Search/SearchResult.js +10 -10
  107. package/lib/Search/SearchResultSleeve.js +16 -16
  108. package/lib/TreeStructure/TreeStructure.js +6 -6
  109. package/lib/all.css +1 -1
  110. package/lib/index.d.ts +5 -20
  111. package/lib/index.js +17 -254
  112. package/lib/locale/messages-en.d.ts +13 -0
  113. package/lib/locale/messages-en.js +15 -2
  114. package/lib/locale/messages-nb.d.ts +13 -0
  115. package/lib/locale/messages-nb.js +15 -2
  116. package/lib/locale/messages-nn.d.ts +13 -0
  117. package/lib/locale/messages-nn.js +16 -3
  118. package/lib/locale/messages-se.d.ts +13 -0
  119. package/lib/locale/messages-se.js +14 -1
  120. package/lib/locale/messages-sma.d.ts +13 -0
  121. package/lib/locale/messages-sma.js +15 -2
  122. package/lib/types.d.ts +0 -51
  123. package/lib/types.js +1 -10
  124. package/package.json +16 -22
  125. package/src/Article/Article.tsx +179 -119
  126. package/src/Article/ArticleHeaderWrapper.tsx +17 -21
  127. package/src/Article/ArticleParagraph.tsx +22 -0
  128. package/src/Article/index.ts +4 -0
  129. package/src/AudioPlayer/AudioPlayer.tsx +2 -2
  130. package/src/AudioPlayer/Controls.tsx +5 -5
  131. package/src/Breadcrumb/Breadcrumb.stories.tsx +0 -4
  132. package/src/Breadcrumb/Breadcrumb.tsx +1 -38
  133. package/src/Breadcrumb/BreadcrumbItem.tsx +5 -19
  134. package/src/Breadcrumb/index.ts +0 -2
  135. package/src/CodeBlock/CodeBlock.stories.tsx +113 -0
  136. package/src/CodeBlock/CodeBlock.tsx +228 -0
  137. package/src/CodeBlock/codeLanguageOptions.ts +115 -0
  138. package/src/CodeBlock/index.ts +10 -0
  139. package/src/CreatedBy/CreatedBy.tsx +2 -2
  140. package/src/Embed/AudioEmbed.stories.tsx +6 -4
  141. package/src/Embed/BrightcoveEmbed.stories.tsx +6 -4
  142. package/src/Embed/BrightcoveEmbed.tsx +2 -2
  143. package/src/Embed/CodeEmbed.tsx +2 -2
  144. package/src/Embed/ConceptEmbed.stories.tsx +6 -4
  145. package/src/Embed/ConceptEmbed.tsx +103 -96
  146. package/src/Embed/ExternalEmbed.stories.tsx +6 -4
  147. package/src/Embed/ExternalEmbed.tsx +2 -2
  148. package/src/Embed/H5pEmbed.stories.tsx +6 -4
  149. package/src/Embed/IframeEmbed.stories.tsx +6 -4
  150. package/src/Embed/IframeEmbed.tsx +1 -1
  151. package/src/Embed/ImageEmbed.stories.tsx +6 -4
  152. package/src/Embed/ImageEmbed.tsx +19 -11
  153. package/src/Embed/RelatedContentEmbed.stories.tsx +6 -4
  154. package/src/Embed/RelatedContentEmbed.tsx +3 -3
  155. package/src/Embed/UuDisclaimerEmbed.stories.tsx +23 -4
  156. package/src/Embed/UuDisclaimerEmbed.tsx +1 -1
  157. package/src/Embed/conceptComponents.tsx +1 -0
  158. package/src/Figure/Figure.tsx +57 -18
  159. package/src/Footer/Footer.stories.tsx +1 -1
  160. package/src/FrontpageArticle/FrontpageArticle.tsx +3 -3
  161. package/src/Gloss/Gloss.tsx +4 -2
  162. package/src/Hero/Hero.tsx +1 -1
  163. package/src/Image/Image.tsx +2 -2
  164. package/src/LanguageSelector/LanguageSelector.tsx +1 -1
  165. package/src/Layout/LayoutItem.tsx +2 -1
  166. package/src/Layout/OneColumn.tsx +25 -35
  167. package/src/Layout/PageContainer.tsx +19 -23
  168. package/src/LicenseByline/LicenseLink.tsx +1 -2
  169. package/src/Messages/MessageBox.tsx +3 -2
  170. package/src/MyNdla/Resource/index.ts +1 -2
  171. package/src/MyNdla/index.ts +1 -2
  172. package/src/Notion/Notion.tsx +2 -2
  173. package/src/Resource/BlockResource.tsx +4 -8
  174. package/src/Resource/ListResource.tsx +4 -6
  175. package/src/Search/ContentTypeResult.tsx +4 -4
  176. package/src/Search/SearchResult.tsx +2 -2
  177. package/src/Search/SearchResultSleeve.tsx +7 -9
  178. package/src/Table/Table.stories.tsx +8 -8
  179. package/src/TreeStructure/TreeStructure.stories.tsx +85 -28
  180. package/src/TreeStructure/TreeStructure.tsx +1 -1
  181. package/src/all.scss +2 -3
  182. package/src/index.ts +7 -48
  183. package/src/locale/messages-en.ts +17 -1
  184. package/src/locale/messages-nb.ts +17 -1
  185. package/src/locale/messages-nn.ts +18 -2
  186. package/src/locale/messages-se.ts +16 -0
  187. package/src/locale/messages-sma.ts +17 -1
  188. package/src/types.ts +0 -62
  189. package/es/Article/ArticleAccessMessage.js +0 -43
  190. package/es/Article/ArticleNotions.js +0 -90
  191. package/es/Aside/Aside.js +0 -75
  192. package/es/Aside/index.js +0 -10
  193. package/es/BannerCard/BannerCard.js +0 -84
  194. package/es/BannerCard/index.js +0 -10
  195. package/es/Breadcrumb/HeaderBreadcrumb.js +0 -57
  196. package/es/CompetenceGoalTab/CompetenceGoalItem.js +0 -42
  197. package/es/CompetenceGoalTab/CompetenceGoalTab.js +0 -75
  198. package/es/CompetenceGoalTab/CompetenceItem.js +0 -108
  199. package/es/CompetenceGoalTab/CoreElementItem.js +0 -44
  200. package/es/CompetenceGoalTab/SearchButton.js +0 -43
  201. package/es/CompetenceGoalTab/index.js +0 -10
  202. package/es/CompetenceGoalTab/styles.js +0 -57
  203. package/es/Filter/FilterButtons.js +0 -185
  204. package/es/Filter/FilterCarousel.js +0 -166
  205. package/es/Filter/ToggleItem.js +0 -68
  206. package/es/Filter/index.js +0 -10
  207. package/es/Frontpage/FrontpageAllSubjects.js +0 -254
  208. package/es/LearningPaths/LearningPathContent.js +0 -25
  209. package/es/LearningPaths/LearningPathInformation.js +0 -74
  210. package/es/LearningPaths/LearningPathLastStepNavigation.js +0 -65
  211. package/es/LearningPaths/LearningPathMenu.js +0 -103
  212. package/es/LearningPaths/LearningPathMenuAside.js +0 -62
  213. package/es/LearningPaths/LearningPathMenuContent.js +0 -109
  214. package/es/LearningPaths/LearningPathMenuIntro.js +0 -72
  215. package/es/LearningPaths/LearningPathMenuModalWrapper.js +0 -63
  216. package/es/LearningPaths/LearningPathMobileHeader.js +0 -35
  217. package/es/LearningPaths/LearningPathMobileStepInfo.js +0 -34
  218. package/es/LearningPaths/LearningPathSticky.js +0 -74
  219. package/es/LearningPaths/LearningPathWrapper.js +0 -27
  220. package/es/LearningPaths/index.js +0 -18
  221. package/es/Masthead/Masthead.js +0 -62
  222. package/es/Masthead/SkipToMainContent.js +0 -30
  223. package/es/Masthead/index.js +0 -13
  224. package/es/Masthead/utils.js +0 -38
  225. package/es/MyNdla/Resource/FolderInput.js +0 -94
  226. package/es/NDLAFilm/AllMoviesAlphabetically.js +0 -127
  227. package/es/NDLAFilm/FilmContentCard.js +0 -93
  228. package/es/NDLAFilm/FilmContentCardTags.js +0 -44
  229. package/es/NDLAFilm/FilmMovieList.js +0 -52
  230. package/es/NDLAFilm/FilmMovieSearch.js +0 -106
  231. package/es/NDLAFilm/FilmSlideshow.js +0 -138
  232. package/es/NDLAFilm/MovieGrid.js +0 -54
  233. package/es/NDLAFilm/VisualElement.js +0 -48
  234. package/es/NDLAFilm/filmStyles.js +0 -31
  235. package/es/NDLAFilm/index.js +0 -14
  236. package/es/NDLAFilm/isLetter.js +0 -13
  237. package/es/NDLAFilm/types.js +0 -1
  238. package/es/Navigation/NavigationBox.js +0 -187
  239. package/es/Navigation/index.js +0 -10
  240. package/es/NoContentBox/NoContentBox.js +0 -31
  241. package/es/NoContentBox/index.js +0 -10
  242. package/es/Programme/Programme.js +0 -104
  243. package/es/Programme/ProgrammeSubjects.js +0 -60
  244. package/es/Programme/index.js +0 -12
  245. package/es/ResourceGroup/ResourceGroup.js +0 -46
  246. package/es/ResourceGroup/ResourceItem.js +0 -196
  247. package/es/ResourceGroup/ResourceList.js +0 -57
  248. package/es/ResourceGroup/index.js +0 -10
  249. package/es/ResourcesWrapper/ResourcesTopicTitle.js +0 -160
  250. package/es/ResourcesWrapper/ResourcesWrapper.js +0 -27
  251. package/es/ResourcesWrapper/index.js +0 -11
  252. package/es/SearchTypeResult/ActiveFilterContent.js +0 -53
  253. package/es/SearchTypeResult/ActiveFilters.js +0 -124
  254. package/es/SearchTypeResult/PopupFilter.js +0 -133
  255. package/es/SearchTypeResult/ResultNavigation.js +0 -75
  256. package/es/SearchTypeResult/SearchFieldHeader.js +0 -103
  257. package/es/SearchTypeResult/SearchFilterContent.js +0 -59
  258. package/es/SearchTypeResult/SearchHeader.js +0 -160
  259. package/es/SearchTypeResult/SearchItem.js +0 -97
  260. package/es/SearchTypeResult/SearchItemList.js +0 -142
  261. package/es/SearchTypeResult/SearchItems.js +0 -60
  262. package/es/SearchTypeResult/SearchSubjectItem.js +0 -62
  263. package/es/SearchTypeResult/SearchSubjectResult.js +0 -34
  264. package/es/SearchTypeResult/SearchTypeHeader.js +0 -118
  265. package/es/SearchTypeResult/SearchTypeResult.js +0 -55
  266. package/es/SearchTypeResult/SearchViewType.js +0 -90
  267. package/es/SearchTypeResult/components/ItemContexts.js +0 -122
  268. package/es/SearchTypeResult/components/ItemResourceHeader.js +0 -96
  269. package/es/SearchTypeResult/components/ItemTopicHeader.js +0 -66
  270. package/es/SearchTypeResult/components/SubjectFilters.js +0 -130
  271. package/es/SearchTypeResult/index.js +0 -14
  272. package/es/Subject/SubjectBanner.js +0 -30
  273. package/es/Subject/index.js +0 -9
  274. package/es/ToolboxPage/ToolboxInfo.js +0 -43
  275. package/es/ToolboxPage/index.js +0 -10
  276. package/es/Topic/Loader.js +0 -107
  277. package/es/Topic/Topic.js +0 -221
  278. package/es/Topic/index.js +0 -10
  279. package/es/locale/LocaleProvider.js +0 -38
  280. package/lib/Article/ArticleAccessMessage.d.ts +0 -12
  281. package/lib/Article/ArticleAccessMessage.js +0 -50
  282. package/lib/Article/ArticleNotions.d.ts +0 -14
  283. package/lib/Article/ArticleNotions.js +0 -96
  284. package/lib/Aside/Aside.d.ts +0 -15
  285. package/lib/Aside/Aside.js +0 -80
  286. package/lib/Aside/index.d.ts +0 -9
  287. package/lib/Aside/index.js +0 -16
  288. package/lib/BannerCard/BannerCard.d.ts +0 -29
  289. package/lib/BannerCard/BannerCard.js +0 -92
  290. package/lib/BannerCard/index.d.ts +0 -9
  291. package/lib/BannerCard/index.js +0 -13
  292. package/lib/Breadcrumb/HeaderBreadcrumb.d.ts +0 -14
  293. package/lib/Breadcrumb/HeaderBreadcrumb.js +0 -64
  294. package/lib/CompetenceGoalTab/CompetenceGoalItem.d.ts +0 -10
  295. package/lib/CompetenceGoalTab/CompetenceGoalItem.js +0 -49
  296. package/lib/CompetenceGoalTab/CompetenceGoalTab.d.ts +0 -14
  297. package/lib/CompetenceGoalTab/CompetenceGoalTab.js +0 -82
  298. package/lib/CompetenceGoalTab/CompetenceItem.d.ts +0 -30
  299. package/lib/CompetenceGoalTab/CompetenceItem.js +0 -113
  300. package/lib/CompetenceGoalTab/CoreElementItem.d.ts +0 -10
  301. package/lib/CompetenceGoalTab/CoreElementItem.js +0 -51
  302. package/lib/CompetenceGoalTab/SearchButton.d.ts +0 -14
  303. package/lib/CompetenceGoalTab/SearchButton.js +0 -50
  304. package/lib/CompetenceGoalTab/index.d.ts +0 -9
  305. package/lib/CompetenceGoalTab/index.js +0 -16
  306. package/lib/CompetenceGoalTab/styles.d.ts +0 -28
  307. package/lib/CompetenceGoalTab/styles.js +0 -62
  308. package/lib/Filter/FilterButtons.d.ts +0 -16
  309. package/lib/Filter/FilterButtons.js +0 -192
  310. package/lib/Filter/FilterCarousel.d.ts +0 -13
  311. package/lib/Filter/FilterCarousel.js +0 -171
  312. package/lib/Filter/ToggleItem.d.ts +0 -21
  313. package/lib/Filter/ToggleItem.js +0 -75
  314. package/lib/Filter/index.d.ts +0 -9
  315. package/lib/Filter/index.js +0 -20
  316. package/lib/Frontpage/FrontpageAllSubjects.d.ts +0 -27
  317. package/lib/Frontpage/FrontpageAllSubjects.js +0 -259
  318. package/lib/LearningPaths/LearningPathContent.d.ts +0 -13
  319. package/lib/LearningPaths/LearningPathContent.js +0 -33
  320. package/lib/LearningPaths/LearningPathInformation.d.ts +0 -18
  321. package/lib/LearningPaths/LearningPathInformation.js +0 -80
  322. package/lib/LearningPaths/LearningPathLastStepNavigation.d.ts +0 -22
  323. package/lib/LearningPaths/LearningPathLastStepNavigation.js +0 -72
  324. package/lib/LearningPaths/LearningPathMenu.d.ts +0 -38
  325. package/lib/LearningPaths/LearningPathMenu.js +0 -110
  326. package/lib/LearningPaths/LearningPathMenuAside.d.ts +0 -24
  327. package/lib/LearningPaths/LearningPathMenuAside.js +0 -69
  328. package/lib/LearningPaths/LearningPathMenuContent.d.ts +0 -22
  329. package/lib/LearningPaths/LearningPathMenuContent.js +0 -116
  330. package/lib/LearningPaths/LearningPathMenuIntro.d.ts +0 -17
  331. package/lib/LearningPaths/LearningPathMenuIntro.js +0 -77
  332. package/lib/LearningPaths/LearningPathMenuModalWrapper.d.ts +0 -14
  333. package/lib/LearningPaths/LearningPathMenuModalWrapper.js +0 -70
  334. package/lib/LearningPaths/LearningPathMobileHeader.d.ts +0 -9
  335. package/lib/LearningPaths/LearningPathMobileHeader.js +0 -42
  336. package/lib/LearningPaths/LearningPathMobileStepInfo.d.ts +0 -13
  337. package/lib/LearningPaths/LearningPathMobileStepInfo.js +0 -41
  338. package/lib/LearningPaths/LearningPathSticky.d.ts +0 -22
  339. package/lib/LearningPaths/LearningPathSticky.js +0 -84
  340. package/lib/LearningPaths/LearningPathWrapper.d.ts +0 -14
  341. package/lib/LearningPaths/LearningPathWrapper.js +0 -35
  342. package/lib/LearningPaths/index.d.ts +0 -17
  343. package/lib/LearningPaths/index.js +0 -74
  344. package/lib/Masthead/Masthead.d.ts +0 -23
  345. package/lib/Masthead/Masthead.js +0 -68
  346. package/lib/Masthead/SkipToMainContent.d.ts +0 -12
  347. package/lib/Masthead/SkipToMainContent.js +0 -37
  348. package/lib/Masthead/index.d.ts +0 -12
  349. package/lib/Masthead/index.js +0 -36
  350. package/lib/Masthead/utils.d.ts +0 -11
  351. package/lib/Masthead/utils.js +0 -46
  352. package/lib/MyNdla/Resource/FolderInput.d.ts +0 -19
  353. package/lib/MyNdla/Resource/FolderInput.js +0 -101
  354. package/lib/NDLAFilm/AllMoviesAlphabetically.d.ts +0 -13
  355. package/lib/NDLAFilm/AllMoviesAlphabetically.js +0 -134
  356. package/lib/NDLAFilm/FilmContentCard.d.ts +0 -19
  357. package/lib/NDLAFilm/FilmContentCard.js +0 -98
  358. package/lib/NDLAFilm/FilmContentCardTags.d.ts +0 -15
  359. package/lib/NDLAFilm/FilmContentCardTags.js +0 -51
  360. package/lib/NDLAFilm/FilmMovieList.d.ts +0 -17
  361. package/lib/NDLAFilm/FilmMovieList.js +0 -59
  362. package/lib/NDLAFilm/FilmMovieSearch.d.ts +0 -21
  363. package/lib/NDLAFilm/FilmMovieSearch.js +0 -113
  364. package/lib/NDLAFilm/FilmSlideshow.d.ts +0 -13
  365. package/lib/NDLAFilm/FilmSlideshow.js +0 -143
  366. package/lib/NDLAFilm/MovieGrid.d.ts +0 -17
  367. package/lib/NDLAFilm/MovieGrid.js +0 -61
  368. package/lib/NDLAFilm/VisualElement.d.ts +0 -16
  369. package/lib/NDLAFilm/VisualElement.js +0 -53
  370. package/lib/NDLAFilm/filmStyles.d.ts +0 -17
  371. package/lib/NDLAFilm/filmStyles.js +0 -39
  372. package/lib/NDLAFilm/index.d.ts +0 -13
  373. package/lib/NDLAFilm/index.js +0 -41
  374. package/lib/NDLAFilm/isLetter.d.ts +0 -8
  375. package/lib/NDLAFilm/isLetter.js +0 -20
  376. package/lib/NDLAFilm/types.d.ts +0 -22
  377. package/lib/NDLAFilm/types.js +0 -5
  378. package/lib/Navigation/NavigationBox.d.ts +0 -30
  379. package/lib/Navigation/NavigationBox.js +0 -193
  380. package/lib/Navigation/index.js +0 -13
  381. package/lib/NoContentBox/NoContentBox.d.ts +0 -14
  382. package/lib/NoContentBox/NoContentBox.js +0 -38
  383. package/lib/NoContentBox/index.d.ts +0 -9
  384. package/lib/NoContentBox/index.js +0 -16
  385. package/lib/Programme/Programme.d.ts +0 -16
  386. package/lib/Programme/Programme.js +0 -112
  387. package/lib/Programme/ProgrammeSubjects.d.ts +0 -26
  388. package/lib/Programme/ProgrammeSubjects.js +0 -67
  389. package/lib/Programme/index.d.ts +0 -11
  390. package/lib/Programme/index.js +0 -23
  391. package/lib/ResourceGroup/ResourceGroup.d.ts +0 -18
  392. package/lib/ResourceGroup/ResourceGroup.js +0 -53
  393. package/lib/ResourceGroup/ResourceItem.d.ts +0 -22
  394. package/lib/ResourceGroup/ResourceItem.js +0 -203
  395. package/lib/ResourceGroup/ResourceList.d.ts +0 -19
  396. package/lib/ResourceGroup/ResourceList.js +0 -64
  397. package/lib/ResourceGroup/index.d.ts +0 -9
  398. package/lib/ResourceGroup/index.js +0 -16
  399. package/lib/ResourcesWrapper/ResourcesTopicTitle.d.ts +0 -20
  400. package/lib/ResourcesWrapper/ResourcesTopicTitle.js +0 -165
  401. package/lib/ResourcesWrapper/ResourcesWrapper.d.ts +0 -16
  402. package/lib/ResourcesWrapper/ResourcesWrapper.js +0 -34
  403. package/lib/ResourcesWrapper/index.d.ts +0 -10
  404. package/lib/ResourcesWrapper/index.js +0 -23
  405. package/lib/SearchTypeResult/ActiveFilterContent.d.ts +0 -23
  406. package/lib/SearchTypeResult/ActiveFilterContent.js +0 -58
  407. package/lib/SearchTypeResult/ActiveFilters.d.ts +0 -18
  408. package/lib/SearchTypeResult/ActiveFilters.js +0 -131
  409. package/lib/SearchTypeResult/PopupFilter.d.ts +0 -26
  410. package/lib/SearchTypeResult/PopupFilter.js +0 -138
  411. package/lib/SearchTypeResult/ResultNavigation.d.ts +0 -18
  412. package/lib/SearchTypeResult/ResultNavigation.js +0 -82
  413. package/lib/SearchTypeResult/SearchFieldHeader.d.ts +0 -17
  414. package/lib/SearchTypeResult/SearchFieldHeader.js +0 -109
  415. package/lib/SearchTypeResult/SearchFilterContent.d.ts +0 -16
  416. package/lib/SearchTypeResult/SearchFilterContent.js +0 -64
  417. package/lib/SearchTypeResult/SearchHeader.d.ts +0 -26
  418. package/lib/SearchTypeResult/SearchHeader.js +0 -166
  419. package/lib/SearchTypeResult/SearchItem.d.ts +0 -30
  420. package/lib/SearchTypeResult/SearchItem.js +0 -104
  421. package/lib/SearchTypeResult/SearchItemList.d.ts +0 -10
  422. package/lib/SearchTypeResult/SearchItemList.js +0 -147
  423. package/lib/SearchTypeResult/SearchItems.d.ts +0 -17
  424. package/lib/SearchTypeResult/SearchItems.js +0 -65
  425. package/lib/SearchTypeResult/SearchSubjectItem.d.ts +0 -20
  426. package/lib/SearchTypeResult/SearchSubjectItem.js +0 -67
  427. package/lib/SearchTypeResult/SearchSubjectResult.d.ts +0 -13
  428. package/lib/SearchTypeResult/SearchSubjectResult.js +0 -41
  429. package/lib/SearchTypeResult/SearchTypeHeader.d.ts +0 -22
  430. package/lib/SearchTypeResult/SearchTypeHeader.js +0 -123
  431. package/lib/SearchTypeResult/SearchTypeResult.d.ts +0 -26
  432. package/lib/SearchTypeResult/SearchTypeResult.js +0 -62
  433. package/lib/SearchTypeResult/SearchViewType.d.ts +0 -13
  434. package/lib/SearchTypeResult/SearchViewType.js +0 -95
  435. package/lib/SearchTypeResult/components/ItemContexts.d.ts +0 -19
  436. package/lib/SearchTypeResult/components/ItemContexts.js +0 -127
  437. package/lib/SearchTypeResult/components/ItemResourceHeader.d.ts +0 -16
  438. package/lib/SearchTypeResult/components/ItemResourceHeader.js +0 -101
  439. package/lib/SearchTypeResult/components/ItemTopicHeader.d.ts +0 -17
  440. package/lib/SearchTypeResult/components/ItemTopicHeader.js +0 -71
  441. package/lib/SearchTypeResult/components/SubjectFilters.d.ts +0 -32
  442. package/lib/SearchTypeResult/components/SubjectFilters.js +0 -135
  443. package/lib/SearchTypeResult/index.d.ts +0 -14
  444. package/lib/SearchTypeResult/index.js +0 -41
  445. package/lib/Subject/SubjectBanner.d.ts +0 -14
  446. package/lib/Subject/SubjectBanner.js +0 -37
  447. package/lib/Subject/index.d.ts +0 -8
  448. package/lib/Subject/index.js +0 -13
  449. package/lib/ToolboxPage/ToolboxInfo.d.ts +0 -18
  450. package/lib/ToolboxPage/ToolboxInfo.js +0 -49
  451. package/lib/ToolboxPage/index.d.ts +0 -9
  452. package/lib/ToolboxPage/index.js +0 -13
  453. package/lib/Topic/Loader.d.ts +0 -9
  454. package/lib/Topic/Loader.js +0 -114
  455. package/lib/Topic/Topic.d.ts +0 -34
  456. package/lib/Topic/Topic.js +0 -228
  457. package/lib/Topic/index.d.ts +0 -10
  458. package/lib/Topic/index.js +0 -16
  459. package/lib/locale/LocaleProvider.d.ts +0 -15
  460. package/lib/locale/LocaleProvider.js +0 -44
  461. package/src/Article/ArticleAccessMessage.tsx +0 -44
  462. package/src/Article/ArticleNotions.tsx +0 -139
  463. package/src/Article/component.article.scss +0 -156
  464. package/src/Aside/Aside.tsx +0 -113
  465. package/src/Aside/index.ts +0 -11
  466. package/src/BannerCard/BannerCard.tsx +0 -99
  467. package/src/BannerCard/index.ts +0 -11
  468. package/src/Breadcrumb/HeaderBreadcrumb.tsx +0 -56
  469. package/src/CompetenceGoalTab/CompetenceGoalItem.tsx +0 -39
  470. package/src/CompetenceGoalTab/CompetenceGoalTab.tsx +0 -85
  471. package/src/CompetenceGoalTab/CompetenceItem.tsx +0 -130
  472. package/src/CompetenceGoalTab/CoreElementItem.tsx +0 -39
  473. package/src/CompetenceGoalTab/SearchButton.tsx +0 -50
  474. package/src/CompetenceGoalTab/index.ts +0 -10
  475. package/src/CompetenceGoalTab/styles.ts +0 -37
  476. package/src/Figure/component.figure.scss +0 -60
  477. package/src/Filter/FilterButtons.tsx +0 -199
  478. package/src/Filter/FilterCarousel.tsx +0 -172
  479. package/src/Filter/ToggleItem.tsx +0 -180
  480. package/src/Filter/index.ts +0 -10
  481. package/src/Frontpage/FrontpageAllSubjects.tsx +0 -231
  482. package/src/LearningPaths/LearningPathContent.tsx +0 -33
  483. package/src/LearningPaths/LearningPathInformation.tsx +0 -82
  484. package/src/LearningPaths/LearningPathLastStepNavigation.tsx +0 -89
  485. package/src/LearningPaths/LearningPathMenu.stories.tsx +0 -65
  486. package/src/LearningPaths/LearningPathMenu.tsx +0 -166
  487. package/src/LearningPaths/LearningPathMenuAside.tsx +0 -100
  488. package/src/LearningPaths/LearningPathMenuContent.tsx +0 -277
  489. package/src/LearningPaths/LearningPathMenuIntro.tsx +0 -126
  490. package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +0 -71
  491. package/src/LearningPaths/LearningPathMobileHeader.tsx +0 -37
  492. package/src/LearningPaths/LearningPathMobileStepInfo.tsx +0 -38
  493. package/src/LearningPaths/LearningPathSticky.tsx +0 -122
  494. package/src/LearningPaths/LearningPathWrapper.tsx +0 -36
  495. package/src/LearningPaths/index.ts +0 -19
  496. package/src/Masthead/Masthead.tsx +0 -100
  497. package/src/Masthead/SkipToMainContent.tsx +0 -54
  498. package/src/Masthead/index.ts +0 -16
  499. package/src/Masthead/utils.ts +0 -45
  500. package/src/MyNdla/Resource/FolderInput.stories.tsx +0 -27
  501. package/src/MyNdla/Resource/FolderInput.tsx +0 -89
  502. package/src/NDLAFilm/AllMoviesAlphabetically.tsx +0 -160
  503. package/src/NDLAFilm/FilmContentCard.tsx +0 -138
  504. package/src/NDLAFilm/FilmContentCardTags.tsx +0 -57
  505. package/src/NDLAFilm/FilmMovieList.tsx +0 -54
  506. package/src/NDLAFilm/FilmMovieSearch.tsx +0 -135
  507. package/src/NDLAFilm/FilmSlideshow.tsx +0 -177
  508. package/src/NDLAFilm/MovieGrid.tsx +0 -86
  509. package/src/NDLAFilm/VisualElement.tsx +0 -38
  510. package/src/NDLAFilm/__tests__/isLetter-test.ts +0 -20
  511. package/src/NDLAFilm/filmStyles.ts +0 -49
  512. package/src/NDLAFilm/index.ts +0 -15
  513. package/src/NDLAFilm/isLetter.ts +0 -13
  514. package/src/NDLAFilm/types.ts +0 -24
  515. package/src/Navigation/NavigationBox.tsx +0 -252
  516. package/src/Navigation/index.ts +0 -11
  517. package/src/NoContentBox/NoContentBox.tsx +0 -32
  518. package/src/NoContentBox/index.ts +0 -11
  519. package/src/Programme/Programme.tsx +0 -101
  520. package/src/Programme/ProgrammeSubjects.tsx +0 -83
  521. package/src/Programme/index.ts +0 -13
  522. package/src/ResourceGroup/ResourceGroup.tsx +0 -65
  523. package/src/ResourceGroup/ResourceItem.stories.tsx +0 -101
  524. package/src/ResourceGroup/ResourceItem.tsx +0 -318
  525. package/src/ResourceGroup/ResourceList.tsx +0 -80
  526. package/src/ResourceGroup/index.ts +0 -11
  527. package/src/ResourcesWrapper/ResourcesTopicTitle.tsx +0 -223
  528. package/src/ResourcesWrapper/ResourcesWrapper.tsx +0 -32
  529. package/src/ResourcesWrapper/index.ts +0 -13
  530. package/src/SearchTypeResult/ActiveFilterContent.tsx +0 -55
  531. package/src/SearchTypeResult/ActiveFilters.tsx +0 -163
  532. package/src/SearchTypeResult/PopupFilter.tsx +0 -149
  533. package/src/SearchTypeResult/ResultNavigation.tsx +0 -105
  534. package/src/SearchTypeResult/SearchFieldHeader.tsx +0 -129
  535. package/src/SearchTypeResult/SearchFilterContent.tsx +0 -61
  536. package/src/SearchTypeResult/SearchHeader.tsx +0 -180
  537. package/src/SearchTypeResult/SearchItem.tsx +0 -144
  538. package/src/SearchTypeResult/SearchItemList.tsx +0 -161
  539. package/src/SearchTypeResult/SearchItems.tsx +0 -72
  540. package/src/SearchTypeResult/SearchSubjectItem.tsx +0 -74
  541. package/src/SearchTypeResult/SearchSubjectResult.tsx +0 -58
  542. package/src/SearchTypeResult/SearchTypeHeader.tsx +0 -148
  543. package/src/SearchTypeResult/SearchTypeResult.tsx +0 -89
  544. package/src/SearchTypeResult/SearchViewType.tsx +0 -111
  545. package/src/SearchTypeResult/components/ItemContexts.tsx +0 -131
  546. package/src/SearchTypeResult/components/ItemResourceHeader.tsx +0 -130
  547. package/src/SearchTypeResult/components/ItemTopicHeader.tsx +0 -88
  548. package/src/SearchTypeResult/components/SubjectFilters.tsx +0 -149
  549. package/src/SearchTypeResult/index.ts +0 -17
  550. package/src/Subject/SubjectBanner.tsx +0 -39
  551. package/src/Subject/index.ts +0 -9
  552. package/src/ToolboxPage/ToolboxInfo.tsx +0 -42
  553. package/src/ToolboxPage/index.ts +0 -11
  554. package/src/Topic/Loader.tsx +0 -29
  555. package/src/Topic/Topic.tsx +0 -348
  556. package/src/Topic/index.ts +0 -13
  557. package/src/locale/LocaleProvider.tsx +0 -31
  558. package/src/main.scss +0 -6
@@ -1,122 +0,0 @@
1
- /**
2
- * Copyright (c) 2019-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { ReactNode } from "react";
10
- import { useTranslation } from "react-i18next";
11
- import { css } from "@emotion/react";
12
- import styled from "@emotion/styled";
13
- import { animations, breakpoints, colors, mq, spacing, stackOrder } from "@ndla/core";
14
- import { Back, Forward } from "@ndla/icons/common";
15
- import { SafeLink } from "@ndla/safelink";
16
-
17
- const FOOTER_HEIGHT = "78px";
18
- const FOOTER_HEIGHT_MOBILE = spacing.large;
19
- const SAFELINK_SIZE_MOBILE = spacing.large;
20
-
21
- const StyledFooter = styled.nav`
22
- display: flex;
23
- height: ${FOOTER_HEIGHT};
24
- width: 100%;
25
- ${mq.range({ until: breakpoints.tablet })} {
26
- --safe-area-inset-bottom: env(safe-area-inset-bottom);
27
- height: calc(${FOOTER_HEIGHT_MOBILE} + var(--safe-area-inset-bottom));
28
- min-height: var(-webkit-fill-available);
29
- position: fixed;
30
- z-index: ${stackOrder.offsetDouble};
31
- bottom: 0;
32
- left: 0;
33
- right: 0;
34
- justify-content: flex-end;
35
- padding-bottom: env(safe-area-inset-bottom);
36
- }
37
- background: ${colors.brand.lighter};
38
- align-items: center;
39
- justify-content: space-between;
40
- ${animations.fadeInBottom()}
41
- `;
42
-
43
- interface Props {
44
- children: ReactNode;
45
- }
46
-
47
- export const LearningPathSticky = ({ children }: Props) => <StyledFooter>{children}</StyledFooter>;
48
-
49
- const SafeLinkCSS = css`
50
- display: flex;
51
- box-shadow: none;
52
- align-items: center;
53
- justify-content: center;
54
- color: ${colors.brand.primary};
55
- height: ${FOOTER_HEIGHT};
56
- ${mq.range({ until: breakpoints.tablet })} {
57
- height: ${SAFELINK_SIZE_MOBILE};
58
- width: ${SAFELINK_SIZE_MOBILE};
59
- min-width: ${SAFELINK_SIZE_MOBILE};
60
- }
61
- padding: 0 ${spacing.normal} 0 ${spacing.normal};
62
- ${mq.range({ until: breakpoints.tablet })} {
63
- padding: 0;
64
- }
65
- transition: background 200ms ease;
66
- div {
67
- display: flex;
68
- flex-direction: column;
69
- padding: 0 ${spacing.small};
70
- span:last-child {
71
- box-shadow: inset 0 -1px;
72
- }
73
- ${mq.range({ until: breakpoints.tablet })} {
74
- display: none;
75
- }
76
- }
77
- &:hover,
78
- &:focus {
79
- hr {
80
- opacity: 0;
81
- }
82
- background: rgba(0, 0, 0, 0.1);
83
- div {
84
- span:last-child {
85
- box-shadow: none;
86
- }
87
- }
88
- }
89
- `;
90
-
91
- const StyledTitle = styled.span`
92
- ${mq.range({ until: breakpoints.tablet })} {
93
- display: none;
94
- }
95
- `;
96
-
97
- type PropsSiblings = {
98
- title: string;
99
- toLearningPathUrl(pathId: number, stepId: number): string;
100
- arrow?: "left" | "right";
101
- pathId: number;
102
- stepId: number;
103
- };
104
-
105
- export const LearningPathStickySibling = ({ title, toLearningPathUrl, pathId, stepId, arrow }: PropsSiblings) => {
106
- const { t } = useTranslation();
107
- return (
108
- <SafeLink
109
- to={toLearningPathUrl(pathId, stepId)}
110
- css={SafeLinkCSS}
111
- aria-label={arrow === "left" ? t("learningPath.previousArrow") : t("learningPath.nextArrow")}
112
- >
113
- {arrow === "left" && <Back size="normal" />}
114
- <div>
115
- <StyledTitle>{title}</StyledTitle>
116
- </div>
117
- {arrow === "right" && <Forward size="normal" />}
118
- </SafeLink>
119
- );
120
- };
121
-
122
- export const LearningPathStickyPlaceholder = () => <div css={SafeLinkCSS} />;
@@ -1,36 +0,0 @@
1
- /**
2
- * Copyright (c) 2019-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { ReactNode } from "react";
10
- import styled from "@emotion/styled";
11
- import { spacing, spacingUnit, breakpoints, mq } from "@ndla/core";
12
-
13
- const StyledWrapper = styled.section`
14
- max-width: ${1402 + spacingUnit}px;
15
- padding: 0 ${spacing.normal};
16
- margin: 0 auto;
17
- .o-wrapper {
18
- padding-right: 0;
19
- padding-left: 0;
20
- }
21
-
22
- &[data-inverted="true"] {
23
- ${mq.range({ until: breakpoints.tablet })} {
24
- background: #fff;
25
- }
26
- }
27
- `;
28
-
29
- interface Props {
30
- children: ReactNode;
31
- invertedStyle?: boolean;
32
- }
33
-
34
- export const LearningPathWrapper = ({ children, invertedStyle }: Props) => (
35
- <StyledWrapper data-inverted={!!invertedStyle}>{children}</StyledWrapper>
36
- );
@@ -1,19 +0,0 @@
1
- /**
2
- * Copyright (c) 2019-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import LearningPathLastStepNavigation from "./LearningPathLastStepNavigation";
10
- import LearningPathMenu from "./LearningPathMenu";
11
- import LearningPathMobileHeader from "./LearningPathMobileHeader";
12
- import LearningPathMobileStepInfo from "./LearningPathMobileStepInfo";
13
-
14
- export { LearningPathWrapper } from "./LearningPathWrapper";
15
- export { LearningPathContent } from "./LearningPathContent";
16
- export { LearningPathMenu, LearningPathLastStepNavigation, LearningPathMobileStepInfo };
17
- export { LearningPathInformation } from "./LearningPathInformation";
18
- export { LearningPathSticky, LearningPathStickySibling, LearningPathStickyPlaceholder } from "./LearningPathSticky";
19
- export { LearningPathMobileHeader };
@@ -1,100 +0,0 @@
1
- /**
2
- * Copyright (c) 2016-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { ReactNode } from "react";
10
- import { css } from "@emotion/react";
11
- import styled from "@emotion/styled";
12
- import { breakpoints, colors, fonts, mq, spacing, stackOrder } from "@ndla/core";
13
- import SkipToMainContent from "./SkipToMainContent";
14
- import { MessageBanner } from "../Messages";
15
-
16
- const MastheadContent = styled.div`
17
- justify-content: center;
18
- align-items: center;
19
- text-align: center;
20
- padding: ${spacing.small} ${spacing.normal};
21
- font-weight: ${fonts.weight.normal};
22
- display: flex;
23
- height: 84px;
24
- justify-content: space-between;
25
- gap: ${spacing.xsmall};
26
- ${mq.range({ until: breakpoints.tablet })} {
27
- padding: ${spacing.small};
28
- gap: ${spacing.xsmall};
29
- }
30
- `;
31
-
32
- interface StyledMastheadProps {
33
- fixed: boolean;
34
- ndlaFilm: boolean;
35
- }
36
-
37
- const StyledMasthead = styled.div<StyledMastheadProps>`
38
- z-index: ${stackOrder.banner};
39
- position: relative;
40
- background: white;
41
- border-bottom: 1px solid ${colors.brand.greyLighter};
42
- min-height: 84px;
43
- display: flex;
44
- flex-flow: column;
45
- justify-content: flex-end;
46
- ${(p) =>
47
- p.fixed &&
48
- css`
49
- top: 0;
50
- position: sticky;
51
- @media print {
52
- position: relative;
53
- }
54
- `};
55
- ${(p) =>
56
- p.ndlaFilm &&
57
- css`
58
- background: ${colors.ndlaFilm.filmColorLight};
59
- background-image: linear-gradient(0deg, ${colors.ndlaFilm.filmColorLight}, ${colors.ndlaFilm.filmColor});
60
- border: 0;
61
- border-bottom: 1px solid #18334c;
62
- `};
63
- `;
64
-
65
- interface Alert {
66
- content: string;
67
- closable?: boolean;
68
- number: number;
69
- }
70
-
71
- interface Props {
72
- children?: ReactNode;
73
- fixed?: boolean;
74
- ndlaFilm?: boolean;
75
- skipToMainContentId?: string;
76
- messages?: Alert[];
77
- onCloseAlert?: (id: number) => void;
78
- }
79
-
80
- export const Masthead = ({ children, fixed, ndlaFilm, skipToMainContentId, messages, onCloseAlert }: Props) => {
81
- return (
82
- <>
83
- {skipToMainContentId && <SkipToMainContent skipToMainContentId={skipToMainContentId} />}
84
- <StyledMasthead fixed={!!fixed} ndlaFilm={!!ndlaFilm} id="masthead">
85
- {messages?.map((message) => (
86
- <MessageBanner
87
- key={message.number}
88
- showCloseButton={message.closable}
89
- onClose={() => onCloseAlert?.(message.number)}
90
- >
91
- {message.content}
92
- </MessageBanner>
93
- ))}
94
- <MastheadContent className="u-1/1">{children}</MastheadContent>
95
- </StyledMasthead>
96
- </>
97
- );
98
- };
99
-
100
- export default Masthead;
@@ -1,54 +0,0 @@
1
- /**
2
- * Copyright (c) 2022-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { useTranslation } from "react-i18next";
10
- import styled from "@emotion/styled";
11
- import { colors, stackOrder } from "@ndla/core";
12
-
13
- interface Props {
14
- skipToMainContentId: string;
15
- }
16
-
17
- const StyledSkipToMainContent = styled.a`
18
- position: absolute;
19
- top: 10px;
20
- left: 0;
21
- right: 0;
22
- margin: 0 auto;
23
- color: ${colors.white};
24
- background: ${colors.brand.primary};
25
- left: auto;
26
- top: auto;
27
- width: 30%;
28
- height: auto;
29
- overflow: auto;
30
- margin: 10px 35%;
31
- padding: 5px;
32
- border-radius: 15px;
33
- border: 4px solid ${colors.brand.tertiary};
34
- text-align: center;
35
- font-size: 1.2em;
36
- z-index: ${stackOrder.popover};
37
- animation-name: fadeIn;
38
- animation-duration: 0.3s;
39
- transform: translateY(-150%);
40
- &:focus {
41
- transform: translateY(0);
42
- }
43
- `;
44
-
45
- const SkipToMainContent = ({ skipToMainContentId }: Props) => {
46
- const { t } = useTranslation();
47
- return (
48
- <StyledSkipToMainContent tabIndex={0} href={`#${skipToMainContentId}`}>
49
- {t("masthead.skipToContent")}
50
- </StyledSkipToMainContent>
51
- );
52
- };
53
-
54
- export default SkipToMainContent;
@@ -1,16 +0,0 @@
1
- /**
2
- * Copyright (c) 2017-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import Masthead from "./Masthead";
10
-
11
- import { default as SkipToMainContent } from "./SkipToMainContent";
12
- import { getMastheadHeight, useMastheadHeight } from "./utils";
13
-
14
- export { getMastheadHeight, useMastheadHeight, SkipToMainContent };
15
-
16
- export default Masthead;
@@ -1,45 +0,0 @@
1
- /**
2
- * Copyright (c) 2022-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { useEffect, useState } from "react";
10
- import { resizeObserver } from "@ndla/util";
11
-
12
- export const getMastheadHeight = (): number | undefined => {
13
- if (typeof window !== "undefined") {
14
- const masthead = document.getElementById("masthead");
15
- return masthead?.getBoundingClientRect().height;
16
- }
17
- };
18
-
19
- export const useMastheadHeight = () => {
20
- const [height, setHeight] = useState<number>();
21
- const [mounted, setMounted] = useState(false);
22
-
23
- useEffect(() => {
24
- setMounted(true);
25
- }, []);
26
-
27
- useEffect(() => {
28
- if (mounted) {
29
- const masthead = document.getElementById("masthead");
30
-
31
- const handleHeightChange = (el: HTMLElement) => {
32
- const newHeight = el.getBoundingClientRect().height;
33
- setHeight(newHeight);
34
- };
35
-
36
- if (masthead) {
37
- resizeObserver(masthead, handleHeightChange);
38
- }
39
- }
40
- }, [mounted]);
41
-
42
- return {
43
- height,
44
- };
45
- };
@@ -1,27 +0,0 @@
1
- /**
2
- * Copyright (c) 2023-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { Meta, StoryObj } from "@storybook/react";
10
- import FolderInput from "./FolderInput";
11
-
12
- export default {
13
- title: "My NDLA/FolderInput",
14
- tags: ["autodocs"],
15
- component: FolderInput,
16
- parameters: {
17
- inlineStories: true,
18
- },
19
- args: {
20
- labelHidden: false,
21
- loading: false,
22
- label: "Create new folder",
23
- name: "folder",
24
- },
25
- } as Meta<typeof FolderInput>;
26
-
27
- export const Default: StoryObj = {};
@@ -1,89 +0,0 @@
1
- /**
2
- * Copyright (c) 2022-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { ComponentPropsWithRef, forwardRef, useEffect, useRef } from "react";
10
- import { isMobile } from "react-device-detect";
11
- import { useTranslation } from "react-i18next";
12
- import styled from "@emotion/styled";
13
- import { IconButtonV2 } from "@ndla/button";
14
- import { spacing } from "@ndla/core";
15
- import { InputContainer, FieldErrorMessage, InputV3, FieldHelper, FormControl, Label } from "@ndla/forms";
16
- import { Spinner } from "@ndla/icons";
17
- import { Cross } from "@ndla/icons/action";
18
- import { Done } from "@ndla/icons/editor";
19
- import { composeRefs } from "@ndla/util";
20
-
21
- interface Props {
22
- loading?: boolean;
23
- onClose?: () => void;
24
- onSave: () => void;
25
- error?: string;
26
- label: string;
27
- }
28
-
29
- const StyledSpinner = styled(Spinner)`
30
- margin: ${spacing.small};
31
- `;
32
-
33
- const Row = styled.div`
34
- display: flex;
35
- align-items: center;
36
- gap: ${spacing.xxsmall};
37
- padding-right: ${spacing.xsmall};
38
- `;
39
-
40
- const FolderInput = forwardRef<HTMLInputElement, Props & ComponentPropsWithRef<"input">>(
41
- ({ loading, label, error, onClose, onSave, ...rest }, ref) => {
42
- const { t } = useTranslation();
43
- const inputRef = useRef<HTMLInputElement | null>(null);
44
-
45
- useEffect(() => {
46
- if (isMobile) {
47
- inputRef.current?.scrollIntoView({ behavior: "smooth" });
48
- }
49
- }, []);
50
-
51
- return (
52
- <FormControl id="folder-name" isRequired isInvalid={!!error}>
53
- <Label visuallyHidden>{label}</Label>
54
- <FieldErrorMessage>{error}</FieldErrorMessage>
55
- <InputContainer>
56
- <InputV3 autoComplete="off" disabled={loading} ref={composeRefs(ref, inputRef)} {...rest} />
57
- <Row>
58
- {!loading ? (
59
- <>
60
- {!error && (
61
- <IconButtonV2
62
- variant={"ghost"}
63
- colorTheme="light"
64
- tabIndex={0}
65
- aria-label={t("save")}
66
- title={t("save")}
67
- size="small"
68
- onClick={onSave}
69
- >
70
- <Done />
71
- </IconButtonV2>
72
- )}
73
- <IconButtonV2 aria-label={t("close")} title={t("close")} size="small" variant="ghost" onClick={onClose}>
74
- <Cross />
75
- </IconButtonV2>
76
- </>
77
- ) : (
78
- <FieldHelper>
79
- <StyledSpinner size="normal" aria-label={t("loading")} />
80
- </FieldHelper>
81
- )}
82
- </Row>
83
- </InputContainer>
84
- </FormControl>
85
- );
86
- },
87
- );
88
-
89
- export default FolderInput;
@@ -1,160 +0,0 @@
1
- /**
2
- * Copyright (c) 2019-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { RefObject, useMemo, useRef } from "react";
10
- import { useTranslation } from "react-i18next";
11
- import styled from "@emotion/styled";
12
- import { breakpoints, mq, spacing, spacingUnit, colors } from "@ndla/core";
13
- import { SafeLink } from "@ndla/safelink";
14
- import { MovieType } from "./types";
15
- import { makeSrcQueryString } from "../Image";
16
-
17
- const IMAGE_WIDTH = 143;
18
-
19
- const Letter = styled.h2`
20
- color: ${colors.white};
21
- ${mq.range({ from: breakpoints.tablet })} {
22
- text-indent: ${spacingUnit * 0.75}px;
23
- }
24
- &:after {
25
- content: "";
26
- display: block;
27
- height: 1px;
28
- background: ${colors.brand.greyDark};
29
- margin-top: ${spacing.small};
30
- }
31
- `;
32
-
33
- const StyledWrapper = styled.section`
34
- width: 652px;
35
- max-width: 100%;
36
- margin: ${spacing.large} auto;
37
- padding: 0 ${spacing.normal};
38
- `;
39
-
40
- const MovieItem = styled.div`
41
- display: flex;
42
- gap: ${spacing.small};
43
- color: ${colors.white};
44
- `;
45
-
46
- const MovieTextWrapper = styled.div`
47
- ${mq.range({ from: breakpoints.tablet })} {
48
- padding: ${spacing.xsmall} ${spacing.xsmall} 0 0;
49
- }
50
- flex: 1;
51
- `;
52
-
53
- const MovieImage = styled.img`
54
- width: 104px;
55
- height: 80px;
56
- ${mq.range({ from: breakpoints.tablet })} {
57
- width: ${IMAGE_WIDTH}px;
58
- height: 90px;
59
- }
60
- `;
61
-
62
- const MovieTitle = styled.h3`
63
- color: ${colors.white};
64
- margin: 0;
65
- `;
66
-
67
- const MovieDescription = styled.p`
68
- color: ${colors.brand.greyLighter};
69
- margin: 0;
70
- overflow: hidden;
71
- text-overflow: ellipsis;
72
- display: -webkit-box;
73
- -webkit-box-orient: vertical;
74
- -webkit-line-clamp: 2;
75
- `;
76
-
77
- const StyledSafeLink = styled(SafeLink)`
78
- box-shadow: none;
79
- display: flex;
80
- gap: ${spacing.small};
81
- &:hover,
82
- &:focus {
83
- ${MovieTitle} {
84
- text-decoration: underline;
85
- }
86
- ${MovieImage} {
87
- &:after {
88
- transition: opacity 200ms ease;
89
- display: block;
90
- opacity: 0.3;
91
- }
92
- }
93
- }
94
- `;
95
-
96
- interface Props {
97
- movies: MovieType[];
98
- }
99
-
100
- const MovieGroup = styled.section`
101
- display: flex;
102
- flex-direction: column;
103
- gap: ${spacing.normal};
104
- `;
105
-
106
- const groupMovies = (movies: MovieType[]) => {
107
- const sortedMovies = movies.toSorted((a, b) => a.title.localeCompare(b.title));
108
-
109
- const grouped = sortedMovies.reduce<Record<string, MovieType[]>>((acc, movie) => {
110
- const firstChar = movie.title[0]?.toUpperCase();
111
- const isLetter = firstChar?.match(/[A-Z\WÆØÅ]+/);
112
- const char = isLetter ? firstChar : "#";
113
- if (acc[char]) {
114
- acc[char].push(movie);
115
- } else {
116
- acc[char] = [movie];
117
- }
118
- return acc;
119
- }, {});
120
- return Object.entries(grouped).map(([letter, movies]) => ({
121
- letter,
122
- movies,
123
- }));
124
- };
125
-
126
- const AllMoviesAlphabetically = ({ movies }: Props) => {
127
- const groupedMovies = useMemo(() => groupMovies(movies), [movies]);
128
- const { t } = useTranslation();
129
- // Split into Letters.
130
- const wrapperRef: RefObject<HTMLElement> = useRef(null);
131
-
132
- return (
133
- <StyledWrapper ref={wrapperRef}>
134
- {groupedMovies.map(({ letter, movies }) => (
135
- <MovieGroup key={letter}>
136
- <Letter aria-label={t("filmfrontpage.allMovieGroupTitleLabel", { letter })}>{letter}</Letter>
137
- {movies.map((movie) => (
138
- <MovieItem key={movie.id}>
139
- <StyledSafeLink to={movie.path}>
140
- <MovieImage
141
- alt=""
142
- loading="lazy"
143
- src={
144
- movie?.metaImage?.url ? `${movie.metaImage?.url}?${makeSrcQueryString(IMAGE_WIDTH * 2)}` : undefined
145
- }
146
- />
147
- <MovieTextWrapper>
148
- <MovieTitle>{movie.title}</MovieTitle>
149
- <MovieDescription>{movie.metaDescription}</MovieDescription>
150
- </MovieTextWrapper>
151
- </StyledSafeLink>
152
- </MovieItem>
153
- ))}
154
- </MovieGroup>
155
- ))}
156
- </StyledWrapper>
157
- );
158
- };
159
-
160
- export default AllMoviesAlphabetically;