@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,11 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { spacing, colors, fonts, breakpoints } from '@ndla/core';
|
|
4
3
|
import SafeLink from '@ndla/safelink';
|
|
5
4
|
import styled from '@emotion/styled';
|
|
6
|
-
// @ts-ignore
|
|
7
5
|
import { makeSrcQueryString } from '../Image';
|
|
8
6
|
import FilmContentCardTags from './FilmContentCardTags';
|
|
7
|
+
import { MovieResourceType, MovieType } from './types';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
movie: MovieType;
|
|
11
|
+
columnWidth: number;
|
|
12
|
+
distanceBetweenItems?: number;
|
|
13
|
+
resourceTypes: MovieResourceType[];
|
|
14
|
+
resizeThumbnailImages?: boolean;
|
|
15
|
+
hideTags?: boolean;
|
|
16
|
+
}
|
|
9
17
|
|
|
10
18
|
const FilmContentCard = ({
|
|
11
19
|
movie: { metaImage, resourceTypes: movieResourceTypes, title, id, path },
|
|
@@ -13,8 +21,8 @@ const FilmContentCard = ({
|
|
|
13
21
|
distanceBetweenItems,
|
|
14
22
|
resourceTypes,
|
|
15
23
|
resizeThumbnailImages,
|
|
16
|
-
hideTags,
|
|
17
|
-
}) => {
|
|
24
|
+
hideTags = false,
|
|
25
|
+
}: Props) => {
|
|
18
26
|
let backgroundImage = `${(metaImage && metaImage.url) || ''}`;
|
|
19
27
|
if (resizeThumbnailImages && metaImage) {
|
|
20
28
|
backgroundImage += '?width=480';
|
|
@@ -55,7 +63,10 @@ const StyledMovieTitle = styled.h2`
|
|
|
55
63
|
}
|
|
56
64
|
`;
|
|
57
65
|
|
|
58
|
-
|
|
66
|
+
interface StyledImageProps {
|
|
67
|
+
columnWidth: number;
|
|
68
|
+
}
|
|
69
|
+
const StyledImage = styled.div<StyledImageProps>`
|
|
59
70
|
height: ${(props) => props.columnWidth * 0.5625}px;
|
|
60
71
|
background-size: cover;
|
|
61
72
|
background-color: ${colors.ndlaFilm.filmColorLight};
|
|
@@ -78,7 +89,11 @@ const StyledImage = styled.div`
|
|
|
78
89
|
}
|
|
79
90
|
`;
|
|
80
91
|
|
|
81
|
-
|
|
92
|
+
interface StyledSlideWrapperProps {
|
|
93
|
+
columnWidth: number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const StyledSlideWrapper = styled.div<StyledSlideWrapperProps>`
|
|
82
97
|
width: ${(props) => props.columnWidth}px;
|
|
83
98
|
color: #fff;
|
|
84
99
|
box-shadow: none;
|
|
@@ -98,20 +113,4 @@ const StyledSlideWrapper = styled.div`
|
|
|
98
113
|
}
|
|
99
114
|
`;
|
|
100
115
|
|
|
101
|
-
FilmContentCard.propTypes = {
|
|
102
|
-
movie: PropTypes.shape({
|
|
103
|
-
id: PropTypes.string,
|
|
104
|
-
url: PropTypes.string,
|
|
105
|
-
}).isRequired,
|
|
106
|
-
columnWidth: PropTypes.number,
|
|
107
|
-
distanceBetweenItems: PropTypes.number,
|
|
108
|
-
resourceTypes: PropTypes.arrayOf(PropTypes.object),
|
|
109
|
-
resizeThumbnailImages: PropTypes.bool,
|
|
110
|
-
hideTags: PropTypes.bool,
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
FilmContentCard.defaultProps = {
|
|
114
|
-
hideTags: false,
|
|
115
|
-
};
|
|
116
|
-
|
|
117
116
|
export default FilmContentCard;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { spacing, spacingUnit, colors, fonts, misc } from '@ndla/core';
|
|
4
3
|
import styled from '@emotion/styled';
|
|
4
|
+
import { MovieResourceType } from './types';
|
|
5
5
|
|
|
6
6
|
const StyledWrapperDiv = styled.div`
|
|
7
7
|
transition: opacity 200ms ease;
|
|
@@ -22,8 +22,12 @@ const StyledMovieTags = styled.span`
|
|
|
22
22
|
margin-bottom: ${spacingUnit / 8}px;
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
interface Props {
|
|
26
|
+
movieResourceTypes: MovieResourceType[];
|
|
27
|
+
resourceTypes: MovieResourceType[];
|
|
28
|
+
}
|
|
29
|
+
const FilmContentCardTags = ({ movieResourceTypes, resourceTypes }: Props) => {
|
|
30
|
+
const resources: Record<string, boolean> = {};
|
|
27
31
|
movieResourceTypes.forEach((movieResourceType) => {
|
|
28
32
|
const resource = resourceTypes.find((resourceType) => resourceType.id === movieResourceType.id);
|
|
29
33
|
if (resource) {
|
|
@@ -39,8 +43,4 @@ const FilmContentCardTags = ({ movieResourceTypes, resourceTypes }) => {
|
|
|
39
43
|
);
|
|
40
44
|
};
|
|
41
45
|
|
|
42
|
-
FilmContentCardTags.propTypes = {
|
|
43
|
-
resourceTypes: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
44
|
-
};
|
|
45
|
-
|
|
46
46
|
export default FilmContentCardTags;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2016-present, NDLA.
|
|
1
|
+
/** * Copyright (c) 2016-present, NDLA.
|
|
3
2
|
*
|
|
4
3
|
* This source code is licensed under the GPLv3 license found in the
|
|
5
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -7,31 +6,41 @@
|
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
8
|
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
9
|
import BEMHelper from 'react-bem-helper';
|
|
12
|
-
import { Carousel } from '@ndla/carousel';
|
|
10
|
+
import { Carousel, CalculatedCarouselProps } from '@ndla/carousel';
|
|
13
11
|
import FilmContentCard from './FilmContentCard';
|
|
14
|
-
import {
|
|
12
|
+
import { MovieResourceType, MovieType } from './types';
|
|
15
13
|
|
|
16
14
|
const classes = new BEMHelper({
|
|
17
15
|
name: 'film-movielist',
|
|
18
16
|
prefix: 'c-',
|
|
19
17
|
});
|
|
20
18
|
|
|
19
|
+
interface Props {
|
|
20
|
+
movies: MovieType[];
|
|
21
|
+
name: string;
|
|
22
|
+
slideBackwardsLabel: string;
|
|
23
|
+
slideForwardsLabel: string;
|
|
24
|
+
resourceTypes: MovieResourceType[];
|
|
25
|
+
autoSizedProps: CalculatedCarouselProps;
|
|
26
|
+
resizeThumbnailImages?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
const FilmMovieList = ({
|
|
22
30
|
name,
|
|
23
|
-
movies,
|
|
31
|
+
movies = [],
|
|
24
32
|
slideBackwardsLabel,
|
|
25
33
|
slideForwardsLabel,
|
|
26
|
-
resourceTypes,
|
|
34
|
+
resourceTypes = [],
|
|
27
35
|
autoSizedProps,
|
|
28
36
|
resizeThumbnailImages,
|
|
29
|
-
}) => (
|
|
37
|
+
}: Props) => (
|
|
30
38
|
<section {...classes()}>
|
|
31
39
|
<h1 {...classes('heading')} style={{ marginLeft: `${autoSizedProps.margin}px` }}>
|
|
32
40
|
{name}
|
|
33
41
|
</h1>
|
|
34
42
|
<Carousel
|
|
43
|
+
disableScroll={false}
|
|
35
44
|
slideBackwardsLabel={slideBackwardsLabel}
|
|
36
45
|
slideForwardsLabel={slideForwardsLabel}
|
|
37
46
|
buttonClass="c-film-movielist__carousel-buttons"
|
|
@@ -50,23 +59,4 @@ const FilmMovieList = ({
|
|
|
50
59
|
</section>
|
|
51
60
|
);
|
|
52
61
|
|
|
53
|
-
FilmMovieList.propTypes = {
|
|
54
|
-
movies: PropTypes.arrayOf(movieShape),
|
|
55
|
-
name: PropTypes.string.isRequired,
|
|
56
|
-
slideBackwardsLabel: PropTypes.string.isRequired,
|
|
57
|
-
slideForwardsLabel: PropTypes.string.isRequired,
|
|
58
|
-
resourceTypes: PropTypes.arrayOf(
|
|
59
|
-
PropTypes.shape({
|
|
60
|
-
name: PropTypes.string,
|
|
61
|
-
id: PropTypes.id,
|
|
62
|
-
}),
|
|
63
|
-
),
|
|
64
|
-
autoSizedProps: PropTypes.shape({}),
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
FilmMovieList.defaultProps = {
|
|
68
|
-
movies: [],
|
|
69
|
-
resourceTypes: [],
|
|
70
|
-
};
|
|
71
|
-
|
|
72
62
|
export default FilmMovieList;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2016-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import BEMHelper from 'react-bem-helper';
|
|
11
|
+
import SafeLink from '@ndla/safelink';
|
|
12
|
+
import { useTranslation } from 'react-i18next';
|
|
13
|
+
import CategorySelect from './CategorySelect';
|
|
14
|
+
import { MovieResourceType } from './types';
|
|
15
|
+
import { OneColumn } from '..';
|
|
16
|
+
|
|
17
|
+
const classes = new BEMHelper({
|
|
18
|
+
name: 'film-moviesearch',
|
|
19
|
+
prefix: 'c-',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const classesMovieList = new BEMHelper({
|
|
23
|
+
name: 'film-movielist',
|
|
24
|
+
prefix: 'c-',
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
interface Props {
|
|
28
|
+
topics?: { id: string; path: string; name: string }[];
|
|
29
|
+
onChangeResourceType: (resourceType?: string) => void;
|
|
30
|
+
resourceTypeSelected?: MovieResourceType;
|
|
31
|
+
resourceTypes: MovieResourceType[];
|
|
32
|
+
ariaControlId: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const FilmMovieSearch = ({
|
|
36
|
+
topics = [],
|
|
37
|
+
onChangeResourceType,
|
|
38
|
+
resourceTypes,
|
|
39
|
+
resourceTypeSelected,
|
|
40
|
+
ariaControlId,
|
|
41
|
+
}: Props) => {
|
|
42
|
+
const { t } = useTranslation();
|
|
43
|
+
return (
|
|
44
|
+
<div {...classes('')}>
|
|
45
|
+
<OneColumn>
|
|
46
|
+
<div {...classes('topic-navigation')}>
|
|
47
|
+
<h2 {...classesMovieList('heading', '', 'u-12/12 u-4/12@tablet')}>{t('ndlaFilm.subjectsInMovies')}:</h2>
|
|
48
|
+
<nav className="u-12/12 u-8/12@tablet">
|
|
49
|
+
<ul>
|
|
50
|
+
{topics.map((topic) => (
|
|
51
|
+
<li key={topic.id}>
|
|
52
|
+
<SafeLink to={topic.path} key={topic.id}>
|
|
53
|
+
<span>{topic.name}</span>
|
|
54
|
+
</SafeLink>
|
|
55
|
+
</li>
|
|
56
|
+
))}
|
|
57
|
+
</ul>
|
|
58
|
+
</nav>
|
|
59
|
+
</div>
|
|
60
|
+
<CategorySelect
|
|
61
|
+
onChangeResourceType={onChangeResourceType}
|
|
62
|
+
resourceTypes={resourceTypes}
|
|
63
|
+
resourceTypeSelected={resourceTypeSelected}
|
|
64
|
+
ariaControlId={ariaControlId}
|
|
65
|
+
/>
|
|
66
|
+
</OneColumn>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default FilmMovieSearch;
|
|
@@ -7,21 +7,20 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
10
|
-
// @ts-ignore
|
|
11
10
|
import { SwipeEventData, useSwipeable } from 'react-swipeable';
|
|
12
11
|
import BEMHelper from 'react-bem-helper';
|
|
13
12
|
import SafeLink from '@ndla/safelink';
|
|
14
13
|
import { OneColumn } from '../Layout';
|
|
15
14
|
import Spinner from '../Spinner';
|
|
16
|
-
import { NDLAMovie } from './interfaces';
|
|
17
15
|
import NavigationArrow from './NavigationArrow';
|
|
18
16
|
import SlideshowIndicator from './SlideshowIndicator';
|
|
17
|
+
import { MovieType } from './types';
|
|
19
18
|
|
|
20
19
|
interface Props {
|
|
21
|
-
autoSlide
|
|
22
|
-
randomStart
|
|
23
|
-
slideshow:
|
|
24
|
-
slideInterval
|
|
20
|
+
autoSlide?: boolean;
|
|
21
|
+
randomStart?: boolean;
|
|
22
|
+
slideshow: MovieType[];
|
|
23
|
+
slideInterval?: number;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
const classes = new BEMHelper({
|
|
@@ -32,7 +31,7 @@ const classes = new BEMHelper({
|
|
|
32
31
|
const defaultTransitionSwipeEnd = 'transform 600ms cubic-bezier(0, 0.76, 0.09, 1)';
|
|
33
32
|
const defaultTransitionText = 'opacity 600ms ease';
|
|
34
33
|
|
|
35
|
-
const renderSlideItem = (slide:
|
|
34
|
+
const renderSlideItem = (slide: MovieType) => (
|
|
36
35
|
<div
|
|
37
36
|
{...classes('item')}
|
|
38
37
|
key={slide.id}
|
|
@@ -206,6 +205,8 @@ const FilmSlideshow = ({ autoSlide = false, slideshow = [], slideInterval = 5000
|
|
|
206
205
|
activeSlide = 0;
|
|
207
206
|
}
|
|
208
207
|
|
|
208
|
+
const backgroundImage = slideshow[activeSlide].metaImage;
|
|
209
|
+
|
|
209
210
|
return (
|
|
210
211
|
<section {...classes('')} {...handlers}>
|
|
211
212
|
<>
|
|
@@ -238,9 +239,7 @@ const FilmSlideshow = ({ autoSlide = false, slideshow = [], slideInterval = 5000
|
|
|
238
239
|
role="img"
|
|
239
240
|
onAnimationEnd={onChangedSlide}
|
|
240
241
|
style={{
|
|
241
|
-
backgroundImage: `url(${
|
|
242
|
-
(slideshow[activeSlide].metaImage && slideshow[activeSlide].metaImage.url) || ''
|
|
243
|
-
})`,
|
|
242
|
+
backgroundImage: `url(${(backgroundImage && backgroundImage.url) || ''})`,
|
|
244
243
|
}}
|
|
245
244
|
/>
|
|
246
245
|
)}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import BEMHelper from 'react-bem-helper';
|
|
3
|
+
import { css } from '@emotion/core';
|
|
4
|
+
import { CalculatedCarouselProps } from '@ndla/carousel';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import FilmContentCard from './FilmContentCard';
|
|
7
|
+
import { MovieResourceType, MovieType } from './types';
|
|
8
|
+
|
|
9
|
+
const movieListClasses = new BEMHelper({
|
|
10
|
+
name: 'film-movielist',
|
|
11
|
+
prefix: 'c-',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
autoSizedProps: CalculatedCarouselProps;
|
|
16
|
+
resourceTypeName?: MovieResourceType;
|
|
17
|
+
fetchingMoviesByType: boolean;
|
|
18
|
+
moviesByType: MovieType[];
|
|
19
|
+
resourceTypes: MovieResourceType[];
|
|
20
|
+
loadingPlaceholderHeight?: string;
|
|
21
|
+
resizeThumbnailImages?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const MovieGrid = ({
|
|
25
|
+
resourceTypeName,
|
|
26
|
+
fetchingMoviesByType,
|
|
27
|
+
moviesByType,
|
|
28
|
+
resourceTypes,
|
|
29
|
+
loadingPlaceholderHeight,
|
|
30
|
+
autoSizedProps,
|
|
31
|
+
resizeThumbnailImages,
|
|
32
|
+
}: Props) => {
|
|
33
|
+
const { t } = useTranslation();
|
|
34
|
+
return (
|
|
35
|
+
<section>
|
|
36
|
+
<h1
|
|
37
|
+
{...movieListClasses('heading')}
|
|
38
|
+
css={css`
|
|
39
|
+
margin-left: ${autoSizedProps.margin}px;
|
|
40
|
+
`}>
|
|
41
|
+
{resourceTypeName && resourceTypeName.name}
|
|
42
|
+
<small>
|
|
43
|
+
{fetchingMoviesByType
|
|
44
|
+
? t('ndlaFilm.loadingMovies')
|
|
45
|
+
: `${moviesByType.length} ${t('ndlaFilm.movieMatchInCategory')}`}
|
|
46
|
+
</small>
|
|
47
|
+
</h1>
|
|
48
|
+
<div
|
|
49
|
+
{...movieListClasses('movie-listing')}
|
|
50
|
+
css={css`
|
|
51
|
+
margin-left: ${autoSizedProps.margin}px;
|
|
52
|
+
`}>
|
|
53
|
+
{fetchingMoviesByType && (
|
|
54
|
+
<div
|
|
55
|
+
css={css`
|
|
56
|
+
height: ${loadingPlaceholderHeight};
|
|
57
|
+
`}
|
|
58
|
+
/>
|
|
59
|
+
)}
|
|
60
|
+
{!fetchingMoviesByType &&
|
|
61
|
+
moviesByType.map((movie) => (
|
|
62
|
+
<FilmContentCard
|
|
63
|
+
hideTags
|
|
64
|
+
movie={movie}
|
|
65
|
+
columnWidth={autoSizedProps.columnWidth}
|
|
66
|
+
distanceBetweenItems={autoSizedProps.distanceBetweenItems}
|
|
67
|
+
resourceTypes={resourceTypes}
|
|
68
|
+
resizeThumbnailImages={resizeThumbnailImages}
|
|
69
|
+
/>
|
|
70
|
+
))}
|
|
71
|
+
</div>
|
|
72
|
+
</section>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default MovieGrid;
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import BEMHelper from 'react-bem-helper';
|
|
11
|
-
import {
|
|
11
|
+
import { MovieType } from './types';
|
|
12
12
|
|
|
13
13
|
interface Props {
|
|
14
|
-
slideshow:
|
|
14
|
+
slideshow: MovieType[];
|
|
15
15
|
activeSlide: number;
|
|
16
16
|
gotoSlide: (indexTarget: number, useAnimation: boolean) => void;
|
|
17
17
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import styled from '@emotion/styled';
|
|
11
|
+
import Image from '../Image';
|
|
12
|
+
|
|
13
|
+
const StylediFrame = styled.iframe`
|
|
14
|
+
height: 100%;
|
|
15
|
+
width: 100%;
|
|
16
|
+
border: 0;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
visualElement: {
|
|
23
|
+
alt?: string;
|
|
24
|
+
url: string;
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const VisualElement = ({ visualElement }: Props) => {
|
|
29
|
+
const { type, url, alt } = visualElement;
|
|
30
|
+
if (type === 'image') {
|
|
31
|
+
return <Image src={url} alt={alt ?? ''} />;
|
|
32
|
+
} else if (type === 'brightcove') {
|
|
33
|
+
//@ts-ignore react does not recognize fullscreen properties.
|
|
34
|
+
return <StylediFrame allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" src={url} />;
|
|
35
|
+
} else {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default VisualElement;
|
|
File without changes
|
package/src/NDLAFilm/types.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
id: string;
|
|
1
|
+
export interface MovieType {
|
|
2
|
+
id: number | string;
|
|
3
3
|
metaDescription: string;
|
|
4
|
-
|
|
4
|
+
resourceTypes: MovieResourceType[];
|
|
5
|
+
metaImage?: {
|
|
5
6
|
alt: string;
|
|
6
7
|
url: string;
|
|
7
8
|
};
|
|
8
|
-
movieTypes: {
|
|
9
|
-
[key: string]: boolean;
|
|
10
|
-
};
|
|
11
9
|
path: string;
|
|
12
10
|
title: string;
|
|
13
11
|
}
|
|
12
|
+
|
|
13
|
+
export interface MovieResourceType {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { MouseEvent, ChangeEventHandler } from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import { SafeLinkButton } from '@ndla/safelink';
|
|
4
4
|
// @ts-ignore
|
|
@@ -186,12 +186,12 @@ type Props = {
|
|
|
186
186
|
colorMode?: 'dark' | 'light' | 'greyLightest' | 'greyLighter';
|
|
187
187
|
isButtonElements?: boolean;
|
|
188
188
|
items: ItemProps[];
|
|
189
|
-
onClick?: (event:
|
|
189
|
+
onClick?: (event: MouseEvent<HTMLElement>, id?: string) => void;
|
|
190
190
|
hasAdditionalResources?: boolean;
|
|
191
191
|
showAdditionalResources?: boolean;
|
|
192
192
|
listDirection?: listProps['direction'];
|
|
193
193
|
invertedStyle?: boolean;
|
|
194
|
-
onToggleAdditionalResources?:
|
|
194
|
+
onToggleAdditionalResources?: ChangeEventHandler<HTMLInputElement>;
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
export const NavigationBox = ({
|
|
@@ -240,7 +240,7 @@ export const NavigationBox = ({
|
|
|
240
240
|
borderShape="sharpened"
|
|
241
241
|
width="full"
|
|
242
242
|
textAlign="left"
|
|
243
|
-
onClick={(e:
|
|
243
|
+
onClick={(e: MouseEvent<HTMLElement>) => {
|
|
244
244
|
if (onClick) {
|
|
245
245
|
onClick(e, item.id);
|
|
246
246
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import { css } from '@emotion/core';
|
|
4
4
|
import { breakpoints, fonts, mq } from '@ndla/core';
|
|
@@ -43,7 +43,7 @@ const StyledSubText = styled.span`
|
|
|
43
43
|
|
|
44
44
|
type Props = {
|
|
45
45
|
subHeading?: string;
|
|
46
|
-
children:
|
|
46
|
+
children: ReactNode;
|
|
47
47
|
invertedStyle?: boolean;
|
|
48
48
|
};
|
|
49
49
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import parse from 'html-react-parser';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
5
5
|
import { css } from '@emotion/core';
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
import Button from '@ndla/button';
|
|
8
|
-
// @ts-ignore
|
|
9
8
|
import { ChevronDown, ChevronUp } from '@ndla/icons/common';
|
|
10
9
|
import { useTranslation } from 'react-i18next';
|
|
11
10
|
|
|
@@ -114,7 +113,7 @@ type Props = {
|
|
|
114
113
|
isAdditionalTopic?: boolean;
|
|
115
114
|
invertedStyle?: boolean;
|
|
116
115
|
renderMarkdown: (text: string) => string;
|
|
117
|
-
children:
|
|
116
|
+
children: ReactNode;
|
|
118
117
|
};
|
|
119
118
|
|
|
120
119
|
export const NavigationTopicAbout = ({
|
package/src/Notion/Notion.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import HTMLReactParser from 'html-react-parser';
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { MouseEventHandler, ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
import Button from '@ndla/button';
|
|
@@ -59,10 +59,10 @@ export type NotionProps = {
|
|
|
59
59
|
labels?: string[];
|
|
60
60
|
license?: string;
|
|
61
61
|
locale?: Locale;
|
|
62
|
-
media?:
|
|
63
|
-
onReferenceClick?:
|
|
62
|
+
media?: ReactNode;
|
|
63
|
+
onReferenceClick?: MouseEventHandler<HTMLButtonElement>;
|
|
64
64
|
renderMarkdown?: (text: string) => string;
|
|
65
|
-
text:
|
|
65
|
+
text: ReactNode;
|
|
66
66
|
title: string;
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React, { Fragment, Component } from 'react';
|
|
9
|
+
import React, { Fragment, Component, ChangeEvent } from 'react';
|
|
10
10
|
import BEMHelper from 'react-bem-helper';
|
|
11
11
|
import { uuid } from '@ndla/util';
|
|
12
12
|
|
|
@@ -39,7 +39,7 @@ class RadioButtonGroup extends Component<Props, State> {
|
|
|
39
39
|
this.uuid = this.props.uniqeIds ? uuid() : undefined;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
handleOnChange(e:
|
|
42
|
+
handleOnChange(e: ChangeEvent<HTMLInputElement>) {
|
|
43
43
|
this.setState({
|
|
44
44
|
selected: e.target.value,
|
|
45
45
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { cloneElement, ReactElement } from 'react';
|
|
1
|
+
import React, { Children, cloneElement, ReactElement } from 'react';
|
|
2
2
|
import BEMHelper from 'react-bem-helper';
|
|
3
3
|
//@ts-ignore
|
|
4
4
|
import Button from '@ndla/button';
|
|
@@ -61,13 +61,13 @@ interface Props {
|
|
|
61
61
|
const RelatedArticleList = ({ messages, children, articleCount, dangerouslySetInnerHTML }: Props) => {
|
|
62
62
|
const clonedChildren =
|
|
63
63
|
!dangerouslySetInnerHTML && children
|
|
64
|
-
?
|
|
65
|
-
|
|
64
|
+
? Children.map(children, (article, i) =>
|
|
65
|
+
cloneElement(article, {
|
|
66
66
|
modifier: i >= 2 ? `${article.props.modifier} hidden` : article.props.modifier,
|
|
67
67
|
}),
|
|
68
68
|
)
|
|
69
69
|
: null;
|
|
70
|
-
const childrenCount = articleCount ||
|
|
70
|
+
const childrenCount = articleCount || Children.count(children);
|
|
71
71
|
|
|
72
72
|
return (
|
|
73
73
|
<section {...classes('')}>
|
|
@@ -14,11 +14,8 @@ import { keyframes } from '@emotion/core';
|
|
|
14
14
|
import SafeLink from '@ndla/safelink';
|
|
15
15
|
import { Additional, Core, HumanMaleBoard } from '@ndla/icons/common';
|
|
16
16
|
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
17
|
-
|
|
18
|
-
// @ts-ignore
|
|
19
17
|
import Tooltip from '@ndla/tooltip';
|
|
20
18
|
import { Resource } from '../types';
|
|
21
|
-
// @ts-ignore
|
|
22
19
|
import ContentTypeBadge from '../ContentTypeBadge';
|
|
23
20
|
import * as contentTypes from '../model/ContentType';
|
|
24
21
|
|
|
@@ -11,7 +11,6 @@ import styled from '@emotion/styled';
|
|
|
11
11
|
import css from '@emotion/css';
|
|
12
12
|
import { keyframes } from '@emotion/core';
|
|
13
13
|
import { useTranslation } from 'react-i18next';
|
|
14
|
-
// @ts-ignore
|
|
15
14
|
import NoContentBox from '../NoContentBox';
|
|
16
15
|
import ResourceItem from './ResourceItem';
|
|
17
16
|
import { Resource } from '../types';
|
|
@@ -3,7 +3,6 @@ import { css } from '@emotion/core';
|
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { spacing } from '@ndla/core';
|
|
5
5
|
import { HelpCircleDual } from '@ndla/icons/common';
|
|
6
|
-
//@ts-ignore
|
|
7
6
|
import Modal, { ModalBody, ModalHeader, ModalCloseButton } from '@ndla/modal';
|
|
8
7
|
import Tooltip from '@ndla/tooltip';
|
|
9
8
|
import { Switch } from '@ndla/switch';
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useRef, ReactElement } from 'react';
|
|
2
2
|
// @ts-ignore
|
|
3
3
|
import Button from '@ndla/button';
|
|
4
|
-
// @ts-ignore
|
|
5
4
|
import Tooltip from '@ndla/tooltip';
|
|
6
|
-
// @ts-ignore
|
|
7
5
|
import { Additional, ChevronUp, ChevronDown } from '@ndla/icons/common';
|
|
8
6
|
import SafeLink from '@ndla/safelink';
|
|
9
7
|
import { useTranslation } from 'react-i18next';
|
|
10
|
-
// @ts-ignore
|
|
11
8
|
import ContentTypeBadge from '../ContentTypeBadge';
|
|
12
9
|
import { ContentTypeResultType, Resource } from '../types';
|
|
13
10
|
import {
|
|
@@ -24,7 +21,7 @@ import {
|
|
|
24
21
|
} from './ContentTypeResultStyles';
|
|
25
22
|
import { isPathToHighlight } from './IsPathToHighlight';
|
|
26
23
|
|
|
27
|
-
const renderAdditionalIcon = (label: string, isAdditional?: boolean):
|
|
24
|
+
const renderAdditionalIcon = (label: string, isAdditional?: boolean): ReactElement | null => {
|
|
28
25
|
if (isAdditional && label) {
|
|
29
26
|
return (
|
|
30
27
|
<Tooltip tooltip={label} align="top" css={tooltipStyle}>
|
|
@@ -58,7 +55,7 @@ type Props = {
|
|
|
58
55
|
unGrouped?: boolean;
|
|
59
56
|
};
|
|
60
57
|
|
|
61
|
-
const ContentTypeResult
|
|
58
|
+
const ContentTypeResult = ({
|
|
62
59
|
contentTypeResult,
|
|
63
60
|
onNavigate,
|
|
64
61
|
defaultCount,
|
|
@@ -70,7 +67,7 @@ const ContentTypeResult: React.FC<Props> = ({
|
|
|
70
67
|
inMenu,
|
|
71
68
|
animateList,
|
|
72
69
|
unGrouped,
|
|
73
|
-
}) => {
|
|
70
|
+
}: Props) => {
|
|
74
71
|
const { t } = useTranslation();
|
|
75
72
|
const [showAll, toggleShowAll] = useState(false);
|
|
76
73
|
const showAllRef = useRef<HTMLLIElement>(null);
|