@ndla/ui 50.15.3 → 52.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/es/Article/Article.js +12 -12
- package/es/Article/ArticleHeaderWrapper.js +0 -11
- package/es/Article/ArticleNotions.js +6 -6
- 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 +18 -14
- package/es/Embed/RelatedContentEmbed.js +3 -3
- package/es/Embed/UuDisclaimerEmbed.js +4 -3
- package/es/Embed/conceptComponents.js +10 -10
- package/es/Embed/index.js +1 -1
- package/es/Figure/Figure.js +32 -19
- package/es/Footer/FooterBlock.js +17 -0
- package/es/Footer/index.js +1 -4
- 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 +7 -21
- package/es/locale/messages-en.js +14 -3
- package/es/locale/messages-nb.js +14 -3
- package/es/locale/messages-nn.js +15 -4
- package/es/locale/messages-se.js +13 -2
- package/es/locale/messages-sma.js +14 -3
- package/es/types.js +0 -9
- package/lib/Article/Article.d.ts +5 -7
- package/lib/Article/Article.js +12 -12
- package/lib/Article/ArticleHeaderWrapper.js +0 -11
- package/lib/Article/ArticleNotions.js +5 -5
- package/lib/Article/ArticleParagraph.d.ts +13 -0
- package/lib/Article/ArticleParagraph.js +32 -0
- package/lib/Article/index.d.ts +1 -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/{NDLAFilm/isLetter.d.ts → CodeBlock/codeLanguageOptions.d.ts} +5 -1
- 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 +18 -14
- package/lib/Embed/RelatedContentEmbed.js +3 -3
- package/lib/Embed/UuDisclaimerEmbed.js +4 -3
- package/lib/Embed/conceptComponents.js +10 -10
- package/lib/Embed/index.d.ts +1 -1
- package/lib/Embed/index.js +15 -3
- package/lib/Figure/Figure.d.ts +2 -5
- package/lib/Figure/Figure.js +32 -23
- package/lib/Footer/FooterBlock.d.ts +13 -0
- package/lib/Footer/FooterBlock.js +24 -0
- package/lib/Footer/index.d.ts +1 -4
- package/lib/Footer/index.js +3 -18
- 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 +6 -21
- package/lib/index.js +31 -249
- package/lib/locale/messages-en.d.ts +11 -0
- package/lib/locale/messages-en.js +14 -3
- package/lib/locale/messages-nb.d.ts +11 -0
- package/lib/locale/messages-nb.js +14 -3
- package/lib/locale/messages-nn.d.ts +11 -0
- package/lib/locale/messages-nn.js +15 -4
- package/lib/locale/messages-se.d.ts +11 -0
- package/lib/locale/messages-se.js +13 -2
- package/lib/locale/messages-sma.d.ts +11 -0
- package/lib/locale/messages-sma.js +14 -3
- package/lib/types.d.ts +0 -51
- package/lib/types.js +1 -10
- package/package.json +16 -21
- package/src/Article/Article.tsx +14 -18
- package/src/Article/ArticleHeaderWrapper.tsx +1 -12
- package/src/Article/ArticleNotions.tsx +3 -3
- package/src/Article/ArticleParagraph.tsx +22 -0
- package/src/Article/component.article.scss +0 -7
- package/src/Article/index.ts +2 -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 +20 -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/Embed/index.ts +1 -1
- package/src/Figure/Figure.tsx +57 -18
- package/src/Footer/Footer.stories.tsx +7 -105
- package/src/Footer/FooterBlock.tsx +30 -0
- package/src/Footer/index.ts +1 -5
- 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/index.ts +8 -47
- package/src/locale/messages-en.ts +15 -1
- package/src/locale/messages-nb.ts +15 -1
- package/src/locale/messages-nn.ts +16 -2
- package/src/locale/messages-se.ts +14 -0
- package/src/locale/messages-sma.ts +15 -1
- package/src/main.scss +0 -2
- package/src/types.ts +0 -62
- package/es/Article/ArticleAccessMessage.js +0 -43
- 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/Footer/EditorName.js +0 -20
- package/es/Footer/Footer.js +0 -83
- package/es/Footer/FooterLinks.js +0 -108
- package/es/Footer/FooterText.js +0 -25
- 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/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/SubjectHeader.js +0 -66
- package/es/Subject/index.js +0 -10
- 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/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/Footer/EditorName.d.ts +0 -13
- package/lib/Footer/EditorName.js +0 -27
- package/lib/Footer/Footer.d.ts +0 -30
- package/lib/Footer/Footer.js +0 -88
- package/lib/Footer/FooterLinks.d.ts +0 -26
- package/lib/Footer/FooterLinks.js +0 -115
- package/lib/Footer/FooterText.d.ts +0 -13
- package/lib/Footer/FooterText.js +0 -33
- 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/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.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.d.ts +0 -9
- 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/SubjectHeader.d.ts +0 -17
- package/lib/Subject/SubjectHeader.js +0 -73
- package/lib/Subject/index.d.ts +0 -9
- package/lib/Subject/index.js +0 -20
- 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/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/Footer/EditorName.tsx +0 -19
- package/src/Footer/Footer.tsx +0 -107
- package/src/Footer/FooterLinks.tsx +0 -144
- package/src/Footer/FooterText.tsx +0 -35
- 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/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/SubjectHeader.tsx +0 -100
- package/src/Subject/index.ts +0 -10
- 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
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2019-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { MouseEvent } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { css } from "@emotion/react";
|
|
12
|
-
import styled from "@emotion/styled";
|
|
13
|
-
import { ButtonV2 } from "@ndla/button";
|
|
14
|
-
import { breakpoints, colors, misc, mq, spacing } from "@ndla/core";
|
|
15
|
-
import { Additional, HumanMaleBoard } from "@ndla/icons/common";
|
|
16
|
-
import { SafeLinkButton } from "@ndla/safelink";
|
|
17
|
-
import { Switch } from "@ndla/switch";
|
|
18
|
-
import { Heading } from "@ndla/typography";
|
|
19
|
-
import { uuid } from "@ndla/util";
|
|
20
|
-
|
|
21
|
-
const StyledWrapper = styled.nav`
|
|
22
|
-
margin: ${spacing.normal} 0 ${spacing.mediumlarge};
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
const StyledHeadingWrapper = styled.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
justify-content: space-between;
|
|
28
|
-
align-items: baseline;
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
const StyledHeading = styled(Heading)`
|
|
32
|
-
&[data-inverted="true"] {
|
|
33
|
-
color: ${colors.white};
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
const StyledList = styled.ul`
|
|
38
|
-
list-style: none;
|
|
39
|
-
padding: 0;
|
|
40
|
-
gap: ${spacing.xxsmall};
|
|
41
|
-
|
|
42
|
-
&[data-direction="horizontal"] {
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
46
|
-
column-count: 2;
|
|
47
|
-
gap: 20px;
|
|
48
|
-
display: grid;
|
|
49
|
-
grid-template-columns: repeat(2, 1fr);
|
|
50
|
-
}
|
|
51
|
-
${mq.range({ from: breakpoints.tabletWide })} {
|
|
52
|
-
column-count: 3;
|
|
53
|
-
gap: 20px;
|
|
54
|
-
grid-template-columns: repeat(3, 1fr);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
58
|
-
|
|
59
|
-
const StyledListItem = styled.li`
|
|
60
|
-
padding: 0;
|
|
61
|
-
break-inside: avoid;
|
|
62
|
-
|
|
63
|
-
&[data-direction="floating"] {
|
|
64
|
-
display: inline-block;
|
|
65
|
-
margin: 0 ${spacing.xsmall} ${spacing.xsmall} 0;
|
|
66
|
-
${mq.range({ until: breakpoints.mobileWide })} {
|
|
67
|
-
display: block;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
`;
|
|
71
|
-
|
|
72
|
-
const StyledButtonContent = styled.span`
|
|
73
|
-
display: flex;
|
|
74
|
-
width: 100%;
|
|
75
|
-
justify-content: space-between;
|
|
76
|
-
align-items: center;
|
|
77
|
-
`;
|
|
78
|
-
|
|
79
|
-
const StyledButtonContentText = styled.span`
|
|
80
|
-
&[data-additional="true"][data-restricted="true"] {
|
|
81
|
-
padding-left: ${spacing.medium};
|
|
82
|
-
}
|
|
83
|
-
&[data-additional="true"] {
|
|
84
|
-
padding-left: ${spacing.small};
|
|
85
|
-
}
|
|
86
|
-
&[data-restricted="true"] {
|
|
87
|
-
padding-left: ${spacing.small};
|
|
88
|
-
}
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
const StyledMarksWrapper = styled.span`
|
|
92
|
-
position: absolute;
|
|
93
|
-
left: ${spacing.xxsmall};
|
|
94
|
-
top: ${spacing.xsmall};
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
& > * {
|
|
98
|
-
margin-left: ${spacing.xxsmall};
|
|
99
|
-
}
|
|
100
|
-
span:first-of-type {
|
|
101
|
-
margin-left: 0;
|
|
102
|
-
}
|
|
103
|
-
`;
|
|
104
|
-
|
|
105
|
-
const StyledAdditional = styled(Additional)`
|
|
106
|
-
fill: ${colors.white};
|
|
107
|
-
width: ${spacing.nsmall};
|
|
108
|
-
height: ${spacing.nsmall};
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
const StyledHumanBoardIconWrapper = styled.span`
|
|
112
|
-
display: flex;
|
|
113
|
-
`;
|
|
114
|
-
|
|
115
|
-
const StyledButtonContentSelected = styled.span`
|
|
116
|
-
width: 10px;
|
|
117
|
-
height: 10px;
|
|
118
|
-
border-radius: ${misc.borderRadiusLarge};
|
|
119
|
-
background: ${colors.white};
|
|
120
|
-
flex-shrink: 0;
|
|
121
|
-
margin-left: ${spacing.small};
|
|
122
|
-
`;
|
|
123
|
-
|
|
124
|
-
const StyledListElementWrapper = styled.div`
|
|
125
|
-
position: relative;
|
|
126
|
-
&[data-additional="true"] {
|
|
127
|
-
& > * {
|
|
128
|
-
border: 1px dashed ${colors.brand.dark};
|
|
129
|
-
background-clip: padding-box;
|
|
130
|
-
:hover,
|
|
131
|
-
:focus {
|
|
132
|
-
border: 1px dashed ${colors.brand.dark};
|
|
133
|
-
background-clip: padding-box;
|
|
134
|
-
color: ${colors.white};
|
|
135
|
-
}
|
|
136
|
-
&[data-color-mode="light"][data-selected="false"] {
|
|
137
|
-
border: 1px dashed ${colors.brand.tertiary};
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
`;
|
|
142
|
-
|
|
143
|
-
const listElementStyle = css`
|
|
144
|
-
display: flex;
|
|
145
|
-
flex: 1;
|
|
146
|
-
text-align: left;
|
|
147
|
-
`;
|
|
148
|
-
|
|
149
|
-
export type ItemProps = {
|
|
150
|
-
url?: string;
|
|
151
|
-
label: string;
|
|
152
|
-
id?: string;
|
|
153
|
-
selected?: boolean;
|
|
154
|
-
isAdditionalResource?: boolean;
|
|
155
|
-
isRestrictedResource?: boolean;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
type Props = {
|
|
159
|
-
heading?: string;
|
|
160
|
-
colorMode?: "primary" | "darker" | "light" | "greyLightest" | "greyLighter";
|
|
161
|
-
isButtonElements?: boolean;
|
|
162
|
-
items?: ItemProps[];
|
|
163
|
-
onClick?: (event: MouseEvent<HTMLElement>, id?: string) => void;
|
|
164
|
-
hasAdditionalResources?: boolean;
|
|
165
|
-
showAdditionalResources?: boolean;
|
|
166
|
-
listDirection?: "horizontal" | "floating";
|
|
167
|
-
invertedStyle?: boolean;
|
|
168
|
-
onToggleAdditionalResources?: (checked: boolean) => void;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
export const NavigationBox = ({
|
|
172
|
-
heading,
|
|
173
|
-
colorMode = "primary",
|
|
174
|
-
items,
|
|
175
|
-
isButtonElements,
|
|
176
|
-
onClick,
|
|
177
|
-
hasAdditionalResources,
|
|
178
|
-
showAdditionalResources = false,
|
|
179
|
-
listDirection = "horizontal",
|
|
180
|
-
invertedStyle,
|
|
181
|
-
onToggleAdditionalResources = () => {},
|
|
182
|
-
}: Props) => {
|
|
183
|
-
const { t } = useTranslation();
|
|
184
|
-
const ListElementType = isButtonElements ? ButtonV2 : SafeLinkButton;
|
|
185
|
-
return (
|
|
186
|
-
<StyledWrapper>
|
|
187
|
-
<StyledHeadingWrapper>
|
|
188
|
-
{heading && (
|
|
189
|
-
<StyledHeading element="h2" margin="small" headingStyle="list-title" data-inverted={invertedStyle}>
|
|
190
|
-
{heading}
|
|
191
|
-
</StyledHeading>
|
|
192
|
-
)}
|
|
193
|
-
{hasAdditionalResources && (
|
|
194
|
-
<Switch
|
|
195
|
-
id={uuid()}
|
|
196
|
-
checked={showAdditionalResources}
|
|
197
|
-
label={t("navigation.additionalTopics")}
|
|
198
|
-
onChange={onToggleAdditionalResources}
|
|
199
|
-
css={invertedStyle ? { color: "#fff" } : {}}
|
|
200
|
-
/>
|
|
201
|
-
)}
|
|
202
|
-
</StyledHeadingWrapper>
|
|
203
|
-
<StyledList data-testid="nav-box-list" data-direction={listDirection}>
|
|
204
|
-
{items?.map((item: ItemProps) => (
|
|
205
|
-
<StyledListItem key={item.label} data-direction={listDirection} data-testid="nav-box-item">
|
|
206
|
-
<StyledListElementWrapper
|
|
207
|
-
data-additional={item.isAdditionalResource}
|
|
208
|
-
data-color-mode={colorMode}
|
|
209
|
-
data-selected={item.selected}
|
|
210
|
-
>
|
|
211
|
-
<ListElementType
|
|
212
|
-
to={item.url ?? ""}
|
|
213
|
-
colorTheme={item.selected ? "darker" : colorMode}
|
|
214
|
-
size="medium"
|
|
215
|
-
shape="sharp"
|
|
216
|
-
css={listElementStyle}
|
|
217
|
-
onClick={(e: MouseEvent<HTMLElement>) => {
|
|
218
|
-
if (onClick) {
|
|
219
|
-
onClick(e, item.id);
|
|
220
|
-
}
|
|
221
|
-
}}
|
|
222
|
-
>
|
|
223
|
-
<StyledButtonContent>
|
|
224
|
-
<StyledButtonContentText
|
|
225
|
-
data-additional={item.isAdditionalResource}
|
|
226
|
-
data-restricted={item.isRestrictedResource}
|
|
227
|
-
data-color-mode={colorMode}
|
|
228
|
-
>
|
|
229
|
-
<StyledMarksWrapper>
|
|
230
|
-
{item.isAdditionalResource && (
|
|
231
|
-
<StyledAdditional aria-label={t("resource.additionalTooltip")} aria-hidden={false} />
|
|
232
|
-
)}
|
|
233
|
-
{item.isRestrictedResource && (
|
|
234
|
-
<StyledHumanBoardIconWrapper>
|
|
235
|
-
<HumanMaleBoard />
|
|
236
|
-
</StyledHumanBoardIconWrapper>
|
|
237
|
-
)}
|
|
238
|
-
</StyledMarksWrapper>
|
|
239
|
-
{item.label}
|
|
240
|
-
</StyledButtonContentText>
|
|
241
|
-
{item.selected && <StyledButtonContentSelected />}
|
|
242
|
-
</StyledButtonContent>
|
|
243
|
-
</ListElementType>
|
|
244
|
-
</StyledListElementWrapper>
|
|
245
|
-
</StyledListItem>
|
|
246
|
-
))}
|
|
247
|
-
</StyledList>
|
|
248
|
-
</StyledWrapper>
|
|
249
|
-
);
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
export default NavigationBox;
|
package/src/Navigation/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2019-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import NavigationBox from "./NavigationBox";
|
|
10
|
-
|
|
11
|
-
export { NavigationBox };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { ButtonV2 } from "@ndla/button";
|
|
10
|
-
|
|
11
|
-
interface Props {
|
|
12
|
-
onClick?: () => void;
|
|
13
|
-
buttonText?: string;
|
|
14
|
-
text: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const NoContentBox = ({ buttonText, text, onClick }: Props) => (
|
|
18
|
-
<div>
|
|
19
|
-
<span>
|
|
20
|
-
<div>
|
|
21
|
-
<p>{text}</p>
|
|
22
|
-
{onClick && (
|
|
23
|
-
<ButtonV2 variant="outline" onClick={onClick}>
|
|
24
|
-
{buttonText}
|
|
25
|
-
</ButtonV2>
|
|
26
|
-
)}
|
|
27
|
-
</div>
|
|
28
|
-
</span>
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
export default NoContentBox;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import NoContentBox from "./NoContentBox";
|
|
10
|
-
|
|
11
|
-
export default NoContentBox;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { useTranslation } from "react-i18next";
|
|
10
|
-
import styled from "@emotion/styled";
|
|
11
|
-
import { breakpoints, mq, spacing } from "@ndla/core";
|
|
12
|
-
import { Heading } from "@ndla/typography";
|
|
13
|
-
import ProgrammeSubjects, { GradesProps } from "./ProgrammeSubjects";
|
|
14
|
-
import LayoutItem, { OneColumn } from "../Layout";
|
|
15
|
-
import MessageBox from "../Messages/MessageBox";
|
|
16
|
-
const StyledWrapper = styled.div`
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
type StyledBackgroundProps = {
|
|
22
|
-
image?: string;
|
|
23
|
-
};
|
|
24
|
-
const StyledBackground = styled.div<StyledBackgroundProps>`
|
|
25
|
-
height: 160px;
|
|
26
|
-
max-width: 1105px;
|
|
27
|
-
width: 100%;
|
|
28
|
-
margin: 0 auto;
|
|
29
|
-
${(props: StyledBackgroundProps) =>
|
|
30
|
-
props.image &&
|
|
31
|
-
`
|
|
32
|
-
background-image: url(${props.image});
|
|
33
|
-
background-position: center;
|
|
34
|
-
background-repeat: no-repeat;
|
|
35
|
-
background-size: cover;
|
|
36
|
-
height: 400px;
|
|
37
|
-
|
|
38
|
-
${mq.range({ until: breakpoints.tablet })} {
|
|
39
|
-
height: 160px;
|
|
40
|
-
margin: ${spacing.normal} ${spacing.normal} 0;
|
|
41
|
-
width: calc(100% - ${spacing.large});
|
|
42
|
-
}
|
|
43
|
-
${mq.range({ until: breakpoints.mobileWide })} {
|
|
44
|
-
height: 128px;
|
|
45
|
-
margin: 20px 20px 0;
|
|
46
|
-
width: calc(100% - 40px);
|
|
47
|
-
}
|
|
48
|
-
`}
|
|
49
|
-
`;
|
|
50
|
-
|
|
51
|
-
const StyledLayoutWrapper = styled.div`
|
|
52
|
-
background: #fff;
|
|
53
|
-
margin-top: -170px;
|
|
54
|
-
${mq.range({ until: breakpoints.tablet })} {
|
|
55
|
-
margin-top: 0;
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
58
|
-
|
|
59
|
-
const StyledContentWrapper = styled.div`
|
|
60
|
-
padding-top: 1px;
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
const SubjectsWrapper = styled.div`
|
|
64
|
-
margin-top: 28px;
|
|
65
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
66
|
-
margin-top: 40px;
|
|
67
|
-
}
|
|
68
|
-
`;
|
|
69
|
-
|
|
70
|
-
type Props = GradesProps & {
|
|
71
|
-
heading?: string;
|
|
72
|
-
image?: string;
|
|
73
|
-
messageBoxText?: string;
|
|
74
|
-
headingId?: string;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const Programme = ({ heading, image, grades, selectedGrade, messageBoxText, headingId }: Props) => {
|
|
78
|
-
const { t } = useTranslation();
|
|
79
|
-
return (
|
|
80
|
-
<StyledWrapper>
|
|
81
|
-
<StyledBackground image={image} />
|
|
82
|
-
<OneColumn>
|
|
83
|
-
<StyledLayoutWrapper>
|
|
84
|
-
<LayoutItem layout="extend">
|
|
85
|
-
<StyledContentWrapper>
|
|
86
|
-
<Heading element="h1" margin="xlarge" headingStyle="h1" serif id={headingId} tabIndex={-1}>
|
|
87
|
-
{heading}
|
|
88
|
-
</Heading>
|
|
89
|
-
{messageBoxText && <MessageBox>{t(messageBoxText)}</MessageBox>}
|
|
90
|
-
<SubjectsWrapper>
|
|
91
|
-
<ProgrammeSubjects grades={grades} selectedGrade={selectedGrade} />
|
|
92
|
-
</SubjectsWrapper>
|
|
93
|
-
</StyledContentWrapper>
|
|
94
|
-
</LayoutItem>
|
|
95
|
-
</StyledLayoutWrapper>
|
|
96
|
-
</OneColumn>
|
|
97
|
-
</StyledWrapper>
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export default Programme;
|
|
@@ -1,83 +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 { useMemo } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import styled from "@emotion/styled";
|
|
12
|
-
import { spacing } from "@ndla/core";
|
|
13
|
-
import { SafeLinkButton } from "@ndla/safelink";
|
|
14
|
-
import { MessageBox } from "../Messages";
|
|
15
|
-
import { NavigationBox } from "../Navigation";
|
|
16
|
-
|
|
17
|
-
const GradesMenu = styled.ul`
|
|
18
|
-
display: flex;
|
|
19
|
-
gap: ${spacing.small};
|
|
20
|
-
padding-left: 0;
|
|
21
|
-
margin-bottom: ${spacing.normal};
|
|
22
|
-
li {
|
|
23
|
-
list-style: none;
|
|
24
|
-
padding: 0;
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
export type GradesProps = {
|
|
29
|
-
selectedGrade?: string;
|
|
30
|
-
grades?: {
|
|
31
|
-
missingProgrammeSubjects?: boolean;
|
|
32
|
-
name: string;
|
|
33
|
-
categories?: {
|
|
34
|
-
name: string;
|
|
35
|
-
subjects?: {
|
|
36
|
-
label: string;
|
|
37
|
-
url: string;
|
|
38
|
-
}[];
|
|
39
|
-
}[];
|
|
40
|
-
}[];
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
type Props = GradesProps & {
|
|
44
|
-
onNavigate?: () => void;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const ProgrammeSubjects = ({ grades, onNavigate, selectedGrade = "vg1" }: Props) => {
|
|
48
|
-
const { t } = useTranslation();
|
|
49
|
-
|
|
50
|
-
const grade = useMemo(
|
|
51
|
-
() => grades?.find((grade) => grade.name.toLowerCase() === selectedGrade) ?? grades?.[0],
|
|
52
|
-
[grades, selectedGrade],
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<>
|
|
57
|
-
<GradesMenu aria-label={t("programmes.grades")}>
|
|
58
|
-
{grades?.map((item) => {
|
|
59
|
-
const current = item.name.toLowerCase() === selectedGrade;
|
|
60
|
-
return (
|
|
61
|
-
<li key={item.name}>
|
|
62
|
-
<SafeLinkButton
|
|
63
|
-
to={current ? "" : item.name.toLowerCase()}
|
|
64
|
-
colorTheme={item !== grade ? "lighter" : undefined}
|
|
65
|
-
shape="pill"
|
|
66
|
-
size="normal"
|
|
67
|
-
aria-current={current}
|
|
68
|
-
>
|
|
69
|
-
{item.name}
|
|
70
|
-
</SafeLinkButton>
|
|
71
|
-
</li>
|
|
72
|
-
);
|
|
73
|
-
})}
|
|
74
|
-
</GradesMenu>
|
|
75
|
-
{grade?.missingProgrammeSubjects && <MessageBox>{t("messageBoxInfo.noContent")}</MessageBox>}
|
|
76
|
-
{grade?.categories?.map((category) => (
|
|
77
|
-
<NavigationBox key={category.name} heading={category.name} items={category.subjects} onClick={onNavigate} />
|
|
78
|
-
))}
|
|
79
|
-
</>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export default ProgrammeSubjects;
|
package/src/Programme/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2019-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import Programme from "./Programme";
|
|
10
|
-
import ProgrammeSubjects from "./ProgrammeSubjects";
|
|
11
|
-
|
|
12
|
-
export { ProgrammeSubjects };
|
|
13
|
-
export default Programme;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { ReactNode } from "react";
|
|
10
|
-
import { css } from "@emotion/react";
|
|
11
|
-
import styled from "@emotion/styled";
|
|
12
|
-
import { colors, fonts, spacing } from "@ndla/core";
|
|
13
|
-
|
|
14
|
-
import { HeadingLevel } from "@ndla/typography";
|
|
15
|
-
import ResourceList, { ResourceListProps } from "./ResourceList";
|
|
16
|
-
|
|
17
|
-
const Wrapper = styled.nav`
|
|
18
|
-
margin-bottom: ${spacing.large};
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
const headingStyle = css`
|
|
22
|
-
${fonts.sizes("16px", "18px")};
|
|
23
|
-
font-weight: ${fonts.weight.bold};
|
|
24
|
-
text-transform: uppercase;
|
|
25
|
-
letter-spacing: 0.05em;
|
|
26
|
-
margin: ${spacing.small} 0 ${spacing.xsmall};
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
const invertedStyle = css`
|
|
30
|
-
color: ${colors.white};
|
|
31
|
-
`;
|
|
32
|
-
|
|
33
|
-
type Props = {
|
|
34
|
-
invertedStyle?: boolean;
|
|
35
|
-
toggleAdditionalResources: () => void;
|
|
36
|
-
heartButton?: (path: string) => ReactNode;
|
|
37
|
-
headingLevel?: HeadingLevel;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const ResourceGroup = ({
|
|
41
|
-
title,
|
|
42
|
-
resources,
|
|
43
|
-
showAdditionalResources,
|
|
44
|
-
toggleAdditionalResources,
|
|
45
|
-
contentType,
|
|
46
|
-
invertedStyle: invertedStyleProp,
|
|
47
|
-
headingLevel: Heading = "h1",
|
|
48
|
-
heartButton,
|
|
49
|
-
}: Props & ResourceListProps) => (
|
|
50
|
-
<Wrapper aria-label={title}>
|
|
51
|
-
{title && <Heading css={[headingStyle, invertedStyleProp ? invertedStyle : undefined]}>{title}</Heading>}
|
|
52
|
-
{resources.length > 0 ? (
|
|
53
|
-
<ResourceList
|
|
54
|
-
title={title}
|
|
55
|
-
onClick={toggleAdditionalResources}
|
|
56
|
-
showAdditionalResources={showAdditionalResources}
|
|
57
|
-
contentType={contentType}
|
|
58
|
-
resources={resources}
|
|
59
|
-
heartButton={heartButton}
|
|
60
|
-
/>
|
|
61
|
-
) : null}
|
|
62
|
-
</Wrapper>
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
export default ResourceGroup;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
10
|
-
import { FavoriteButton } from "@ndla/button";
|
|
11
|
-
import ResourceItem from "./ResourceItem";
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
title: "Components/ResourceItem",
|
|
15
|
-
tags: ["autodocs"],
|
|
16
|
-
component: ResourceItem,
|
|
17
|
-
parameters: {
|
|
18
|
-
inlineStories: true,
|
|
19
|
-
},
|
|
20
|
-
args: {
|
|
21
|
-
id: "urn:resource:a7a49c0a-32ea-4343-8b11-bd6d65c24f87",
|
|
22
|
-
name: "Refleksjonsoppgave om ideer og idéutvikling",
|
|
23
|
-
path: "",
|
|
24
|
-
contentType: "subject-material",
|
|
25
|
-
additional: false,
|
|
26
|
-
heartButton: () => <FavoriteButton />,
|
|
27
|
-
access: undefined,
|
|
28
|
-
},
|
|
29
|
-
} as Meta<typeof ResourceItem>;
|
|
30
|
-
|
|
31
|
-
export const Default: StoryObj<typeof ResourceItem> = {};
|
|
32
|
-
|
|
33
|
-
export const WithCoreOrAdditionalIndicator: StoryObj<typeof ResourceItem> = {
|
|
34
|
-
args: {
|
|
35
|
-
contentTypeName: "Fagstoff",
|
|
36
|
-
contentTypeDescription: "Kjernestoff",
|
|
37
|
-
showAdditionalResources: true,
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const WithCoreOrAdditionalIndicatorAdditional: StoryObj<typeof ResourceItem> = {
|
|
42
|
-
args: {
|
|
43
|
-
additional: true,
|
|
44
|
-
contentTypeName: "Fagstoff",
|
|
45
|
-
contentTypeDescription: "Tilleggsstoff",
|
|
46
|
-
showAdditionalResources: true,
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const RelevanceIndicatorWithoutLabel: StoryObj<typeof ResourceItem> = {
|
|
51
|
-
args: {
|
|
52
|
-
contentTypeDescription: "Kjernestoff",
|
|
53
|
-
showAdditionalResources: true,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const OnlyAvailableForTeachers: StoryObj<typeof ResourceItem> = {
|
|
58
|
-
args: {
|
|
59
|
-
access: "teacher",
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const CurrentPage: StoryObj<typeof ResourceItem> = {
|
|
64
|
-
args: { active: true },
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const SubjectMaterial: StoryObj<typeof ResourceItem> = {
|
|
68
|
-
args: {
|
|
69
|
-
contentType: "subject-material",
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const TasksAndActivities: StoryObj<typeof ResourceItem> = {
|
|
74
|
-
args: {
|
|
75
|
-
contentType: "tasks-and-activities",
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const AssessmentResource: StoryObj<typeof ResourceItem> = {
|
|
80
|
-
args: {
|
|
81
|
-
contentType: "assessment-resources",
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const Concept: StoryObj<typeof ResourceItem> = {
|
|
86
|
-
args: {
|
|
87
|
-
contentType: "concept",
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const SourceMaterial: StoryObj<typeof ResourceItem> = {
|
|
92
|
-
args: {
|
|
93
|
-
contentType: "source-material",
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const LearningPath: StoryObj<typeof ResourceItem> = {
|
|
98
|
-
args: {
|
|
99
|
-
contentType: "learning-path",
|
|
100
|
-
},
|
|
101
|
-
};
|