@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
package/src/Figure/Figure.tsx
CHANGED
|
@@ -8,28 +8,68 @@
|
|
|
8
8
|
|
|
9
9
|
// N.B These components is used to render static markup serverside
|
|
10
10
|
|
|
11
|
-
import { ComponentPropsWithRef,
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
import { ComponentPropsWithRef, forwardRef, useMemo } from "react";
|
|
12
|
+
import { css } from "@emotion/react";
|
|
13
|
+
import styled from "@emotion/styled";
|
|
14
|
+
import { spacing } from "@ndla/core";
|
|
15
|
+
|
|
16
|
+
const StyledFigure = styled.figure`
|
|
17
|
+
position: relative;
|
|
18
|
+
width: 100%;
|
|
19
|
+
transition:
|
|
20
|
+
transform 0.4s,
|
|
21
|
+
width 0.4s,
|
|
22
|
+
height 0.4s;
|
|
23
|
+
img {
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
iframe {
|
|
27
|
+
display: block;
|
|
28
|
+
border: 0;
|
|
29
|
+
}
|
|
30
|
+
&[data-sizetype="full"][data-float=""] {
|
|
31
|
+
margin: ${spacing.normal} 0 ${spacing.normal};
|
|
32
|
+
}
|
|
33
|
+
&[data-sizetype="full"] {
|
|
34
|
+
margin-bottom: ${spacing.normal};
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const fullColumnStyle = css`
|
|
39
|
+
left: auto !important;
|
|
40
|
+
right: auto !important;
|
|
41
|
+
width: auto !important;
|
|
42
|
+
padding-left: 0;
|
|
43
|
+
padding-right: 0;
|
|
44
|
+
padding-bottom: ${spacing.large};
|
|
45
|
+
margin-bottom: 0;
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
const rightStyle = css`
|
|
49
|
+
float: right;
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
const smallTypes = ["small-right", "xsmall-right"];
|
|
18
53
|
|
|
19
54
|
const Figure = forwardRef<HTMLElement, Props>(({ children, type = "full", className, ...rest }, ref) => {
|
|
20
|
-
const
|
|
21
|
-
|
|
55
|
+
const floatClass = type === "full-column" ? undefined : `u-float-${type}`;
|
|
56
|
+
|
|
57
|
+
const styles = useMemo(() => {
|
|
58
|
+
const styles = [];
|
|
59
|
+
if (!floatClass) styles.push(fullColumnStyle);
|
|
60
|
+
if (smallTypes.includes(type)) styles.push(rightStyle);
|
|
61
|
+
return styles;
|
|
62
|
+
}, [floatClass, type]);
|
|
63
|
+
|
|
64
|
+
const classes = floatClass ? `${floatClass} ${className ?? ""}` : className;
|
|
65
|
+
|
|
22
66
|
return (
|
|
23
|
-
<
|
|
24
|
-
{
|
|
25
|
-
</
|
|
67
|
+
<StyledFigure data-sizetype={type} css={styles} className={classes} {...rest} ref={ref}>
|
|
68
|
+
{children}
|
|
69
|
+
</StyledFigure>
|
|
26
70
|
);
|
|
27
71
|
});
|
|
28
72
|
|
|
29
|
-
const isFunction = (children: Function | ReactNode): children is Function => {
|
|
30
|
-
return isFunctionHelper(children);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
73
|
export type FigureType =
|
|
34
74
|
| "full"
|
|
35
75
|
| "full-column"
|
|
@@ -40,8 +80,7 @@ export type FigureType =
|
|
|
40
80
|
| "xsmall-right"
|
|
41
81
|
| "xsmall-left";
|
|
42
82
|
|
|
43
|
-
interface Props extends Omit<ComponentPropsWithRef<"figure">, "
|
|
44
|
-
children?: ReactNode | ((params: { typeClass: string }) => ReactNode);
|
|
83
|
+
interface Props extends Omit<ComponentPropsWithRef<"figure">, "type"> {
|
|
45
84
|
type?: FigureType;
|
|
46
85
|
noFigcaption?: boolean;
|
|
47
86
|
}
|
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
languageSelector: { control: false },
|
|
30
30
|
auth: { control: false },
|
|
31
31
|
},
|
|
32
|
-
render: (args) => <FooterBlock {...args}
|
|
32
|
+
render: (args) => <FooterBlock {...args} />,
|
|
33
33
|
} as Meta<typeof FooterBlock>;
|
|
34
34
|
|
|
35
35
|
export const Default: StoryObj<typeof FooterBlock> = {};
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
import { CSSProperties, ReactNode, useMemo } from "react";
|
|
10
10
|
import styled from "@emotion/styled";
|
|
11
|
-
import { spacing
|
|
11
|
+
import { spacing } from "@ndla/core";
|
|
12
|
+
import { useComponentSize } from "@ndla/hooks";
|
|
12
13
|
import { Heading, Text } from "@ndla/typography";
|
|
13
14
|
import { ArticleByline } from "../Article";
|
|
14
|
-
import { useMastheadHeight } from "../Masthead";
|
|
15
15
|
import { Article } from "../types";
|
|
16
16
|
|
|
17
17
|
interface Props {
|
|
@@ -58,7 +58,7 @@ const StyledArticle = styled.article`
|
|
|
58
58
|
`;
|
|
59
59
|
|
|
60
60
|
export const FrontpageArticle = ({ article, id, isWide, licenseBox, lang }: Props) => {
|
|
61
|
-
const { height = 0 } =
|
|
61
|
+
const { height = 0 } = useComponentSize("masthead");
|
|
62
62
|
const cssVars = useMemo(() => ({ "--masthead-height": `${height}px` }) as unknown as CSSProperties, [height]);
|
|
63
63
|
const { title, introduction, content } = article;
|
|
64
64
|
|
package/src/Gloss/Gloss.tsx
CHANGED
|
@@ -118,11 +118,13 @@ const getFilteredExamples = (
|
|
|
118
118
|
glossData?.examples?.map((examples, i) => {
|
|
119
119
|
if (exampleIdsList.includes(i.toString())) {
|
|
120
120
|
return examples.filter((e) => exampleLangsList.includes(e.language));
|
|
121
|
-
}
|
|
121
|
+
}
|
|
122
|
+
return [];
|
|
122
123
|
}) ?? [];
|
|
123
124
|
const examplesWithoutEmpty = filteredExamples.filter((el) => !!el.length);
|
|
124
125
|
return examplesWithoutEmpty;
|
|
125
|
-
}
|
|
126
|
+
}
|
|
127
|
+
return glossData?.examples ?? [];
|
|
126
128
|
};
|
|
127
129
|
|
|
128
130
|
const Gloss = ({ title, glossData, audio, exampleIds, exampleLangs }: Props) => {
|
package/src/Hero/Hero.tsx
CHANGED
|
@@ -84,7 +84,7 @@ const StyledDiv = styled.div`
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
${mq.range({ until: breakpoints.tablet })} {
|
|
87
|
-
+ div article
|
|
87
|
+
+ div article[data-ndla-article] {
|
|
88
88
|
background: ${colors.white};
|
|
89
89
|
margin: 0 -${spacing.normal};
|
|
90
90
|
padding: ${spacing.large} ${spacing.normal} ${spacing.normal} ${spacing.normal};
|
package/src/Image/Image.tsx
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { ReactNode } from "react";
|
|
10
10
|
import styled from "@emotion/styled";
|
|
11
|
-
import { colors } from "@ndla/core";
|
|
11
|
+
import { colors, misc } from "@ndla/core";
|
|
12
12
|
|
|
13
13
|
export interface ImageCrop {
|
|
14
14
|
startX: number;
|
|
@@ -51,7 +51,7 @@ const StyledImageWrapper = styled.div`
|
|
|
51
51
|
&[data-border="true"] {
|
|
52
52
|
border: 1px solid ${colors.brand.tertiary};
|
|
53
53
|
border-bottom: 0;
|
|
54
|
-
border-radius:
|
|
54
|
+
border-radius: ${misc.borderRadius};
|
|
55
55
|
border-bottom-left-radius: 0;
|
|
56
56
|
border-bottom-right-radius: 0;
|
|
57
57
|
}
|
|
@@ -74,7 +74,7 @@ const LanguageSelector = <T extends string>({ locales, onSelect, inverted, trigg
|
|
|
74
74
|
aria-label={t("footer.selectLanguage")}
|
|
75
75
|
id={triggerId}
|
|
76
76
|
>
|
|
77
|
-
{t(
|
|
77
|
+
{t("languages.prefixChangeLanguage")} <ChevronDown />
|
|
78
78
|
</ButtonV2>
|
|
79
79
|
</DropdownTrigger>
|
|
80
80
|
<StyledDropdownContent sideOffset={4} showArrow>
|
|
@@ -17,7 +17,8 @@ export const LayoutItem = ({ children, layout, ...rest }: Props) => {
|
|
|
17
17
|
const className = useMemo(() => {
|
|
18
18
|
if (layout === "extend") {
|
|
19
19
|
return "u-10/12@desktop u-push-1/12@desktop u-10/12@tablet u-push-1/12@tablet";
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
|
+
if (layout === "center") {
|
|
21
22
|
return "u-10/12 u-push-1/12";
|
|
22
23
|
}
|
|
23
24
|
return undefined;
|
package/src/Layout/OneColumn.tsx
CHANGED
|
@@ -6,48 +6,38 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
9
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
10
|
+
import { css } from "@emotion/react";
|
|
11
|
+
import styled from "@emotion/styled";
|
|
12
|
+
import { mq, spacing, breakpoints } from "@ndla/core";
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
prefix: "o-",
|
|
14
|
-
name: "wrapper",
|
|
15
|
-
outputIsString: true,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
19
|
-
children?: ReactNode;
|
|
20
|
-
className?: string;
|
|
21
|
-
cssModifier?: string;
|
|
14
|
+
interface Props extends ComponentPropsWithoutRef<"div"> {
|
|
22
15
|
wide?: boolean;
|
|
23
|
-
noPadding?: boolean;
|
|
24
|
-
extraPadding?: boolean;
|
|
25
16
|
}
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
const StyledOneColumn = styled.div`
|
|
19
|
+
max-width: 1024px;
|
|
20
|
+
margin-left: auto;
|
|
21
|
+
margin-right: auto;
|
|
22
|
+
width: 100%;
|
|
23
|
+
padding-left: ${spacing.nsmall};
|
|
24
|
+
padding-right: ${spacing.nsmall};
|
|
25
|
+
|
|
26
|
+
${mq.range({ from: breakpoints.mobileWide })} {
|
|
27
|
+
padding-left: ${spacing.normal};
|
|
28
|
+
padding-right: ${spacing.normal};
|
|
36
29
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
&::after {
|
|
31
|
+
content: "" !important;
|
|
32
|
+
display: block !important;
|
|
33
|
+
clear: both !important;
|
|
40
34
|
}
|
|
35
|
+
`;
|
|
41
36
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
const wideStyle = css`
|
|
38
|
+
max-width: 1150px;
|
|
39
|
+
`;
|
|
45
40
|
|
|
46
|
-
|
|
47
|
-
<div className={`${classes("", modifiers, className)}`} {...rest}>
|
|
48
|
-
{children}
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
41
|
+
export const OneColumn = ({ wide, ...rest }: Props) => <StyledOneColumn css={wide ? wideStyle : undefined} {...rest} />;
|
|
52
42
|
|
|
53
43
|
export default OneColumn;
|
|
@@ -6,33 +6,29 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
9
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
10
|
+
import { css } from "@emotion/react";
|
|
11
|
+
import styled from "@emotion/styled";
|
|
12
|
+
import { colors, mq, breakpoints } from "@ndla/core";
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
name: "container",
|
|
14
|
-
prefix: "o-",
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
18
|
-
children?: ReactNode;
|
|
19
|
-
background?: boolean;
|
|
14
|
+
interface Props extends ComponentPropsWithoutRef<"div"> {
|
|
20
15
|
backgroundWide?: boolean;
|
|
21
|
-
ndlaFilm?: boolean;
|
|
22
|
-
learningPath?: boolean;
|
|
23
16
|
}
|
|
24
17
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
const StyledPageContainer = styled.div`
|
|
19
|
+
min-height: 100vh;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const backgroundWideStyle = css`
|
|
25
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
26
|
+
background-color: ${colors.brand.greyLightest};
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
export const PageContainer = ({ backgroundWide = false, ...rest }: Props) => (
|
|
31
|
+
<StyledPageContainer css={backgroundWide ? backgroundWideStyle : undefined} {...rest} />
|
|
36
32
|
);
|
|
37
33
|
|
|
38
34
|
export default PageContainer;
|
|
@@ -42,9 +42,8 @@ const LicenseLink = ({ license, asLink = true }: Props) => {
|
|
|
42
42
|
{license.abbreviation}
|
|
43
43
|
</StyledSafeLink>
|
|
44
44
|
);
|
|
45
|
-
} else {
|
|
46
|
-
return <StyledSpan>{license.abbreviation}</StyledSpan>;
|
|
47
45
|
}
|
|
46
|
+
return <StyledSpan>{license.abbreviation}</StyledSpan>;
|
|
48
47
|
};
|
|
49
48
|
|
|
50
49
|
export default LicenseLink;
|
|
@@ -27,6 +27,7 @@ interface MessageBoxProps {
|
|
|
27
27
|
links?: LinkProps[];
|
|
28
28
|
showCloseButton?: boolean;
|
|
29
29
|
onClose?: () => void;
|
|
30
|
+
contentEditable?: boolean;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
const MessageBoxWrapper = styled.div`
|
|
@@ -93,10 +94,10 @@ const StyledCloseButton = styled(IconButtonV2)`
|
|
|
93
94
|
right: ${spacing.xsmall};
|
|
94
95
|
`;
|
|
95
96
|
|
|
96
|
-
export const MessageBox = ({ type, children, links, showCloseButton, onClose }: MessageBoxProps) => {
|
|
97
|
+
export const MessageBox = ({ type, children, links, showCloseButton, onClose, contentEditable }: MessageBoxProps) => {
|
|
97
98
|
const { t } = useTranslation();
|
|
98
99
|
return (
|
|
99
|
-
<MessageBoxWrapper data-type={type}>
|
|
100
|
+
<MessageBoxWrapper data-type={type} contentEditable={contentEditable ?? undefined}>
|
|
100
101
|
<InfoWrapper>
|
|
101
102
|
<div>
|
|
102
103
|
<ChildrenWrapper>{children}</ChildrenWrapper>
|
package/src/MyNdla/index.ts
CHANGED
package/src/Notion/Notion.tsx
CHANGED
|
@@ -30,11 +30,11 @@ const TextWrapper = styled.div<{ hasVisualElement: boolean }>`
|
|
|
30
30
|
${mq.range({ from: breakpoints.desktop })} {
|
|
31
31
|
ul,
|
|
32
32
|
ol {
|
|
33
|
-
margin:
|
|
33
|
+
margin: ${spacing.small} 0;
|
|
34
34
|
padding: 0 1rem 0 2rem;
|
|
35
35
|
}
|
|
36
36
|
ol > li {
|
|
37
|
-
margin-left:
|
|
37
|
+
margin-left: ${spacing.normal};
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
`;
|
|
@@ -119,9 +119,8 @@ const BlockImage = ({ image, loading, contentType }: BlockImageProps) => {
|
|
|
119
119
|
<ContentTypeBadge type={contentType} size="large" />
|
|
120
120
|
</ContentIconWrapper>
|
|
121
121
|
);
|
|
122
|
-
} else {
|
|
123
|
-
return <Image alt={image.alt} src={image.src} fallbackWidth={300} />;
|
|
124
122
|
}
|
|
123
|
+
return <Image alt={image.alt} src={image.src} fallbackWidth={300} />;
|
|
125
124
|
};
|
|
126
125
|
|
|
127
126
|
const ResourceTypeAndTitleLoader = ({ children, loading }: LoaderProps) => {
|
|
@@ -169,13 +168,10 @@ const BlockResource = ({
|
|
|
169
168
|
const contentType = useMemo(() => {
|
|
170
169
|
if (!firstResourceType) {
|
|
171
170
|
return MISSING;
|
|
172
|
-
} else {
|
|
173
|
-
return (
|
|
174
|
-
contentTypeMapping[firstResourceType] ??
|
|
175
|
-
resourceEmbedTypeMapping[firstResourceType] ??
|
|
176
|
-
contentTypeMapping["default"]
|
|
177
|
-
);
|
|
178
171
|
}
|
|
172
|
+
return (
|
|
173
|
+
contentTypeMapping[firstResourceType] ?? resourceEmbedTypeMapping[firstResourceType] ?? contentTypeMapping.default
|
|
174
|
+
);
|
|
179
175
|
}, [firstResourceType]);
|
|
180
176
|
|
|
181
177
|
return (
|
|
@@ -142,11 +142,10 @@ const ListResourceImage = ({ resourceImage, loading, type, contentType, backgrou
|
|
|
142
142
|
<ContentTypeBadge type={contentType} background={background} size="x-small" />
|
|
143
143
|
</ContentIconWrapper>
|
|
144
144
|
);
|
|
145
|
-
} else {
|
|
146
|
-
return (
|
|
147
|
-
<StyledImage alt={resourceImage.alt} src={resourceImage.src} fallbackWidth={type === "compact" ? 56 : 136} />
|
|
148
|
-
);
|
|
149
145
|
}
|
|
146
|
+
return (
|
|
147
|
+
<StyledImage alt={resourceImage.alt} src={resourceImage.src} fallbackWidth={type === "compact" ? 56 : 136} />
|
|
148
|
+
);
|
|
150
149
|
}
|
|
151
150
|
|
|
152
151
|
return (
|
|
@@ -231,9 +230,8 @@ const ListResource = ({
|
|
|
231
230
|
const contentType = useMemo(() => {
|
|
232
231
|
if (!firstContentType) {
|
|
233
232
|
return MISSING;
|
|
234
|
-
} else {
|
|
235
|
-
return contentTypeMapping[firstContentType] ?? embedResourceType ?? contentTypeMapping["default"];
|
|
236
233
|
}
|
|
234
|
+
return contentTypeMapping[firstContentType] ?? embedResourceType ?? contentTypeMapping.default;
|
|
237
235
|
}, [embedResourceType, firstContentType]);
|
|
238
236
|
|
|
239
237
|
return (
|
|
@@ -130,10 +130,10 @@ const ContentTypeResult = ({
|
|
|
130
130
|
|
|
131
131
|
// Figure out highlighting by comparing path of link with keyboard navigated anchor
|
|
132
132
|
const anchor =
|
|
133
|
-
keyboardPathNavigation instanceof HTMLElement &&
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const anchorHref = anchor
|
|
133
|
+
keyboardPathNavigation instanceof HTMLElement && keyboardPathNavigation
|
|
134
|
+
? keyboardPathNavigation.querySelector("a")
|
|
135
|
+
: undefined;
|
|
136
|
+
const anchorHref = anchor?.getAttribute("href") ?? null;
|
|
137
137
|
const shouldHighlight = isPathToHighlight(path, anchorHref);
|
|
138
138
|
|
|
139
139
|
return (
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { ElementType, Fragment, ReactNode } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
11
|
import styled from "@emotion/styled";
|
|
12
|
-
import { fonts, mq, spacing, breakpoints, colors, spacingUnit } from "@ndla/core";
|
|
12
|
+
import { fonts, mq, spacing, breakpoints, colors, spacingUnit, misc } from "@ndla/core";
|
|
13
13
|
import { Spinner } from "@ndla/icons";
|
|
14
14
|
import { ChevronRight } from "@ndla/icons/common";
|
|
15
15
|
import { SafeLink } from "@ndla/safelink";
|
|
@@ -68,7 +68,7 @@ const PillsWrapper = styled.div`
|
|
|
68
68
|
background: ${colors.brand.greyLightest};
|
|
69
69
|
margin-right: ${spacing.small};
|
|
70
70
|
padding: 0 ${spacingUnit / 3}px;
|
|
71
|
-
border-radius:
|
|
71
|
+
border-radius: ${misc.borderRadiusLarge};
|
|
72
72
|
${fonts.sizes("12px", "20px")};
|
|
73
73
|
font-weight: ${fonts.weight.semibold};
|
|
74
74
|
`;
|
|
@@ -164,12 +164,12 @@ const getNextElementInDirection = (
|
|
|
164
164
|
if (direction === 1) {
|
|
165
165
|
const idx = currentIdx + 1 > arr.length - 1 ? 0 : currentIdx + 1;
|
|
166
166
|
return arr[idx];
|
|
167
|
-
}
|
|
167
|
+
}
|
|
168
|
+
if (direction === -1) {
|
|
168
169
|
const idx = currentIdx - 1 < 0 ? arr.length - 1 : currentIdx - 1;
|
|
169
170
|
return arr[idx];
|
|
170
|
-
} else {
|
|
171
|
-
return arr[currentIdx];
|
|
172
171
|
}
|
|
172
|
+
return arr[currentIdx];
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
const getDefaultCount = () => {
|
|
@@ -196,9 +196,8 @@ const findPathForKeyboardNavigation = (
|
|
|
196
196
|
default:
|
|
197
197
|
return current;
|
|
198
198
|
}
|
|
199
|
-
} else {
|
|
200
|
-
return getNextElementInDirection(current, resultsContainingPaths, direction);
|
|
201
199
|
}
|
|
200
|
+
return getNextElementInDirection(current, resultsContainingPaths, direction);
|
|
202
201
|
};
|
|
203
202
|
|
|
204
203
|
type Props = {
|
|
@@ -259,11 +258,10 @@ const SearchResultSleeve = ({
|
|
|
259
258
|
e.stopPropagation();
|
|
260
259
|
e.preventDefault();
|
|
261
260
|
const toClick =
|
|
262
|
-
keyboardPathNavigation &&
|
|
263
|
-
keyboardPathNavigation.querySelector &&
|
|
261
|
+
keyboardPathNavigation?.querySelector &&
|
|
264
262
|
(keyboardPathNavigation.querySelector("a") || keyboardPathNavigation.querySelector("button"));
|
|
265
263
|
|
|
266
|
-
toClick
|
|
264
|
+
toClick?.click();
|
|
267
265
|
}
|
|
268
266
|
} else if (e.code === "Tab") {
|
|
269
267
|
setKeyNavigation("");
|
|
@@ -283,7 +281,7 @@ const SearchResultSleeve = ({
|
|
|
283
281
|
const highlightedElement =
|
|
284
282
|
keyboardPathNavigation === GO_TO_SEARCHPAGE
|
|
285
283
|
? searchAllRef.current
|
|
286
|
-
: contentRef.current
|
|
284
|
+
: contentRef.current?.querySelector('[data-highlighted="true"]');
|
|
287
285
|
|
|
288
286
|
if (highlightedElement) {
|
|
289
287
|
highlightedElement.scrollIntoView({
|
|
@@ -594,7 +594,7 @@ export const WithScrollbar: StoryFn = () => (
|
|
|
594
594
|
<td>Hearson</td>
|
|
595
595
|
<td>rhearson0@nifty.com</td>
|
|
596
596
|
|
|
597
|
-
<td
|
|
597
|
+
<td style={{ whiteSpace: "nowrap" }}>34704 Duke Circle</td>
|
|
598
598
|
<td>Brazil</td>
|
|
599
599
|
<td>Fijian</td>
|
|
600
600
|
<td>rhearson0</td>
|
|
@@ -604,8 +604,8 @@ export const WithScrollbar: StoryFn = () => (
|
|
|
604
604
|
<td>Lucie</td>
|
|
605
605
|
<td>Jikylls</td>
|
|
606
606
|
<td>ljikylls1@csmonitor.com</td>
|
|
607
|
-
<td
|
|
608
|
-
<td
|
|
607
|
+
<td style={{ whiteSpace: "nowrap" }}>9824 Swallow Place</td>
|
|
608
|
+
<td style={{ whiteSpace: "nowrap" }}>Sweden/Denmark/Norway</td>
|
|
609
609
|
<td>Italian</td>
|
|
610
610
|
<td>ljikylls1</td>
|
|
611
611
|
</tr>
|
|
@@ -614,7 +614,7 @@ export const WithScrollbar: StoryFn = () => (
|
|
|
614
614
|
<td>Kippie</td>
|
|
615
615
|
<td>Reeveley</td>
|
|
616
616
|
<td>kreeveley2@ebay.com</td>
|
|
617
|
-
<td
|
|
617
|
+
<td style={{ whiteSpace: "nowrap" }}>1 Stephen Court</td>
|
|
618
618
|
<td>Namibia</td>
|
|
619
619
|
<td>West Frisian</td>
|
|
620
620
|
<td>kreeveley2</td>
|
|
@@ -624,7 +624,7 @@ export const WithScrollbar: StoryFn = () => (
|
|
|
624
624
|
<td>Klarrisa</td>
|
|
625
625
|
<td>Minghetti</td>
|
|
626
626
|
<td>kminghetti3@163.com</td>
|
|
627
|
-
<td
|
|
627
|
+
<td style={{ whiteSpace: "nowrap" }}>7 Truax Point</td>
|
|
628
628
|
<td>Greece</td>
|
|
629
629
|
<td>Luxembourgish</td>
|
|
630
630
|
<td>kminghetti3</td>
|
|
@@ -634,7 +634,7 @@ export const WithScrollbar: StoryFn = () => (
|
|
|
634
634
|
<td>Trefor</td>
|
|
635
635
|
<td>Lambregts</td>
|
|
636
636
|
<td>tlambregts4@youtu.be</td>
|
|
637
|
-
<td
|
|
637
|
+
<td style={{ whiteSpace: "nowrap" }}>61 Monica Center</td>
|
|
638
638
|
<td>Sweden</td>
|
|
639
639
|
<td>Northern Sotho</td>
|
|
640
640
|
<td>tlambregts4</td>
|
|
@@ -644,7 +644,7 @@ export const WithScrollbar: StoryFn = () => (
|
|
|
644
644
|
<td>Aridatha</td>
|
|
645
645
|
<td>Kuhnt</td>
|
|
646
646
|
<td>akuhnt5@sitemeter.com</td>
|
|
647
|
-
<td
|
|
647
|
+
<td style={{ whiteSpace: "nowrap" }}>2898 Wayridge Terrace</td>
|
|
648
648
|
<td>China</td>
|
|
649
649
|
<td>Latvian</td>
|
|
650
650
|
<td>akuhnt5</td>
|
|
@@ -654,7 +654,7 @@ export const WithScrollbar: StoryFn = () => (
|
|
|
654
654
|
<td>Kalie</td>
|
|
655
655
|
<td>Olander</td>
|
|
656
656
|
<td>kolander6@loc.gov</td>
|
|
657
|
-
<td
|
|
657
|
+
<td style={{ whiteSpace: "nowrap" }}>554 Maywood Parkway</td>
|
|
658
658
|
<td>China</td>
|
|
659
659
|
<td>Czech</td>
|
|
660
660
|
<td>kolander6</td>
|