@ndla/ui 55.0.15-alpha.0 → 55.0.17-alpha.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/dist/panda.buildinfo.json +125 -29
- package/dist/styles.css +453 -103
- package/es/Article/Article.js +101 -162
- package/es/Article/ArticleByline.js +89 -56
- package/es/Article/ArticleFootNotes.js +35 -23
- package/es/Article/ArticleParagraph.js +2 -2
- package/es/Article/index.js +3 -5
- package/es/AudioPlayer/AudioPlayer.js +20 -20
- package/es/AudioPlayer/Controls.js +45 -45
- package/es/AudioPlayer/SpeechControl.js +8 -8
- package/es/BlogPost/BlogPost.js +6 -6
- package/es/Breadcrumb/Breadcrumb.js +19 -29
- package/es/Breadcrumb/BreadcrumbItem.js +20 -49
- package/es/Breadcrumb/HomeBreadcrumb.js +36 -82
- package/es/CampaignBlock/CampaignBlock.js +12 -12
- package/es/CodeBlock/CodeBlock.js +2 -2
- package/es/Concept/Concept.js +11 -11
- package/es/ContactBlock/ContactBlock.js +170 -185
- package/es/ContactBlock/index.js +3 -3
- package/es/ContentLoader/index.js +12 -12
- package/es/ContentPlaceholder/ContentPlaceholder.js +3 -3
- package/es/ContentTypeBadge/ContentTypeBadge.js +81 -80
- package/es/ContentTypeBadge/ContentTypeBadgeNew.js +3 -2
- package/es/ContentTypeHero/ContentTypeHero.js +50 -0
- package/es/{Logo → ContentTypeHero}/index.js +2 -3
- package/es/CopyParagraphButton/CopyParagraphButton.js +13 -12
- package/es/Embed/AudioEmbed.js +7 -7
- package/es/Embed/BrightcoveEmbed.js +8 -8
- package/es/Embed/CodeEmbed.js +6 -6
- package/es/Embed/ConceptEmbed.js +13 -13
- package/es/Embed/ConceptListEmbed.js +9 -9
- package/es/Embed/ContentLinkEmbed.js +6 -6
- package/es/Embed/CopyrightEmbed.js +3 -3
- package/es/Embed/EmbedErrorPlaceholder.js +5 -5
- package/es/Embed/ExternalEmbed.js +5 -5
- package/es/Embed/FootnoteEmbed.js +5 -5
- package/es/Embed/GlossEmbed.js +11 -11
- package/es/Embed/H5pEmbed.js +5 -5
- package/es/Embed/IframeEmbed.js +6 -6
- package/es/Embed/ImageEmbed.js +10 -10
- package/es/Embed/InlineTriggerButton.js +2 -2
- package/es/Embed/RelatedContentEmbed.js +5 -5
- package/es/Embed/UnknownEmbed.js +3 -3
- package/es/Embed/UuDisclaimerEmbed.js +6 -6
- package/es/ErrorMessage/ErrorMessage.js +14 -14
- package/es/ErrorMessage/ErrorResourceAccessDenied.js +6 -6
- package/es/FactBox/FactBox.js +5 -5
- package/es/FileList/File.js +3 -3
- package/es/FileList/FileList.js +6 -6
- package/es/FileList/Format.js +6 -6
- package/es/FileList/PdfFile.js +5 -5
- package/es/FrontpageArticle/FrontpageArticle.js +7 -8
- package/es/Gloss/Gloss.js +23 -23
- package/es/Gloss/GlossExample.js +9 -9
- package/es/Grid/Grid.js +4 -4
- package/es/KeyFigure/KeyFigure.js +5 -5
- package/es/Layout/LayoutItem.js +25 -37
- package/es/Layout/OneColumn.js +33 -31
- package/es/Layout/PageContainer.js +21 -30
- package/es/LicenseByline/EmbedByline.js +21 -21
- package/es/LicenseByline/LicenseLink.js +3 -3
- package/es/LinkBlock/LinkBlock.js +8 -8
- package/es/LinkBlock/LinkBlockSection.js +4 -4
- package/es/Messages/MessageBox.js +11 -11
- package/es/Messages/index.js +1 -2
- package/es/ProgrammeCard/ProgrammeCard.js +5 -5
- package/es/RelatedArticleList/RelatedArticleList.js +15 -15
- package/es/ResourceBox/ResourceBox.js +9 -9
- package/es/SnackBar/DefaultSnackbar.js +5 -5
- package/es/SnackBar/SnackbarProvider.js +7 -7
- package/es/TagSelector/TagSelector.js +17 -17
- package/es/TreeStructure/AddFolderButton.js +4 -4
- package/es/TreeStructure/ComboboxButton.js +7 -7
- package/es/TreeStructure/FolderItem.js +13 -13
- package/es/TreeStructure/FolderItems.js +6 -6
- package/es/TreeStructure/TreeStructure.js +9 -9
- package/es/ZendeskButton/ZendeskButton.js +2 -2
- package/es/i18n/index.js +1 -1
- package/es/index.js +5 -12
- package/es/locale/messages-en.js +1 -1
- package/es/locale/messages-nb.js +1 -1
- package/es/locale/messages-nn.js +1 -1
- package/es/locale/messages-se.js +1 -1
- package/es/locale/messages-sma.js +1 -1
- package/es/model/ContentType.js +3 -1
- package/es/styles.css +453 -103
- package/lib/Article/Article.d.ts +9 -30
- package/lib/Article/Article.js +104 -164
- package/lib/Article/ArticleByline.d.ts +1 -3
- package/lib/Article/ArticleByline.js +89 -56
- package/lib/Article/ArticleFootNotes.js +35 -24
- package/lib/Article/ArticleParagraph.js +2 -2
- package/lib/Article/index.d.ts +2 -5
- package/lib/Article/index.js +18 -24
- package/lib/AudioPlayer/AudioPlayer.js +20 -20
- package/lib/AudioPlayer/Controls.js +45 -45
- package/lib/AudioPlayer/SpeechControl.js +8 -8
- package/lib/BlogPost/BlogPost.js +6 -6
- package/lib/Breadcrumb/Breadcrumb.js +21 -29
- package/lib/Breadcrumb/BreadcrumbItem.js +22 -50
- package/lib/Breadcrumb/HomeBreadcrumb.d.ts +1 -2
- package/lib/Breadcrumb/HomeBreadcrumb.js +38 -82
- package/lib/CampaignBlock/CampaignBlock.js +12 -12
- package/lib/CodeBlock/CodeBlock.js +2 -2
- package/lib/Concept/Concept.js +11 -11
- package/lib/ContactBlock/ContactBlock.d.ts +6 -7
- package/lib/ContactBlock/ContactBlock.js +173 -184
- package/lib/ContactBlock/index.d.ts +3 -3
- package/lib/ContactBlock/index.js +13 -11
- package/lib/ContentLoader/index.js +12 -12
- package/lib/ContentPlaceholder/ContentPlaceholder.js +3 -3
- package/lib/ContentTypeBadge/ContentTypeBadge.d.ts +11 -12
- package/lib/ContentTypeBadge/ContentTypeBadge.js +83 -80
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.d.ts +1 -2
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.js +3 -2
- package/lib/ContentTypeHero/ContentTypeHero.d.ts +15 -0
- package/lib/ContentTypeHero/ContentTypeHero.js +57 -0
- package/lib/ContentTypeHero/index.d.ts +9 -0
- package/lib/ContentTypeHero/index.js +12 -0
- package/lib/CopyParagraphButton/CopyParagraphButton.js +13 -12
- package/lib/Embed/AudioEmbed.js +7 -7
- package/lib/Embed/BrightcoveEmbed.js +8 -8
- package/lib/Embed/CodeEmbed.js +6 -6
- package/lib/Embed/ConceptEmbed.js +13 -13
- package/lib/Embed/ConceptListEmbed.js +9 -9
- package/lib/Embed/ContentLinkEmbed.js +6 -6
- package/lib/Embed/CopyrightEmbed.js +3 -3
- package/lib/Embed/EmbedErrorPlaceholder.js +5 -5
- package/lib/Embed/ExternalEmbed.js +5 -5
- package/lib/Embed/FootnoteEmbed.js +5 -5
- package/lib/Embed/GlossEmbed.js +11 -11
- package/lib/Embed/H5pEmbed.js +5 -5
- package/lib/Embed/IframeEmbed.js +6 -6
- package/lib/Embed/ImageEmbed.js +10 -10
- package/lib/Embed/InlineTriggerButton.js +2 -2
- package/lib/Embed/RelatedContentEmbed.js +5 -5
- package/lib/Embed/UnknownEmbed.js +3 -3
- package/lib/Embed/UuDisclaimerEmbed.js +6 -6
- package/lib/ErrorMessage/ErrorMessage.js +14 -14
- package/lib/ErrorMessage/ErrorResourceAccessDenied.js +6 -6
- package/lib/FactBox/FactBox.js +5 -5
- package/lib/FileList/File.js +3 -3
- package/lib/FileList/FileList.js +6 -6
- package/lib/FileList/Format.js +6 -6
- package/lib/FileList/PdfFile.js +5 -5
- package/lib/FrontpageArticle/FrontpageArticle.js +7 -8
- package/lib/Gloss/Gloss.js +23 -23
- package/lib/Gloss/GlossExample.js +9 -9
- package/lib/Grid/Grid.js +4 -4
- package/lib/KeyFigure/KeyFigure.js +5 -5
- package/lib/Layout/LayoutItem.d.ts +3 -7
- package/lib/Layout/LayoutItem.js +27 -38
- package/lib/Layout/OneColumn.d.ts +3 -6
- package/lib/Layout/OneColumn.js +36 -33
- package/lib/Layout/PageContainer.d.ts +3 -6
- package/lib/Layout/PageContainer.js +24 -32
- package/lib/LicenseByline/EmbedByline.js +21 -21
- package/lib/LicenseByline/LicenseLink.js +3 -3
- package/lib/LinkBlock/LinkBlock.js +8 -8
- package/lib/LinkBlock/LinkBlockSection.js +4 -4
- package/lib/Messages/MessageBox.js +11 -11
- package/lib/Messages/index.d.ts +1 -2
- package/lib/Messages/index.js +0 -7
- package/lib/ProgrammeCard/ProgrammeCard.js +5 -5
- package/lib/RelatedArticleList/RelatedArticleList.js +15 -15
- package/lib/ResourceBox/ResourceBox.js +9 -9
- package/lib/SnackBar/DefaultSnackbar.js +5 -5
- package/lib/SnackBar/SnackbarProvider.js +7 -7
- package/lib/TagSelector/TagSelector.js +17 -17
- package/lib/TreeStructure/AddFolderButton.js +4 -4
- package/lib/TreeStructure/ComboboxButton.js +7 -7
- package/lib/TreeStructure/FolderItem.js +13 -13
- package/lib/TreeStructure/FolderItems.js +6 -6
- package/lib/TreeStructure/TreeStructure.js +9 -9
- package/lib/ZendeskButton/ZendeskButton.js +2 -2
- package/lib/i18n/index.d.ts +1 -1
- package/lib/i18n/index.js +6 -0
- package/lib/index.d.ts +8 -15
- package/lib/index.js +30 -139
- package/lib/locale/messages-en.js +1 -1
- package/lib/locale/messages-nb.js +1 -1
- package/lib/locale/messages-nn.js +1 -1
- package/lib/locale/messages-se.js +1 -1
- package/lib/locale/messages-sma.js +1 -1
- package/lib/model/ContentType.d.ts +1 -0
- package/lib/model/ContentType.js +4 -2
- package/lib/styles.css +453 -103
- package/package.json +10 -11
- package/src/Article/Article.tsx +101 -229
- package/src/Article/ArticleByline.tsx +82 -69
- package/src/Article/ArticleFootNotes.tsx +32 -36
- package/src/Article/index.ts +3 -7
- package/src/Breadcrumb/Breadcrumb.tsx +20 -18
- package/src/Breadcrumb/BreadcrumbItem.tsx +36 -59
- package/src/Breadcrumb/HomeBreadcrumb.stories.tsx +0 -12
- package/src/Breadcrumb/HomeBreadcrumb.tsx +33 -46
- package/src/ContactBlock/{Contactblock.stories.tsx → ContactBlock.stories.tsx} +3 -4
- package/src/ContactBlock/ContactBlock.tsx +165 -199
- package/src/ContactBlock/index.ts +3 -3
- package/src/ContentTypeBadge/ContentTypeBadge.tsx +77 -77
- package/src/ContentTypeBadge/ContentTypeBadgeNew.tsx +3 -1
- package/src/ContentTypeHero/ContentTypeHero.stories.tsx +76 -0
- package/src/ContentTypeHero/ContentTypeHero.tsx +55 -0
- package/src/ContentTypeHero/index.ts +10 -0
- package/src/CopyParagraphButton/CopyParagraphButton.tsx +10 -3
- package/src/Embed/AudioEmbed.stories.tsx +6 -8
- package/src/Embed/BrightcoveEmbed.stories.tsx +6 -8
- package/src/Embed/ConceptEmbed.stories.tsx +6 -8
- package/src/Embed/ExternalEmbed.stories.tsx +5 -5
- package/src/Embed/H5pEmbed.stories.tsx +6 -8
- package/src/Embed/IframeEmbed.stories.tsx +6 -8
- package/src/Embed/ImageEmbed.stories.tsx +6 -8
- package/src/Embed/RelatedContentEmbed.stories.tsx +6 -8
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +6 -8
- package/src/FrontpageArticle/FrontpageArticle.tsx +1 -1
- package/src/Layout/LayoutItem.tsx +25 -41
- package/src/Layout/OneColumn.tsx +33 -33
- package/src/Layout/PageContainer.tsx +22 -24
- package/src/Messages/index.ts +1 -2
- package/src/i18n/index.ts +1 -0
- package/src/index.ts +11 -35
- package/src/locale/messages-en.ts +1 -1
- package/src/locale/messages-nb.ts +1 -1
- package/src/locale/messages-nn.ts +1 -1
- package/src/locale/messages-se.ts +1 -1
- package/src/locale/messages-sma.ts +1 -1
- package/src/model/ContentType.ts +2 -0
- package/es/Article/ArticleHeaderWrapper.js +0 -33
- package/es/CreatedBy/CreatedBy.js +0 -73
- package/es/CreatedBy/index.js +0 -10
- package/es/Hero/Hero.js +0 -68
- package/es/Hero/HeroContent.js +0 -16
- package/es/Hero/index.js +0 -10
- package/es/LanguageSelector/LanguageSelector.js +0 -87
- package/es/LanguageSelector/index.js +0 -10
- package/es/Logo/Logo.js +0 -52
- package/es/Logo/SvgLogo.js +0 -54
- package/es/Messages/MessageBanner.js +0 -72
- package/es/Search/ActiveFilterContent.js +0 -40
- package/es/Search/ActiveFilters.js +0 -112
- package/es/Search/ContentTypeResult.js +0 -151
- package/es/Search/ContentTypeResultStyles.js +0 -51
- package/es/Search/IsPathToHighlight.js +0 -12
- package/es/Search/LoadingWrapper.js +0 -31
- package/es/Search/SearchField.js +0 -110
- package/es/Search/SearchFieldForm.js +0 -33
- package/es/Search/SearchResult.js +0 -185
- package/es/Search/SearchResultSleeve.js +0 -229
- package/es/Search/index.js +0 -12
- package/lib/Article/ArticleHeaderWrapper.d.ts +0 -14
- package/lib/Article/ArticleHeaderWrapper.js +0 -40
- package/lib/CreatedBy/CreatedBy.d.ts +0 -15
- package/lib/CreatedBy/CreatedBy.js +0 -78
- package/lib/CreatedBy/index.d.ts +0 -9
- package/lib/CreatedBy/index.js +0 -16
- package/lib/Hero/Hero.d.ts +0 -25
- package/lib/Hero/Hero.js +0 -83
- package/lib/Hero/HeroContent.d.ts +0 -12
- package/lib/Hero/HeroContent.js +0 -23
- package/lib/Hero/index.d.ts +0 -10
- package/lib/Hero/index.js +0 -61
- package/lib/LanguageSelector/LanguageSelector.d.ts +0 -15
- package/lib/LanguageSelector/LanguageSelector.js +0 -92
- package/lib/LanguageSelector/index.d.ts +0 -9
- package/lib/LanguageSelector/index.js +0 -13
- package/lib/Logo/Logo.d.ts +0 -20
- package/lib/Logo/Logo.js +0 -58
- package/lib/Logo/SvgLogo.d.ts +0 -14
- package/lib/Logo/SvgLogo.js +0 -62
- package/lib/Logo/index.d.ts +0 -9
- package/lib/Logo/index.js +0 -16
- package/lib/Messages/MessageBanner.d.ts +0 -16
- package/lib/Messages/MessageBanner.js +0 -77
- package/lib/Search/ActiveFilterContent.d.ts +0 -23
- package/lib/Search/ActiveFilterContent.js +0 -47
- package/lib/Search/ActiveFilters.d.ts +0 -19
- package/lib/Search/ActiveFilters.js +0 -119
- package/lib/Search/ContentTypeResult.d.ts +0 -29
- package/lib/Search/ContentTypeResult.js +0 -159
- package/lib/Search/ContentTypeResultStyles.d.ts +0 -45
- package/lib/Search/ContentTypeResultStyles.js +0 -58
- package/lib/Search/IsPathToHighlight.d.ts +0 -8
- package/lib/Search/IsPathToHighlight.js +0 -19
- package/lib/Search/LoadingWrapper.d.ts +0 -12
- package/lib/Search/LoadingWrapper.js +0 -38
- package/lib/Search/SearchField.d.ts +0 -25
- package/lib/Search/SearchField.js +0 -117
- package/lib/Search/SearchFieldForm.d.ts +0 -15
- package/lib/Search/SearchFieldForm.js +0 -41
- package/lib/Search/SearchResult.d.ts +0 -43
- package/lib/Search/SearchResult.js +0 -194
- package/lib/Search/SearchResultSleeve.d.ts +0 -25
- package/lib/Search/SearchResultSleeve.js +0 -237
- package/lib/Search/index.d.ts +0 -11
- package/lib/Search/index.js +0 -33
- package/src/Article/ArticleHeaderWrapper.tsx +0 -38
- package/src/CreatedBy/CreatedBy.stories.tsx +0 -36
- package/src/CreatedBy/CreatedBy.tsx +0 -63
- package/src/CreatedBy/index.ts +0 -11
- package/src/Hero/Hero.stories.tsx +0 -35
- package/src/Hero/Hero.tsx +0 -129
- package/src/Hero/HeroContent.tsx +0 -43
- package/src/Hero/index.ts +0 -21
- package/src/LanguageSelector/LanguageSelector.stories.tsx +0 -44
- package/src/LanguageSelector/LanguageSelector.tsx +0 -101
- package/src/LanguageSelector/index.ts +0 -11
- package/src/Logo/Logo.stories.tsx +0 -47
- package/src/Logo/Logo.tsx +0 -47
- package/src/Logo/SvgLogo.tsx +0 -48
- package/src/Logo/index.ts +0 -11
- package/src/Messages/MessageBanner.stories.tsx +0 -31
- package/src/Messages/MessageBanner.tsx +0 -67
- package/src/Search/ActiveFilterContent.tsx +0 -64
- package/src/Search/ActiveFilters.tsx +0 -145
- package/src/Search/ContentTypeResult.tsx +0 -190
- package/src/Search/ContentTypeResultStyles.tsx +0 -172
- package/src/Search/IsPathToHighlight.ts +0 -12
- package/src/Search/LoadingWrapper.tsx +0 -44
- package/src/Search/SearchField.tsx +0 -175
- package/src/Search/SearchFieldForm.tsx +0 -64
- package/src/Search/SearchResult.tsx +0 -368
- package/src/Search/SearchResultSleeve.tsx +0 -367
- package/src/Search/__tests__/Highlight-test.ts +0 -66
- package/src/Search/index.ts +0 -14
package/es/Layout/LayoutItem.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) 2016-present, NDLA.
|
|
4
3
|
*
|
|
@@ -7,41 +6,30 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
7
6
|
*
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const style = useMemo(() => {
|
|
34
|
-
if (layout === "extend") {
|
|
35
|
-
return extendCss;
|
|
36
|
-
} else if (layout === "center") {
|
|
37
|
-
return centerCss;
|
|
9
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
10
|
+
|
|
11
|
+
// TODO: Refactor this. This is a copy of our old layout.
|
|
12
|
+
export const LayoutItem = styled("section", {
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
layout: "center"
|
|
15
|
+
},
|
|
16
|
+
variants: {
|
|
17
|
+
layout: {
|
|
18
|
+
center: {
|
|
19
|
+
position: "relative!",
|
|
20
|
+
width: "83.333%",
|
|
21
|
+
right: "auto !important",
|
|
22
|
+
left: "8.333%"
|
|
23
|
+
},
|
|
24
|
+
extend: {
|
|
25
|
+
tablet: {
|
|
26
|
+
position: "relative!",
|
|
27
|
+
width: "83.333%",
|
|
28
|
+
right: "auto!",
|
|
29
|
+
left: "8.333%"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
38
32
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return _jsx("section", {
|
|
42
|
-
css: style,
|
|
43
|
-
...rest,
|
|
44
|
-
children: children
|
|
45
|
-
});
|
|
46
|
-
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
47
35
|
export default LayoutItem;
|
package/es/Layout/OneColumn.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
1
|
/**
|
|
4
2
|
* Copyright (c) 2016-present, NDLA.
|
|
5
3
|
*
|
|
@@ -8,34 +6,38 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
6
|
*
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
11
|
+
// TODO: This is a rewrite of our old layout. Refactor this.
|
|
12
|
+
export const OneColumn = styled("div", {
|
|
13
|
+
base: {
|
|
14
|
+
marginLeft: "auto",
|
|
15
|
+
marginRight: "auto",
|
|
16
|
+
width: "100%",
|
|
17
|
+
paddingLeft: "18px",
|
|
18
|
+
paddingRight: "18px",
|
|
19
|
+
mobileWide: {
|
|
20
|
+
paddingLeft: "medium",
|
|
21
|
+
paddingRight: "medium"
|
|
22
|
+
},
|
|
23
|
+
_after: {
|
|
24
|
+
content: '""!',
|
|
25
|
+
display: "block!",
|
|
26
|
+
clear: "both!"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
wide: false
|
|
31
|
+
},
|
|
32
|
+
variants: {
|
|
33
|
+
wide: {
|
|
34
|
+
true: {
|
|
35
|
+
maxWidth: "1150px"
|
|
36
|
+
},
|
|
37
|
+
false: {
|
|
38
|
+
maxWidth: "1024px"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
41
43
|
export default OneColumn;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
1
|
/**
|
|
4
2
|
* Copyright (c) 2016-present, NDLA.
|
|
5
3
|
*
|
|
@@ -8,34 +6,27 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
6
|
*
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
// TODO: Refactor this. It's a rewrite of our old layout.
|
|
12
|
+
export const PageContainer = styled("div", {
|
|
13
|
+
base: {
|
|
14
|
+
minHeight: "100vh",
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column"
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
backgroundWide: false
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
backgroundWide: {
|
|
23
|
+
true: {
|
|
24
|
+
tablet: {
|
|
25
|
+
backgroundColor: "#f8f8f8"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
false: {}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
27
31
|
});
|
|
28
|
-
const backgroundWideStyle = /*#__PURE__*/css(mq.range({
|
|
29
|
-
from: breakpoints.tablet
|
|
30
|
-
}), "{background-color:", colors.brand.greyLightest, ";};label:backgroundWideStyle;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBhZ2VDb250YWluZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdCK0IiLCJmaWxlIjoiUGFnZUNvbnRhaW5lci50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAxNi1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFIGZpbGUgaW4gdGhlIHJvb3QgZGlyZWN0b3J5IG9mIHRoaXMgc291cmNlIHRyZWUuXG4gKlxuICovXG5cbi8qKiBAanN4SW1wb3J0U291cmNlIEBlbW90aW9uL3JlYWN0ICovXG5pbXBvcnQgeyBDb21wb25lbnRQcm9wc1dpdGhvdXRSZWYgfSBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7IGNzcyB9IGZyb20gXCJAZW1vdGlvbi9yZWFjdFwiO1xuaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XG5pbXBvcnQgeyBjb2xvcnMsIG1xLCBicmVha3BvaW50cyB9IGZyb20gXCJAbmRsYS9jb3JlXCI7XG5cbmludGVyZmFjZSBQcm9wcyBleHRlbmRzIENvbXBvbmVudFByb3BzV2l0aG91dFJlZjxcImRpdlwiPiB7XG4gIGJhY2tncm91bmRXaWRlPzogYm9vbGVhbjtcbn1cblxuY29uc3QgU3R5bGVkUGFnZUNvbnRhaW5lciA9IHN0eWxlZC5kaXZgXG4gIG1pbi1oZWlnaHQ6IDEwMHZoO1xuICBkaXNwbGF5OiBmbGV4O1xuICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuYDtcblxuY29uc3QgYmFja2dyb3VuZFdpZGVTdHlsZSA9IGNzc2BcbiAgJHttcS5yYW5nZSh7IGZyb206IGJyZWFrcG9pbnRzLnRhYmxldCB9KX0ge1xuICAgIGJhY2tncm91bmQtY29sb3I6ICR7Y29sb3JzLmJyYW5kLmdyZXlMaWdodGVzdH07XG4gIH1cbmA7XG5cbmV4cG9ydCBjb25zdCBQYWdlQ29udGFpbmVyID0gKHsgYmFja2dyb3VuZFdpZGUgPSBmYWxzZSwgLi4ucmVzdCB9OiBQcm9wcykgPT4gKFxuICA8U3R5bGVkUGFnZUNvbnRhaW5lciBjc3M9e2JhY2tncm91bmRXaWRlID8gYmFja2dyb3VuZFdpZGVTdHlsZSA6IHVuZGVmaW5lZH0gey4uLnJlc3R9IC8+XG4pO1xuXG5leHBvcnQgZGVmYXVsdCBQYWdlQ29udGFpbmVyO1xuIl19 */"));
|
|
31
|
-
export const PageContainer = _ref => {
|
|
32
|
-
let {
|
|
33
|
-
backgroundWide = false,
|
|
34
|
-
...rest
|
|
35
|
-
} = _ref;
|
|
36
|
-
return _jsx(StyledPageContainer, {
|
|
37
|
-
css: backgroundWide ? backgroundWideStyle : undefined,
|
|
38
|
-
...rest
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
32
|
export default PageContainer;
|
|
@@ -13,7 +13,7 @@ import { getLicenseByAbbreviation, getLicenseCredits } from "@ndla/licenses";
|
|
|
13
13
|
import { Button, Text } from "@ndla/primitives";
|
|
14
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
15
|
import { LicenseLink } from "./LicenseLink";
|
|
16
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
17
|
const BylineWrapper = styled("figcaption", {
|
|
18
18
|
base: {
|
|
19
19
|
display: "flex",
|
|
@@ -65,10 +65,10 @@ export const EmbedByline = _ref => {
|
|
|
65
65
|
} = useTranslation();
|
|
66
66
|
if (props.error) {
|
|
67
67
|
const typeString = type === "h5p" ? "H5P" : t(`embed.type.${type}`).toLowerCase();
|
|
68
|
-
return _jsx(ErrorBylineWrapper, {
|
|
69
|
-
children: _jsxs(ContentWrapper, {
|
|
70
|
-
children: [_jsx(WarningOutline, {}), _jsx(BaseDescription, {
|
|
71
|
-
children: _jsx("span", {
|
|
68
|
+
return /*#__PURE__*/_jsx(ErrorBylineWrapper, {
|
|
69
|
+
children: /*#__PURE__*/_jsxs(ContentWrapper, {
|
|
70
|
+
children: [/*#__PURE__*/_jsx(WarningOutline, {}), /*#__PURE__*/_jsx(BaseDescription, {
|
|
71
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
72
72
|
children: t("embed.embedError", {
|
|
73
73
|
type: typeString
|
|
74
74
|
})
|
|
@@ -80,21 +80,21 @@ export const EmbedByline = _ref => {
|
|
|
80
80
|
const {
|
|
81
81
|
copyright
|
|
82
82
|
} = props;
|
|
83
|
-
return _jsxs(_Fragment, {
|
|
84
|
-
children: [_jsx(BylineWrapper, {
|
|
85
|
-
children: _jsxs("div", {
|
|
86
|
-
children: [_jsx(LicenseContainerContent, {
|
|
83
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
84
|
+
children: [/*#__PURE__*/_jsx(BylineWrapper, {
|
|
85
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
86
|
+
children: [/*#__PURE__*/_jsx(LicenseContainerContent, {
|
|
87
87
|
type: type,
|
|
88
88
|
copyright: copyright,
|
|
89
89
|
children: description
|
|
90
90
|
}), children]
|
|
91
91
|
})
|
|
92
|
-
}), visibleAlt ? _jsx(StyledText, {
|
|
92
|
+
}), visibleAlt ? /*#__PURE__*/_jsx(StyledText, {
|
|
93
93
|
color: "text.subtle",
|
|
94
94
|
textStyle: "label.medium",
|
|
95
95
|
asChild: true,
|
|
96
96
|
consumeCss: true,
|
|
97
|
-
children: _jsx("span", {
|
|
97
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
98
98
|
children: `Alt: ${visibleAlt}`
|
|
99
99
|
})
|
|
100
100
|
}) : null]
|
|
@@ -151,13 +151,13 @@ const LicenseDescription = _ref2 => {
|
|
|
151
151
|
const handleToggle = () => {
|
|
152
152
|
setIsOpen(!isOpen);
|
|
153
153
|
};
|
|
154
|
-
return _jsx(ContentWrapper, {
|
|
155
|
-
children: _jsxs(StyledDescription, {
|
|
154
|
+
return /*#__PURE__*/_jsx(ContentWrapper, {
|
|
155
|
+
children: /*#__PURE__*/_jsxs(StyledDescription, {
|
|
156
156
|
...open,
|
|
157
|
-
children: [_jsx(TextContent, {
|
|
157
|
+
children: [/*#__PURE__*/_jsx(TextContent, {
|
|
158
158
|
...open,
|
|
159
159
|
children: children
|
|
160
|
-
}), _jsx(StyledButton, {
|
|
160
|
+
}), /*#__PURE__*/_jsx(StyledButton, {
|
|
161
161
|
variant: "link",
|
|
162
162
|
size: "small",
|
|
163
163
|
onClick: handleToggle,
|
|
@@ -179,23 +179,23 @@ export const LicenseContainerContent = _ref3 => {
|
|
|
179
179
|
const license = copyright ? getLicenseByAbbreviation(copyright.license?.license ?? "", i18n.language) : undefined;
|
|
180
180
|
const authors = getLicenseCredits(copyright);
|
|
181
181
|
const captionAuthors = Object.values(authors).find(i => i.length > 0) ?? [];
|
|
182
|
-
const content = _jsxs(_Fragment, {
|
|
183
|
-
children: [children, ` ${t(`embed.type.${type}`)}${captionAuthors.length ? ": " : ""}`, captionAuthors.map(author => author.name).join(", "), license ? _jsxs(_Fragment, {
|
|
184
|
-
children: [" / ", _jsx(LicenseLink, {
|
|
182
|
+
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
183
|
+
children: [children, ` ${t(`embed.type.${type}`)}${captionAuthors.length ? ": " : ""}`, captionAuthors.map(author => author.name).join(", "), license ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
184
|
+
children: [" / ", /*#__PURE__*/_jsx(LicenseLink, {
|
|
185
185
|
license: license
|
|
186
186
|
})]
|
|
187
187
|
}) : null]
|
|
188
188
|
});
|
|
189
189
|
if (children) {
|
|
190
|
-
return _jsx(LicenseDescription, {
|
|
190
|
+
return /*#__PURE__*/_jsx(LicenseDescription, {
|
|
191
191
|
children: content
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
return _jsx(Text, {
|
|
194
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
195
195
|
textStyle: "label.medium",
|
|
196
196
|
asChild: true,
|
|
197
197
|
consumeCss: true,
|
|
198
|
-
children: _jsx("span", {
|
|
198
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
199
199
|
children: content
|
|
200
200
|
})
|
|
201
201
|
});
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { SafeLink } from "@ndla/safelink";
|
|
10
10
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
|
-
import { jsx as _jsx } from "
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const StyledSafeLink = styled(SafeLink, {
|
|
13
13
|
base: {
|
|
14
14
|
color: "primary",
|
|
@@ -30,13 +30,13 @@ export const LicenseLink = _ref => {
|
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
if (license.url?.length) {
|
|
33
|
-
return _jsx(StyledSafeLink, {
|
|
33
|
+
return /*#__PURE__*/_jsx(StyledSafeLink, {
|
|
34
34
|
to: license.url,
|
|
35
35
|
rel: "license",
|
|
36
36
|
children: license.abbreviation
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
return _jsx("span", {
|
|
39
|
+
return /*#__PURE__*/_jsx("span", {
|
|
40
40
|
children: license.abbreviation
|
|
41
41
|
});
|
|
42
42
|
};
|
|
@@ -15,7 +15,7 @@ import { Heading } from "@ndla/primitives";
|
|
|
15
15
|
import { SafeLink } from "@ndla/safelink";
|
|
16
16
|
import { styled } from "@ndla/styled-system/jsx";
|
|
17
17
|
import { getPossiblyRelativeUrl } from "../utils/relativeUrl";
|
|
18
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
19
|
const InfoWrapper = styled("div", {
|
|
20
20
|
base: {
|
|
21
21
|
display: "flex",
|
|
@@ -80,21 +80,21 @@ const LinkBlock = _ref => {
|
|
|
80
80
|
locale
|
|
81
81
|
});
|
|
82
82
|
}, [date, articleLanguage]);
|
|
83
|
-
return _jsxs(StyledSafeLink, {
|
|
83
|
+
return /*#__PURE__*/_jsxs(StyledSafeLink, {
|
|
84
84
|
to: href,
|
|
85
|
-
children: [_jsxs(InfoWrapper, {
|
|
86
|
-
children: [_jsx(Heading, {
|
|
85
|
+
children: [/*#__PURE__*/_jsxs(InfoWrapper, {
|
|
86
|
+
children: [/*#__PURE__*/_jsx(Heading, {
|
|
87
87
|
asChild: true,
|
|
88
88
|
consumeCss: true,
|
|
89
89
|
textStyle: "title.medium",
|
|
90
|
-
children: _jsx("h3", {
|
|
90
|
+
children: /*#__PURE__*/_jsx("h3", {
|
|
91
91
|
"data-heading": true,
|
|
92
92
|
children: parse(title)
|
|
93
93
|
})
|
|
94
|
-
}), date && _jsxs(StyledDateContainer, {
|
|
95
|
-
children: [_jsx(StyledCalendarEd, {}), formattedDate]
|
|
94
|
+
}), date && /*#__PURE__*/_jsxs(StyledDateContainer, {
|
|
95
|
+
children: [/*#__PURE__*/_jsx(StyledCalendarEd, {}), formattedDate]
|
|
96
96
|
})]
|
|
97
|
-
}), _jsx(Forward, {
|
|
97
|
+
}), /*#__PURE__*/_jsx(Forward, {
|
|
98
98
|
"data-forward": true
|
|
99
99
|
})]
|
|
100
100
|
});
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { Children } from "react";
|
|
10
10
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
|
-
import { jsx as _jsx } from "
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const StyledList = styled("ul", {
|
|
13
13
|
base: {
|
|
14
14
|
display: "flex",
|
|
@@ -22,10 +22,10 @@ const LinkBlockSection = _ref => {
|
|
|
22
22
|
children,
|
|
23
23
|
...rest
|
|
24
24
|
} = _ref;
|
|
25
|
-
return _jsx("nav", {
|
|
25
|
+
return /*#__PURE__*/_jsx("nav", {
|
|
26
26
|
...rest,
|
|
27
|
-
children: _jsx(StyledList, {
|
|
28
|
-
children: Children.map(children, child => _jsx("li", {
|
|
27
|
+
children: /*#__PURE__*/_jsx(StyledList, {
|
|
28
|
+
children: Children.map(children, child => /*#__PURE__*/_jsx("li", {
|
|
29
29
|
children: child
|
|
30
30
|
}))
|
|
31
31
|
})
|
|
@@ -12,7 +12,7 @@ import { IconButtonV2 } from "@ndla/button";
|
|
|
12
12
|
import { breakpoints, colors, fonts, mq, spacing } from "@ndla/core";
|
|
13
13
|
import { Cross } from "@ndla/icons/action";
|
|
14
14
|
import { Forward } from "@ndla/icons/common";
|
|
15
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const MessageBoxWrapper = /*#__PURE__*/_styled("div", {
|
|
17
17
|
target: "e1hvxgh95",
|
|
18
18
|
label: "MessageBoxWrapper"
|
|
@@ -51,28 +51,28 @@ export const MessageBox = _ref => {
|
|
|
51
51
|
const {
|
|
52
52
|
t
|
|
53
53
|
} = useTranslation();
|
|
54
|
-
return _jsxs(MessageBoxWrapper, {
|
|
54
|
+
return /*#__PURE__*/_jsxs(MessageBoxWrapper, {
|
|
55
55
|
"data-type": type,
|
|
56
56
|
contentEditable: contentEditable ?? undefined,
|
|
57
|
-
children: [_jsx(InfoWrapper, {
|
|
58
|
-
children: _jsxs("div", {
|
|
59
|
-
children: [_jsx(ChildrenWrapper, {
|
|
57
|
+
children: [/*#__PURE__*/_jsx(InfoWrapper, {
|
|
58
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
59
|
+
children: [/*#__PURE__*/_jsx(ChildrenWrapper, {
|
|
60
60
|
children: children
|
|
61
|
-
}), links && _jsx(LinkWrapper, {
|
|
62
|
-
children: links.map(x => _jsxs(Link, {
|
|
61
|
+
}), links && /*#__PURE__*/_jsx(LinkWrapper, {
|
|
62
|
+
children: links.map(x => /*#__PURE__*/_jsxs(Link, {
|
|
63
63
|
href: x.href,
|
|
64
|
-
children: [_jsx("span", {
|
|
64
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
65
65
|
children: x.text
|
|
66
|
-
}), _jsx(Forward, {})]
|
|
66
|
+
}), /*#__PURE__*/_jsx(Forward, {})]
|
|
67
67
|
}, x.href))
|
|
68
68
|
})]
|
|
69
69
|
})
|
|
70
|
-
}), showCloseButton && _jsx(StyledCloseButton, {
|
|
70
|
+
}), showCloseButton && /*#__PURE__*/_jsx(StyledCloseButton, {
|
|
71
71
|
variant: "ghost",
|
|
72
72
|
"aria-label": t("close"),
|
|
73
73
|
title: t("close"),
|
|
74
74
|
onClick: onClose,
|
|
75
|
-
children: _jsx(Cross, {})
|
|
75
|
+
children: /*#__PURE__*/_jsx(Cross, {})
|
|
76
76
|
})]
|
|
77
77
|
});
|
|
78
78
|
};
|
package/es/Messages/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import _styled from "@emotion/styled/base";
|
|
|
9
9
|
|
|
10
10
|
import { spacing, colors, misc, breakpoints, mq, fonts } from "@ndla/core";
|
|
11
11
|
import { SafeLink } from "@ndla/safelink";
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
const StyledCardContainer = /*#__PURE__*/_styled(SafeLink, {
|
|
14
14
|
target: "eo9d6lc2",
|
|
15
15
|
label: "StyledCardContainer"
|
|
@@ -31,19 +31,19 @@ const ProgrammeCard = _ref => {
|
|
|
31
31
|
wideImage,
|
|
32
32
|
url
|
|
33
33
|
} = _ref;
|
|
34
|
-
return _jsxs(StyledCardContainer, {
|
|
34
|
+
return /*#__PURE__*/_jsxs(StyledCardContainer, {
|
|
35
35
|
to: url,
|
|
36
|
-
children: [narrowImage && _jsx(StyledImg, {
|
|
36
|
+
children: [narrowImage && /*#__PURE__*/_jsx(StyledImg, {
|
|
37
37
|
height: 280,
|
|
38
38
|
width: 250,
|
|
39
39
|
src: narrowImage.src,
|
|
40
40
|
alt: narrowImage.alt
|
|
41
|
-
}), wideImage && _jsx(StyledImg, {
|
|
41
|
+
}), wideImage && /*#__PURE__*/_jsx(StyledImg, {
|
|
42
42
|
height: 330,
|
|
43
43
|
width: 120,
|
|
44
44
|
src: wideImage.src,
|
|
45
45
|
alt: wideImage.alt
|
|
46
|
-
}), _jsx(StyledTitle, {
|
|
46
|
+
}), /*#__PURE__*/_jsx(StyledTitle, {
|
|
47
47
|
children: title.title
|
|
48
48
|
})]
|
|
49
49
|
});
|
|
@@ -14,7 +14,7 @@ import { styled } from "@ndla/styled-system/jsx";
|
|
|
14
14
|
import { linkOverlay } from "@ndla/styled-system/patterns";
|
|
15
15
|
import { ContentTypeBadge } from "../ContentTypeBadge/ContentTypeBadgeNew";
|
|
16
16
|
import { contentTypes } from "../model/ContentType";
|
|
17
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
export const RelatedArticle = _ref => {
|
|
19
19
|
let {
|
|
20
20
|
title,
|
|
@@ -24,15 +24,15 @@ export const RelatedArticle = _ref => {
|
|
|
24
24
|
target = "",
|
|
25
25
|
type = contentTypes.SUBJECT_MATERIAL
|
|
26
26
|
} = _ref;
|
|
27
|
-
return _jsx(CardRoot, {
|
|
28
|
-
children: _jsxs(CardContent, {
|
|
29
|
-
children: [_jsx(ContentTypeBadge, {
|
|
27
|
+
return /*#__PURE__*/_jsx(CardRoot, {
|
|
28
|
+
children: /*#__PURE__*/_jsxs(CardContent, {
|
|
29
|
+
children: [/*#__PURE__*/_jsx(ContentTypeBadge, {
|
|
30
30
|
contentType: type
|
|
31
|
-
}), _jsx(CardHeading, {
|
|
31
|
+
}), /*#__PURE__*/_jsx(CardHeading, {
|
|
32
32
|
asChild: true,
|
|
33
33
|
consumeCss: true,
|
|
34
|
-
children: _jsx("span", {
|
|
35
|
-
children: _jsx(SafeLink, {
|
|
34
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
35
|
+
children: /*#__PURE__*/_jsx(SafeLink, {
|
|
36
36
|
unstyled: true,
|
|
37
37
|
to: to,
|
|
38
38
|
target: target,
|
|
@@ -41,11 +41,11 @@ export const RelatedArticle = _ref => {
|
|
|
41
41
|
children: title
|
|
42
42
|
})
|
|
43
43
|
})
|
|
44
|
-
}), _jsx(Text, {
|
|
44
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
45
45
|
dangerouslySetInnerHTML: {
|
|
46
46
|
__html: introduction
|
|
47
47
|
}
|
|
48
|
-
}), _jsx(Text, {
|
|
48
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
49
49
|
color: "text.subtle",
|
|
50
50
|
textStyle: "label.small",
|
|
51
51
|
children: linkInfo
|
|
@@ -100,21 +100,21 @@ export const RelatedArticleList = _ref2 => {
|
|
|
100
100
|
} = useTranslation();
|
|
101
101
|
const childCount = useMemo(() => articleCount ?? Children.count(children), [children, articleCount]);
|
|
102
102
|
const childrenToShow = useMemo(() => childCount > 2 && !expanded ? children?.slice(0, 2) : children, [childCount, children, expanded]);
|
|
103
|
-
return _jsxs(StyledSection, {
|
|
103
|
+
return /*#__PURE__*/_jsxs(StyledSection, {
|
|
104
104
|
...rest,
|
|
105
|
-
children: [_jsxs(HeadingWrapper, {
|
|
106
|
-
children: [_jsx(Heading, {
|
|
105
|
+
children: [/*#__PURE__*/_jsxs(HeadingWrapper, {
|
|
106
|
+
children: [/*#__PURE__*/_jsx(Heading, {
|
|
107
107
|
asChild: true,
|
|
108
108
|
consumeCss: true,
|
|
109
109
|
textStyle: "title.large",
|
|
110
110
|
fontWeight: "bold",
|
|
111
|
-
children: _jsx(HeadingElement, {
|
|
111
|
+
children: /*#__PURE__*/_jsx(HeadingElement, {
|
|
112
112
|
children: t("related.title")
|
|
113
113
|
})
|
|
114
114
|
}), headingButtons]
|
|
115
|
-
}), _jsx(ArticlesWrapper, {
|
|
115
|
+
}), /*#__PURE__*/_jsx(ArticlesWrapper, {
|
|
116
116
|
children: childrenToShow
|
|
117
|
-
}), childCount > 2 ? _jsx(StyledButton, {
|
|
117
|
+
}), childCount > 2 ? /*#__PURE__*/_jsx(StyledButton, {
|
|
118
118
|
variant: "secondary",
|
|
119
119
|
onClick: () => setExpanded(p => !p),
|
|
120
120
|
children: t(`related.show${expanded ? "Less" : "More"}`)
|
|
@@ -11,7 +11,7 @@ import { Heading, Image, Text } from "@ndla/primitives";
|
|
|
11
11
|
import { SafeLinkButton } from "@ndla/safelink";
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
13
|
import { token } from "@ndla/styled-system/tokens";
|
|
14
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
const Container = styled("div", {
|
|
16
16
|
base: {
|
|
17
17
|
display: "flex",
|
|
@@ -68,28 +68,28 @@ export const ResourceBox = _ref => {
|
|
|
68
68
|
url,
|
|
69
69
|
buttonText
|
|
70
70
|
} = _ref;
|
|
71
|
-
return _jsxs(Container, {
|
|
72
|
-
children: [_jsx(StyledImage, {
|
|
71
|
+
return /*#__PURE__*/_jsxs(Container, {
|
|
72
|
+
children: [/*#__PURE__*/_jsx(StyledImage, {
|
|
73
73
|
src: image.src,
|
|
74
74
|
alt: image.alt,
|
|
75
75
|
sizes: `(min-width: ${token("breakpoints.desktop")}) 150px, (max-width: ${token("breakpoints.tablet")} ) 400px, 200px`
|
|
76
|
-
}), _jsxs(ContentWrapper, {
|
|
77
|
-
children: [_jsx(Heading, {
|
|
76
|
+
}), /*#__PURE__*/_jsxs(ContentWrapper, {
|
|
77
|
+
children: [/*#__PURE__*/_jsx(Heading, {
|
|
78
78
|
textStyle: "label.large",
|
|
79
79
|
fontWeight: "bold",
|
|
80
80
|
asChild: true,
|
|
81
81
|
consumeCss: true,
|
|
82
|
-
children: _jsx("h3", {
|
|
82
|
+
children: /*#__PURE__*/_jsx("h3", {
|
|
83
83
|
children: title
|
|
84
84
|
})
|
|
85
|
-
}), _jsx(StyledText, {
|
|
85
|
+
}), /*#__PURE__*/_jsx(StyledText, {
|
|
86
86
|
textStyle: "body.medium",
|
|
87
87
|
children: caption
|
|
88
|
-
}), _jsxs(SafeLinkButton, {
|
|
88
|
+
}), /*#__PURE__*/_jsxs(SafeLinkButton, {
|
|
89
89
|
to: url,
|
|
90
90
|
target: "_blank",
|
|
91
91
|
variant: "secondary",
|
|
92
|
-
children: [buttonText, _jsx(Launch, {})]
|
|
92
|
+
children: [buttonText, /*#__PURE__*/_jsx(Launch, {})]
|
|
93
93
|
})]
|
|
94
94
|
})]
|
|
95
95
|
});
|