@ndla/ui 3.3.13 → 3.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -3
- package/es/Article/Article.js +3 -3
- package/es/Article/ArticleByline.js +4 -5
- package/es/Article/ArticleNotions.js +5 -6
- package/es/Article/ArticleSideBar.js +11 -12
- package/es/AudioPlayer/AudioPlayer.js +15 -16
- package/es/AudioPlayer/SpeechControl.js +2 -3
- package/es/BlogPosts/BlogPost.js +6 -8
- package/es/BlogPosts/BlogPostWrapper.js +1 -1
- package/es/Breadcrumb/Breadcrumb.js +1 -2
- package/es/Breadcrumb/BreadcrumbItem.js +2 -3
- package/es/Breadcrumblist/Breadcrumblist.js +7 -8
- package/es/CompetenceGoalTab/CompetenceGoalTab.js +6 -7
- package/es/CompetenceGoalTab/CompetenceItem.js +11 -13
- package/es/ComponentCursor/ComponentCursor.js +8 -8
- package/es/CopyParagraphButton/CopyParagraphButton.js +3 -4
- package/es/CreatedBy/CreatedBy.js +5 -6
- package/es/Dialog/Dialog.js +1 -2
- package/es/Embedded/Twitter.js +5 -5
- package/es/ErrorMessage/ErrorMessage.js +5 -5
- package/es/Figure/Figure.js +3 -1
- package/es/Figure/FigureLicenseDialog.js +1 -2
- package/es/Filter/FilterButtons.js +11 -13
- package/es/Footer/Footer.js +8 -9
- package/es/Footer/FooterLinks.js +7 -8
- package/es/Footer/FooterPrivacy.js +2 -3
- package/es/Footer/FooterText.js +1 -1
- package/es/Frontpage/FrontpageAllSubjects.js +10 -11
- package/es/Frontpage/FrontpageFilm.js +6 -8
- package/es/Frontpage/FrontpageHeader.js +5 -6
- package/es/Frontpage/FrontpageInfo.js +1 -1
- package/es/Frontpage/FrontpageMultidisciplinarySubject.js +8 -9
- package/es/Frontpage/FrontpageSearch.js +4 -6
- package/es/Frontpage/FrontpageToolbox.js +5 -6
- package/es/Frontpage/illustrations/FrontpageSubjectIllustration.js +1 -1
- package/es/LanguageSelector/LanguageSelector.js +8 -9
- package/es/LearningPaths/LearningPathContent.js +1 -1
- package/es/LearningPaths/LearningPathInformation.js +1 -1
- package/es/LearningPaths/LearningPathLastStepNavigation.js +4 -4
- package/es/LearningPaths/LearningPathMenu.js +5 -7
- package/es/LearningPaths/LearningPathMenuAside.js +7 -8
- package/es/LearningPaths/LearningPathMenuAsideCopyright.js +1 -2
- package/es/LearningPaths/LearningPathMenuContent.js +6 -8
- package/es/LearningPaths/LearningPathMenuIntro.js +7 -8
- package/es/LearningPaths/LearningPathMenuModalWrapper.js +3 -5
- package/es/LearningPaths/LearningPathMobileHeader.js +4 -5
- package/es/LearningPaths/LearningPathMobileStepInfo.js +1 -1
- package/es/LearningPaths/LearningPathSticky.js +4 -5
- package/es/LearningPaths/LearningPathWrapper.js +2 -2
- package/es/Masthead/MastheadSearchModal.js +5 -7
- package/es/NDLAFilm/AboutNdlaFilm.js +6 -17
- package/es/NDLAFilm/AllMoviesAlphabetically.js +14 -15
- package/es/NDLAFilm/CategorySelect.js +17 -18
- package/es/NDLAFilm/FilmContentCard.js +8 -23
- package/es/NDLAFilm/FilmContentCardTags.js +4 -8
- package/es/NDLAFilm/FilmMovieList.js +6 -21
- package/es/NDLAFilm/FilmMovieSearch.js +18 -26
- package/es/NDLAFilm/FilmSlideshow.js +3 -3
- package/es/NDLAFilm/MovieGrid.js +10 -19
- package/es/NDLAFilm/VisualElement.js +22 -29
- package/es/Navigation/NavigationBox.js +19 -19
- package/es/Navigation/NavigationHeading.js +4 -4
- package/es/Navigation/NavigationTopicAbout.js +15 -16
- package/es/Notion/Notion.js +4 -4
- package/es/RelatedArticleList/RelatedArticleList.js +4 -4
- package/es/ResourceGroup/ResourceItem.js +12 -14
- package/es/ResourceGroup/ResourceList.js +3 -4
- package/es/ResourcesWrapper/ResourcesTopicTitle.js +5 -6
- package/es/Search/ContentTypeResult.js +4 -7
- package/es/Search/LoadingWrapper.js +2 -3
- package/es/Search/SearchFieldForm.js +3 -3
- package/es/Search/SearchPage.js +2 -2
- package/es/Search/SearchResultSleeve.js +8 -8
- package/es/SearchTypeResult/ActiveFilterContent.js +1 -2
- package/es/SearchTypeResult/ActiveFilters.js +6 -7
- package/es/SearchTypeResult/PopupFilter.js +9 -11
- package/es/SearchTypeResult/ResultNavigation.js +2 -3
- package/es/SearchTypeResult/SearchFieldHeader.js +7 -9
- package/es/SearchTypeResult/SearchItem.js +20 -24
- package/es/SearchTypeResult/SearchItems.js +4 -4
- package/es/SearchTypeResult/SearchNotionItem.js +16 -20
- package/es/SearchTypeResult/SearchNotionsResult.js +6 -8
- package/es/SearchTypeResult/SearchSubjectItem.js +3 -4
- package/es/SearchTypeResult/SearchTypeHeader.js +9 -10
- package/es/SearchTypeResult/SearchTypeResult.js +5 -6
- package/es/ToolboxPage/ToolboxInfo.js +2 -2
- package/es/Topic/Loader.js +1 -2
- package/es/Topic/Topic.js +21 -22
- package/es/TopicIntroductionList/TopicIntroduction.js +14 -33
- package/es/TopicIntroductionList/TopicIntroductionList.js +6 -23
- package/es/TopicIntroductionList/TopicIntroductionShortcuts.js +71 -110
- package/es/TopicIntroductionList/TopicShortcutItem.js +0 -9
- package/es/Translation/TranslationBox.js +1 -2
- package/es/User/AuthModal.js +9 -10
- package/es/all.css +1 -4
- package/es/index-javascript.js +1 -5
- package/es/index.js +4 -0
- package/es/shapes.js +0 -6
- package/lib/Article/Article.d.ts +2 -2
- package/lib/Article/Article.js +2 -4
- package/lib/Article/ArticleByline.d.ts +2 -2
- package/lib/Article/ArticleByline.js +4 -4
- package/lib/Article/ArticleNotions.d.ts +2 -2
- package/lib/Article/ArticleNotions.js +4 -4
- package/lib/Article/ArticleSideBar.d.ts +4 -4
- package/lib/Article/ArticleSideBar.js +10 -11
- package/lib/Aside/Aside.d.ts +2 -2
- package/lib/AudioPlayer/AudioPlayer.js +14 -14
- package/lib/AudioPlayer/SpeechControl.js +1 -2
- package/lib/BlogPosts/BlogPost.d.ts +1 -2
- package/lib/BlogPosts/BlogPost.js +4 -6
- package/lib/BlogPosts/BlogPostWrapper.d.ts +3 -3
- package/lib/BlogPosts/BlogPostWrapper.js +1 -1
- package/lib/Breadcrumb/Breadcrumb.d.ts +4 -4
- package/lib/Breadcrumb/Breadcrumb.js +0 -1
- package/lib/Breadcrumb/BreadcrumbBlock.d.ts +3 -3
- package/lib/Breadcrumb/BreadcrumbItem.d.ts +2 -2
- package/lib/Breadcrumb/BreadcrumbItem.js +1 -2
- package/lib/Breadcrumblist/Breadcrumblist.d.ts +4 -4
- package/lib/Breadcrumblist/Breadcrumblist.js +6 -6
- package/lib/CompetenceGoalTab/CompetenceGoalTab.js +5 -5
- package/lib/CompetenceGoalTab/CompetenceItem.js +10 -10
- package/lib/ComponentCursor/ComponentCursor.js +8 -8
- package/lib/CopyParagraphButton/CopyParagraphButton.js +2 -2
- package/lib/CreatedBy/CreatedBy.js +4 -4
- package/lib/Embedded/Twitter.js +5 -5
- package/lib/ErrorMessage/ErrorMessage.d.ts +2 -2
- package/lib/ErrorMessage/ErrorMessage.js +5 -5
- package/lib/Figure/Figure.js +3 -1
- package/lib/Filter/FilterButtons.js +9 -9
- package/lib/Footer/EditorName.d.ts +1 -2
- package/lib/Footer/Footer.d.ts +5 -5
- package/lib/Footer/Footer.js +7 -7
- package/lib/Footer/FooterLinks.d.ts +3 -3
- package/lib/Footer/FooterLinks.js +6 -6
- package/lib/Footer/FooterPrivacy.d.ts +1 -2
- package/lib/Footer/FooterPrivacy.js +2 -3
- package/lib/Footer/FooterText.d.ts +3 -3
- package/lib/Footer/FooterText.js +1 -1
- package/lib/Footer/privacy_en.d.ts +1 -2
- package/lib/Footer/privacy_nb.d.ts +1 -2
- package/lib/Footer/privacy_nn.d.ts +1 -2
- package/lib/Frontpage/FrontpageAllSubjects.js +15 -9
- package/lib/Frontpage/FrontpageFilm.d.ts +1 -1
- package/lib/Frontpage/FrontpageFilm.js +4 -6
- package/lib/Frontpage/FrontpageHeader.d.ts +3 -2
- package/lib/Frontpage/FrontpageHeader.js +4 -5
- package/lib/Frontpage/FrontpageInfo.d.ts +3 -3
- package/lib/Frontpage/FrontpageInfo.js +1 -1
- package/lib/Frontpage/FrontpageMultidisciplinarySubject.d.ts +1 -1
- package/lib/Frontpage/FrontpageMultidisciplinarySubject.js +7 -7
- package/lib/Frontpage/FrontpageSearch.d.ts +3 -3
- package/lib/Frontpage/FrontpageSearch.js +2 -4
- package/lib/Frontpage/FrontpageToolbox.d.ts +1 -1
- package/lib/Frontpage/FrontpageToolbox.js +4 -5
- package/lib/Frontpage/illustrations/Fellesfag.d.ts +1 -2
- package/lib/Frontpage/illustrations/FrontpageHeaderIllustration.d.ts +1 -2
- package/lib/Frontpage/illustrations/FrontpageSubjectIllustration.d.ts +1 -2
- package/lib/Frontpage/illustrations/FrontpageSubjectIllustration.js +1 -1
- package/lib/Frontpage/illustrations/MenuFellesfag.d.ts +1 -2
- package/lib/Frontpage/illustrations/MenuStudiespesialiserende.d.ts +1 -2
- package/lib/Frontpage/illustrations/MenuYrkesfag.d.ts +1 -2
- package/lib/Frontpage/illustrations/Studiespesialiserende.d.ts +1 -2
- package/lib/Frontpage/illustrations/Yrkesfag.d.ts +1 -2
- package/lib/Frontpage/illustrations/index.d.ts +6 -6
- package/lib/LanguageSelector/LanguageSelector.js +7 -7
- package/lib/LearningPaths/LearningPathContent.d.ts +3 -3
- package/lib/LearningPaths/LearningPathContent.js +1 -1
- package/lib/LearningPaths/LearningPathInformation.d.ts +1 -2
- package/lib/LearningPaths/LearningPathInformation.js +1 -1
- package/lib/LearningPaths/LearningPathLastStepNavigation.d.ts +3 -3
- package/lib/LearningPaths/LearningPathLastStepNavigation.js +4 -4
- package/lib/LearningPaths/LearningPathMenu.d.ts +1 -2
- package/lib/LearningPaths/LearningPathMenu.js +3 -3
- package/lib/LearningPaths/LearningPathMenuAside.d.ts +1 -1
- package/lib/LearningPaths/LearningPathMenuAside.js +6 -7
- package/lib/LearningPaths/LearningPathMenuAsideCopyright.d.ts +1 -2
- package/lib/LearningPaths/LearningPathMenuAsideCopyright.js +1 -2
- package/lib/LearningPaths/LearningPathMenuContent.d.ts +1 -2
- package/lib/LearningPaths/LearningPathMenuContent.js +5 -7
- package/lib/LearningPaths/LearningPathMenuIntro.d.ts +1 -2
- package/lib/LearningPaths/LearningPathMenuIntro.js +6 -6
- package/lib/LearningPaths/LearningPathMenuModalWrapper.d.ts +3 -3
- package/lib/LearningPaths/LearningPathMenuModalWrapper.js +1 -3
- package/lib/LearningPaths/LearningPathMobileHeader.d.ts +1 -1
- package/lib/LearningPaths/LearningPathMobileHeader.js +4 -5
- package/lib/LearningPaths/LearningPathMobileStepInfo.d.ts +1 -1
- package/lib/LearningPaths/LearningPathMobileStepInfo.js +1 -1
- package/lib/LearningPaths/LearningPathSticky.d.ts +11 -5
- package/lib/LearningPaths/LearningPathSticky.js +3 -4
- package/lib/LearningPaths/LearningPathWrapper.d.ts +3 -3
- package/lib/LearningPaths/LearningPathWrapper.js +2 -2
- package/lib/Masthead/MastheadSearchModal.d.ts +3 -3
- package/lib/Masthead/MastheadSearchModal.js +3 -5
- package/lib/NDLAFilm/AboutNdlaFilm.d.ts +15 -0
- package/lib/NDLAFilm/AboutNdlaFilm.js +6 -18
- package/lib/NDLAFilm/AllMoviesAlphabetically.d.ts +3 -4
- package/lib/NDLAFilm/AllMoviesAlphabetically.js +12 -13
- package/lib/NDLAFilm/CategorySelect.d.ts +11 -0
- package/lib/NDLAFilm/CategorySelect.js +20 -19
- package/lib/NDLAFilm/FilmContentCard.d.ts +11 -0
- package/lib/NDLAFilm/FilmContentCard.js +8 -24
- package/lib/NDLAFilm/FilmContentCardTags.d.ts +7 -0
- package/lib/NDLAFilm/FilmContentCardTags.js +4 -9
- package/lib/NDLAFilm/FilmMovieList.d.ts +19 -0
- package/lib/NDLAFilm/FilmMovieList.js +5 -21
- package/lib/NDLAFilm/FilmMovieSearch.d.ts +21 -0
- package/lib/NDLAFilm/FilmMovieSearch.js +25 -30
- package/lib/NDLAFilm/FilmSlideshow.d.ts +5 -5
- package/lib/NDLAFilm/FilmSlideshow.js +2 -1
- package/lib/NDLAFilm/MovieGrid.d.ts +13 -0
- package/lib/NDLAFilm/MovieGrid.js +9 -21
- package/lib/NDLAFilm/SlideshowIndicator.d.ts +2 -2
- package/lib/NDLAFilm/VisualElement.d.ts +16 -0
- package/lib/NDLAFilm/VisualElement.js +22 -30
- package/lib/NDLAFilm/index.d.ts +14 -0
- package/lib/NDLAFilm/types.d.ts +8 -6
- package/lib/Navigation/NavigationBox.d.ts +3 -3
- package/lib/Navigation/NavigationBox.js +19 -19
- package/lib/Navigation/NavigationHeading.d.ts +2 -2
- package/lib/Navigation/NavigationHeading.js +4 -4
- package/lib/Navigation/NavigationTopicAbout.d.ts +2 -2
- package/lib/Navigation/NavigationTopicAbout.js +14 -14
- package/lib/Notion/Notion.d.ts +4 -4
- package/lib/Notion/Notion.js +4 -4
- package/lib/RadioButtonGroup/RadioButtonGroup.d.ts +2 -2
- package/lib/RelatedArticleList/RelatedArticleList.js +3 -3
- package/lib/ResourceGroup/ResourceItem.js +11 -11
- package/lib/ResourceGroup/ResourceList.js +2 -2
- package/lib/ResourcesWrapper/ResourcesTopicTitle.js +4 -4
- package/lib/Search/ContentTypeResult.d.ts +1 -2
- package/lib/Search/ContentTypeResult.js +1 -1
- package/lib/Search/LoadingWrapper.d.ts +1 -2
- package/lib/Search/LoadingWrapper.js +1 -2
- package/lib/Search/SearchFieldForm.d.ts +4 -4
- package/lib/Search/SearchFieldForm.js +3 -3
- package/lib/Search/SearchPage.js +1 -1
- package/lib/Search/SearchResultSleeve.d.ts +1 -2
- package/lib/Search/SearchResultSleeve.js +8 -8
- package/lib/SearchTypeResult/ActiveFilterContent.js +1 -2
- package/lib/SearchTypeResult/ActiveFilters.d.ts +2 -2
- package/lib/SearchTypeResult/ActiveFilters.js +5 -5
- package/lib/SearchTypeResult/PopupFilter.js +8 -8
- package/lib/SearchTypeResult/ResultNavigation.js +2 -3
- package/lib/SearchTypeResult/SearchFieldHeader.d.ts +2 -2
- package/lib/SearchTypeResult/SearchFieldHeader.js +5 -5
- package/lib/SearchTypeResult/SearchItem.d.ts +2 -2
- package/lib/SearchTypeResult/SearchItem.js +17 -17
- package/lib/SearchTypeResult/SearchItems.js +10 -4
- package/lib/SearchTypeResult/SearchNotionItem.d.ts +4 -4
- package/lib/SearchTypeResult/SearchNotionItem.js +12 -12
- package/lib/SearchTypeResult/SearchNotionsResult.d.ts +2 -2
- package/lib/SearchTypeResult/SearchNotionsResult.js +4 -4
- package/lib/SearchTypeResult/SearchSubjectItem.js +3 -3
- package/lib/SearchTypeResult/SearchTypeHeader.js +14 -8
- package/lib/SearchTypeResult/SearchTypeResult.d.ts +2 -2
- package/lib/SearchTypeResult/SearchTypeResult.js +10 -5
- package/lib/ToolboxPage/ToolboxInfo.d.ts +2 -2
- package/lib/ToolboxPage/ToolboxInfo.js +2 -2
- package/lib/Topic/Loader.js +0 -1
- package/lib/Topic/Topic.d.ts +5 -5
- package/lib/Topic/Topic.js +20 -20
- package/lib/TopicIntroductionList/TopicIntroduction.d.ts +21 -0
- package/lib/TopicIntroductionList/TopicIntroduction.js +16 -36
- package/lib/TopicIntroductionList/TopicIntroductionList.d.ts +35 -0
- package/lib/TopicIntroductionList/TopicIntroductionList.js +6 -25
- package/lib/TopicIntroductionList/TopicIntroductionShortcuts.d.ts +8 -0
- package/lib/TopicIntroductionList/TopicIntroductionShortcuts.js +72 -110
- package/lib/TopicIntroductionList/TopicShortcutItem.d.ts +6 -0
- package/lib/TopicIntroductionList/TopicShortcutItem.js +0 -11
- package/lib/TopicIntroductionList/index.d.ts +9 -0
- package/lib/Translation/TranslationBox.js +0 -1
- package/lib/User/AuthModal.js +8 -8
- package/lib/all.css +1 -4
- package/lib/index-javascript.js +3 -137
- package/lib/index.d.ts +4 -0
- package/lib/index.js +155 -0
- package/lib/locale/LocaleProvider.d.ts +2 -2
- package/lib/shapes.js +1 -10
- package/lib/types.d.ts +2 -1
- package/package.json +15 -15
- package/src/Article/Article.tsx +3 -3
- package/src/Article/ArticleByline.tsx +2 -3
- package/src/Article/ArticleNotions.tsx +2 -4
- package/src/Article/ArticleSideBar.tsx +7 -8
- package/src/Aside/Aside.tsx +2 -2
- package/src/AudioPlayer/AudioPlayer.tsx +0 -1
- package/src/AudioPlayer/SpeechControl.tsx +0 -1
- package/src/BlogPosts/BlogPost.tsx +2 -4
- package/src/BlogPosts/BlogPostWrapper.tsx +3 -3
- package/src/Breadcrumb/Breadcrumb.tsx +4 -5
- package/src/Breadcrumb/BreadcrumbBlock.tsx +3 -3
- package/src/Breadcrumb/BreadcrumbItem.tsx +3 -4
- package/src/Breadcrumblist/Breadcrumblist.tsx +5 -6
- package/src/CompetenceGoalTab/CompetenceGoalTab.tsx +0 -1
- package/src/CompetenceGoalTab/CompetenceItem.tsx +1 -5
- package/src/ComponentCursor/ComponentCursor.tsx +2 -2
- package/src/CopyParagraphButton/CopyParagraphButton.tsx +2 -3
- package/src/CreatedBy/CreatedBy.tsx +0 -1
- package/src/Dialog/Dialog.tsx +0 -1
- package/src/Embedded/Twitter.jsx +3 -3
- package/src/ErrorMessage/ErrorMessage.tsx +2 -7
- package/src/Figure/Figure.tsx +2 -1
- package/src/Figure/FigureLicenseDialog.tsx +0 -1
- package/src/Figure/component.figure.scss +37 -3
- package/src/Filter/FilterButtons.tsx +0 -3
- package/src/Footer/EditorName.tsx +1 -1
- package/src/Footer/Footer.tsx +4 -5
- package/src/Footer/FooterLinks.tsx +4 -8
- package/src/Footer/FooterPrivacy.tsx +1 -2
- package/src/Footer/FooterText.tsx +3 -5
- package/src/Footer/privacy_en.tsx +1 -1
- package/src/Footer/privacy_nb.tsx +1 -1
- package/src/Footer/privacy_nn.tsx +1 -1
- package/src/Frontpage/FrontpageAllSubjects.tsx +5 -6
- package/src/Frontpage/FrontpageFilm.tsx +1 -3
- package/src/Frontpage/FrontpageHeader.tsx +3 -8
- package/src/Frontpage/FrontpageInfo.tsx +3 -3
- package/src/Frontpage/FrontpageMultidisciplinarySubject.tsx +1 -2
- package/src/Frontpage/FrontpageSearch.tsx +4 -6
- package/src/Frontpage/FrontpageToolbox.tsx +1 -2
- package/src/Frontpage/illustrations/Fellesfag.tsx +1 -1
- package/src/Frontpage/illustrations/FrontpageHeaderIllustration.tsx +1 -1
- package/src/Frontpage/illustrations/FrontpageSubjectIllustration.tsx +1 -1
- package/src/Frontpage/illustrations/MenuFellesfag.tsx +1 -1
- package/src/Frontpage/illustrations/MenuStudiespesialiserende.tsx +1 -1
- package/src/Frontpage/illustrations/MenuYrkesfag.tsx +1 -1
- package/src/Frontpage/illustrations/Studiespesialiserende.tsx +1 -1
- package/src/Frontpage/illustrations/Yrkesfag.tsx +1 -1
- package/src/LanguageSelector/LanguageSelector.tsx +0 -1
- package/src/LearningPaths/LearningPathContent.tsx +3 -5
- package/src/LearningPaths/LearningPathInformation.tsx +1 -6
- package/src/LearningPaths/LearningPathLastStepNavigation.tsx +3 -9
- package/src/LearningPaths/LearningPathMenu.tsx +2 -4
- package/src/LearningPaths/LearningPathMenuAside.tsx +2 -3
- package/src/LearningPaths/LearningPathMenuAsideCopyright.tsx +1 -2
- package/src/LearningPaths/LearningPathMenuContent.tsx +2 -4
- package/src/LearningPaths/LearningPathMenuIntro.tsx +1 -2
- package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +3 -5
- package/src/LearningPaths/LearningPathMobileHeader.tsx +2 -3
- package/src/LearningPaths/LearningPathMobileStepInfo.tsx +1 -1
- package/src/LearningPaths/LearningPathSticky.tsx +5 -14
- package/src/LearningPaths/LearningPathWrapper.tsx +3 -3
- package/src/Masthead/MastheadSearchModal.tsx +4 -6
- package/src/NDLAFilm/{AboutNdlaFilm.jsx → AboutNdlaFilm.tsx} +19 -18
- package/src/NDLAFilm/AllMoviesAlphabetically.tsx +6 -7
- package/src/NDLAFilm/{CategorySelect.jsx → CategorySelect.tsx} +23 -20
- package/src/NDLAFilm/{FilmContentCard.jsx → FilmContentCard.tsx} +21 -22
- package/src/NDLAFilm/{FilmContentCardTags.jsx → FilmContentCardTags.tsx} +7 -7
- package/src/NDLAFilm/{FilmMovieList.jsx → FilmMovieList.tsx} +17 -27
- package/src/NDLAFilm/FilmMovieSearch.tsx +71 -0
- package/src/NDLAFilm/FilmSlideshow.tsx +9 -10
- package/src/NDLAFilm/MovieGrid.tsx +76 -0
- package/src/NDLAFilm/SlideshowIndicator.tsx +2 -2
- package/src/NDLAFilm/VisualElement.tsx +40 -0
- package/src/NDLAFilm/{index.js → index.ts} +0 -0
- package/src/NDLAFilm/types.ts +9 -6
- package/src/Navigation/NavigationBox.tsx +4 -4
- package/src/Navigation/NavigationHeading.tsx +2 -2
- package/src/Navigation/NavigationTopicAbout.tsx +2 -3
- package/src/Notion/Notion.tsx +4 -4
- package/src/RadioButtonGroup/RadioButtonGroup.tsx +2 -2
- package/src/RelatedArticleList/RelatedArticleList.tsx +4 -4
- package/src/ResourceGroup/ResourceItem.tsx +0 -3
- package/src/ResourceGroup/ResourceList.tsx +0 -1
- package/src/ResourcesWrapper/ResourcesTopicTitle.tsx +0 -1
- package/src/Search/ContentTypeResult.tsx +4 -7
- package/src/Search/LoadingWrapper.tsx +1 -2
- package/src/Search/SearchFieldForm.tsx +4 -4
- package/src/Search/SearchPage.jsx +2 -2
- package/src/Search/SearchResultSleeve.tsx +2 -2
- package/src/SearchTypeResult/ActiveFilterContent.tsx +0 -1
- package/src/SearchTypeResult/ActiveFilters.tsx +2 -3
- package/src/SearchTypeResult/PopupFilter.tsx +0 -2
- package/src/SearchTypeResult/ResultNavigation.tsx +0 -1
- package/src/SearchTypeResult/SearchFieldHeader.tsx +1 -3
- package/src/SearchTypeResult/SearchItem.tsx +3 -8
- package/src/SearchTypeResult/SearchItems.tsx +2 -2
- package/src/SearchTypeResult/SearchNotionItem.tsx +4 -8
- package/src/SearchTypeResult/SearchNotionsResult.tsx +2 -4
- package/src/SearchTypeResult/SearchSubjectItem.tsx +0 -1
- package/src/SearchTypeResult/SearchTypeHeader.tsx +3 -4
- package/src/SearchTypeResult/SearchTypeResult.tsx +3 -4
- package/src/ToolboxPage/ToolboxInfo.tsx +2 -2
- package/src/Topic/Loader.tsx +0 -1
- package/src/Topic/Topic.tsx +5 -6
- package/src/TopicIntroductionList/{TopicIntroduction.jsx → TopicIntroduction.tsx} +22 -35
- package/src/TopicIntroductionList/{TopicIntroductionList.jsx → TopicIntroductionList.tsx} +32 -26
- package/src/TopicIntroductionList/TopicIntroductionShortcuts.tsx +71 -0
- package/src/TopicIntroductionList/{TopicShortcutItem.jsx → TopicShortcutItem.tsx} +5 -13
- package/src/TopicIntroductionList/{index.js → index.ts} +0 -0
- package/src/Translation/TranslationBox.tsx +0 -1
- package/src/User/AuthModal.tsx +0 -1
- package/src/index-javascript.js +0 -30
- package/src/index.ts +31 -0
- package/src/locale/LocaleProvider.tsx +2 -2
- package/src/shapes.js +0 -7
- package/src/types.ts +3 -1
- package/es/NDLAFilm/interfaces.js +0 -0
- package/es/NDLAFilm/shapes.js +0 -15
- package/lib/NDLAFilm/interfaces.d.ts +0 -10
- package/lib/NDLAFilm/interfaces.js +0 -1
- package/lib/NDLAFilm/shapes.d.ts +0 -15
- package/lib/NDLAFilm/shapes.js +0 -30
- package/src/NDLAFilm/FilmMovieSearch.jsx +0 -66
- package/src/NDLAFilm/MovieGrid.jsx +0 -75
- package/src/NDLAFilm/VisualElement.jsx +0 -48
- package/src/NDLAFilm/interfaces.ts +0 -10
- package/src/NDLAFilm/shapes.ts +0 -17
- package/src/TopicIntroductionList/TopicIntroductionShortcuts.jsx +0 -92
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import { spacing, spacingUnit, animations } from '@ndla/core';
|
|
4
|
-
// @ts-ignore
|
|
5
4
|
import Spinner from '../Spinner';
|
|
6
5
|
|
|
7
6
|
const StyledWrapper = styled.div`
|
|
@@ -26,7 +25,7 @@ type Props = {
|
|
|
26
25
|
value: string;
|
|
27
26
|
};
|
|
28
27
|
|
|
29
|
-
const LoadingWrapper
|
|
28
|
+
const LoadingWrapper = ({ value }: Props) => (
|
|
30
29
|
<StyledWrapper>
|
|
31
30
|
<span>{value}</span>
|
|
32
31
|
<div>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { FormEvent, ReactNode } from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import { css } from '@emotion/core';
|
|
4
4
|
import { spacing, mq, breakpoints } from '@ndla/core';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
|
-
children:
|
|
7
|
+
children: ReactNode;
|
|
8
8
|
inputHasFocus?: boolean;
|
|
9
|
-
onSubmit?: (event:
|
|
9
|
+
onSubmit?: (event: FormEvent) => void;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
type StyledProps = {
|
|
@@ -56,7 +56,7 @@ const StyledForm = styled.form<StyledProps>`
|
|
|
56
56
|
`}
|
|
57
57
|
`;
|
|
58
58
|
|
|
59
|
-
export const SearchFieldForm
|
|
59
|
+
export const SearchFieldForm = ({ children, inputHasFocus, onSubmit }: Props) => {
|
|
60
60
|
return (
|
|
61
61
|
<StyledForm action="/search/" inputHasFocus={inputHasFocus} onSubmit={onSubmit}>
|
|
62
62
|
{children}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Component, Fragment } from 'react';
|
|
1
|
+
import React, { Component, Fragment, createRef } from 'react';
|
|
2
2
|
import BEMHelper from 'react-bem-helper';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { Back } from '@ndla/icons/common';
|
|
@@ -23,7 +23,7 @@ class SearchPage extends Component {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
this.filterCloseButton = null;
|
|
26
|
-
this.inputRef =
|
|
26
|
+
this.inputRef = createRef();
|
|
27
27
|
this.checkScreenSize = this.checkScreenSize.bind(this);
|
|
28
28
|
this.checkScreenSizeDebounce = debounce(() => this.checkScreenSize(), 100);
|
|
29
29
|
}
|
|
@@ -217,7 +217,7 @@ type Props = {
|
|
|
217
217
|
suggestionUrl?: string;
|
|
218
218
|
};
|
|
219
219
|
|
|
220
|
-
const SearchResultSleeve
|
|
220
|
+
const SearchResultSleeve = ({
|
|
221
221
|
result,
|
|
222
222
|
allResultUrl,
|
|
223
223
|
resourceToLinkProps,
|
|
@@ -229,7 +229,7 @@ const SearchResultSleeve: React.FC<Props> = ({
|
|
|
229
229
|
frontpage,
|
|
230
230
|
suggestion,
|
|
231
231
|
suggestionUrl,
|
|
232
|
-
}) => {
|
|
232
|
+
}: Props) => {
|
|
233
233
|
const { t } = useTranslation();
|
|
234
234
|
const contentRef = useRef<HTMLDivElement>(null);
|
|
235
235
|
const searchAllRef = useRef<HTMLDivElement>(null);
|
|
@@ -6,11 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
9
|
+
import React, { ReactElement } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import css from '@emotion/css';
|
|
12
12
|
import { spacing, mq, breakpoints } from '@ndla/core';
|
|
13
|
-
// @ts-ignore
|
|
14
13
|
import Tooltip from '@ndla/tooltip';
|
|
15
14
|
import { useTranslation } from 'react-i18next';
|
|
16
15
|
import ActiveFilterContent, { FilterProps, StyledActiveFilterTitle } from './ActiveFilterContent';
|
|
@@ -88,7 +87,7 @@ type Props = {
|
|
|
88
87
|
filters: FilterProps[];
|
|
89
88
|
onFilterRemove: (value: string, name: string) => void;
|
|
90
89
|
showOnSmallScreen?: boolean;
|
|
91
|
-
customElements?:
|
|
90
|
+
customElements?: ReactElement[];
|
|
92
91
|
};
|
|
93
92
|
|
|
94
93
|
const ActiveFilters = ({ filters, onFilterRemove, showOnSmallScreen, customElements }: Props) => {
|
|
@@ -8,12 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
import React, { useEffect, useRef, useState } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
// @ts-ignore
|
|
12
11
|
import Modal, { ModalCloseButton, ModalBody } from '@ndla/modal';
|
|
13
12
|
import { breakpoints, fonts, mq, spacing } from '@ndla/core';
|
|
14
13
|
// @ts-ignore
|
|
15
14
|
import Button from '@ndla/button';
|
|
16
|
-
// @ts-ignore
|
|
17
15
|
import { Plus as PlusIcon } from '@ndla/icons/action';
|
|
18
16
|
import { useTranslation } from 'react-i18next';
|
|
19
17
|
// @ts-ignore
|
|
@@ -9,10 +9,8 @@
|
|
|
9
9
|
import React, { FormEvent, useEffect, useRef, useState } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { colors, breakpoints, mq } from '@ndla/core';
|
|
12
|
-
// @ts-ignore
|
|
13
12
|
import { Search as SearchIcon } from '@ndla/icons/common';
|
|
14
13
|
import { spacing } from '@ndla/core';
|
|
15
|
-
// @ts-ignore
|
|
16
14
|
import { Cross as CrossIcon } from '@ndla/icons/action';
|
|
17
15
|
|
|
18
16
|
import { useTranslation } from 'react-i18next';
|
|
@@ -86,7 +84,7 @@ type Props = {
|
|
|
86
84
|
};
|
|
87
85
|
};
|
|
88
86
|
|
|
89
|
-
const SearchFieldHeader
|
|
87
|
+
const SearchFieldHeader = ({ value, onSubmit, onChange, filters, activeFilters }: Props) => {
|
|
90
88
|
const { t } = useTranslation();
|
|
91
89
|
const [hasFocus, setHasFocus] = useState(false);
|
|
92
90
|
const [isNarrowScreen, setIsNarrowScreen] = useState(false);
|
|
@@ -6,24 +6,19 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
9
|
+
import React, { ReactNode } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import parse from 'html-react-parser';
|
|
12
|
-
// @ts-ignore
|
|
13
12
|
import { ChevronRight, Additional, Core } from '@ndla/icons/common';
|
|
14
13
|
import SafeLink from '@ndla/safelink';
|
|
15
14
|
// @ts-ignore
|
|
16
15
|
import Button from '@ndla/button';
|
|
17
|
-
// @ts-ignore
|
|
18
16
|
import Modal, { ModalCloseButton } from '@ndla/modal';
|
|
19
17
|
|
|
20
18
|
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
21
19
|
import { useTranslation } from 'react-i18next';
|
|
22
20
|
import { ContentType } from './SearchTypeResult';
|
|
23
|
-
// @ts-ignore
|
|
24
21
|
import constants from '../model';
|
|
25
|
-
|
|
26
|
-
// @ts-ignore
|
|
27
22
|
import ContentTypeBadge from '../ContentTypeBadge';
|
|
28
23
|
|
|
29
24
|
const { contentTypes } = constants;
|
|
@@ -210,7 +205,7 @@ export type SearchItemType = {
|
|
|
210
205
|
contexts?: context[];
|
|
211
206
|
img?: { url: string; alt: string };
|
|
212
207
|
labels?: string[];
|
|
213
|
-
children?:
|
|
208
|
+
children?: ReactNode;
|
|
214
209
|
};
|
|
215
210
|
type Props = {
|
|
216
211
|
item: SearchItemType;
|
|
@@ -221,7 +216,7 @@ const SearchItem = ({ item, type }: Props) => {
|
|
|
221
216
|
const { title, url, ingress, contexts, img = null, labels = [] } = item;
|
|
222
217
|
const mainContext = contexts?.[0];
|
|
223
218
|
|
|
224
|
-
const Breadcrumb = ({ breadcrumb, children }: { breadcrumb: string[]; children?:
|
|
219
|
+
const Breadcrumb = ({ breadcrumb, children }: { breadcrumb: string[]; children?: ReactNode }) => (
|
|
225
220
|
<BreadcrumbPath>
|
|
226
221
|
{breadcrumb.map((breadcrumbItem: string, i: number) => {
|
|
227
222
|
return (
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
9
|
+
import React, { memo } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { breakpoints, mq, spacing } from '@ndla/core';
|
|
12
12
|
import SearchItem, { SearchItemType } from './SearchItem';
|
|
@@ -52,4 +52,4 @@ const SearchItems = ({ items, type }: Props) => (
|
|
|
52
52
|
</Wrapper>
|
|
53
53
|
);
|
|
54
54
|
|
|
55
|
-
export default
|
|
55
|
+
export default memo(SearchItems);
|
|
@@ -6,20 +6,16 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
9
|
+
import React, { MouseEventHandler, ReactNode } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import parse from 'html-react-parser';
|
|
12
12
|
|
|
13
13
|
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
14
|
-
// @ts-ignore
|
|
15
14
|
import { getLicenseByAbbreviation } from '@ndla/licenses';
|
|
16
15
|
// @ts-ignore
|
|
17
16
|
import Button from '@ndla/button';
|
|
18
|
-
// @ts-ignore
|
|
19
17
|
import { Play } from '@ndla/icons/common';
|
|
20
|
-
// @ts-ignore
|
|
21
18
|
import { ArrowExpand } from '@ndla/icons/editor';
|
|
22
|
-
// @ts-ignore
|
|
23
19
|
import Modal, { ModalCloseButton, ModalHeader, ModalBody } from '@ndla/modal';
|
|
24
20
|
import { useTranslation } from 'react-i18next';
|
|
25
21
|
import { joinArrayWithConjunction } from '@ndla/util';
|
|
@@ -122,15 +118,15 @@ const AuthorsWrapper = styled.div`
|
|
|
122
118
|
export type SearchNotionItemProps = {
|
|
123
119
|
id: string | number;
|
|
124
120
|
title: string;
|
|
125
|
-
text:
|
|
121
|
+
text: ReactNode;
|
|
126
122
|
image?: { url: string; alt: string };
|
|
127
123
|
media?: NotionMedia;
|
|
128
124
|
labels?: string[];
|
|
129
125
|
authors?: { name: string }[];
|
|
130
126
|
license?: string;
|
|
131
127
|
locale?: string;
|
|
132
|
-
onReferenceClick?:
|
|
133
|
-
renderMarkdown: (text:
|
|
128
|
+
onReferenceClick?: MouseEventHandler<HTMLButtonElement>;
|
|
129
|
+
renderMarkdown: (text: ReactNode) => string;
|
|
134
130
|
};
|
|
135
131
|
|
|
136
132
|
const SearchNotionItem = ({
|
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
9
|
+
import React, { ReactNode } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { fonts, mq, breakpoints, spacing } from '@ndla/core';
|
|
12
|
-
// @ts-ignore
|
|
13
12
|
import { ModalCloseButton } from '@ndla/modal';
|
|
14
|
-
// @ts-ignore
|
|
15
13
|
import { withTranslation, WithTranslation } from 'react-i18next';
|
|
16
14
|
import SearchNotionItem, { SearchNotionItemProps } from './SearchNotionItem';
|
|
17
15
|
|
|
@@ -52,7 +50,7 @@ type Props = {
|
|
|
52
50
|
items: SearchNotionItemProps[];
|
|
53
51
|
totalCount: number;
|
|
54
52
|
onRemove: () => void;
|
|
55
|
-
renderMarkdown: (text:
|
|
53
|
+
renderMarkdown: (text: ReactNode) => string;
|
|
56
54
|
};
|
|
57
55
|
|
|
58
56
|
const SearchNotionsResult = ({ items, totalCount, onRemove, renderMarkdown, t }: Props & WithTranslation) => (
|
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react'; // useMemo , { Children }
|
|
9
|
+
import React, { MouseEvent, memo } from 'react'; // useMemo , { Children }
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
// @ts-ignore
|
|
12
12
|
import Button from '@ndla/button';
|
|
13
13
|
import { breakpoints, mq, spacing } from '@ndla/core';
|
|
14
14
|
import { WithTranslation, withTranslation } from 'react-i18next';
|
|
15
|
-
// @ts-ignore
|
|
16
15
|
import ContentTypeBadge from '../ContentTypeBadge';
|
|
17
16
|
import { ContentType } from './SearchTypeResult';
|
|
18
17
|
|
|
@@ -98,7 +97,7 @@ const SearchTypeHeader = ({ filters, onFilterClick, totalCount, type, t }: Props
|
|
|
98
97
|
<Button
|
|
99
98
|
size="small"
|
|
100
99
|
lighter={!option.active}
|
|
101
|
-
onClick={(e:
|
|
100
|
+
onClick={(e: MouseEvent<HTMLButtonElement>) => {
|
|
102
101
|
if (e.currentTarget && option.active) {
|
|
103
102
|
e.currentTarget.blur();
|
|
104
103
|
}
|
|
@@ -112,4 +111,4 @@ const SearchTypeHeader = ({ filters, onFilterClick, totalCount, type, t }: Props
|
|
|
112
111
|
)}
|
|
113
112
|
</HeaderWrapper>
|
|
114
113
|
);
|
|
115
|
-
export default
|
|
114
|
+
export default memo(withTranslation()(SearchTypeHeader));
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
9
|
+
import React, { memo, ReactNode } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { spacing } from '@ndla/core';
|
|
12
|
-
// @ts-ignore
|
|
13
12
|
import Spinner from '../Spinner';
|
|
14
13
|
import constants from '../model';
|
|
15
14
|
import SearchTypeHeader, { FilterOptionsType } from './SearchTypeHeader';
|
|
@@ -58,7 +57,7 @@ type Props = {
|
|
|
58
57
|
pagination?: PaginationType;
|
|
59
58
|
type?: ContentType;
|
|
60
59
|
loading?: boolean;
|
|
61
|
-
children?:
|
|
60
|
+
children?: ReactNode;
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
const SearchTypeResult = ({
|
|
@@ -86,4 +85,4 @@ const SearchTypeResult = ({
|
|
|
86
85
|
</Wrapper>
|
|
87
86
|
);
|
|
88
87
|
|
|
89
|
-
export default
|
|
88
|
+
export default memo(SearchTypeResult);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
9
|
+
import React, { MouseEvent } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { breakpoints, fonts, mq } from '@ndla/core';
|
|
12
12
|
import { WithTranslation, withTranslation } from 'react-i18next';
|
|
@@ -43,7 +43,7 @@ type Props = {
|
|
|
43
43
|
title: string;
|
|
44
44
|
introduction: string;
|
|
45
45
|
topics: ItemProps[];
|
|
46
|
-
onSelectTopic?: (event:
|
|
46
|
+
onSelectTopic?: (event: MouseEvent<HTMLElement>, id?: string) => void;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
const ToolboxInfo = ({ title, introduction, topics, onSelectTopic, t }: Props & WithTranslation) => (
|
package/src/Topic/Loader.tsx
CHANGED
package/src/Topic/Topic.tsx
CHANGED
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
9
|
+
import React, { ReactNode, MouseEvent } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { animations, breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
12
12
|
|
|
13
13
|
import parse from 'html-react-parser';
|
|
14
14
|
import { ChevronDown, ChevronUp, PlayCircleFilled } from '@ndla/icons/common';
|
|
15
|
-
// @ts-ignore
|
|
16
15
|
import Modal, { ModalCloseButton, ModalHeader, ModalBody } from '@ndla/modal';
|
|
17
16
|
// @ts-ignore
|
|
18
17
|
import Button from '@ndla/button';
|
|
@@ -212,7 +211,7 @@ const StyledNavigationBoxWrapper = styled.div`
|
|
|
212
211
|
|
|
213
212
|
type VisualElementProps = {
|
|
214
213
|
type: 'image' | 'video' | 'other';
|
|
215
|
-
element:
|
|
214
|
+
element: ReactNode;
|
|
216
215
|
};
|
|
217
216
|
|
|
218
217
|
export type TopicProps = {
|
|
@@ -226,10 +225,10 @@ export type TopicProps = {
|
|
|
226
225
|
focalPoint?: ImageFocalPoint;
|
|
227
226
|
};
|
|
228
227
|
visualElement?: VisualElementProps;
|
|
229
|
-
resources?:
|
|
228
|
+
resources?: ReactNode;
|
|
230
229
|
};
|
|
231
230
|
subTopics?: ItemProps[] | null | undefined;
|
|
232
|
-
onSubTopicSelected?: (event:
|
|
231
|
+
onSubTopicSelected?: (event: MouseEvent<HTMLElement>, id?: string) => void;
|
|
233
232
|
isLoading?: boolean;
|
|
234
233
|
renderMarkdown?: (text: string) => string;
|
|
235
234
|
invertedStyle?: boolean;
|
|
@@ -237,7 +236,7 @@ export type TopicProps = {
|
|
|
237
236
|
showContent?: boolean;
|
|
238
237
|
isAdditionalTopic?: boolean;
|
|
239
238
|
frame?: boolean;
|
|
240
|
-
children?:
|
|
239
|
+
children?: ReactNode;
|
|
241
240
|
};
|
|
242
241
|
|
|
243
242
|
const Topic = ({
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
10
|
import BEMHelper from 'react-bem-helper';
|
|
11
|
+
import { useTranslation } from 'react-i18next';
|
|
12
12
|
import { Additional, Core } from '@ndla/icons/common';
|
|
13
13
|
import Tooltip from '@ndla/tooltip';
|
|
14
14
|
import SafeLink from '@ndla/safelink';
|
|
15
|
-
import { TopicShape, ShortcutShape } from '../shapes';
|
|
16
15
|
import TopicIntroductionShortcuts from './TopicIntroductionShortcuts';
|
|
16
|
+
import { Shortcut, Topic } from './TopicIntroductionList';
|
|
17
17
|
|
|
18
18
|
const topicClasses = new BEMHelper({
|
|
19
19
|
prefix: 'c-',
|
|
@@ -21,23 +21,35 @@ const topicClasses = new BEMHelper({
|
|
|
21
21
|
outputIsString: true,
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
+
interface Props {
|
|
25
|
+
additional?: boolean;
|
|
26
|
+
showAdditionalCores?: boolean;
|
|
27
|
+
topic: Topic;
|
|
28
|
+
toTopic: (id: string) => string;
|
|
29
|
+
subjectPage?: boolean;
|
|
30
|
+
shortcuts?: Shortcut[];
|
|
31
|
+
twoColumns?: boolean;
|
|
32
|
+
shortcutAlwaysExpanded?: boolean;
|
|
33
|
+
id: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
24
36
|
export const TopicIntroduction = ({
|
|
25
37
|
toTopic,
|
|
26
38
|
topic,
|
|
27
39
|
subjectPage,
|
|
28
40
|
shortcuts,
|
|
29
|
-
messages,
|
|
30
41
|
shortcutAlwaysExpanded,
|
|
31
|
-
additional,
|
|
32
|
-
showAdditionalCores,
|
|
42
|
+
additional = false,
|
|
43
|
+
showAdditionalCores = false,
|
|
33
44
|
id,
|
|
34
|
-
}) => {
|
|
35
|
-
const
|
|
45
|
+
}: Props) => {
|
|
46
|
+
const { t } = useTranslation();
|
|
47
|
+
const contentTypeDescription = t(additional ? 'resource.tooltipAdditionalTopic' : 'resource.tooltipCoreTopic');
|
|
36
48
|
|
|
37
49
|
return (
|
|
38
50
|
<li
|
|
39
51
|
className={topicClasses('item', {
|
|
40
|
-
subjectPage,
|
|
52
|
+
subjectPage: !!subjectPage,
|
|
41
53
|
additional,
|
|
42
54
|
showAdditionalCores,
|
|
43
55
|
})}>
|
|
@@ -52,12 +64,12 @@ export const TopicIntroduction = ({
|
|
|
52
64
|
{contentTypeDescription}
|
|
53
65
|
</span>
|
|
54
66
|
{additional && (
|
|
55
|
-
<Tooltip tooltip={
|
|
67
|
+
<Tooltip tooltip={t('resource.tooltipAdditionalTopic')} align="left">
|
|
56
68
|
<Additional className="c-icon--20 u-margin-left-tiny" />
|
|
57
69
|
</Tooltip>
|
|
58
70
|
)}
|
|
59
71
|
{!additional && showAdditionalCores && (
|
|
60
|
-
<Tooltip tooltip={
|
|
72
|
+
<Tooltip tooltip={t('resource.tooltipCoreTopic')} align="left">
|
|
61
73
|
<Core className="c-icon--20 u-margin-left-tiny" />
|
|
62
74
|
</Tooltip>
|
|
63
75
|
)}
|
|
@@ -73,9 +85,6 @@ export const TopicIntroduction = ({
|
|
|
73
85
|
alwaysExpanded={shortcutAlwaysExpanded}
|
|
74
86
|
id={`${topic.id}_shortcuts`}
|
|
75
87
|
shortcuts={shortcuts}
|
|
76
|
-
messages={{
|
|
77
|
-
toggleButtonText: messages.shortcutButtonText,
|
|
78
|
-
}}
|
|
79
88
|
/>
|
|
80
89
|
)}
|
|
81
90
|
</div>
|
|
@@ -89,25 +98,3 @@ export const TopicIntroduction = ({
|
|
|
89
98
|
</li>
|
|
90
99
|
);
|
|
91
100
|
};
|
|
92
|
-
|
|
93
|
-
TopicIntroduction.propTypes = {
|
|
94
|
-
additional: PropTypes.bool,
|
|
95
|
-
showAdditionalCores: PropTypes.bool,
|
|
96
|
-
messages: PropTypes.shape({
|
|
97
|
-
shortcutButtonText: PropTypes.string.isRequired,
|
|
98
|
-
tooltipAdditionalTopic: PropTypes.string,
|
|
99
|
-
tooltipCoreTopic: PropTypes.string,
|
|
100
|
-
}),
|
|
101
|
-
topic: TopicShape.isRequired,
|
|
102
|
-
toTopic: PropTypes.func.isRequired,
|
|
103
|
-
subjectPage: PropTypes.bool,
|
|
104
|
-
shortcuts: PropTypes.arrayOf(ShortcutShape),
|
|
105
|
-
twoColumns: PropTypes.bool,
|
|
106
|
-
shortcutAlwaysExpanded: PropTypes.bool,
|
|
107
|
-
id: PropTypes.string.isRequired,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
TopicIntroduction.defaultProps = {
|
|
111
|
-
showAdditionalCores: false,
|
|
112
|
-
additional: false,
|
|
113
|
-
};
|
|
@@ -7,11 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
10
|
import BEMHelper from 'react-bem-helper';
|
|
12
11
|
import { useTranslation } from 'react-i18next';
|
|
13
12
|
import NoContentBox from '../NoContentBox';
|
|
14
|
-
import { TopicShape } from '../shapes';
|
|
15
13
|
import { TopicIntroduction } from './TopicIntroduction';
|
|
16
14
|
|
|
17
15
|
const topicClasses = new BEMHelper({
|
|
@@ -20,14 +18,42 @@ const topicClasses = new BEMHelper({
|
|
|
20
18
|
outputIsString: true,
|
|
21
19
|
});
|
|
22
20
|
|
|
21
|
+
export interface Shortcut {
|
|
22
|
+
id: string | number;
|
|
23
|
+
tooltip: string;
|
|
24
|
+
contentType: string;
|
|
25
|
+
url: string;
|
|
26
|
+
count: number;
|
|
27
|
+
}
|
|
28
|
+
export interface Topic {
|
|
29
|
+
name: string;
|
|
30
|
+
id: string;
|
|
31
|
+
additional?: boolean;
|
|
32
|
+
shortcuts?: Shortcut[];
|
|
33
|
+
introduction: string;
|
|
34
|
+
metaImage?: {
|
|
35
|
+
url?: string;
|
|
36
|
+
alt?: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface Props {
|
|
41
|
+
toTopic: (id: string) => string;
|
|
42
|
+
topics: Topic[];
|
|
43
|
+
twoColumns?: boolean;
|
|
44
|
+
shortcutAlwaysExpanded?: boolean;
|
|
45
|
+
showAdditionalCores?: boolean;
|
|
46
|
+
toggleAdditionalCores?: () => void;
|
|
47
|
+
}
|
|
48
|
+
|
|
23
49
|
const TopicIntroductionList = ({
|
|
24
50
|
topics,
|
|
25
|
-
twoColumns,
|
|
26
|
-
shortcutAlwaysExpanded,
|
|
27
|
-
showAdditionalCores,
|
|
51
|
+
twoColumns = false,
|
|
52
|
+
shortcutAlwaysExpanded = false,
|
|
53
|
+
showAdditionalCores = false,
|
|
28
54
|
toggleAdditionalCores,
|
|
29
55
|
...rest
|
|
30
|
-
}) => {
|
|
56
|
+
}: Props) => {
|
|
31
57
|
const { t } = useTranslation();
|
|
32
58
|
const renderAdditionalTopicsTrigger =
|
|
33
59
|
!showAdditionalCores &&
|
|
@@ -47,11 +73,6 @@ const TopicIntroductionList = ({
|
|
|
47
73
|
additional={additional}
|
|
48
74
|
showAdditionalCores={showAdditionalCores}
|
|
49
75
|
shortcutAlwaysExpanded={shortcutAlwaysExpanded}
|
|
50
|
-
messages={{
|
|
51
|
-
shortcutButtonText: t('resource.label'),
|
|
52
|
-
tooltipAdditionalTopic: t('resource.tooltipAdditionalTopic'),
|
|
53
|
-
tooltipCoreTopic: t('resource.tooltipCoreTopic'),
|
|
54
|
-
}}
|
|
55
76
|
id={`${topic.id}_${index}`}
|
|
56
77
|
/>
|
|
57
78
|
);
|
|
@@ -69,19 +90,4 @@ const TopicIntroductionList = ({
|
|
|
69
90
|
);
|
|
70
91
|
};
|
|
71
92
|
|
|
72
|
-
TopicIntroductionList.propTypes = {
|
|
73
|
-
toTopic: PropTypes.func.isRequired,
|
|
74
|
-
topics: PropTypes.arrayOf(TopicShape).isRequired,
|
|
75
|
-
twoColumns: PropTypes.bool,
|
|
76
|
-
shortcutAlwaysExpanded: PropTypes.bool,
|
|
77
|
-
showAdditionalCores: PropTypes.bool,
|
|
78
|
-
toggleAdditionalCores: PropTypes.func.isRequired,
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
TopicIntroductionList.defaultProps = {
|
|
82
|
-
twoColumns: false,
|
|
83
|
-
shortcutAlwaysExpanded: false,
|
|
84
|
-
showAdditionalCores: false,
|
|
85
|
-
};
|
|
86
|
-
|
|
87
93
|
export default TopicIntroductionList;
|