@ndla/ui 51.0.0 → 53.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/es/Article/Article.js +113 -120
- package/es/Article/ArticleHeaderWrapper.js +14 -20
- package/es/Article/ArticleParagraph.js +25 -0
- package/es/Article/index.js +1 -0
- package/es/AudioPlayer/AudioPlayer.js +13 -13
- package/es/AudioPlayer/Controls.js +22 -38
- package/es/Breadcrumb/Breadcrumb.js +2 -33
- package/es/Breadcrumb/BreadcrumbItem.js +16 -29
- package/es/Breadcrumb/index.js +0 -1
- package/es/CodeBlock/CodeBlock.js +115 -0
- package/es/CodeBlock/codeLanguageOptions.js +84 -0
- package/es/CodeBlock/index.js +10 -0
- package/es/CreatedBy/CreatedBy.js +4 -4
- package/es/Embed/BrightcoveEmbed.js +3 -3
- package/es/Embed/CodeEmbed.js +2 -2
- package/es/Embed/ConceptEmbed.js +37 -33
- package/es/Embed/ExternalEmbed.js +2 -2
- package/es/Embed/IframeEmbed.js +1 -1
- package/es/Embed/ImageEmbed.js +17 -14
- package/es/Embed/RelatedContentEmbed.js +3 -3
- package/es/Embed/UuDisclaimerEmbed.js +4 -3
- package/es/Embed/conceptComponents.js +10 -10
- package/es/Figure/Figure.js +32 -19
- package/es/FrontpageArticle/FrontpageArticle.js +3 -3
- package/es/Gloss/Gloss.js +12 -10
- package/es/Hero/Hero.js +1 -1
- package/es/Image/Image.js +3 -3
- package/es/LanguageSelector/LanguageSelector.js +5 -5
- package/es/Layout/LayoutItem.js +2 -1
- package/es/Layout/OneColumn.js +22 -28
- package/es/Layout/PageContainer.js +21 -17
- package/es/LicenseByline/LicenseLink.js +5 -6
- package/es/Messages/MessageBox.js +9 -7
- package/es/MyNdla/Resource/index.js +1 -2
- package/es/MyNdla/index.js +1 -2
- package/es/Notion/Notion.js +4 -4
- package/es/Resource/BlockResource.js +13 -15
- package/es/Resource/ListResource.js +13 -15
- package/es/Search/ContentTypeResult.js +4 -4
- package/es/Search/SearchResult.js +11 -11
- package/es/Search/SearchResultSleeve.js +16 -16
- package/es/TreeStructure/TreeStructure.js +6 -6
- package/es/all.css +1 -1
- package/es/index.js +5 -20
- package/es/locale/messages-en.js +15 -2
- package/es/locale/messages-nb.js +15 -2
- package/es/locale/messages-nn.js +16 -3
- package/es/locale/messages-se.js +14 -1
- package/es/locale/messages-sma.js +15 -2
- package/es/types.js +0 -9
- package/lib/Article/Article.d.ts +8 -11
- package/lib/Article/Article.js +111 -118
- package/lib/Article/ArticleHeaderWrapper.js +14 -20
- package/lib/Article/ArticleParagraph.d.ts +13 -0
- package/lib/Article/ArticleParagraph.js +32 -0
- package/lib/Article/index.d.ts +2 -0
- package/lib/Article/index.js +7 -0
- package/lib/AudioPlayer/AudioPlayer.js +13 -13
- package/lib/AudioPlayer/Controls.js +21 -37
- package/lib/Breadcrumb/Breadcrumb.d.ts +1 -2
- package/lib/Breadcrumb/Breadcrumb.js +2 -33
- package/lib/Breadcrumb/BreadcrumbItem.js +16 -29
- package/lib/Breadcrumb/index.d.ts +0 -1
- package/lib/Breadcrumb/index.js +0 -7
- package/lib/CodeBlock/CodeBlock.d.ts +18 -0
- package/lib/CodeBlock/CodeBlock.js +121 -0
- package/lib/{Navigation/index.d.ts → CodeBlock/codeLanguageOptions.d.ts} +5 -2
- package/lib/CodeBlock/codeLanguageOptions.js +90 -0
- package/lib/CodeBlock/index.d.ts +9 -0
- package/lib/CodeBlock/index.js +20 -0
- package/lib/CreatedBy/CreatedBy.js +4 -4
- package/lib/Embed/BrightcoveEmbed.js +3 -3
- package/lib/Embed/CodeEmbed.js +2 -2
- package/lib/Embed/ConceptEmbed.d.ts +1 -1
- package/lib/Embed/ConceptEmbed.js +36 -33
- package/lib/Embed/ExternalEmbed.js +2 -2
- package/lib/Embed/IframeEmbed.js +1 -1
- package/lib/Embed/ImageEmbed.js +17 -14
- package/lib/Embed/RelatedContentEmbed.js +3 -3
- package/lib/Embed/UuDisclaimerEmbed.js +4 -3
- package/lib/Embed/conceptComponents.js +10 -10
- package/lib/Figure/Figure.d.ts +2 -5
- package/lib/Figure/Figure.js +32 -23
- package/lib/FrontpageArticle/FrontpageArticle.js +3 -3
- package/lib/Gloss/Gloss.js +12 -10
- package/lib/Hero/Hero.js +1 -1
- package/lib/Image/Image.js +2 -2
- package/lib/LanguageSelector/LanguageSelector.js +5 -5
- package/lib/Layout/LayoutItem.js +2 -1
- package/lib/Layout/OneColumn.d.ts +3 -8
- package/lib/Layout/OneColumn.js +22 -30
- package/lib/Layout/PageContainer.d.ts +3 -7
- package/lib/Layout/PageContainer.js +21 -19
- package/lib/LicenseByline/LicenseLink.js +5 -6
- package/lib/Messages/MessageBox.d.ts +2 -1
- package/lib/Messages/MessageBox.js +9 -7
- package/lib/MyNdla/Resource/index.d.ts +1 -2
- package/lib/MyNdla/Resource/index.js +0 -7
- package/lib/MyNdla/index.d.ts +1 -2
- package/lib/MyNdla/index.js +0 -7
- package/lib/Notion/Notion.js +4 -4
- package/lib/Resource/BlockResource.js +13 -15
- package/lib/Resource/ListResource.js +13 -15
- package/lib/Search/ContentTypeResult.js +4 -4
- package/lib/Search/SearchResult.js +10 -10
- package/lib/Search/SearchResultSleeve.js +16 -16
- package/lib/TreeStructure/TreeStructure.js +6 -6
- package/lib/all.css +1 -1
- package/lib/index.d.ts +5 -20
- package/lib/index.js +17 -254
- package/lib/locale/messages-en.d.ts +13 -0
- package/lib/locale/messages-en.js +15 -2
- package/lib/locale/messages-nb.d.ts +13 -0
- package/lib/locale/messages-nb.js +15 -2
- package/lib/locale/messages-nn.d.ts +13 -0
- package/lib/locale/messages-nn.js +16 -3
- package/lib/locale/messages-se.d.ts +13 -0
- package/lib/locale/messages-se.js +14 -1
- package/lib/locale/messages-sma.d.ts +13 -0
- package/lib/locale/messages-sma.js +15 -2
- package/lib/types.d.ts +0 -51
- package/lib/types.js +1 -10
- package/package.json +16 -22
- package/src/Article/Article.tsx +179 -119
- package/src/Article/ArticleHeaderWrapper.tsx +17 -21
- package/src/Article/ArticleParagraph.tsx +22 -0
- package/src/Article/index.ts +4 -0
- package/src/AudioPlayer/AudioPlayer.tsx +2 -2
- package/src/AudioPlayer/Controls.tsx +5 -5
- package/src/Breadcrumb/Breadcrumb.stories.tsx +0 -4
- package/src/Breadcrumb/Breadcrumb.tsx +1 -38
- package/src/Breadcrumb/BreadcrumbItem.tsx +5 -19
- package/src/Breadcrumb/index.ts +0 -2
- package/src/CodeBlock/CodeBlock.stories.tsx +113 -0
- package/src/CodeBlock/CodeBlock.tsx +228 -0
- package/src/CodeBlock/codeLanguageOptions.ts +115 -0
- package/src/CodeBlock/index.ts +10 -0
- package/src/CreatedBy/CreatedBy.tsx +2 -2
- package/src/Embed/AudioEmbed.stories.tsx +6 -4
- package/src/Embed/BrightcoveEmbed.stories.tsx +6 -4
- package/src/Embed/BrightcoveEmbed.tsx +2 -2
- package/src/Embed/CodeEmbed.tsx +2 -2
- package/src/Embed/ConceptEmbed.stories.tsx +6 -4
- package/src/Embed/ConceptEmbed.tsx +103 -96
- package/src/Embed/ExternalEmbed.stories.tsx +6 -4
- package/src/Embed/ExternalEmbed.tsx +2 -2
- package/src/Embed/H5pEmbed.stories.tsx +6 -4
- package/src/Embed/IframeEmbed.stories.tsx +6 -4
- package/src/Embed/IframeEmbed.tsx +1 -1
- package/src/Embed/ImageEmbed.stories.tsx +6 -4
- package/src/Embed/ImageEmbed.tsx +19 -11
- package/src/Embed/RelatedContentEmbed.stories.tsx +6 -4
- package/src/Embed/RelatedContentEmbed.tsx +3 -3
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +23 -4
- package/src/Embed/UuDisclaimerEmbed.tsx +1 -1
- package/src/Embed/conceptComponents.tsx +1 -0
- package/src/Figure/Figure.tsx +57 -18
- package/src/Footer/Footer.stories.tsx +1 -1
- package/src/FrontpageArticle/FrontpageArticle.tsx +3 -3
- package/src/Gloss/Gloss.tsx +4 -2
- package/src/Hero/Hero.tsx +1 -1
- package/src/Image/Image.tsx +2 -2
- package/src/LanguageSelector/LanguageSelector.tsx +1 -1
- package/src/Layout/LayoutItem.tsx +2 -1
- package/src/Layout/OneColumn.tsx +25 -35
- package/src/Layout/PageContainer.tsx +19 -23
- package/src/LicenseByline/LicenseLink.tsx +1 -2
- package/src/Messages/MessageBox.tsx +3 -2
- package/src/MyNdla/Resource/index.ts +1 -2
- package/src/MyNdla/index.ts +1 -2
- package/src/Notion/Notion.tsx +2 -2
- package/src/Resource/BlockResource.tsx +4 -8
- package/src/Resource/ListResource.tsx +4 -6
- package/src/Search/ContentTypeResult.tsx +4 -4
- package/src/Search/SearchResult.tsx +2 -2
- package/src/Search/SearchResultSleeve.tsx +7 -9
- package/src/Table/Table.stories.tsx +8 -8
- package/src/TreeStructure/TreeStructure.stories.tsx +85 -28
- package/src/TreeStructure/TreeStructure.tsx +1 -1
- package/src/all.scss +2 -3
- package/src/index.ts +7 -48
- package/src/locale/messages-en.ts +17 -1
- package/src/locale/messages-nb.ts +17 -1
- package/src/locale/messages-nn.ts +18 -2
- package/src/locale/messages-se.ts +16 -0
- package/src/locale/messages-sma.ts +17 -1
- package/src/types.ts +0 -62
- package/es/Article/ArticleAccessMessage.js +0 -43
- package/es/Article/ArticleNotions.js +0 -90
- package/es/Aside/Aside.js +0 -75
- package/es/Aside/index.js +0 -10
- package/es/BannerCard/BannerCard.js +0 -84
- package/es/BannerCard/index.js +0 -10
- package/es/Breadcrumb/HeaderBreadcrumb.js +0 -57
- package/es/CompetenceGoalTab/CompetenceGoalItem.js +0 -42
- package/es/CompetenceGoalTab/CompetenceGoalTab.js +0 -75
- package/es/CompetenceGoalTab/CompetenceItem.js +0 -108
- package/es/CompetenceGoalTab/CoreElementItem.js +0 -44
- package/es/CompetenceGoalTab/SearchButton.js +0 -43
- package/es/CompetenceGoalTab/index.js +0 -10
- package/es/CompetenceGoalTab/styles.js +0 -57
- package/es/Filter/FilterButtons.js +0 -185
- package/es/Filter/FilterCarousel.js +0 -166
- package/es/Filter/ToggleItem.js +0 -68
- package/es/Filter/index.js +0 -10
- package/es/Frontpage/FrontpageAllSubjects.js +0 -254
- package/es/LearningPaths/LearningPathContent.js +0 -25
- package/es/LearningPaths/LearningPathInformation.js +0 -74
- package/es/LearningPaths/LearningPathLastStepNavigation.js +0 -65
- package/es/LearningPaths/LearningPathMenu.js +0 -103
- package/es/LearningPaths/LearningPathMenuAside.js +0 -62
- package/es/LearningPaths/LearningPathMenuContent.js +0 -109
- package/es/LearningPaths/LearningPathMenuIntro.js +0 -72
- package/es/LearningPaths/LearningPathMenuModalWrapper.js +0 -63
- package/es/LearningPaths/LearningPathMobileHeader.js +0 -35
- package/es/LearningPaths/LearningPathMobileStepInfo.js +0 -34
- package/es/LearningPaths/LearningPathSticky.js +0 -74
- package/es/LearningPaths/LearningPathWrapper.js +0 -27
- package/es/LearningPaths/index.js +0 -18
- package/es/Masthead/Masthead.js +0 -62
- package/es/Masthead/SkipToMainContent.js +0 -30
- package/es/Masthead/index.js +0 -13
- package/es/Masthead/utils.js +0 -38
- package/es/MyNdla/Resource/FolderInput.js +0 -94
- package/es/NDLAFilm/AllMoviesAlphabetically.js +0 -127
- package/es/NDLAFilm/FilmContentCard.js +0 -93
- package/es/NDLAFilm/FilmContentCardTags.js +0 -44
- package/es/NDLAFilm/FilmMovieList.js +0 -52
- package/es/NDLAFilm/FilmMovieSearch.js +0 -106
- package/es/NDLAFilm/FilmSlideshow.js +0 -138
- package/es/NDLAFilm/MovieGrid.js +0 -54
- package/es/NDLAFilm/VisualElement.js +0 -48
- package/es/NDLAFilm/filmStyles.js +0 -31
- package/es/NDLAFilm/index.js +0 -14
- package/es/NDLAFilm/isLetter.js +0 -13
- package/es/NDLAFilm/types.js +0 -1
- package/es/Navigation/NavigationBox.js +0 -187
- package/es/Navigation/index.js +0 -10
- package/es/NoContentBox/NoContentBox.js +0 -31
- package/es/NoContentBox/index.js +0 -10
- package/es/Programme/Programme.js +0 -104
- package/es/Programme/ProgrammeSubjects.js +0 -60
- package/es/Programme/index.js +0 -12
- package/es/ResourceGroup/ResourceGroup.js +0 -46
- package/es/ResourceGroup/ResourceItem.js +0 -196
- package/es/ResourceGroup/ResourceList.js +0 -57
- package/es/ResourceGroup/index.js +0 -10
- package/es/ResourcesWrapper/ResourcesTopicTitle.js +0 -160
- package/es/ResourcesWrapper/ResourcesWrapper.js +0 -27
- package/es/ResourcesWrapper/index.js +0 -11
- package/es/SearchTypeResult/ActiveFilterContent.js +0 -53
- package/es/SearchTypeResult/ActiveFilters.js +0 -124
- package/es/SearchTypeResult/PopupFilter.js +0 -133
- package/es/SearchTypeResult/ResultNavigation.js +0 -75
- package/es/SearchTypeResult/SearchFieldHeader.js +0 -103
- package/es/SearchTypeResult/SearchFilterContent.js +0 -59
- package/es/SearchTypeResult/SearchHeader.js +0 -160
- package/es/SearchTypeResult/SearchItem.js +0 -97
- package/es/SearchTypeResult/SearchItemList.js +0 -142
- package/es/SearchTypeResult/SearchItems.js +0 -60
- package/es/SearchTypeResult/SearchSubjectItem.js +0 -62
- package/es/SearchTypeResult/SearchSubjectResult.js +0 -34
- package/es/SearchTypeResult/SearchTypeHeader.js +0 -118
- package/es/SearchTypeResult/SearchTypeResult.js +0 -55
- package/es/SearchTypeResult/SearchViewType.js +0 -90
- package/es/SearchTypeResult/components/ItemContexts.js +0 -122
- package/es/SearchTypeResult/components/ItemResourceHeader.js +0 -96
- package/es/SearchTypeResult/components/ItemTopicHeader.js +0 -66
- package/es/SearchTypeResult/components/SubjectFilters.js +0 -130
- package/es/SearchTypeResult/index.js +0 -14
- package/es/Subject/SubjectBanner.js +0 -30
- package/es/Subject/index.js +0 -9
- package/es/ToolboxPage/ToolboxInfo.js +0 -43
- package/es/ToolboxPage/index.js +0 -10
- package/es/Topic/Loader.js +0 -107
- package/es/Topic/Topic.js +0 -221
- package/es/Topic/index.js +0 -10
- package/es/locale/LocaleProvider.js +0 -38
- package/lib/Article/ArticleAccessMessage.d.ts +0 -12
- package/lib/Article/ArticleAccessMessage.js +0 -50
- package/lib/Article/ArticleNotions.d.ts +0 -14
- package/lib/Article/ArticleNotions.js +0 -96
- package/lib/Aside/Aside.d.ts +0 -15
- package/lib/Aside/Aside.js +0 -80
- package/lib/Aside/index.d.ts +0 -9
- package/lib/Aside/index.js +0 -16
- package/lib/BannerCard/BannerCard.d.ts +0 -29
- package/lib/BannerCard/BannerCard.js +0 -92
- package/lib/BannerCard/index.d.ts +0 -9
- package/lib/BannerCard/index.js +0 -13
- package/lib/Breadcrumb/HeaderBreadcrumb.d.ts +0 -14
- package/lib/Breadcrumb/HeaderBreadcrumb.js +0 -64
- package/lib/CompetenceGoalTab/CompetenceGoalItem.d.ts +0 -10
- package/lib/CompetenceGoalTab/CompetenceGoalItem.js +0 -49
- package/lib/CompetenceGoalTab/CompetenceGoalTab.d.ts +0 -14
- package/lib/CompetenceGoalTab/CompetenceGoalTab.js +0 -82
- package/lib/CompetenceGoalTab/CompetenceItem.d.ts +0 -30
- package/lib/CompetenceGoalTab/CompetenceItem.js +0 -113
- package/lib/CompetenceGoalTab/CoreElementItem.d.ts +0 -10
- package/lib/CompetenceGoalTab/CoreElementItem.js +0 -51
- package/lib/CompetenceGoalTab/SearchButton.d.ts +0 -14
- package/lib/CompetenceGoalTab/SearchButton.js +0 -50
- package/lib/CompetenceGoalTab/index.d.ts +0 -9
- package/lib/CompetenceGoalTab/index.js +0 -16
- package/lib/CompetenceGoalTab/styles.d.ts +0 -28
- package/lib/CompetenceGoalTab/styles.js +0 -62
- package/lib/Filter/FilterButtons.d.ts +0 -16
- package/lib/Filter/FilterButtons.js +0 -192
- package/lib/Filter/FilterCarousel.d.ts +0 -13
- package/lib/Filter/FilterCarousel.js +0 -171
- package/lib/Filter/ToggleItem.d.ts +0 -21
- package/lib/Filter/ToggleItem.js +0 -75
- package/lib/Filter/index.d.ts +0 -9
- package/lib/Filter/index.js +0 -20
- package/lib/Frontpage/FrontpageAllSubjects.d.ts +0 -27
- package/lib/Frontpage/FrontpageAllSubjects.js +0 -259
- package/lib/LearningPaths/LearningPathContent.d.ts +0 -13
- package/lib/LearningPaths/LearningPathContent.js +0 -33
- package/lib/LearningPaths/LearningPathInformation.d.ts +0 -18
- package/lib/LearningPaths/LearningPathInformation.js +0 -80
- package/lib/LearningPaths/LearningPathLastStepNavigation.d.ts +0 -22
- package/lib/LearningPaths/LearningPathLastStepNavigation.js +0 -72
- package/lib/LearningPaths/LearningPathMenu.d.ts +0 -38
- package/lib/LearningPaths/LearningPathMenu.js +0 -110
- package/lib/LearningPaths/LearningPathMenuAside.d.ts +0 -24
- package/lib/LearningPaths/LearningPathMenuAside.js +0 -69
- package/lib/LearningPaths/LearningPathMenuContent.d.ts +0 -22
- package/lib/LearningPaths/LearningPathMenuContent.js +0 -116
- package/lib/LearningPaths/LearningPathMenuIntro.d.ts +0 -17
- package/lib/LearningPaths/LearningPathMenuIntro.js +0 -77
- package/lib/LearningPaths/LearningPathMenuModalWrapper.d.ts +0 -14
- package/lib/LearningPaths/LearningPathMenuModalWrapper.js +0 -70
- package/lib/LearningPaths/LearningPathMobileHeader.d.ts +0 -9
- package/lib/LearningPaths/LearningPathMobileHeader.js +0 -42
- package/lib/LearningPaths/LearningPathMobileStepInfo.d.ts +0 -13
- package/lib/LearningPaths/LearningPathMobileStepInfo.js +0 -41
- package/lib/LearningPaths/LearningPathSticky.d.ts +0 -22
- package/lib/LearningPaths/LearningPathSticky.js +0 -84
- package/lib/LearningPaths/LearningPathWrapper.d.ts +0 -14
- package/lib/LearningPaths/LearningPathWrapper.js +0 -35
- package/lib/LearningPaths/index.d.ts +0 -17
- package/lib/LearningPaths/index.js +0 -74
- package/lib/Masthead/Masthead.d.ts +0 -23
- package/lib/Masthead/Masthead.js +0 -68
- package/lib/Masthead/SkipToMainContent.d.ts +0 -12
- package/lib/Masthead/SkipToMainContent.js +0 -37
- package/lib/Masthead/index.d.ts +0 -12
- package/lib/Masthead/index.js +0 -36
- package/lib/Masthead/utils.d.ts +0 -11
- package/lib/Masthead/utils.js +0 -46
- package/lib/MyNdla/Resource/FolderInput.d.ts +0 -19
- package/lib/MyNdla/Resource/FolderInput.js +0 -101
- package/lib/NDLAFilm/AllMoviesAlphabetically.d.ts +0 -13
- package/lib/NDLAFilm/AllMoviesAlphabetically.js +0 -134
- package/lib/NDLAFilm/FilmContentCard.d.ts +0 -19
- package/lib/NDLAFilm/FilmContentCard.js +0 -98
- package/lib/NDLAFilm/FilmContentCardTags.d.ts +0 -15
- package/lib/NDLAFilm/FilmContentCardTags.js +0 -51
- package/lib/NDLAFilm/FilmMovieList.d.ts +0 -17
- package/lib/NDLAFilm/FilmMovieList.js +0 -59
- package/lib/NDLAFilm/FilmMovieSearch.d.ts +0 -21
- package/lib/NDLAFilm/FilmMovieSearch.js +0 -113
- package/lib/NDLAFilm/FilmSlideshow.d.ts +0 -13
- package/lib/NDLAFilm/FilmSlideshow.js +0 -143
- package/lib/NDLAFilm/MovieGrid.d.ts +0 -17
- package/lib/NDLAFilm/MovieGrid.js +0 -61
- package/lib/NDLAFilm/VisualElement.d.ts +0 -16
- package/lib/NDLAFilm/VisualElement.js +0 -53
- package/lib/NDLAFilm/filmStyles.d.ts +0 -17
- package/lib/NDLAFilm/filmStyles.js +0 -39
- package/lib/NDLAFilm/index.d.ts +0 -13
- package/lib/NDLAFilm/index.js +0 -41
- package/lib/NDLAFilm/isLetter.d.ts +0 -8
- package/lib/NDLAFilm/isLetter.js +0 -20
- package/lib/NDLAFilm/types.d.ts +0 -22
- package/lib/NDLAFilm/types.js +0 -5
- package/lib/Navigation/NavigationBox.d.ts +0 -30
- package/lib/Navigation/NavigationBox.js +0 -193
- package/lib/Navigation/index.js +0 -13
- package/lib/NoContentBox/NoContentBox.d.ts +0 -14
- package/lib/NoContentBox/NoContentBox.js +0 -38
- package/lib/NoContentBox/index.d.ts +0 -9
- package/lib/NoContentBox/index.js +0 -16
- package/lib/Programme/Programme.d.ts +0 -16
- package/lib/Programme/Programme.js +0 -112
- package/lib/Programme/ProgrammeSubjects.d.ts +0 -26
- package/lib/Programme/ProgrammeSubjects.js +0 -67
- package/lib/Programme/index.d.ts +0 -11
- package/lib/Programme/index.js +0 -23
- package/lib/ResourceGroup/ResourceGroup.d.ts +0 -18
- package/lib/ResourceGroup/ResourceGroup.js +0 -53
- package/lib/ResourceGroup/ResourceItem.d.ts +0 -22
- package/lib/ResourceGroup/ResourceItem.js +0 -203
- package/lib/ResourceGroup/ResourceList.d.ts +0 -19
- package/lib/ResourceGroup/ResourceList.js +0 -64
- package/lib/ResourceGroup/index.d.ts +0 -9
- package/lib/ResourceGroup/index.js +0 -16
- package/lib/ResourcesWrapper/ResourcesTopicTitle.d.ts +0 -20
- package/lib/ResourcesWrapper/ResourcesTopicTitle.js +0 -165
- package/lib/ResourcesWrapper/ResourcesWrapper.d.ts +0 -16
- package/lib/ResourcesWrapper/ResourcesWrapper.js +0 -34
- package/lib/ResourcesWrapper/index.d.ts +0 -10
- package/lib/ResourcesWrapper/index.js +0 -23
- package/lib/SearchTypeResult/ActiveFilterContent.d.ts +0 -23
- package/lib/SearchTypeResult/ActiveFilterContent.js +0 -58
- package/lib/SearchTypeResult/ActiveFilters.d.ts +0 -18
- package/lib/SearchTypeResult/ActiveFilters.js +0 -131
- package/lib/SearchTypeResult/PopupFilter.d.ts +0 -26
- package/lib/SearchTypeResult/PopupFilter.js +0 -138
- package/lib/SearchTypeResult/ResultNavigation.d.ts +0 -18
- package/lib/SearchTypeResult/ResultNavigation.js +0 -82
- package/lib/SearchTypeResult/SearchFieldHeader.d.ts +0 -17
- package/lib/SearchTypeResult/SearchFieldHeader.js +0 -109
- package/lib/SearchTypeResult/SearchFilterContent.d.ts +0 -16
- package/lib/SearchTypeResult/SearchFilterContent.js +0 -64
- package/lib/SearchTypeResult/SearchHeader.d.ts +0 -26
- package/lib/SearchTypeResult/SearchHeader.js +0 -166
- package/lib/SearchTypeResult/SearchItem.d.ts +0 -30
- package/lib/SearchTypeResult/SearchItem.js +0 -104
- package/lib/SearchTypeResult/SearchItemList.d.ts +0 -10
- package/lib/SearchTypeResult/SearchItemList.js +0 -147
- package/lib/SearchTypeResult/SearchItems.d.ts +0 -17
- package/lib/SearchTypeResult/SearchItems.js +0 -65
- package/lib/SearchTypeResult/SearchSubjectItem.d.ts +0 -20
- package/lib/SearchTypeResult/SearchSubjectItem.js +0 -67
- package/lib/SearchTypeResult/SearchSubjectResult.d.ts +0 -13
- package/lib/SearchTypeResult/SearchSubjectResult.js +0 -41
- package/lib/SearchTypeResult/SearchTypeHeader.d.ts +0 -22
- package/lib/SearchTypeResult/SearchTypeHeader.js +0 -123
- package/lib/SearchTypeResult/SearchTypeResult.d.ts +0 -26
- package/lib/SearchTypeResult/SearchTypeResult.js +0 -62
- package/lib/SearchTypeResult/SearchViewType.d.ts +0 -13
- package/lib/SearchTypeResult/SearchViewType.js +0 -95
- package/lib/SearchTypeResult/components/ItemContexts.d.ts +0 -19
- package/lib/SearchTypeResult/components/ItemContexts.js +0 -127
- package/lib/SearchTypeResult/components/ItemResourceHeader.d.ts +0 -16
- package/lib/SearchTypeResult/components/ItemResourceHeader.js +0 -101
- package/lib/SearchTypeResult/components/ItemTopicHeader.d.ts +0 -17
- package/lib/SearchTypeResult/components/ItemTopicHeader.js +0 -71
- package/lib/SearchTypeResult/components/SubjectFilters.d.ts +0 -32
- package/lib/SearchTypeResult/components/SubjectFilters.js +0 -135
- package/lib/SearchTypeResult/index.d.ts +0 -14
- package/lib/SearchTypeResult/index.js +0 -41
- package/lib/Subject/SubjectBanner.d.ts +0 -14
- package/lib/Subject/SubjectBanner.js +0 -37
- package/lib/Subject/index.d.ts +0 -8
- package/lib/Subject/index.js +0 -13
- package/lib/ToolboxPage/ToolboxInfo.d.ts +0 -18
- package/lib/ToolboxPage/ToolboxInfo.js +0 -49
- package/lib/ToolboxPage/index.d.ts +0 -9
- package/lib/ToolboxPage/index.js +0 -13
- package/lib/Topic/Loader.d.ts +0 -9
- package/lib/Topic/Loader.js +0 -114
- package/lib/Topic/Topic.d.ts +0 -34
- package/lib/Topic/Topic.js +0 -228
- package/lib/Topic/index.d.ts +0 -10
- package/lib/Topic/index.js +0 -16
- package/lib/locale/LocaleProvider.d.ts +0 -15
- package/lib/locale/LocaleProvider.js +0 -44
- package/src/Article/ArticleAccessMessage.tsx +0 -44
- package/src/Article/ArticleNotions.tsx +0 -139
- package/src/Article/component.article.scss +0 -156
- package/src/Aside/Aside.tsx +0 -113
- package/src/Aside/index.ts +0 -11
- package/src/BannerCard/BannerCard.tsx +0 -99
- package/src/BannerCard/index.ts +0 -11
- package/src/Breadcrumb/HeaderBreadcrumb.tsx +0 -56
- package/src/CompetenceGoalTab/CompetenceGoalItem.tsx +0 -39
- package/src/CompetenceGoalTab/CompetenceGoalTab.tsx +0 -85
- package/src/CompetenceGoalTab/CompetenceItem.tsx +0 -130
- package/src/CompetenceGoalTab/CoreElementItem.tsx +0 -39
- package/src/CompetenceGoalTab/SearchButton.tsx +0 -50
- package/src/CompetenceGoalTab/index.ts +0 -10
- package/src/CompetenceGoalTab/styles.ts +0 -37
- package/src/Figure/component.figure.scss +0 -60
- package/src/Filter/FilterButtons.tsx +0 -199
- package/src/Filter/FilterCarousel.tsx +0 -172
- package/src/Filter/ToggleItem.tsx +0 -180
- package/src/Filter/index.ts +0 -10
- package/src/Frontpage/FrontpageAllSubjects.tsx +0 -231
- package/src/LearningPaths/LearningPathContent.tsx +0 -33
- package/src/LearningPaths/LearningPathInformation.tsx +0 -82
- package/src/LearningPaths/LearningPathLastStepNavigation.tsx +0 -89
- package/src/LearningPaths/LearningPathMenu.stories.tsx +0 -65
- package/src/LearningPaths/LearningPathMenu.tsx +0 -166
- package/src/LearningPaths/LearningPathMenuAside.tsx +0 -100
- package/src/LearningPaths/LearningPathMenuContent.tsx +0 -277
- package/src/LearningPaths/LearningPathMenuIntro.tsx +0 -126
- package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +0 -71
- package/src/LearningPaths/LearningPathMobileHeader.tsx +0 -37
- package/src/LearningPaths/LearningPathMobileStepInfo.tsx +0 -38
- package/src/LearningPaths/LearningPathSticky.tsx +0 -122
- package/src/LearningPaths/LearningPathWrapper.tsx +0 -36
- package/src/LearningPaths/index.ts +0 -19
- package/src/Masthead/Masthead.tsx +0 -100
- package/src/Masthead/SkipToMainContent.tsx +0 -54
- package/src/Masthead/index.ts +0 -16
- package/src/Masthead/utils.ts +0 -45
- package/src/MyNdla/Resource/FolderInput.stories.tsx +0 -27
- package/src/MyNdla/Resource/FolderInput.tsx +0 -89
- package/src/NDLAFilm/AllMoviesAlphabetically.tsx +0 -160
- package/src/NDLAFilm/FilmContentCard.tsx +0 -138
- package/src/NDLAFilm/FilmContentCardTags.tsx +0 -57
- package/src/NDLAFilm/FilmMovieList.tsx +0 -54
- package/src/NDLAFilm/FilmMovieSearch.tsx +0 -135
- package/src/NDLAFilm/FilmSlideshow.tsx +0 -177
- package/src/NDLAFilm/MovieGrid.tsx +0 -86
- package/src/NDLAFilm/VisualElement.tsx +0 -38
- package/src/NDLAFilm/__tests__/isLetter-test.ts +0 -20
- package/src/NDLAFilm/filmStyles.ts +0 -49
- package/src/NDLAFilm/index.ts +0 -15
- package/src/NDLAFilm/isLetter.ts +0 -13
- package/src/NDLAFilm/types.ts +0 -24
- package/src/Navigation/NavigationBox.tsx +0 -252
- package/src/Navigation/index.ts +0 -11
- package/src/NoContentBox/NoContentBox.tsx +0 -32
- package/src/NoContentBox/index.ts +0 -11
- package/src/Programme/Programme.tsx +0 -101
- package/src/Programme/ProgrammeSubjects.tsx +0 -83
- package/src/Programme/index.ts +0 -13
- package/src/ResourceGroup/ResourceGroup.tsx +0 -65
- package/src/ResourceGroup/ResourceItem.stories.tsx +0 -101
- package/src/ResourceGroup/ResourceItem.tsx +0 -318
- package/src/ResourceGroup/ResourceList.tsx +0 -80
- package/src/ResourceGroup/index.ts +0 -11
- package/src/ResourcesWrapper/ResourcesTopicTitle.tsx +0 -223
- package/src/ResourcesWrapper/ResourcesWrapper.tsx +0 -32
- package/src/ResourcesWrapper/index.ts +0 -13
- package/src/SearchTypeResult/ActiveFilterContent.tsx +0 -55
- package/src/SearchTypeResult/ActiveFilters.tsx +0 -163
- package/src/SearchTypeResult/PopupFilter.tsx +0 -149
- package/src/SearchTypeResult/ResultNavigation.tsx +0 -105
- package/src/SearchTypeResult/SearchFieldHeader.tsx +0 -129
- package/src/SearchTypeResult/SearchFilterContent.tsx +0 -61
- package/src/SearchTypeResult/SearchHeader.tsx +0 -180
- package/src/SearchTypeResult/SearchItem.tsx +0 -144
- package/src/SearchTypeResult/SearchItemList.tsx +0 -161
- package/src/SearchTypeResult/SearchItems.tsx +0 -72
- package/src/SearchTypeResult/SearchSubjectItem.tsx +0 -74
- package/src/SearchTypeResult/SearchSubjectResult.tsx +0 -58
- package/src/SearchTypeResult/SearchTypeHeader.tsx +0 -148
- package/src/SearchTypeResult/SearchTypeResult.tsx +0 -89
- package/src/SearchTypeResult/SearchViewType.tsx +0 -111
- package/src/SearchTypeResult/components/ItemContexts.tsx +0 -131
- package/src/SearchTypeResult/components/ItemResourceHeader.tsx +0 -130
- package/src/SearchTypeResult/components/ItemTopicHeader.tsx +0 -88
- package/src/SearchTypeResult/components/SubjectFilters.tsx +0 -149
- package/src/SearchTypeResult/index.ts +0 -17
- package/src/Subject/SubjectBanner.tsx +0 -39
- package/src/Subject/index.ts +0 -9
- package/src/ToolboxPage/ToolboxInfo.tsx +0 -42
- package/src/ToolboxPage/index.ts +0 -11
- package/src/Topic/Loader.tsx +0 -29
- package/src/Topic/Topic.tsx +0 -348
- package/src/Topic/index.ts +0 -13
- package/src/locale/LocaleProvider.tsx +0 -31
- package/src/main.scss +0 -6
|
@@ -1,131 +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 { ReactNode, Fragment } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import styled from "@emotion/styled";
|
|
12
|
-
import { ButtonV2 } from "@ndla/button";
|
|
13
|
-
import { breakpoints, colors, fonts, mq, spacing, stackOrder } from "@ndla/core";
|
|
14
|
-
import { Additional, Core } from "@ndla/icons/common";
|
|
15
|
-
import { Modal, ModalCloseButton, ModalContent, ModalHeader, ModalTitle, ModalTrigger } from "@ndla/modal";
|
|
16
|
-
import { SafeLink } from "@ndla/safelink";
|
|
17
|
-
|
|
18
|
-
const BreadcrumbPath = styled.div`
|
|
19
|
-
color: ${colors.text.light};
|
|
20
|
-
${fonts.sizes("14px", "20px")};
|
|
21
|
-
|
|
22
|
-
svg {
|
|
23
|
-
margin-left: ${spacing.small};
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
const ModalButton = styled(ButtonV2)`
|
|
28
|
-
z-index: ${stackOrder.offsetSingle};
|
|
29
|
-
position: relative;
|
|
30
|
-
${fonts.sizes("14px", "20px")};
|
|
31
|
-
box-shadow: none;
|
|
32
|
-
&:hover {
|
|
33
|
-
box-shadow: inset 0 -1px;
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
const Content = styled.div`
|
|
38
|
-
padding: 0 ${spacing.small} ${spacing.normal};
|
|
39
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
40
|
-
padding: 0 ${spacing.large} ${spacing.normal};
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
const ContextList = styled.ul`
|
|
45
|
-
padding: 0;
|
|
46
|
-
list-style: none;
|
|
47
|
-
`;
|
|
48
|
-
const ContextListItem = styled.li`
|
|
49
|
-
margin-bottom: ${spacing.normal};
|
|
50
|
-
${fonts.sizes("16px", "28px")};
|
|
51
|
-
`;
|
|
52
|
-
|
|
53
|
-
const StyledAdditional = styled(Additional)`
|
|
54
|
-
color: ${colors.brand.dark};
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
|
-
const StyledCore = styled(Core)`
|
|
58
|
-
color: ${colors.brand.primary};
|
|
59
|
-
`;
|
|
60
|
-
|
|
61
|
-
type context = {
|
|
62
|
-
breadcrumb: string[];
|
|
63
|
-
url: string;
|
|
64
|
-
isAdditional?: boolean;
|
|
65
|
-
};
|
|
66
|
-
export type ItemContextsType = {
|
|
67
|
-
contexts: context[];
|
|
68
|
-
id: string | number;
|
|
69
|
-
title: string;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const ItemContexts = ({ contexts, id, title }: ItemContextsType) => {
|
|
73
|
-
const { t } = useTranslation();
|
|
74
|
-
const mainContext = contexts[0];
|
|
75
|
-
const Breadcrumb = ({ breadcrumb, children }: { breadcrumb: string[]; children?: ReactNode }) => (
|
|
76
|
-
<BreadcrumbPath>
|
|
77
|
-
{breadcrumb.map((breadcrumbItem: string, i: number) => (
|
|
78
|
-
<Fragment key={`${breadcrumbItem}-${id}`}>
|
|
79
|
-
{i > 0 && <> › </>}
|
|
80
|
-
{breadcrumbItem}
|
|
81
|
-
</Fragment>
|
|
82
|
-
))}
|
|
83
|
-
{children}
|
|
84
|
-
</BreadcrumbPath>
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<Breadcrumb breadcrumb={mainContext.breadcrumb}>
|
|
89
|
-
|
|
90
|
-
{contexts.length > 1 && (
|
|
91
|
-
<Modal>
|
|
92
|
-
<ModalTrigger>
|
|
93
|
-
<ModalButton variant="link">
|
|
94
|
-
{t("searchPage.contextModal.button", {
|
|
95
|
-
count: contexts.length - 1,
|
|
96
|
-
})}
|
|
97
|
-
</ModalButton>
|
|
98
|
-
</ModalTrigger>
|
|
99
|
-
<ModalContent animation="subtle" animationDuration={50}>
|
|
100
|
-
<ModalHeader>
|
|
101
|
-
<ModalTitle>{t("searchPage.contextModal.heading")}</ModalTitle>
|
|
102
|
-
<ModalCloseButton />
|
|
103
|
-
</ModalHeader>
|
|
104
|
-
<Content>
|
|
105
|
-
<ContextList>
|
|
106
|
-
{contexts.map((context) => (
|
|
107
|
-
<ContextListItem key={context.url}>
|
|
108
|
-
<SafeLink to={context.url}>{title}</SafeLink>
|
|
109
|
-
<Breadcrumb breadcrumb={context.breadcrumb}>
|
|
110
|
-
{context.isAdditional ? (
|
|
111
|
-
<StyledAdditional
|
|
112
|
-
size="normal"
|
|
113
|
-
aria-label={t("resource.tooltipAdditionalTopic")}
|
|
114
|
-
aria-hidden={false}
|
|
115
|
-
/>
|
|
116
|
-
) : (
|
|
117
|
-
<StyledCore size="normal" aria-label={t("resource.tooltipCoreTopic")} aria-hidden={false} />
|
|
118
|
-
)}
|
|
119
|
-
</Breadcrumb>
|
|
120
|
-
</ContextListItem>
|
|
121
|
-
))}
|
|
122
|
-
</ContextList>
|
|
123
|
-
</Content>
|
|
124
|
-
</ModalContent>
|
|
125
|
-
</Modal>
|
|
126
|
-
)}
|
|
127
|
-
</Breadcrumb>
|
|
128
|
-
);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export default ItemContexts;
|
|
@@ -1,130 +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 { Fragment } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import styled from "@emotion/styled";
|
|
12
|
-
import { fonts, spacing, stackOrder } from "@ndla/core";
|
|
13
|
-
import ContentTypeBadge from "../../ContentTypeBadge";
|
|
14
|
-
import resourceTypeColor from "../../utils/resourceTypeColor";
|
|
15
|
-
import { SearchItemType } from "../SearchItem";
|
|
16
|
-
import { ContentType } from "../SearchTypeResult";
|
|
17
|
-
|
|
18
|
-
interface ItemTypeProps {
|
|
19
|
-
contentType?: ContentType;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const ImageElement = styled.img`
|
|
23
|
-
width: 100%;
|
|
24
|
-
height: 100%;
|
|
25
|
-
object-fit: cover;
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
const NoImageElement = styled.div<ItemTypeProps>`
|
|
30
|
-
flex: 1;
|
|
31
|
-
background: ${(props) => props.contentType && `${resourceTypeColor(props.contentType)}`};
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
[data-badge] {
|
|
36
|
-
width: 58px;
|
|
37
|
-
height: 58px;
|
|
38
|
-
opacity: 0.2;
|
|
39
|
-
z-index: ${stackOrder.offsetDouble};
|
|
40
|
-
svg {
|
|
41
|
-
width: 58px;
|
|
42
|
-
height: 58px;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
`;
|
|
46
|
-
|
|
47
|
-
const ContentTypeWrapper = styled.div<ItemTypeProps>`
|
|
48
|
-
height: 48px;
|
|
49
|
-
background: ${(props) => props.contentType && `${resourceTypeColor(props.contentType)}`};
|
|
50
|
-
position: relative;
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
padding: 0 ${spacing.normal};
|
|
54
|
-
${fonts.sizes("12px", "16px")};
|
|
55
|
-
font-weight: ${fonts.weight.semibold};
|
|
56
|
-
`;
|
|
57
|
-
|
|
58
|
-
const ContentTypeIcon = styled.span<ItemTypeProps>`
|
|
59
|
-
display: flex;
|
|
60
|
-
position: absolute;
|
|
61
|
-
top: -23px;
|
|
62
|
-
margin-left: ${spacing.small};
|
|
63
|
-
justify-content: center;
|
|
64
|
-
::before {
|
|
65
|
-
content: "";
|
|
66
|
-
position: absolute;
|
|
67
|
-
height: 23px;
|
|
68
|
-
width: 78px;
|
|
69
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='78' height='23' viewBox='17 0 78 23' fill='none'%3E%3Cpath d='M35.6874 10.8284C37.0999 8.9889 38.405 7.28934 40 6C44.8452 2.08335 48.9078 0 56 0C63.0922 0 67.6548 2.5833 72.5 6.49995C74.0499 7.75284 75.2937 9.39082 76.6385 11.1617C80.0028 15.5921 83.9988 20.8545 95 23H17C27.9865 20.8573 32.1701 15.409 35.6874 10.8284ZM352' fill='${(
|
|
70
|
-
props,
|
|
71
|
-
) => props.contentType && `${encodeURIComponent(resourceTypeColor(props.contentType))}`}'/%3E%3C/svg%3E");
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
74
|
-
|
|
75
|
-
const StyledContentTypeBadge = styled(ContentTypeBadge)`
|
|
76
|
-
z-index: ${stackOrder.offsetSingle};
|
|
77
|
-
margin-top: ${spacing.xxsmall};
|
|
78
|
-
|
|
79
|
-
svg {
|
|
80
|
-
width: 20px;
|
|
81
|
-
height: 20px;
|
|
82
|
-
}
|
|
83
|
-
`;
|
|
84
|
-
|
|
85
|
-
const Wrapper = styled.header`
|
|
86
|
-
display: grid;
|
|
87
|
-
grid-template-rows: 1fr auto;
|
|
88
|
-
overflow: hidden;
|
|
89
|
-
flex-direction: column;
|
|
90
|
-
height: 180px;
|
|
91
|
-
`;
|
|
92
|
-
|
|
93
|
-
interface Props {
|
|
94
|
-
labels: SearchItemType["item"]["labels"];
|
|
95
|
-
img?: SearchItemType["item"]["img"] | null;
|
|
96
|
-
type?: ContentType;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const ItemResourceHeader = ({ labels = [], img, type }: Props) => {
|
|
100
|
-
const { t } = useTranslation();
|
|
101
|
-
return (
|
|
102
|
-
<Wrapper>
|
|
103
|
-
{img ? (
|
|
104
|
-
<ImageElement src={img.url} alt={img.alt} />
|
|
105
|
-
) : (
|
|
106
|
-
<NoImageElement contentType={type}>{type && <ContentTypeBadge type={type} border={false} />}</NoImageElement>
|
|
107
|
-
)}
|
|
108
|
-
<ContentTypeWrapper className="resource-type-wrapper" contentType={type}>
|
|
109
|
-
{img && type && (
|
|
110
|
-
<ContentTypeIcon className="resource-icon-wrapper" contentType={type}>
|
|
111
|
-
<StyledContentTypeBadge type={type} border={false} />
|
|
112
|
-
</ContentTypeIcon>
|
|
113
|
-
)}
|
|
114
|
-
{type && t(`contentTypes.${type}`)}
|
|
115
|
-
{labels.length > 0 && (
|
|
116
|
-
<>
|
|
117
|
-
{labels.map((label) => (
|
|
118
|
-
<Fragment key={label}>
|
|
119
|
-
{" "}
|
|
120
|
-
<>•</> {label}
|
|
121
|
-
</Fragment>
|
|
122
|
-
))}
|
|
123
|
-
</>
|
|
124
|
-
)}
|
|
125
|
-
</ContentTypeWrapper>
|
|
126
|
-
</Wrapper>
|
|
127
|
-
);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export default ItemResourceHeader;
|
|
@@ -1,88 +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 { ReactNode } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import styled from "@emotion/styled";
|
|
12
|
-
import { colors, fonts, spacing } from "@ndla/core";
|
|
13
|
-
|
|
14
|
-
import ContentTypeBadge from "../../ContentTypeBadge";
|
|
15
|
-
import { SearchItemType } from "../SearchItem";
|
|
16
|
-
import { ContentType } from "../SearchTypeResult";
|
|
17
|
-
|
|
18
|
-
const Wrapper = styled.header`
|
|
19
|
-
padding: ${spacing.small} ${spacing.normal} 0;
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
const Label = styled.div`
|
|
23
|
-
${fonts.sizes("12px", "16px")};
|
|
24
|
-
font-weight: ${fonts.weight.semibold};
|
|
25
|
-
height: 26px;
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
margin: ${spacing.small} 0;
|
|
29
|
-
|
|
30
|
-
[data-badge] {
|
|
31
|
-
width: 26px;
|
|
32
|
-
height: 26px;
|
|
33
|
-
margin-right: ${spacing.xsmall};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
svg {
|
|
37
|
-
width: 22px;
|
|
38
|
-
height: 22px;
|
|
39
|
-
color: ${colors.text.primary} !important;
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
const TopicHeaderVisualElementWrapper = styled.div`
|
|
44
|
-
float: right;
|
|
45
|
-
margin-left: ${spacing.small};
|
|
46
|
-
width: 110px;
|
|
47
|
-
height: 110px;
|
|
48
|
-
display: flex;
|
|
49
|
-
overflow: hidden;
|
|
50
|
-
border-radius: 50%;
|
|
51
|
-
`;
|
|
52
|
-
|
|
53
|
-
const TopicHeaderImage = styled.img`
|
|
54
|
-
width: 100%;
|
|
55
|
-
height: 100%;
|
|
56
|
-
object-fit: cover;
|
|
57
|
-
max-width: unset;
|
|
58
|
-
`;
|
|
59
|
-
|
|
60
|
-
interface Props {
|
|
61
|
-
children: ReactNode;
|
|
62
|
-
image?: SearchItemType["item"]["img"] | null;
|
|
63
|
-
type?: ContentType;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const ItemTopicHeader = ({ children, image, type }: Props) => {
|
|
67
|
-
const { t } = useTranslation();
|
|
68
|
-
return (
|
|
69
|
-
<Wrapper>
|
|
70
|
-
{image && (
|
|
71
|
-
<TopicHeaderVisualElementWrapper>
|
|
72
|
-
<TopicHeaderImage className="topic-header-image" src={image.url} alt="" />
|
|
73
|
-
</TopicHeaderVisualElementWrapper>
|
|
74
|
-
)}
|
|
75
|
-
<Label className="topic-label">
|
|
76
|
-
{type && (
|
|
77
|
-
<>
|
|
78
|
-
<ContentTypeBadge type={type} border={false} />
|
|
79
|
-
{t(`contentTypes.${type}`)}
|
|
80
|
-
</>
|
|
81
|
-
)}
|
|
82
|
-
</Label>
|
|
83
|
-
{children}
|
|
84
|
-
</Wrapper>
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export default ItemTopicHeader;
|
|
@@ -1,149 +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 { useEffect, useRef, useState } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import styled from "@emotion/styled";
|
|
12
|
-
import { ButtonV2 } from "@ndla/button";
|
|
13
|
-
import { Plus as PlusIcon } from "@ndla/icons/action";
|
|
14
|
-
|
|
15
|
-
import { Modal, ModalTrigger } from "@ndla/modal";
|
|
16
|
-
import { FilterProps } from "../ActiveFilterContent";
|
|
17
|
-
import ActiveFilters from "../ActiveFilters";
|
|
18
|
-
import PopupFilter, { PopupFilterProps } from "../PopupFilter";
|
|
19
|
-
|
|
20
|
-
const FilterButtonText = styled.span`
|
|
21
|
-
display: inline-block;
|
|
22
|
-
font-weight: 600;
|
|
23
|
-
margin-right: 10px;
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
type ProgrammeProps = PopupFilterProps["programmes"] & {
|
|
27
|
-
values: string[];
|
|
28
|
-
onProgrammeValuesChange: (values: string[]) => void;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
type SubjectCategoriesProps = PopupFilterProps["subjectCategories"] & {
|
|
32
|
-
values: string[];
|
|
33
|
-
onSubjectValuesChange: (values: string[]) => void;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type SubjectFilterProps = {
|
|
37
|
-
filters: {
|
|
38
|
-
programmes?: ProgrammeProps;
|
|
39
|
-
subjectCategories?: SubjectCategoriesProps;
|
|
40
|
-
};
|
|
41
|
-
activeFilters?: {
|
|
42
|
-
filters: FilterProps[];
|
|
43
|
-
onFilterRemove: (value: string, name: string) => void;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
type Props = {
|
|
48
|
-
isNarrowScreen?: boolean;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const SubjectFilters = ({ filters, activeFilters, isNarrowScreen }: SubjectFilterProps & Props) => {
|
|
52
|
-
const { t } = useTranslation();
|
|
53
|
-
const { subjectCategories, programmes } = filters;
|
|
54
|
-
const [subjectValues, setSubjectValues] = useState<Array<string>>([]);
|
|
55
|
-
const [programmesValues, setProgrammesValues] = useState<Array<string>>([]);
|
|
56
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
57
|
-
|
|
58
|
-
const prevIsOpenRef = useRef<boolean>();
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
prevIsOpenRef.current = isOpen;
|
|
61
|
-
});
|
|
62
|
-
const prevIsOpen = prevIsOpenRef.current;
|
|
63
|
-
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
if (isOpen && isOpen !== prevIsOpen) {
|
|
66
|
-
if (subjectCategories) {
|
|
67
|
-
setSubjectValues([...subjectCategories.values]);
|
|
68
|
-
}
|
|
69
|
-
if (programmes) {
|
|
70
|
-
setProgrammesValues([...programmes.values]);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}, [isOpen, prevIsOpen, subjectCategories, programmes]);
|
|
74
|
-
|
|
75
|
-
const onToggleSubject = (subjectId: string) => {
|
|
76
|
-
let updatedFilter = [...subjectValues];
|
|
77
|
-
if (updatedFilter.includes(subjectId)) {
|
|
78
|
-
updatedFilter = subjectValues.filter((option) => option !== subjectId);
|
|
79
|
-
} else {
|
|
80
|
-
updatedFilter.push(subjectId);
|
|
81
|
-
}
|
|
82
|
-
setSubjectValues(updatedFilter);
|
|
83
|
-
if (subjectCategories) {
|
|
84
|
-
subjectCategories.onSubjectValuesChange(updatedFilter);
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const onToggleProgramme = (programmeId: string) => {
|
|
89
|
-
let updatedFilter = [...programmesValues];
|
|
90
|
-
if (updatedFilter.includes(programmeId)) {
|
|
91
|
-
updatedFilter = programmesValues.filter((option) => option !== programmeId);
|
|
92
|
-
} else {
|
|
93
|
-
updatedFilter.push(programmeId);
|
|
94
|
-
}
|
|
95
|
-
setProgrammesValues(updatedFilter);
|
|
96
|
-
if (programmes) {
|
|
97
|
-
programmes.onProgrammeValuesChange(updatedFilter);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const handlePopupOpen = () => {
|
|
102
|
-
setIsOpen(true);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const OpenModalButton = () => (
|
|
106
|
-
<ModalTrigger>
|
|
107
|
-
<ButtonV2 type="button" size="normal" colorTheme="greyLighter" shape="pill">
|
|
108
|
-
<FilterButtonText>{t("searchPage.searchFilterMessages.noValuesButtonText")}</FilterButtonText>
|
|
109
|
-
<PlusIcon />
|
|
110
|
-
</ButtonV2>
|
|
111
|
-
</ModalTrigger>
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
const ActiveFiltersElement = ({ showModalButton }: { showModalButton?: boolean }) => {
|
|
115
|
-
const customElements = showModalButton ? [OpenModalButton()] : [];
|
|
116
|
-
if (!activeFilters) return null;
|
|
117
|
-
return (
|
|
118
|
-
<ActiveFilters
|
|
119
|
-
{...activeFilters}
|
|
120
|
-
showOnSmallScreen={isNarrowScreen}
|
|
121
|
-
onClickShowHiddenSubjects={handlePopupOpen}
|
|
122
|
-
customElements={customElements}
|
|
123
|
-
/>
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<Modal open={isOpen} onOpenChange={setIsOpen}>
|
|
129
|
-
{isNarrowScreen ? (
|
|
130
|
-
<ActiveFiltersElement showModalButton />
|
|
131
|
-
) : isNarrowScreen === false ? (
|
|
132
|
-
<>
|
|
133
|
-
<OpenModalButton />
|
|
134
|
-
<ActiveFiltersElement />
|
|
135
|
-
</>
|
|
136
|
-
) : undefined}
|
|
137
|
-
<PopupFilter
|
|
138
|
-
programmes={programmes}
|
|
139
|
-
subjectCategories={subjectCategories}
|
|
140
|
-
subjectValues={subjectValues}
|
|
141
|
-
programmesValues={programmesValues}
|
|
142
|
-
onToggleSubject={onToggleSubject}
|
|
143
|
-
onToggleProgramme={onToggleProgramme}
|
|
144
|
-
/>
|
|
145
|
-
</Modal>
|
|
146
|
-
);
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export default SubjectFilters;
|
|
@@ -1,17 +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 SearchFieldHeader from "./SearchFieldHeader";
|
|
10
|
-
import SearchFilterContent from "./SearchFilterContent";
|
|
11
|
-
import SearchHeader from "./SearchHeader";
|
|
12
|
-
import SearchSubjectResult from "./SearchSubjectResult";
|
|
13
|
-
import SearchTypeResult from "./SearchTypeResult";
|
|
14
|
-
|
|
15
|
-
export type { ContentType } from "./SearchTypeResult";
|
|
16
|
-
|
|
17
|
-
export { SearchTypeResult, SearchHeader, SearchFieldHeader, SearchSubjectResult, SearchFilterContent };
|
|
@@ -1,39 +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 { breakpoints, mq } from "@ndla/core";
|
|
11
|
-
|
|
12
|
-
type BannerProps = {
|
|
13
|
-
image: string;
|
|
14
|
-
negativeTopMargin?: boolean;
|
|
15
|
-
};
|
|
16
|
-
const StyledBanner = styled.div<BannerProps>`
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: 120px;
|
|
19
|
-
margin-top: 0px;
|
|
20
|
-
background-image: url(${(props) => props.image});
|
|
21
|
-
background-size: cover;
|
|
22
|
-
background-repeat: no-repeat;
|
|
23
|
-
background-position: center right;
|
|
24
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
25
|
-
height: 190px;
|
|
26
|
-
${(props) => props.negativeTopMargin && `margin-top: -30px;`}
|
|
27
|
-
}
|
|
28
|
-
${mq.range({ from: breakpoints.desktop })} {
|
|
29
|
-
height: 220px;
|
|
30
|
-
${(props) => props.negativeTopMargin && `margin-top: -60px;`}
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
type Props = BannerProps & {};
|
|
35
|
-
const SubjectBanner = ({ image, negativeTopMargin }: Props) => (
|
|
36
|
-
<StyledBanner image={image} negativeTopMargin={negativeTopMargin} />
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
export default SubjectBanner;
|
package/src/Subject/index.ts
DELETED
|
@@ -1,42 +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 { MouseEvent } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { Heading, Text } from "@ndla/typography";
|
|
12
|
-
import { NavigationBox } from "../Navigation";
|
|
13
|
-
import { ItemProps } from "../Navigation/NavigationBox";
|
|
14
|
-
|
|
15
|
-
interface Props {
|
|
16
|
-
id?: string;
|
|
17
|
-
title: string;
|
|
18
|
-
introduction: string;
|
|
19
|
-
topics: ItemProps[];
|
|
20
|
-
onSelectTopic?: (event: MouseEvent<HTMLElement>, id?: string) => void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const ToolboxInfo = ({ title, introduction, topics, onSelectTopic, id }: Props) => {
|
|
24
|
-
const { t } = useTranslation();
|
|
25
|
-
return (
|
|
26
|
-
<>
|
|
27
|
-
<Heading element="h1" headingStyle="h1-resource" id={id} tabIndex={-1}>
|
|
28
|
-
{title}
|
|
29
|
-
</Heading>
|
|
30
|
-
<Text textStyle="ingress">{introduction}</Text>
|
|
31
|
-
<NavigationBox
|
|
32
|
-
items={topics}
|
|
33
|
-
listDirection="floating"
|
|
34
|
-
heading={t("topicPage.topics")}
|
|
35
|
-
colorMode="greyLighter"
|
|
36
|
-
onClick={onSelectTopic}
|
|
37
|
-
/>
|
|
38
|
-
</>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default ToolboxInfo;
|
package/src/ToolboxPage/index.ts
DELETED
|
@@ -1,11 +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 ToolboxInfo from "./ToolboxInfo";
|
|
10
|
-
|
|
11
|
-
export { ToolboxInfo };
|
package/src/Topic/Loader.tsx
DELETED
|
@@ -1,29 +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 ContentLoader from "../ContentLoader";
|
|
10
|
-
|
|
11
|
-
const Loader = () => (
|
|
12
|
-
<ContentLoader width={800} height={880}>
|
|
13
|
-
<rect x="0" y="0" rx="3" ry="3" width="500" height="60" />
|
|
14
|
-
<rect x="0" y="100" rx="3" ry="3" width="500" height="25" />
|
|
15
|
-
<rect x="0" y="140" rx="3" ry="3" width="500" height="25" />
|
|
16
|
-
<rect x="0" y="180" rx="3" ry="3" width="400" height="25" />
|
|
17
|
-
<rect x="600" y="0" rx="3" ry="3" width="200" height="205" />
|
|
18
|
-
<rect x="0" y="280" rx="3" ry="3" width="800" height="60" />
|
|
19
|
-
<rect x="0" y="350" rx="3" ry="3" width="800" height="60" />
|
|
20
|
-
<rect x="0" y="420" rx="3" ry="3" width="800" height="60" />
|
|
21
|
-
<rect x="0" y="490" rx="3" ry="3" width="800" height="60" />
|
|
22
|
-
<rect x="0" y="560" rx="3" ry="3" width="800" height="60" />
|
|
23
|
-
<rect x="0" y="680" rx="3" ry="3" width="800" height="60" />
|
|
24
|
-
<rect x="0" y="750" rx="3" ry="3" width="800" height="60" />
|
|
25
|
-
<rect x="0" y="820" rx="3" ry="3" width="800" height="60" />
|
|
26
|
-
</ContentLoader>
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
export default Loader;
|