@ndla/ui 51.0.0 → 52.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 (540) hide show
  1. package/README.md +2 -2
  2. package/es/Article/Article.js +12 -12
  3. package/es/Article/ArticleHeaderWrapper.js +0 -11
  4. package/es/Article/ArticleNotions.js +6 -6
  5. package/es/Article/ArticleParagraph.js +25 -0
  6. package/es/Article/index.js +1 -0
  7. package/es/AudioPlayer/AudioPlayer.js +13 -13
  8. package/es/AudioPlayer/Controls.js +22 -38
  9. package/es/Breadcrumb/Breadcrumb.js +2 -33
  10. package/es/Breadcrumb/BreadcrumbItem.js +16 -29
  11. package/es/Breadcrumb/index.js +0 -1
  12. package/es/CodeBlock/CodeBlock.js +115 -0
  13. package/es/CodeBlock/codeLanguageOptions.js +84 -0
  14. package/es/CodeBlock/index.js +10 -0
  15. package/es/CreatedBy/CreatedBy.js +4 -4
  16. package/es/Embed/BrightcoveEmbed.js +3 -3
  17. package/es/Embed/CodeEmbed.js +2 -2
  18. package/es/Embed/ConceptEmbed.js +37 -33
  19. package/es/Embed/ExternalEmbed.js +2 -2
  20. package/es/Embed/IframeEmbed.js +1 -1
  21. package/es/Embed/ImageEmbed.js +17 -14
  22. package/es/Embed/RelatedContentEmbed.js +3 -3
  23. package/es/Embed/UuDisclaimerEmbed.js +4 -3
  24. package/es/Embed/conceptComponents.js +10 -10
  25. package/es/Figure/Figure.js +32 -19
  26. package/es/FrontpageArticle/FrontpageArticle.js +3 -3
  27. package/es/Gloss/Gloss.js +12 -10
  28. package/es/Hero/Hero.js +1 -1
  29. package/es/Image/Image.js +3 -3
  30. package/es/LanguageSelector/LanguageSelector.js +5 -5
  31. package/es/Layout/LayoutItem.js +2 -1
  32. package/es/Layout/OneColumn.js +22 -28
  33. package/es/Layout/PageContainer.js +21 -17
  34. package/es/LicenseByline/LicenseLink.js +5 -6
  35. package/es/Messages/MessageBox.js +9 -7
  36. package/es/MyNdla/Resource/index.js +1 -2
  37. package/es/MyNdla/index.js +1 -2
  38. package/es/Notion/Notion.js +4 -4
  39. package/es/Resource/BlockResource.js +13 -15
  40. package/es/Resource/ListResource.js +13 -15
  41. package/es/Search/ContentTypeResult.js +4 -4
  42. package/es/Search/SearchResult.js +11 -11
  43. package/es/Search/SearchResultSleeve.js +16 -16
  44. package/es/TreeStructure/TreeStructure.js +6 -6
  45. package/es/all.css +1 -1
  46. package/es/index.js +5 -19
  47. package/es/locale/messages-en.js +12 -2
  48. package/es/locale/messages-nb.js +12 -2
  49. package/es/locale/messages-nn.js +13 -3
  50. package/es/locale/messages-se.js +11 -1
  51. package/es/locale/messages-sma.js +12 -2
  52. package/es/types.js +0 -9
  53. package/lib/Article/Article.d.ts +5 -7
  54. package/lib/Article/Article.js +12 -12
  55. package/lib/Article/ArticleHeaderWrapper.js +0 -11
  56. package/lib/Article/ArticleNotions.js +5 -5
  57. package/lib/Article/ArticleParagraph.d.ts +13 -0
  58. package/lib/Article/ArticleParagraph.js +32 -0
  59. package/lib/Article/index.d.ts +1 -0
  60. package/lib/Article/index.js +7 -0
  61. package/lib/AudioPlayer/AudioPlayer.js +13 -13
  62. package/lib/AudioPlayer/Controls.js +21 -37
  63. package/lib/Breadcrumb/Breadcrumb.d.ts +1 -2
  64. package/lib/Breadcrumb/Breadcrumb.js +2 -33
  65. package/lib/Breadcrumb/BreadcrumbItem.js +16 -29
  66. package/lib/Breadcrumb/index.d.ts +0 -1
  67. package/lib/Breadcrumb/index.js +0 -7
  68. package/lib/CodeBlock/CodeBlock.d.ts +18 -0
  69. package/lib/CodeBlock/CodeBlock.js +121 -0
  70. package/lib/{Navigation/index.d.ts → CodeBlock/codeLanguageOptions.d.ts} +5 -2
  71. package/lib/CodeBlock/codeLanguageOptions.js +90 -0
  72. package/lib/CodeBlock/index.d.ts +9 -0
  73. package/lib/CodeBlock/index.js +20 -0
  74. package/lib/CreatedBy/CreatedBy.js +4 -4
  75. package/lib/Embed/BrightcoveEmbed.js +3 -3
  76. package/lib/Embed/CodeEmbed.js +2 -2
  77. package/lib/Embed/ConceptEmbed.d.ts +1 -1
  78. package/lib/Embed/ConceptEmbed.js +36 -33
  79. package/lib/Embed/ExternalEmbed.js +2 -2
  80. package/lib/Embed/IframeEmbed.js +1 -1
  81. package/lib/Embed/ImageEmbed.js +17 -14
  82. package/lib/Embed/RelatedContentEmbed.js +3 -3
  83. package/lib/Embed/UuDisclaimerEmbed.js +4 -3
  84. package/lib/Embed/conceptComponents.js +10 -10
  85. package/lib/Figure/Figure.d.ts +2 -5
  86. package/lib/Figure/Figure.js +32 -23
  87. package/lib/FrontpageArticle/FrontpageArticle.js +3 -3
  88. package/lib/Gloss/Gloss.js +12 -10
  89. package/lib/Hero/Hero.js +1 -1
  90. package/lib/Image/Image.js +2 -2
  91. package/lib/LanguageSelector/LanguageSelector.js +5 -5
  92. package/lib/Layout/LayoutItem.js +2 -1
  93. package/lib/Layout/OneColumn.d.ts +3 -8
  94. package/lib/Layout/OneColumn.js +22 -30
  95. package/lib/Layout/PageContainer.d.ts +3 -7
  96. package/lib/Layout/PageContainer.js +21 -19
  97. package/lib/LicenseByline/LicenseLink.js +5 -6
  98. package/lib/Messages/MessageBox.d.ts +2 -1
  99. package/lib/Messages/MessageBox.js +9 -7
  100. package/lib/MyNdla/Resource/index.d.ts +1 -2
  101. package/lib/MyNdla/Resource/index.js +0 -7
  102. package/lib/MyNdla/index.d.ts +1 -2
  103. package/lib/MyNdla/index.js +0 -7
  104. package/lib/Notion/Notion.js +4 -4
  105. package/lib/Resource/BlockResource.js +13 -15
  106. package/lib/Resource/ListResource.js +13 -15
  107. package/lib/Search/ContentTypeResult.js +4 -4
  108. package/lib/Search/SearchResult.js +10 -10
  109. package/lib/Search/SearchResultSleeve.js +16 -16
  110. package/lib/TreeStructure/TreeStructure.js +6 -6
  111. package/lib/all.css +1 -1
  112. package/lib/index.d.ts +4 -19
  113. package/lib/index.js +17 -229
  114. package/lib/locale/messages-en.d.ts +10 -0
  115. package/lib/locale/messages-en.js +12 -2
  116. package/lib/locale/messages-nb.d.ts +10 -0
  117. package/lib/locale/messages-nb.js +12 -2
  118. package/lib/locale/messages-nn.d.ts +10 -0
  119. package/lib/locale/messages-nn.js +13 -3
  120. package/lib/locale/messages-se.d.ts +10 -0
  121. package/lib/locale/messages-se.js +11 -1
  122. package/lib/locale/messages-sma.d.ts +10 -0
  123. package/lib/locale/messages-sma.js +12 -2
  124. package/lib/types.d.ts +0 -51
  125. package/lib/types.js +1 -10
  126. package/package.json +16 -21
  127. package/src/Article/Article.tsx +14 -18
  128. package/src/Article/ArticleHeaderWrapper.tsx +1 -12
  129. package/src/Article/ArticleNotions.tsx +3 -3
  130. package/src/Article/ArticleParagraph.tsx +22 -0
  131. package/src/Article/component.article.scss +0 -7
  132. package/src/Article/index.ts +2 -0
  133. package/src/AudioPlayer/AudioPlayer.tsx +2 -2
  134. package/src/AudioPlayer/Controls.tsx +5 -5
  135. package/src/Breadcrumb/Breadcrumb.stories.tsx +0 -4
  136. package/src/Breadcrumb/Breadcrumb.tsx +1 -38
  137. package/src/Breadcrumb/BreadcrumbItem.tsx +5 -19
  138. package/src/Breadcrumb/index.ts +0 -2
  139. package/src/CodeBlock/CodeBlock.stories.tsx +113 -0
  140. package/src/CodeBlock/CodeBlock.tsx +228 -0
  141. package/src/CodeBlock/codeLanguageOptions.ts +115 -0
  142. package/src/CodeBlock/index.ts +10 -0
  143. package/src/CreatedBy/CreatedBy.tsx +2 -2
  144. package/src/Embed/AudioEmbed.stories.tsx +6 -4
  145. package/src/Embed/BrightcoveEmbed.stories.tsx +6 -4
  146. package/src/Embed/BrightcoveEmbed.tsx +2 -2
  147. package/src/Embed/CodeEmbed.tsx +2 -2
  148. package/src/Embed/ConceptEmbed.stories.tsx +6 -4
  149. package/src/Embed/ConceptEmbed.tsx +103 -96
  150. package/src/Embed/ExternalEmbed.stories.tsx +6 -4
  151. package/src/Embed/ExternalEmbed.tsx +2 -2
  152. package/src/Embed/H5pEmbed.stories.tsx +6 -4
  153. package/src/Embed/IframeEmbed.stories.tsx +6 -4
  154. package/src/Embed/IframeEmbed.tsx +1 -1
  155. package/src/Embed/ImageEmbed.stories.tsx +6 -4
  156. package/src/Embed/ImageEmbed.tsx +19 -11
  157. package/src/Embed/RelatedContentEmbed.stories.tsx +6 -4
  158. package/src/Embed/RelatedContentEmbed.tsx +3 -3
  159. package/src/Embed/UuDisclaimerEmbed.stories.tsx +23 -4
  160. package/src/Embed/UuDisclaimerEmbed.tsx +1 -1
  161. package/src/Embed/conceptComponents.tsx +1 -0
  162. package/src/Figure/Figure.tsx +57 -18
  163. package/src/Footer/Footer.stories.tsx +1 -1
  164. package/src/FrontpageArticle/FrontpageArticle.tsx +3 -3
  165. package/src/Gloss/Gloss.tsx +4 -2
  166. package/src/Hero/Hero.tsx +1 -1
  167. package/src/Image/Image.tsx +2 -2
  168. package/src/LanguageSelector/LanguageSelector.tsx +1 -1
  169. package/src/Layout/LayoutItem.tsx +2 -1
  170. package/src/Layout/OneColumn.tsx +25 -35
  171. package/src/Layout/PageContainer.tsx +19 -23
  172. package/src/LicenseByline/LicenseLink.tsx +1 -2
  173. package/src/Messages/MessageBox.tsx +3 -2
  174. package/src/MyNdla/Resource/index.ts +1 -2
  175. package/src/MyNdla/index.ts +1 -2
  176. package/src/Notion/Notion.tsx +2 -2
  177. package/src/Resource/BlockResource.tsx +4 -8
  178. package/src/Resource/ListResource.tsx +4 -6
  179. package/src/Search/ContentTypeResult.tsx +4 -4
  180. package/src/Search/SearchResult.tsx +2 -2
  181. package/src/Search/SearchResultSleeve.tsx +7 -9
  182. package/src/Table/Table.stories.tsx +8 -8
  183. package/src/TreeStructure/TreeStructure.stories.tsx +85 -28
  184. package/src/TreeStructure/TreeStructure.tsx +1 -1
  185. package/src/index.ts +5 -46
  186. package/src/locale/messages-en.ts +14 -1
  187. package/src/locale/messages-nb.ts +14 -1
  188. package/src/locale/messages-nn.ts +15 -2
  189. package/src/locale/messages-se.ts +13 -0
  190. package/src/locale/messages-sma.ts +14 -1
  191. package/src/main.scss +0 -2
  192. package/src/types.ts +0 -62
  193. package/es/Article/ArticleAccessMessage.js +0 -43
  194. package/es/Aside/Aside.js +0 -75
  195. package/es/Aside/index.js +0 -10
  196. package/es/BannerCard/BannerCard.js +0 -84
  197. package/es/BannerCard/index.js +0 -10
  198. package/es/Breadcrumb/HeaderBreadcrumb.js +0 -57
  199. package/es/CompetenceGoalTab/CompetenceGoalItem.js +0 -42
  200. package/es/CompetenceGoalTab/CompetenceGoalTab.js +0 -75
  201. package/es/CompetenceGoalTab/CompetenceItem.js +0 -108
  202. package/es/CompetenceGoalTab/CoreElementItem.js +0 -44
  203. package/es/CompetenceGoalTab/SearchButton.js +0 -43
  204. package/es/CompetenceGoalTab/index.js +0 -10
  205. package/es/CompetenceGoalTab/styles.js +0 -57
  206. package/es/Filter/FilterButtons.js +0 -185
  207. package/es/Filter/FilterCarousel.js +0 -166
  208. package/es/Filter/ToggleItem.js +0 -68
  209. package/es/Filter/index.js +0 -10
  210. package/es/Frontpage/FrontpageAllSubjects.js +0 -254
  211. package/es/LearningPaths/LearningPathContent.js +0 -25
  212. package/es/LearningPaths/LearningPathInformation.js +0 -74
  213. package/es/LearningPaths/LearningPathLastStepNavigation.js +0 -65
  214. package/es/LearningPaths/LearningPathMenu.js +0 -103
  215. package/es/LearningPaths/LearningPathMenuAside.js +0 -62
  216. package/es/LearningPaths/LearningPathMenuContent.js +0 -109
  217. package/es/LearningPaths/LearningPathMenuIntro.js +0 -72
  218. package/es/LearningPaths/LearningPathMenuModalWrapper.js +0 -63
  219. package/es/LearningPaths/LearningPathMobileHeader.js +0 -35
  220. package/es/LearningPaths/LearningPathMobileStepInfo.js +0 -34
  221. package/es/LearningPaths/LearningPathSticky.js +0 -74
  222. package/es/LearningPaths/LearningPathWrapper.js +0 -27
  223. package/es/LearningPaths/index.js +0 -18
  224. package/es/MyNdla/Resource/FolderInput.js +0 -94
  225. package/es/NDLAFilm/AllMoviesAlphabetically.js +0 -127
  226. package/es/NDLAFilm/FilmContentCard.js +0 -93
  227. package/es/NDLAFilm/FilmContentCardTags.js +0 -44
  228. package/es/NDLAFilm/FilmMovieList.js +0 -52
  229. package/es/NDLAFilm/FilmMovieSearch.js +0 -106
  230. package/es/NDLAFilm/FilmSlideshow.js +0 -138
  231. package/es/NDLAFilm/MovieGrid.js +0 -54
  232. package/es/NDLAFilm/VisualElement.js +0 -48
  233. package/es/NDLAFilm/filmStyles.js +0 -31
  234. package/es/NDLAFilm/index.js +0 -14
  235. package/es/NDLAFilm/isLetter.js +0 -13
  236. package/es/NDLAFilm/types.js +0 -1
  237. package/es/Navigation/NavigationBox.js +0 -187
  238. package/es/Navigation/index.js +0 -10
  239. package/es/NoContentBox/NoContentBox.js +0 -31
  240. package/es/NoContentBox/index.js +0 -10
  241. package/es/Programme/Programme.js +0 -104
  242. package/es/Programme/ProgrammeSubjects.js +0 -60
  243. package/es/Programme/index.js +0 -12
  244. package/es/ResourceGroup/ResourceGroup.js +0 -46
  245. package/es/ResourceGroup/ResourceItem.js +0 -196
  246. package/es/ResourceGroup/ResourceList.js +0 -57
  247. package/es/ResourceGroup/index.js +0 -10
  248. package/es/ResourcesWrapper/ResourcesTopicTitle.js +0 -160
  249. package/es/ResourcesWrapper/ResourcesWrapper.js +0 -27
  250. package/es/ResourcesWrapper/index.js +0 -11
  251. package/es/SearchTypeResult/ActiveFilterContent.js +0 -53
  252. package/es/SearchTypeResult/ActiveFilters.js +0 -124
  253. package/es/SearchTypeResult/PopupFilter.js +0 -133
  254. package/es/SearchTypeResult/ResultNavigation.js +0 -75
  255. package/es/SearchTypeResult/SearchFieldHeader.js +0 -103
  256. package/es/SearchTypeResult/SearchFilterContent.js +0 -59
  257. package/es/SearchTypeResult/SearchHeader.js +0 -160
  258. package/es/SearchTypeResult/SearchItem.js +0 -97
  259. package/es/SearchTypeResult/SearchItemList.js +0 -142
  260. package/es/SearchTypeResult/SearchItems.js +0 -60
  261. package/es/SearchTypeResult/SearchSubjectItem.js +0 -62
  262. package/es/SearchTypeResult/SearchSubjectResult.js +0 -34
  263. package/es/SearchTypeResult/SearchTypeHeader.js +0 -118
  264. package/es/SearchTypeResult/SearchTypeResult.js +0 -55
  265. package/es/SearchTypeResult/SearchViewType.js +0 -90
  266. package/es/SearchTypeResult/components/ItemContexts.js +0 -122
  267. package/es/SearchTypeResult/components/ItemResourceHeader.js +0 -96
  268. package/es/SearchTypeResult/components/ItemTopicHeader.js +0 -66
  269. package/es/SearchTypeResult/components/SubjectFilters.js +0 -130
  270. package/es/SearchTypeResult/index.js +0 -14
  271. package/es/Subject/SubjectBanner.js +0 -30
  272. package/es/Subject/index.js +0 -9
  273. package/es/ToolboxPage/ToolboxInfo.js +0 -43
  274. package/es/ToolboxPage/index.js +0 -10
  275. package/es/Topic/Loader.js +0 -107
  276. package/es/Topic/Topic.js +0 -221
  277. package/es/Topic/index.js +0 -10
  278. package/es/locale/LocaleProvider.js +0 -38
  279. package/lib/Article/ArticleAccessMessage.d.ts +0 -12
  280. package/lib/Article/ArticleAccessMessage.js +0 -50
  281. package/lib/Aside/Aside.d.ts +0 -15
  282. package/lib/Aside/Aside.js +0 -80
  283. package/lib/Aside/index.d.ts +0 -9
  284. package/lib/Aside/index.js +0 -16
  285. package/lib/BannerCard/BannerCard.d.ts +0 -29
  286. package/lib/BannerCard/BannerCard.js +0 -92
  287. package/lib/BannerCard/index.d.ts +0 -9
  288. package/lib/BannerCard/index.js +0 -13
  289. package/lib/Breadcrumb/HeaderBreadcrumb.d.ts +0 -14
  290. package/lib/Breadcrumb/HeaderBreadcrumb.js +0 -64
  291. package/lib/CompetenceGoalTab/CompetenceGoalItem.d.ts +0 -10
  292. package/lib/CompetenceGoalTab/CompetenceGoalItem.js +0 -49
  293. package/lib/CompetenceGoalTab/CompetenceGoalTab.d.ts +0 -14
  294. package/lib/CompetenceGoalTab/CompetenceGoalTab.js +0 -82
  295. package/lib/CompetenceGoalTab/CompetenceItem.d.ts +0 -30
  296. package/lib/CompetenceGoalTab/CompetenceItem.js +0 -113
  297. package/lib/CompetenceGoalTab/CoreElementItem.d.ts +0 -10
  298. package/lib/CompetenceGoalTab/CoreElementItem.js +0 -51
  299. package/lib/CompetenceGoalTab/SearchButton.d.ts +0 -14
  300. package/lib/CompetenceGoalTab/SearchButton.js +0 -50
  301. package/lib/CompetenceGoalTab/index.d.ts +0 -9
  302. package/lib/CompetenceGoalTab/index.js +0 -16
  303. package/lib/CompetenceGoalTab/styles.d.ts +0 -28
  304. package/lib/CompetenceGoalTab/styles.js +0 -62
  305. package/lib/Filter/FilterButtons.d.ts +0 -16
  306. package/lib/Filter/FilterButtons.js +0 -192
  307. package/lib/Filter/FilterCarousel.d.ts +0 -13
  308. package/lib/Filter/FilterCarousel.js +0 -171
  309. package/lib/Filter/ToggleItem.d.ts +0 -21
  310. package/lib/Filter/ToggleItem.js +0 -75
  311. package/lib/Filter/index.d.ts +0 -9
  312. package/lib/Filter/index.js +0 -20
  313. package/lib/Frontpage/FrontpageAllSubjects.d.ts +0 -27
  314. package/lib/Frontpage/FrontpageAllSubjects.js +0 -259
  315. package/lib/LearningPaths/LearningPathContent.d.ts +0 -13
  316. package/lib/LearningPaths/LearningPathContent.js +0 -33
  317. package/lib/LearningPaths/LearningPathInformation.d.ts +0 -18
  318. package/lib/LearningPaths/LearningPathInformation.js +0 -80
  319. package/lib/LearningPaths/LearningPathLastStepNavigation.d.ts +0 -22
  320. package/lib/LearningPaths/LearningPathLastStepNavigation.js +0 -72
  321. package/lib/LearningPaths/LearningPathMenu.d.ts +0 -38
  322. package/lib/LearningPaths/LearningPathMenu.js +0 -110
  323. package/lib/LearningPaths/LearningPathMenuAside.d.ts +0 -24
  324. package/lib/LearningPaths/LearningPathMenuAside.js +0 -69
  325. package/lib/LearningPaths/LearningPathMenuContent.d.ts +0 -22
  326. package/lib/LearningPaths/LearningPathMenuContent.js +0 -116
  327. package/lib/LearningPaths/LearningPathMenuIntro.d.ts +0 -17
  328. package/lib/LearningPaths/LearningPathMenuIntro.js +0 -77
  329. package/lib/LearningPaths/LearningPathMenuModalWrapper.d.ts +0 -14
  330. package/lib/LearningPaths/LearningPathMenuModalWrapper.js +0 -70
  331. package/lib/LearningPaths/LearningPathMobileHeader.d.ts +0 -9
  332. package/lib/LearningPaths/LearningPathMobileHeader.js +0 -42
  333. package/lib/LearningPaths/LearningPathMobileStepInfo.d.ts +0 -13
  334. package/lib/LearningPaths/LearningPathMobileStepInfo.js +0 -41
  335. package/lib/LearningPaths/LearningPathSticky.d.ts +0 -22
  336. package/lib/LearningPaths/LearningPathSticky.js +0 -84
  337. package/lib/LearningPaths/LearningPathWrapper.d.ts +0 -14
  338. package/lib/LearningPaths/LearningPathWrapper.js +0 -35
  339. package/lib/LearningPaths/index.d.ts +0 -17
  340. package/lib/LearningPaths/index.js +0 -74
  341. package/lib/MyNdla/Resource/FolderInput.d.ts +0 -19
  342. package/lib/MyNdla/Resource/FolderInput.js +0 -101
  343. package/lib/NDLAFilm/AllMoviesAlphabetically.d.ts +0 -13
  344. package/lib/NDLAFilm/AllMoviesAlphabetically.js +0 -134
  345. package/lib/NDLAFilm/FilmContentCard.d.ts +0 -19
  346. package/lib/NDLAFilm/FilmContentCard.js +0 -98
  347. package/lib/NDLAFilm/FilmContentCardTags.d.ts +0 -15
  348. package/lib/NDLAFilm/FilmContentCardTags.js +0 -51
  349. package/lib/NDLAFilm/FilmMovieList.d.ts +0 -17
  350. package/lib/NDLAFilm/FilmMovieList.js +0 -59
  351. package/lib/NDLAFilm/FilmMovieSearch.d.ts +0 -21
  352. package/lib/NDLAFilm/FilmMovieSearch.js +0 -113
  353. package/lib/NDLAFilm/FilmSlideshow.d.ts +0 -13
  354. package/lib/NDLAFilm/FilmSlideshow.js +0 -143
  355. package/lib/NDLAFilm/MovieGrid.d.ts +0 -17
  356. package/lib/NDLAFilm/MovieGrid.js +0 -61
  357. package/lib/NDLAFilm/VisualElement.d.ts +0 -16
  358. package/lib/NDLAFilm/VisualElement.js +0 -53
  359. package/lib/NDLAFilm/filmStyles.d.ts +0 -17
  360. package/lib/NDLAFilm/filmStyles.js +0 -39
  361. package/lib/NDLAFilm/index.d.ts +0 -13
  362. package/lib/NDLAFilm/index.js +0 -41
  363. package/lib/NDLAFilm/isLetter.d.ts +0 -8
  364. package/lib/NDLAFilm/isLetter.js +0 -20
  365. package/lib/NDLAFilm/types.d.ts +0 -22
  366. package/lib/NDLAFilm/types.js +0 -5
  367. package/lib/Navigation/NavigationBox.d.ts +0 -30
  368. package/lib/Navigation/NavigationBox.js +0 -193
  369. package/lib/Navigation/index.js +0 -13
  370. package/lib/NoContentBox/NoContentBox.d.ts +0 -14
  371. package/lib/NoContentBox/NoContentBox.js +0 -38
  372. package/lib/NoContentBox/index.d.ts +0 -9
  373. package/lib/NoContentBox/index.js +0 -16
  374. package/lib/Programme/Programme.d.ts +0 -16
  375. package/lib/Programme/Programme.js +0 -112
  376. package/lib/Programme/ProgrammeSubjects.d.ts +0 -26
  377. package/lib/Programme/ProgrammeSubjects.js +0 -67
  378. package/lib/Programme/index.d.ts +0 -11
  379. package/lib/Programme/index.js +0 -23
  380. package/lib/ResourceGroup/ResourceGroup.d.ts +0 -18
  381. package/lib/ResourceGroup/ResourceGroup.js +0 -53
  382. package/lib/ResourceGroup/ResourceItem.d.ts +0 -22
  383. package/lib/ResourceGroup/ResourceItem.js +0 -203
  384. package/lib/ResourceGroup/ResourceList.d.ts +0 -19
  385. package/lib/ResourceGroup/ResourceList.js +0 -64
  386. package/lib/ResourceGroup/index.d.ts +0 -9
  387. package/lib/ResourceGroup/index.js +0 -16
  388. package/lib/ResourcesWrapper/ResourcesTopicTitle.d.ts +0 -20
  389. package/lib/ResourcesWrapper/ResourcesTopicTitle.js +0 -165
  390. package/lib/ResourcesWrapper/ResourcesWrapper.d.ts +0 -16
  391. package/lib/ResourcesWrapper/ResourcesWrapper.js +0 -34
  392. package/lib/ResourcesWrapper/index.d.ts +0 -10
  393. package/lib/ResourcesWrapper/index.js +0 -23
  394. package/lib/SearchTypeResult/ActiveFilterContent.d.ts +0 -23
  395. package/lib/SearchTypeResult/ActiveFilterContent.js +0 -58
  396. package/lib/SearchTypeResult/ActiveFilters.d.ts +0 -18
  397. package/lib/SearchTypeResult/ActiveFilters.js +0 -131
  398. package/lib/SearchTypeResult/PopupFilter.d.ts +0 -26
  399. package/lib/SearchTypeResult/PopupFilter.js +0 -138
  400. package/lib/SearchTypeResult/ResultNavigation.d.ts +0 -18
  401. package/lib/SearchTypeResult/ResultNavigation.js +0 -82
  402. package/lib/SearchTypeResult/SearchFieldHeader.d.ts +0 -17
  403. package/lib/SearchTypeResult/SearchFieldHeader.js +0 -109
  404. package/lib/SearchTypeResult/SearchFilterContent.d.ts +0 -16
  405. package/lib/SearchTypeResult/SearchFilterContent.js +0 -64
  406. package/lib/SearchTypeResult/SearchHeader.d.ts +0 -26
  407. package/lib/SearchTypeResult/SearchHeader.js +0 -166
  408. package/lib/SearchTypeResult/SearchItem.d.ts +0 -30
  409. package/lib/SearchTypeResult/SearchItem.js +0 -104
  410. package/lib/SearchTypeResult/SearchItemList.d.ts +0 -10
  411. package/lib/SearchTypeResult/SearchItemList.js +0 -147
  412. package/lib/SearchTypeResult/SearchItems.d.ts +0 -17
  413. package/lib/SearchTypeResult/SearchItems.js +0 -65
  414. package/lib/SearchTypeResult/SearchSubjectItem.d.ts +0 -20
  415. package/lib/SearchTypeResult/SearchSubjectItem.js +0 -67
  416. package/lib/SearchTypeResult/SearchSubjectResult.d.ts +0 -13
  417. package/lib/SearchTypeResult/SearchSubjectResult.js +0 -41
  418. package/lib/SearchTypeResult/SearchTypeHeader.d.ts +0 -22
  419. package/lib/SearchTypeResult/SearchTypeHeader.js +0 -123
  420. package/lib/SearchTypeResult/SearchTypeResult.d.ts +0 -26
  421. package/lib/SearchTypeResult/SearchTypeResult.js +0 -62
  422. package/lib/SearchTypeResult/SearchViewType.d.ts +0 -13
  423. package/lib/SearchTypeResult/SearchViewType.js +0 -95
  424. package/lib/SearchTypeResult/components/ItemContexts.d.ts +0 -19
  425. package/lib/SearchTypeResult/components/ItemContexts.js +0 -127
  426. package/lib/SearchTypeResult/components/ItemResourceHeader.d.ts +0 -16
  427. package/lib/SearchTypeResult/components/ItemResourceHeader.js +0 -101
  428. package/lib/SearchTypeResult/components/ItemTopicHeader.d.ts +0 -17
  429. package/lib/SearchTypeResult/components/ItemTopicHeader.js +0 -71
  430. package/lib/SearchTypeResult/components/SubjectFilters.d.ts +0 -32
  431. package/lib/SearchTypeResult/components/SubjectFilters.js +0 -135
  432. package/lib/SearchTypeResult/index.d.ts +0 -14
  433. package/lib/SearchTypeResult/index.js +0 -41
  434. package/lib/Subject/SubjectBanner.d.ts +0 -14
  435. package/lib/Subject/SubjectBanner.js +0 -37
  436. package/lib/Subject/index.d.ts +0 -8
  437. package/lib/Subject/index.js +0 -13
  438. package/lib/ToolboxPage/ToolboxInfo.d.ts +0 -18
  439. package/lib/ToolboxPage/ToolboxInfo.js +0 -49
  440. package/lib/ToolboxPage/index.d.ts +0 -9
  441. package/lib/ToolboxPage/index.js +0 -13
  442. package/lib/Topic/Loader.d.ts +0 -9
  443. package/lib/Topic/Loader.js +0 -114
  444. package/lib/Topic/Topic.d.ts +0 -34
  445. package/lib/Topic/Topic.js +0 -228
  446. package/lib/Topic/index.d.ts +0 -10
  447. package/lib/Topic/index.js +0 -16
  448. package/lib/locale/LocaleProvider.d.ts +0 -15
  449. package/lib/locale/LocaleProvider.js +0 -44
  450. package/src/Article/ArticleAccessMessage.tsx +0 -44
  451. package/src/Aside/Aside.tsx +0 -113
  452. package/src/Aside/index.ts +0 -11
  453. package/src/BannerCard/BannerCard.tsx +0 -99
  454. package/src/BannerCard/index.ts +0 -11
  455. package/src/Breadcrumb/HeaderBreadcrumb.tsx +0 -56
  456. package/src/CompetenceGoalTab/CompetenceGoalItem.tsx +0 -39
  457. package/src/CompetenceGoalTab/CompetenceGoalTab.tsx +0 -85
  458. package/src/CompetenceGoalTab/CompetenceItem.tsx +0 -130
  459. package/src/CompetenceGoalTab/CoreElementItem.tsx +0 -39
  460. package/src/CompetenceGoalTab/SearchButton.tsx +0 -50
  461. package/src/CompetenceGoalTab/index.ts +0 -10
  462. package/src/CompetenceGoalTab/styles.ts +0 -37
  463. package/src/Figure/component.figure.scss +0 -60
  464. package/src/Filter/FilterButtons.tsx +0 -199
  465. package/src/Filter/FilterCarousel.tsx +0 -172
  466. package/src/Filter/ToggleItem.tsx +0 -180
  467. package/src/Filter/index.ts +0 -10
  468. package/src/Frontpage/FrontpageAllSubjects.tsx +0 -231
  469. package/src/LearningPaths/LearningPathContent.tsx +0 -33
  470. package/src/LearningPaths/LearningPathInformation.tsx +0 -82
  471. package/src/LearningPaths/LearningPathLastStepNavigation.tsx +0 -89
  472. package/src/LearningPaths/LearningPathMenu.stories.tsx +0 -65
  473. package/src/LearningPaths/LearningPathMenu.tsx +0 -166
  474. package/src/LearningPaths/LearningPathMenuAside.tsx +0 -100
  475. package/src/LearningPaths/LearningPathMenuContent.tsx +0 -277
  476. package/src/LearningPaths/LearningPathMenuIntro.tsx +0 -126
  477. package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +0 -71
  478. package/src/LearningPaths/LearningPathMobileHeader.tsx +0 -37
  479. package/src/LearningPaths/LearningPathMobileStepInfo.tsx +0 -38
  480. package/src/LearningPaths/LearningPathSticky.tsx +0 -122
  481. package/src/LearningPaths/LearningPathWrapper.tsx +0 -36
  482. package/src/LearningPaths/index.ts +0 -19
  483. package/src/MyNdla/Resource/FolderInput.stories.tsx +0 -27
  484. package/src/MyNdla/Resource/FolderInput.tsx +0 -89
  485. package/src/NDLAFilm/AllMoviesAlphabetically.tsx +0 -160
  486. package/src/NDLAFilm/FilmContentCard.tsx +0 -138
  487. package/src/NDLAFilm/FilmContentCardTags.tsx +0 -57
  488. package/src/NDLAFilm/FilmMovieList.tsx +0 -54
  489. package/src/NDLAFilm/FilmMovieSearch.tsx +0 -135
  490. package/src/NDLAFilm/FilmSlideshow.tsx +0 -177
  491. package/src/NDLAFilm/MovieGrid.tsx +0 -86
  492. package/src/NDLAFilm/VisualElement.tsx +0 -38
  493. package/src/NDLAFilm/__tests__/isLetter-test.ts +0 -20
  494. package/src/NDLAFilm/filmStyles.ts +0 -49
  495. package/src/NDLAFilm/index.ts +0 -15
  496. package/src/NDLAFilm/isLetter.ts +0 -13
  497. package/src/NDLAFilm/types.ts +0 -24
  498. package/src/Navigation/NavigationBox.tsx +0 -252
  499. package/src/Navigation/index.ts +0 -11
  500. package/src/NoContentBox/NoContentBox.tsx +0 -32
  501. package/src/NoContentBox/index.ts +0 -11
  502. package/src/Programme/Programme.tsx +0 -101
  503. package/src/Programme/ProgrammeSubjects.tsx +0 -83
  504. package/src/Programme/index.ts +0 -13
  505. package/src/ResourceGroup/ResourceGroup.tsx +0 -65
  506. package/src/ResourceGroup/ResourceItem.stories.tsx +0 -101
  507. package/src/ResourceGroup/ResourceItem.tsx +0 -318
  508. package/src/ResourceGroup/ResourceList.tsx +0 -80
  509. package/src/ResourceGroup/index.ts +0 -11
  510. package/src/ResourcesWrapper/ResourcesTopicTitle.tsx +0 -223
  511. package/src/ResourcesWrapper/ResourcesWrapper.tsx +0 -32
  512. package/src/ResourcesWrapper/index.ts +0 -13
  513. package/src/SearchTypeResult/ActiveFilterContent.tsx +0 -55
  514. package/src/SearchTypeResult/ActiveFilters.tsx +0 -163
  515. package/src/SearchTypeResult/PopupFilter.tsx +0 -149
  516. package/src/SearchTypeResult/ResultNavigation.tsx +0 -105
  517. package/src/SearchTypeResult/SearchFieldHeader.tsx +0 -129
  518. package/src/SearchTypeResult/SearchFilterContent.tsx +0 -61
  519. package/src/SearchTypeResult/SearchHeader.tsx +0 -180
  520. package/src/SearchTypeResult/SearchItem.tsx +0 -144
  521. package/src/SearchTypeResult/SearchItemList.tsx +0 -161
  522. package/src/SearchTypeResult/SearchItems.tsx +0 -72
  523. package/src/SearchTypeResult/SearchSubjectItem.tsx +0 -74
  524. package/src/SearchTypeResult/SearchSubjectResult.tsx +0 -58
  525. package/src/SearchTypeResult/SearchTypeHeader.tsx +0 -148
  526. package/src/SearchTypeResult/SearchTypeResult.tsx +0 -89
  527. package/src/SearchTypeResult/SearchViewType.tsx +0 -111
  528. package/src/SearchTypeResult/components/ItemContexts.tsx +0 -131
  529. package/src/SearchTypeResult/components/ItemResourceHeader.tsx +0 -130
  530. package/src/SearchTypeResult/components/ItemTopicHeader.tsx +0 -88
  531. package/src/SearchTypeResult/components/SubjectFilters.tsx +0 -149
  532. package/src/SearchTypeResult/index.ts +0 -17
  533. package/src/Subject/SubjectBanner.tsx +0 -39
  534. package/src/Subject/index.ts +0 -9
  535. package/src/ToolboxPage/ToolboxInfo.tsx +0 -42
  536. package/src/ToolboxPage/index.ts +0 -11
  537. package/src/Topic/Loader.tsx +0 -29
  538. package/src/Topic/Topic.tsx +0 -348
  539. package/src/Topic/index.ts +0 -13
  540. package/src/locale/LocaleProvider.tsx +0 -31
@@ -1,161 +0,0 @@
1
- /**
2
- * Copyright (c) 2021-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 parse from "html-react-parser";
10
- import { Fragment } from "react";
11
- import { useTranslation } from "react-i18next";
12
- import styled from "@emotion/styled";
13
-
14
- import { animations, colors, fonts, spacing } from "@ndla/core";
15
- import { SafeLink } from "@ndla/safelink";
16
-
17
- import ItemContexts from "./components/ItemContexts";
18
- import { SearchItemType } from "./SearchItem";
19
- import ContentTypeBadge from "../ContentTypeBadge";
20
- import constants from "../model";
21
- const { contentTypes } = constants;
22
-
23
- const Container = styled.div`
24
- display: flex;
25
- flex-direction: column;
26
- min-height: 192px;
27
- height: 100%;
28
- border: 1px solid ${colors.brand.neutral7};
29
- border-radius: 5px;
30
-
31
- img {
32
- transition: all ${animations.durations.fast} ease-in-out;
33
- }
34
- :hover {
35
- img {
36
- transform: scale(1.1);
37
- }
38
- }
39
- `;
40
-
41
- const ItemLink = styled(SafeLink)`
42
- box-shadow: none;
43
- color: unset;
44
- text-decoration: none;
45
- display: flex;
46
- position: relative;
47
- min-height: 0;
48
- flex: 1;
49
- justify-content: space-between;
50
- `;
51
-
52
- const TextWrapper = styled.div`
53
- display: flex;
54
- flex-direction: column;
55
- flex: 1;
56
- margin: ${spacing.small} ${spacing.small} ${spacing.small} ${spacing.normal};
57
- max-width: 800px;
58
- `;
59
- const ContentTypeWrapper = styled.div`
60
- display: flex;
61
- align-items: center;
62
- ${fonts.sizes("12px", "16px")};
63
- font-weight: ${fonts.weight.semibold};
64
- `;
65
- const ContentTypeIconWrapper = styled.div`
66
- margin-right: ${spacing.small};
67
- `;
68
-
69
- const ItemTitleWrapper = styled.div`
70
- margin: ${spacing.small} 0 ${spacing.xsmall};
71
- `;
72
-
73
- const ItemTitle = styled.h3`
74
- ${fonts.sizes("24px", "28px")};
75
- color: ${colors.brand.primary};
76
- font-weight: ${fonts.weight.semibold};
77
- overflow-wrap: anywhere;
78
- display: inline;
79
- transition: all ${animations.durations.fast} ease-in-out;
80
- ${Container}:hover & {
81
- box-shadow: inset 0 -1px;
82
- background-color: transparent;
83
- }
84
- `;
85
-
86
- const ItemText = styled.div`
87
- ${fonts.sizes("16px", "24px")};
88
- flex: 1 auto;
89
- `;
90
-
91
- const ImageWrapper = styled.div<{ isTopic: boolean }>`
92
- float: right;
93
- position: relative;
94
- width: ${(props) => (props.isTopic ? `164px` : `224px`)};
95
- height: 164px;
96
- display: flex;
97
- justify-content: center;
98
- align-items: center;
99
- margin: ${spacing.small};
100
- overflow: hidden;
101
- ${(props) => props.isTopic && `border-radius: 50%;`};
102
- -webkit-mask-image: -webkit-radial-gradient(white, black);
103
- `;
104
-
105
- const ImageElement = styled.img`
106
- border-radius: 2px;
107
- width: 100%;
108
- height: 100%;
109
- object-fit: cover;
110
- max-width: unset;
111
- `;
112
-
113
- const ContextWrapper = styled.div`
114
- transition: all ${animations.durations.fast} ease-in-out;
115
- `;
116
-
117
- const SearchItemList = ({ item, type }: SearchItemType) => {
118
- const { t } = useTranslation();
119
- const { id, title, url, ingress, contexts, img = null, labels = [] } = item;
120
- const isTopic = type === contentTypes.TOPIC || type === contentTypes.MULTIDISCIPLINARY_TOPIC;
121
- return (
122
- <Container>
123
- <ItemLink to={url}>
124
- <TextWrapper>
125
- {type && (
126
- <ContentTypeWrapper>
127
- <ContentTypeIconWrapper>
128
- <ContentTypeBadge type={type} background border={false} />
129
- </ContentTypeIconWrapper>
130
- {t(`contentTypes.${type}`)}
131
- {labels.length > 0 && (
132
- <>
133
- {labels.map((label) => (
134
- <Fragment key={label}>
135
- {" "}
136
- <>&#8226;</> {label}
137
- </Fragment>
138
- ))}
139
- </>
140
- )}
141
- </ContentTypeWrapper>
142
- )}
143
- <ItemTitleWrapper>
144
- <ItemTitle>{title}</ItemTitle>
145
- </ItemTitleWrapper>
146
- <ItemText>{parse(ingress)}</ItemText>
147
- <ContextWrapper>
148
- {contexts && contexts.length > 0 && <ItemContexts contexts={contexts} id={id} title={title} />}
149
- </ContextWrapper>
150
- </TextWrapper>
151
- {img && (
152
- <ImageWrapper isTopic={isTopic}>
153
- <ImageElement src={img.url} alt={img.alt} />
154
- </ImageWrapper>
155
- )}
156
- </ItemLink>
157
- </Container>
158
- );
159
- };
160
-
161
- export default SearchItemList;
@@ -1,72 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-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 { memo } from "react";
10
- import { css } from "@emotion/react";
11
- import styled from "@emotion/styled";
12
- import { breakpoints, mq, spacing } from "@ndla/core";
13
- import SearchItem, { SearchItemProps } from "./SearchItem";
14
- import SearchItemList from "./SearchItemList";
15
- import { ContentType } from "./SearchTypeResult";
16
-
17
- const Wrapper = styled.div`
18
- width: 100%;
19
- position: relative;
20
- `;
21
-
22
- interface ContainerProps {
23
- viewType: Props["viewType"];
24
- }
25
-
26
- const Container = styled.ul<ContainerProps>`
27
- display: grid;
28
- align-items: flex-start;
29
- list-style: none;
30
- padding: 0;
31
- row-gap: ${spacing.normal};
32
- grid-template-columns: repeat(1, 1fr);
33
-
34
- ${(props) =>
35
- props.viewType === "grid" &&
36
- css`
37
- ${mq.range({ from: breakpoints.tablet })} {
38
- column-gap: ${spacing.normal};
39
- grid-template-columns: repeat(2, 1fr);
40
- }
41
-
42
- ${mq.range({ from: breakpoints.desktop })} {
43
- grid-template-columns: repeat(3, 1fr);
44
- }
45
- `}
46
- `;
47
-
48
- interface Props {
49
- items: SearchItemProps[];
50
- type?: ContentType;
51
- viewType?: "grid" | "list";
52
- }
53
-
54
- const SearchItems = ({ items, type, viewType = "grid" }: Props) => {
55
- return (
56
- <Wrapper>
57
- <Container aria-labelledby={`searchitem-header-${type}`} viewType={viewType}>
58
- {items.map((item) => {
59
- const contentType = type || item.type;
60
- const Component = viewType === "list" ? SearchItemList : SearchItem;
61
- return (
62
- <li key={`${item.id}`}>
63
- <Component item={item} type={contentType} />
64
- </li>
65
- );
66
- })}
67
- </Container>
68
- </Wrapper>
69
- );
70
- };
71
-
72
- export default memo(SearchItems);
@@ -1,74 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-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 { spacing } from "@ndla/core";
12
- import { SafeLink } from "@ndla/safelink";
13
-
14
- type ItemWrapperProps = {
15
- backgroundImage?: string;
16
- };
17
-
18
- const ItemWrapper = styled.div<ItemWrapperProps>`
19
- background: #deebf6;
20
- padding: ${spacing.normal} ${spacing.medium};
21
- border-radius: 5px;
22
- height: 150px;
23
- ${(props) =>
24
- props.backgroundImage !== "" &&
25
- `
26
- background-image: url(${props.backgroundImage});
27
- background-repeat: no-repeat;
28
- background-repeat: no-repeat;
29
- background-position-y: 100%;
30
- background-position-x: 100%;
31
- background-size: auto 100px;
32
- `}
33
- `;
34
-
35
- const ItemTitle = styled.h2`
36
- font-size: 18px;
37
- line-height: 18px;
38
- margin-top: ${spacing.small};
39
- font-weight: 600;
40
- `;
41
- const ItemText = styled.span`
42
- a {
43
- font-size: 16px;
44
- line-height: 20px;
45
- font-weight: 600;
46
- }
47
- `;
48
-
49
- export type SearchSubjecItemType = {
50
- id: string;
51
- title: string;
52
- url: string;
53
- img?: { url: string };
54
- };
55
- type Props = {
56
- item: SearchSubjecItemType;
57
- };
58
- const SearchSubjectItem = ({ item }: Props) => {
59
- const { t } = useTranslation();
60
- const { title, url, img = null } = item; // img = null
61
-
62
- return (
63
- <>
64
- <ItemWrapper backgroundImage={img ? img.url : ""}>
65
- <ItemTitle>{title}</ItemTitle>
66
- <ItemText>
67
- <SafeLink to={url}>{t("searchPage.resultType.toSubjectPageLabel")}</SafeLink>
68
- </ItemText>
69
- </ItemWrapper>
70
- </>
71
- );
72
- };
73
-
74
- export default SearchSubjectItem;
@@ -1,58 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-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 styled from "@emotion/styled";
10
- import { mq, breakpoints, spacing } from "@ndla/core";
11
- import SearchSubjectItem, { SearchSubjecItemType } from "./SearchSubjectItem";
12
-
13
- type ContainerProps = {
14
- itemCount: number;
15
- };
16
- const Container = styled.div<ContainerProps>`
17
- display: grid;
18
- row-gap: ${spacing.normal};
19
- grid-template-columns: repeat(1, 1fr);
20
- margin: ${spacing.medium} 0;
21
- ${mq.range({ from: breakpoints.tablet })} {
22
- column-gap: ${spacing.normal};
23
- margin: ${spacing.large} 0;
24
- ${(props) =>
25
- props.itemCount > 1 &&
26
- `
27
- grid-template-columns: repeat(2, 1fr);
28
- `}
29
- }
30
- ${mq.range({ from: breakpoints.tabletWide })} {
31
- ${(props) =>
32
- props.itemCount > 2 &&
33
- `
34
- grid-template-columns: repeat(3, 1fr);
35
- `}
36
- }
37
- ${mq.range({ from: breakpoints.desktop })} {
38
- ${(props) =>
39
- props.itemCount > 3 &&
40
- `
41
- grid-template-columns: repeat(4, 1fr);
42
- `}
43
- }
44
- `;
45
-
46
- type Props = {
47
- items: SearchSubjecItemType[];
48
- };
49
-
50
- const SearchSubjectResult = ({ items }: Props) => (
51
- <Container itemCount={items.length}>
52
- {items.map((item) => (
53
- <SearchSubjectItem item={item} key={`${item.id}`} />
54
- ))}
55
- </Container>
56
- );
57
-
58
- export default SearchSubjectResult;
@@ -1,148 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-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 { MouseEvent, memo } from "react";
10
- import { useTranslation } from "react-i18next";
11
- import styled from "@emotion/styled";
12
- import { ButtonV2 } from "@ndla/button";
13
- import { breakpoints, fonts, mq, spacing } from "@ndla/core";
14
- import { Cross } from "@ndla/icons/action";
15
- import { ContentType } from "./SearchTypeResult";
16
- import ContentTypeBadge from "../ContentTypeBadge";
17
-
18
- const Wrapper = styled.div`
19
- margin: ${spacing.small} 0;
20
- `;
21
- const HeaderWrapper = styled.div`
22
- display: flex;
23
- flex-direction: row;
24
- align-items: center;
25
- justify-content: space-between;
26
- padding: 0 2px;
27
- ${mq.range({ until: breakpoints.tablet })} {
28
- flex-wrap: wrap;
29
- }
30
- `;
31
- const TypeWrapper = styled.div`
32
- flex: 1 0 auto;
33
- flex-direction: row;
34
- display: flex;
35
- min-width: 200px;
36
- justify-content: flex-start;
37
- align-items: center;
38
- margin-bottom: ${spacing.xsmall};
39
- `;
40
-
41
- const BadgeWrapper = styled.span`
42
- margin-right: ${spacing.small};
43
- `;
44
-
45
- const SubjectName = styled.div`
46
- display: flex;
47
- gap: ${spacing.small};
48
- ${fonts.sizes("18px", "24px")};
49
- margin: 2px 0;
50
- h2 {
51
- margin: 0;
52
- ${fonts.sizes("18px", "24px")};
53
- margin-right: 4px;
54
- }
55
- `;
56
-
57
- const Count = styled.span``;
58
-
59
- const CategoryItems = styled.div`
60
- position: relative;
61
- button {
62
- white-space: nowrap;
63
- max-height: 29px;
64
- }
65
- white-space: nowrap;
66
- display: flex;
67
- flex-wrap: wrap;
68
- margin: ${spacing.small} 0 0;
69
- `;
70
-
71
- const CategoryTypeButtonWrapper = styled.div`
72
- margin: 4px;
73
- `;
74
-
75
- const CategoryTypeCrossWrapper = styled.span`
76
- margin-left: ${spacing.xsmall};
77
- `;
78
-
79
- export type FilterOptionsType = {
80
- id: string;
81
- name: string;
82
- active?: boolean;
83
- };
84
-
85
- type Props = {
86
- filters?: FilterOptionsType[];
87
- onFilterClick?: (id: string) => void;
88
- totalCount: number;
89
- type?: ContentType;
90
- };
91
- const SearchTypeHeader = ({ filters = [], onFilterClick, totalCount, type }: Props) => {
92
- const { t } = useTranslation();
93
- return (
94
- <Wrapper>
95
- <HeaderWrapper>
96
- <TypeWrapper>
97
- {type && (
98
- <BadgeWrapper>
99
- <ContentTypeBadge
100
- aria-hidden
101
- type={type}
102
- title={t(`contentTypes.${type}`)}
103
- background
104
- border={false}
105
- size="large"
106
- />
107
- </BadgeWrapper>
108
- )}
109
- <SubjectName>
110
- <h2 id={`searchitem-header-${type}`}>
111
- {type ? t(`contentTypes.${type}`) : t(`searchPage.resultType.allContentTypes`)}
112
- </h2>
113
- {totalCount && <Count>{t(`searchPage.resultType.hits`, { count: totalCount })}</Count>}
114
- </SubjectName>
115
- </TypeWrapper>
116
- </HeaderWrapper>
117
- {filters.length > 0 && (
118
- <CategoryItems>
119
- {filters.map((option: FilterOptionsType) => (
120
- <CategoryTypeButtonWrapper key={option.id}>
121
- <ButtonV2
122
- aria-current={option.active}
123
- size="xsmall"
124
- shape="pill"
125
- colorTheme={!option.active ? "greyLighter" : undefined}
126
- onClick={(e: MouseEvent<HTMLButtonElement>) => {
127
- if (e.currentTarget && option.active) {
128
- e.currentTarget.blur();
129
- }
130
- onFilterClick?.(option.id);
131
- }}
132
- >
133
- {option.name}
134
- {option.active && (
135
- <CategoryTypeCrossWrapper>
136
- <Cross />
137
- </CategoryTypeCrossWrapper>
138
- )}
139
- </ButtonV2>
140
- </CategoryTypeButtonWrapper>
141
- ))}
142
- </CategoryItems>
143
- )}
144
- </Wrapper>
145
- );
146
- };
147
-
148
- export default memo(SearchTypeHeader);
@@ -1,89 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-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 { memo, ReactNode } from "react";
10
- import styled from "@emotion/styled";
11
- import { spacing, stackOrder } from "@ndla/core";
12
- import { Spinner } from "@ndla/icons";
13
- import ResultNavigation, { PaginationType } from "./ResultNavigation";
14
- import { SearchItemProps } from "./SearchItem";
15
- import SearchItems from "./SearchItems";
16
- import SearchTypeHeader, { FilterOptionsType } from "./SearchTypeHeader";
17
- import constants from "../model";
18
-
19
- const Wrapper = styled.section`
20
- display: flex;
21
- flex-direction: column;
22
- flex: 1;
23
- margin: ${spacing.medium} 0;
24
- position: relative;
25
- `;
26
-
27
- const Overlay = styled.div`
28
- position: absolute;
29
- top: 0;
30
- left: -1%;
31
- right: 0;
32
- bottom: 0;
33
- width: 102%;
34
- background-color: rgb(204, 204, 204, 0.1);
35
- z-index: ${stackOrder.offsetDouble};
36
- display: flex;
37
- flex-direction: column;
38
- justify-content: center;
39
- border-radius: 4px;
40
- padding: ${spacing.small};
41
- `;
42
-
43
- export type ContentType =
44
- | typeof constants.contentTypes.SUBJECT_MATERIAL
45
- | typeof constants.contentTypes.TASKS_AND_ACTIVITIES
46
- | typeof constants.contentTypes.ASSESSMENT_RESOURCES
47
- | typeof constants.contentTypes.CONCEPT
48
- | typeof constants.contentTypes.SOURCE_MATERIAL
49
- | typeof constants.contentTypes.LEARNING_PATH
50
- | typeof constants.contentTypes.TOPIC
51
- | typeof constants.contentTypes.MULTIDISCIPLINARY_TOPIC;
52
-
53
- type Props = {
54
- items: SearchItemProps[];
55
- filters?: FilterOptionsType[];
56
- onFilterClick?: (id: string) => void;
57
- totalCount?: number;
58
- pagination?: PaginationType;
59
- type?: ContentType;
60
- loading?: boolean;
61
- children?: ReactNode;
62
- viewType?: "grid" | "list";
63
- };
64
-
65
- const SearchTypeResult = ({
66
- items,
67
- filters,
68
- onFilterClick,
69
- totalCount = 0,
70
- pagination,
71
- type,
72
- loading,
73
- viewType,
74
- children,
75
- }: Props) => (
76
- <Wrapper>
77
- {loading && (
78
- <Overlay>
79
- <Spinner />
80
- </Overlay>
81
- )}
82
- <SearchTypeHeader onFilterClick={onFilterClick} filters={filters} totalCount={totalCount} type={type} />
83
- <SearchItems items={items} type={type} viewType={viewType} />
84
- {pagination && <ResultNavigation {...pagination} type={type} />}
85
- {children}
86
- </Wrapper>
87
- );
88
-
89
- export default memo(SearchTypeResult);
@@ -1,111 +0,0 @@
1
- /**
2
- * Copyright (c) 2021-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 { ButtonV2 } from "@ndla/button";
12
- import { animations, breakpoints, colors, mq } from "@ndla/core";
13
- import { Grid } from "@ndla/icons/common";
14
- import { ListCircle } from "@ndla/icons/editor";
15
-
16
- const Wrapper = styled.div`
17
- display: inline-flex;
18
- justify-content: right;
19
- align-items: center;
20
- flex: 1;
21
- ${mq.range({ until: breakpoints.tablet })} {
22
- display: none;
23
- }
24
- padding-top: 8px;
25
- `;
26
-
27
- const ButtonContainer = styled.div`
28
- display: flex;
29
- justify-content: center;
30
- align-items: center;
31
- width: 44px;
32
- height: 44px;
33
- `;
34
- const ButtonElement = styled(ButtonV2)`
35
- border-radius: 50%;
36
- padding: 2px;
37
- width: 100%;
38
- height: 100%;
39
- transition: all ${animations.durations.fast} ease-in-out;
40
- &:hover {
41
- padding: 0;
42
- }
43
- `;
44
-
45
- type ButtonContentProps = {
46
- selected?: boolean;
47
- };
48
-
49
- const ButtonContent = styled.span<ButtonContentProps>`
50
- width: 100%;
51
- height: 100%;
52
- display: flex;
53
- justify-content: center;
54
- align-items: center;
55
- color: ${colors.brand.primary};
56
- ${(props) => props.selected && `background: ${colors.brand.greyLighter};`}
57
- border-radius: 50%;
58
- transition: all ${animations.durations.fast} ease-in-out;
59
- ${ButtonElement}:hover & {
60
- background: ${colors.brand.greyLighter};
61
- }
62
- svg {
63
- width: 24px;
64
- height: 24px;
65
- }
66
- `;
67
-
68
- export type SearchViewTypeProps = {
69
- viewType: "grid" | "list";
70
- onChangeViewType: (viewType: SearchViewTypeProps["viewType"]) => void;
71
- };
72
- const SearchViewType = ({ viewType, onChangeViewType }: SearchViewTypeProps) => {
73
- const { t } = useTranslation();
74
- const onClickHandler = (viewTypeClicked: SearchViewTypeProps["viewType"]) => {
75
- if (viewTypeClicked !== viewType) {
76
- onChangeViewType(viewTypeClicked);
77
- }
78
- };
79
- return (
80
- <Wrapper>
81
- <ButtonContainer>
82
- <ButtonElement
83
- variant="stripped"
84
- colorTheme="greyLighter"
85
- type="button"
86
- size="normal"
87
- title={t("searchPage.resultType.gridView")}
88
- onClick={() => onClickHandler("grid")}
89
- >
90
- <ButtonContent selected={viewType === "grid"}>
91
- <Grid aria-hidden title="" />
92
- </ButtonContent>
93
- </ButtonElement>
94
- </ButtonContainer>
95
- <ButtonContainer>
96
- <ButtonElement
97
- variant="stripped"
98
- size="normal"
99
- title={t("searchPage.resultType.listView")}
100
- onClick={() => onClickHandler("list")}
101
- >
102
- <ButtonContent selected={viewType === "list"}>
103
- <ListCircle aria-hidden title="" />
104
- </ButtonContent>
105
- </ButtonElement>
106
- </ButtonContainer>
107
- </Wrapper>
108
- );
109
- };
110
-
111
- export default SearchViewType;