@ndla/ui 56.0.123-alpha.0 → 56.0.124-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/es/Article/Article.js +122 -194
- package/es/Article/Article.js.map +1 -0
- package/es/Article/ArticleByline.js +121 -170
- package/es/Article/ArticleByline.js.map +1 -0
- package/es/Article/ArticleFootNotes.js +38 -58
- package/es/Article/ArticleFootNotes.js.map +1 -0
- package/es/AudioPlayer/AudioPlayer.js +151 -212
- package/es/AudioPlayer/AudioPlayer.js.map +1 -0
- package/es/AudioPlayer/Controls.js +246 -324
- package/es/AudioPlayer/Controls.js.map +1 -0
- package/es/AudioPlayer/SpeechControl.js +36 -52
- package/es/AudioPlayer/SpeechControl.js.map +1 -0
- package/es/AudioPlayer/index.js +7 -9
- package/es/AudioPlayer/index.js.map +1 -0
- package/es/Breadcrumb/Breadcrumb.js +42 -58
- package/es/Breadcrumb/Breadcrumb.js.map +1 -0
- package/es/Breadcrumb/BreadcrumbItem.js +33 -59
- package/es/Breadcrumb/BreadcrumbItem.js.map +1 -0
- package/es/Breadcrumb/HomeBreadcrumb.js +41 -74
- package/es/Breadcrumb/HomeBreadcrumb.js.map +1 -0
- package/es/Breadcrumb/index.js +8 -10
- package/es/Breadcrumb/index.js.map +1 -0
- package/es/CampaignBlock/CampaignBlock.js +124 -173
- package/es/CampaignBlock/CampaignBlock.js.map +1 -0
- package/es/CodeBlock/CodeBlock.js +21 -31
- package/es/CodeBlock/CodeBlock.js.map +1 -0
- package/es/CodeBlock/codeLanguageOptions.js +112 -82
- package/es/CodeBlock/codeLanguageOptions.js.map +1 -0
- package/es/Concept/Concept.js +46 -68
- package/es/Concept/Concept.js.map +1 -0
- package/es/ContactBlock/ContactBlock.js +137 -191
- package/es/ContactBlock/ContactBlock.js.map +1 -0
- package/es/ContentTypeBadge/ContentTypeBadge.js +38 -47
- package/es/ContentTypeBadge/ContentTypeBadge.js.map +1 -0
- package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js +21 -28
- package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js.map +1 -0
- package/es/ContentTypeFramedContent/ContentTypeFramedContent.js +21 -28
- package/es/ContentTypeFramedContent/ContentTypeFramedContent.js.map +1 -0
- package/es/ContentTypeHero/ContentTypeHero.js +36 -47
- package/es/ContentTypeHero/ContentTypeHero.js.map +1 -0
- package/es/CopyParagraphButton/CopyParagraphButton.js +57 -78
- package/es/CopyParagraphButton/CopyParagraphButton.js.map +1 -0
- package/es/CopyParagraphButton/index.js +7 -10
- package/es/CopyParagraphButton/index.js.map +1 -0
- package/es/Embed/AudioEmbed.js +49 -73
- package/es/Embed/AudioEmbed.js.map +1 -0
- package/es/Embed/BrightcoveEmbed.js +90 -127
- package/es/Embed/BrightcoveEmbed.js.map +1 -0
- package/es/Embed/CodeEmbed.js +55 -73
- package/es/Embed/CodeEmbed.js.map +1 -0
- package/es/Embed/ConceptEmbed.js +72 -117
- package/es/Embed/ConceptEmbed.js.map +1 -0
- package/es/Embed/ConceptInlineTriggerButton.js +39 -44
- package/es/Embed/ConceptInlineTriggerButton.js.map +1 -0
- package/es/Embed/ContentLinkEmbed.js +29 -49
- package/es/Embed/ContentLinkEmbed.js.map +1 -0
- package/es/Embed/CopyrightEmbed.js +21 -31
- package/es/Embed/CopyrightEmbed.js.map +1 -0
- package/es/Embed/EmbedErrorPlaceholder.js +40 -55
- package/es/Embed/EmbedErrorPlaceholder.js.map +1 -0
- package/es/Embed/EmbedWrapper.js +21 -46
- package/es/Embed/EmbedWrapper.js.map +1 -0
- package/es/Embed/ExternalEmbed.js +50 -70
- package/es/Embed/ExternalEmbed.js.map +1 -0
- package/es/Embed/FootnoteEmbed.js +25 -42
- package/es/Embed/FootnoteEmbed.js.map +1 -0
- package/es/Embed/GlossEmbed.js +49 -77
- package/es/Embed/GlossEmbed.js.map +1 -0
- package/es/Embed/H5pEmbed.js +35 -58
- package/es/Embed/H5pEmbed.js.map +1 -0
- package/es/Embed/IframeEmbed.js +65 -89
- package/es/Embed/IframeEmbed.js.map +1 -0
- package/es/Embed/ImageEmbed.js +167 -225
- package/es/Embed/ImageEmbed.js.map +1 -0
- package/es/Embed/InlineTriggerButton.js +20 -32
- package/es/Embed/InlineTriggerButton.js.map +1 -0
- package/es/Embed/RelatedContentEmbed.js +36 -53
- package/es/Embed/RelatedContentEmbed.js.map +1 -0
- package/es/Embed/UnknownEmbed.js +18 -29
- package/es/Embed/UnknownEmbed.js.map +1 -0
- package/es/Embed/UuDisclaimerEmbed.js +51 -85
- package/es/Embed/UuDisclaimerEmbed.js.map +1 -0
- package/es/ErrorMessage/ErrorMessage.js +51 -92
- package/es/ErrorMessage/ErrorMessage.js.map +1 -0
- package/es/ErrorMessage/index.js +7 -9
- package/es/ErrorMessage/index.js.map +1 -0
- package/es/FactBox/FactBox.js +114 -170
- package/es/FactBox/FactBox.js.map +1 -0
- package/es/FactBox/index.js +7 -9
- package/es/FactBox/index.js.map +1 -0
- package/es/FileList/File.js +70 -95
- package/es/FileList/File.js.map +1 -0
- package/es/FileList/FileList.js +31 -46
- package/es/FileList/FileList.js.map +1 -0
- package/es/FileList/PdfFile.js +27 -49
- package/es/FileList/PdfFile.js.map +1 -0
- package/es/Gloss/Gloss.js +133 -166
- package/es/Gloss/Gloss.js.map +1 -0
- package/es/Gloss/GlossExample.js +42 -60
- package/es/Gloss/GlossExample.js.map +1 -0
- package/es/Grid/Grid.js +63 -91
- package/es/Grid/Grid.js.map +1 -0
- package/es/Grid/GridParallaxItem.js +19 -30
- package/es/Grid/GridParallaxItem.js.map +1 -0
- package/es/KeyFigure/KeyFigure.js +44 -61
- package/es/KeyFigure/KeyFigure.js.map +1 -0
- package/es/LicenseByline/EmbedByline.js +126 -206
- package/es/LicenseByline/EmbedByline.js.map +1 -0
- package/es/LicenseByline/LicenseLink.js +28 -53
- package/es/LicenseByline/LicenseLink.js.map +1 -0
- package/es/LinkBlock/LinkBlock.js +70 -99
- package/es/LinkBlock/LinkBlock.js.map +1 -0
- package/es/LinkBlock/LinkBlockSection.js +20 -32
- package/es/LinkBlock/LinkBlockSection.js.map +1 -0
- package/es/Pitch/Pitch.js +59 -80
- package/es/Pitch/Pitch.js.map +1 -0
- package/es/RelatedArticleList/RelatedArticleList.js +91 -129
- package/es/RelatedArticleList/RelatedArticleList.js.map +1 -0
- package/es/RelatedArticleList/index.js +7 -10
- package/es/RelatedArticleList/index.js.map +1 -0
- package/es/ResourceBox/ResourceBox.js +71 -96
- package/es/ResourceBox/ResourceBox.js.map +1 -0
- package/es/TagSelector/TagSelector.js +93 -136
- package/es/TagSelector/TagSelector.js.map +1 -0
- package/es/ZendeskButton/ZendeskButton.js +38 -52
- package/es/ZendeskButton/ZendeskButton.js.map +1 -0
- package/es/_virtual/rolldown_runtime.js +11 -0
- package/es/i18n/formatNestedMessages.js +16 -24
- package/es/i18n/formatNestedMessages.js.map +1 -0
- package/es/i18n/i18n.js +25 -31
- package/es/i18n/i18n.js.map +1 -0
- package/es/i18n/useComponentTranslations.js +147 -203
- package/es/i18n/useComponentTranslations.js.map +1 -0
- package/es/index.js +64 -44
- package/es/locale/messages-en.js +435 -459
- package/es/locale/messages-en.js.map +1 -0
- package/es/locale/messages-nb.js +435 -459
- package/es/locale/messages-nb.js.map +1 -0
- package/es/locale/messages-nn.js +435 -459
- package/es/locale/messages-nn.js.map +1 -0
- package/es/locale/messages-se.js +435 -459
- package/es/locale/messages-se.js.map +1 -0
- package/es/model/ContentType.js +69 -65
- package/es/model/ContentType.js.map +1 -0
- package/es/model/SubjectCategories.js +23 -10
- package/es/model/SubjectCategories.js.map +1 -0
- package/es/model/SubjectTypes.js +21 -9
- package/es/model/SubjectTypes.js.map +1 -0
- package/es/model/WordClass.js +51 -43
- package/es/model/WordClass.js.map +1 -0
- package/es/model/index.js +16 -18
- package/es/model/index.js.map +1 -0
- package/es/utils/licenseAttributes.js +15 -17
- package/es/utils/licenseAttributes.js.map +1 -0
- package/es/utils/relativeUrl.js +21 -32
- package/es/utils/relativeUrl.js.map +1 -0
- package/lib/Article/Article.js +130 -203
- package/lib/Article/Article.js.map +1 -0
- package/lib/Article/ArticleByline.js +125 -179
- package/lib/Article/ArticleByline.js.map +1 -0
- package/lib/Article/ArticleFootNotes.js +39 -65
- package/lib/Article/ArticleFootNotes.js.map +1 -0
- package/lib/AudioPlayer/AudioPlayer.js +155 -221
- package/lib/AudioPlayer/AudioPlayer.js.map +1 -0
- package/lib/AudioPlayer/Controls.js +249 -332
- package/lib/AudioPlayer/Controls.js.map +1 -0
- package/lib/AudioPlayer/SpeechControl.js +39 -60
- package/lib/AudioPlayer/SpeechControl.js.map +1 -0
- package/lib/AudioPlayer/index.js +7 -15
- package/lib/AudioPlayer/index.js.map +1 -0
- package/lib/Breadcrumb/Breadcrumb.js +43 -65
- package/lib/Breadcrumb/Breadcrumb.js.map +1 -0
- package/lib/Breadcrumb/BreadcrumbItem.js +34 -65
- package/lib/Breadcrumb/BreadcrumbItem.js.map +1 -0
- package/lib/Breadcrumb/HomeBreadcrumb.js +43 -82
- package/lib/Breadcrumb/HomeBreadcrumb.js.map +1 -0
- package/lib/Breadcrumb/index.js +8 -22
- package/lib/Breadcrumb/index.js.map +1 -0
- package/lib/CampaignBlock/CampaignBlock.js +128 -183
- package/lib/CampaignBlock/CampaignBlock.js.map +1 -0
- package/lib/CodeBlock/CodeBlock.js +23 -38
- package/lib/CodeBlock/CodeBlock.js.map +1 -0
- package/lib/CodeBlock/codeLanguageOptions.js +112 -87
- package/lib/CodeBlock/codeLanguageOptions.js.map +1 -0
- package/lib/Concept/Concept.js +48 -75
- package/lib/Concept/Concept.js.map +1 -0
- package/lib/ContactBlock/ContactBlock.js +141 -200
- package/lib/ContactBlock/ContactBlock.js.map +1 -0
- package/lib/ContentTypeBadge/ContentTypeBadge.js +40 -54
- package/lib/ContentTypeBadge/ContentTypeBadge.js.map +1 -0
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +23 -35
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js.map +1 -0
- package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +23 -35
- package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js.map +1 -0
- package/lib/ContentTypeHero/ContentTypeHero.js +37 -54
- package/lib/ContentTypeHero/ContentTypeHero.js.map +1 -0
- package/lib/CopyParagraphButton/CopyParagraphButton.js +61 -87
- package/lib/CopyParagraphButton/CopyParagraphButton.js.map +1 -0
- package/lib/CopyParagraphButton/index.js +7 -21
- package/lib/CopyParagraphButton/index.js.map +1 -0
- package/lib/Embed/AudioEmbed.js +51 -82
- package/lib/Embed/AudioEmbed.js.map +1 -0
- package/lib/Embed/BrightcoveEmbed.js +93 -138
- package/lib/Embed/BrightcoveEmbed.js.map +1 -0
- package/lib/Embed/CodeEmbed.js +59 -83
- package/lib/Embed/CodeEmbed.js.map +1 -0
- package/lib/Embed/ConceptEmbed.js +77 -127
- package/lib/Embed/ConceptEmbed.js.map +1 -0
- package/lib/Embed/ConceptInlineTriggerButton.js +39 -49
- package/lib/Embed/ConceptInlineTriggerButton.js.map +1 -0
- package/lib/Embed/ContentLinkEmbed.js +30 -55
- package/lib/Embed/ContentLinkEmbed.js.map +1 -0
- package/lib/Embed/CopyrightEmbed.js +22 -37
- package/lib/Embed/CopyrightEmbed.js.map +1 -0
- package/lib/Embed/EmbedErrorPlaceholder.js +42 -62
- package/lib/Embed/EmbedErrorPlaceholder.js.map +1 -0
- package/lib/Embed/EmbedWrapper.js +24 -54
- package/lib/Embed/EmbedWrapper.js.map +1 -0
- package/lib/Embed/ExternalEmbed.js +53 -79
- package/lib/Embed/ExternalEmbed.js.map +1 -0
- package/lib/Embed/FootnoteEmbed.js +26 -48
- package/lib/Embed/FootnoteEmbed.js.map +1 -0
- package/lib/Embed/GlossEmbed.js +51 -86
- package/lib/Embed/GlossEmbed.js.map +1 -0
- package/lib/Embed/H5pEmbed.js +37 -66
- package/lib/Embed/H5pEmbed.js.map +1 -0
- package/lib/Embed/IframeEmbed.js +68 -98
- package/lib/Embed/IframeEmbed.js.map +1 -0
- package/lib/Embed/ImageEmbed.js +173 -238
- package/lib/Embed/ImageEmbed.js.map +1 -0
- package/lib/Embed/InlineTriggerButton.js +23 -40
- package/lib/Embed/InlineTriggerButton.js.map +1 -0
- package/lib/Embed/RelatedContentEmbed.js +37 -59
- package/lib/Embed/RelatedContentEmbed.js.map +1 -0
- package/lib/Embed/UnknownEmbed.js +19 -35
- package/lib/Embed/UnknownEmbed.js.map +1 -0
- package/lib/Embed/UuDisclaimerEmbed.js +53 -92
- package/lib/Embed/UuDisclaimerEmbed.js.map +1 -0
- package/lib/ErrorMessage/ErrorMessage.js +53 -99
- package/lib/ErrorMessage/ErrorMessage.js.map +1 -0
- package/lib/ErrorMessage/index.js +7 -15
- package/lib/ErrorMessage/index.js.map +1 -0
- package/lib/FactBox/FactBox.js +118 -180
- package/lib/FactBox/FactBox.js.map +1 -0
- package/lib/FactBox/index.js +7 -15
- package/lib/FactBox/index.js.map +1 -0
- package/lib/FileList/File.js +75 -105
- package/lib/FileList/File.js.map +1 -0
- package/lib/FileList/FileList.js +33 -52
- package/lib/FileList/FileList.js.map +1 -0
- package/lib/FileList/PdfFile.js +27 -55
- package/lib/FileList/PdfFile.js.map +1 -0
- package/lib/Gloss/Gloss.js +138 -176
- package/lib/Gloss/Gloss.js.map +1 -0
- package/lib/Gloss/GlossExample.js +45 -68
- package/lib/Gloss/GlossExample.js.map +1 -0
- package/lib/Grid/Grid.js +64 -98
- package/lib/Grid/Grid.js.map +1 -0
- package/lib/Grid/GridParallaxItem.js +19 -36
- package/lib/Grid/GridParallaxItem.js.map +1 -0
- package/lib/KeyFigure/KeyFigure.js +45 -68
- package/lib/KeyFigure/KeyFigure.js.map +1 -0
- package/lib/LicenseByline/EmbedByline.js +130 -216
- package/lib/LicenseByline/EmbedByline.js.map +1 -0
- package/lib/LicenseByline/LicenseLink.js +29 -59
- package/lib/LicenseByline/LicenseLink.js.map +1 -0
- package/lib/LinkBlock/LinkBlock.js +73 -108
- package/lib/LinkBlock/LinkBlock.js.map +1 -0
- package/lib/LinkBlock/LinkBlockSection.js +22 -39
- package/lib/LinkBlock/LinkBlockSection.js.map +1 -0
- package/lib/Pitch/Pitch.js +61 -89
- package/lib/Pitch/Pitch.js.map +1 -0
- package/lib/RelatedArticleList/RelatedArticleList.js +96 -140
- package/lib/RelatedArticleList/RelatedArticleList.js.map +1 -0
- package/lib/RelatedArticleList/index.js +7 -20
- package/lib/RelatedArticleList/index.js.map +1 -0
- package/lib/ResourceBox/ResourceBox.js +73 -104
- package/lib/ResourceBox/ResourceBox.js.map +1 -0
- package/lib/TagSelector/TagSelector.js +103 -145
- package/lib/TagSelector/TagSelector.js.map +1 -0
- package/lib/ZendeskButton/ZendeskButton.js +39 -58
- package/lib/ZendeskButton/ZendeskButton.js.map +1 -0
- package/lib/_virtual/rolldown_runtime.js +42 -0
- package/lib/i18n/formatNestedMessages.js +16 -30
- package/lib/i18n/formatNestedMessages.js.map +1 -0
- package/lib/i18n/i18n.js +28 -38
- package/lib/i18n/i18n.js.map +1 -0
- package/lib/i18n/useComponentTranslations.js +154 -215
- package/lib/i18n/useComponentTranslations.js.map +1 -0
- package/lib/index.js +156 -598
- package/lib/locale/messages-en.js +436 -466
- package/lib/locale/messages-en.js.map +1 -0
- package/lib/locale/messages-nb.js +436 -466
- package/lib/locale/messages-nb.js.map +1 -0
- package/lib/locale/messages-nn.js +436 -466
- package/lib/locale/messages-nn.js.map +1 -0
- package/lib/locale/messages-se.js +436 -466
- package/lib/locale/messages-se.js.map +1 -0
- package/lib/model/ContentType.js +90 -70
- package/lib/model/ContentType.js.map +1 -0
- package/lib/model/SubjectCategories.js +26 -14
- package/lib/model/SubjectCategories.js.map +1 -0
- package/lib/model/SubjectTypes.js +24 -13
- package/lib/model/SubjectTypes.js.map +1 -0
- package/lib/model/WordClass.js +55 -48
- package/lib/model/WordClass.js.map +1 -0
- package/lib/model/index.js +16 -25
- package/lib/model/index.js.map +1 -0
- package/lib/utils/licenseAttributes.js +14 -22
- package/lib/utils/licenseAttributes.js.map +1 -0
- package/lib/utils/relativeUrl.js +20 -38
- package/lib/utils/relativeUrl.js.map +1 -0
- package/package.json +12 -11
- package/es/Article/index.js +0 -11
- package/es/CampaignBlock/index.js +0 -9
- package/es/CodeBlock/index.js +0 -10
- package/es/ContactBlock/index.js +0 -9
- package/es/ContentTypeHero/index.js +0 -9
- package/es/Embed/index.js +0 -25
- package/es/Embed/types.js +0 -1
- package/es/FileList/index.js +0 -11
- package/es/Gloss/index.js +0 -10
- package/es/Grid/index.js +0 -10
- package/es/KeyFigure/index.js +0 -9
- package/es/LicenseByline/index.js +0 -10
- package/es/LinkBlock/index.js +0 -10
- package/es/Pitch/index.js +0 -9
- package/es/ResourceBox/index.js +0 -10
- package/es/i18n/index.js +0 -11
- package/es/types.js +0 -1
- package/lib/Article/index.js +0 -68
- package/lib/CampaignBlock/index.js +0 -13
- package/lib/CodeBlock/index.js +0 -20
- package/lib/ContactBlock/index.js +0 -18
- package/lib/ContentTypeHero/index.js +0 -12
- package/lib/Embed/index.js +0 -150
- package/lib/Embed/types.js +0 -5
- package/lib/FileList/index.js +0 -44
- package/lib/Gloss/index.js +0 -20
- package/lib/Grid/index.js +0 -19
- package/lib/KeyFigure/index.js +0 -13
- package/lib/LicenseByline/index.js +0 -19
- package/lib/LinkBlock/index.js +0 -20
- package/lib/Pitch/index.js +0 -12
- package/lib/ResourceBox/index.js +0 -13
- package/lib/i18n/index.js +0 -68
- package/lib/types.js +0 -5
package/lib/Concept/Concept.js
CHANGED
|
@@ -1,78 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_EmbedByline = require('../LicenseByline/EmbedByline.js');
|
|
3
|
+
const require_licenseAttributes = require('../utils/licenseAttributes.js');
|
|
4
|
+
const require_ImageEmbed = require('../Embed/ImageEmbed.js');
|
|
5
|
+
const require_H5pEmbed = require('../Embed/H5pEmbed.js');
|
|
6
|
+
const require_ExternalEmbed = require('../Embed/ExternalEmbed.js');
|
|
7
|
+
const require_IframeEmbed = require('../Embed/IframeEmbed.js');
|
|
8
|
+
const require_BrightcoveEmbed = require('../Embed/BrightcoveEmbed.js');
|
|
9
|
+
const react = require_rolldown_runtime.__toESM(require("react"));
|
|
10
|
+
const __ndla_primitives = require_rolldown_runtime.__toESM(require("@ndla/primitives"));
|
|
11
|
+
const __ndla_styled_system_jsx = require_rolldown_runtime.__toESM(require("@ndla/styled-system/jsx"));
|
|
12
|
+
const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
|
|
2
13
|
|
|
3
|
-
|
|
4
|
-
|
|
14
|
+
//#region src/Concept/Concept.tsx
|
|
15
|
+
const StyledFigure = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.Figure, { base: {
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexDirection: "column",
|
|
18
|
+
gap: "medium"
|
|
19
|
+
} });
|
|
20
|
+
const ContentWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: {
|
|
21
|
+
textStyle: "body.large",
|
|
22
|
+
display: "inline",
|
|
23
|
+
"& p": { display: "inline" }
|
|
24
|
+
} });
|
|
25
|
+
const Concept = (0, react.forwardRef)(({ copyright, visualElement, lang, children, title, source, previewAlt,...rest }, ref) => {
|
|
26
|
+
const licenseProps = require_licenseAttributes.licenseAttributes(copyright?.license?.license, lang, source);
|
|
27
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledFigure, {
|
|
28
|
+
ref,
|
|
29
|
+
...rest,
|
|
30
|
+
...licenseProps,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ContentWrapper, {
|
|
33
|
+
lang,
|
|
34
|
+
children: [!!title && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: title }), ` – `] }), children]
|
|
35
|
+
}),
|
|
36
|
+
visualElement?.resource === "image" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ImageEmbed.ImageEmbed_default, {
|
|
37
|
+
embed: visualElement,
|
|
38
|
+
lang,
|
|
39
|
+
previewAlt
|
|
40
|
+
}) : visualElement?.resource === "brightcove" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_BrightcoveEmbed.BrightcoveEmbed_default, { embed: visualElement }) : visualElement?.resource === "h5p" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_H5pEmbed.H5pEmbed_default, { embed: visualElement }) : visualElement?.resource === "iframe" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IframeEmbed.IframeEmbed_default, { embed: visualElement }) : visualElement?.resource === "external" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ExternalEmbed.ExternalEmbed_default, { embed: visualElement }) : null,
|
|
41
|
+
!!copyright && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_EmbedByline.EmbedByline, {
|
|
42
|
+
copyright,
|
|
43
|
+
type: "concept"
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
5
47
|
});
|
|
6
|
-
exports.Concept = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _primitives = require("@ndla/primitives");
|
|
9
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
10
|
-
var _Embed = require("../Embed");
|
|
11
|
-
var _EmbedByline = require("../LicenseByline/EmbedByline");
|
|
12
|
-
var _licenseAttributes = require("../utils/licenseAttributes");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
/**
|
|
15
|
-
* Copyright (c) 2024-present, NDLA.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
18
|
-
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
48
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
flexDirection: "column",
|
|
26
|
-
gap: "medium"
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
const ContentWrapper = (0, _jsx2.styled)("div", {
|
|
30
|
-
base: {
|
|
31
|
-
textStyle: "body.large",
|
|
32
|
-
display: "inline",
|
|
33
|
-
"& p": {
|
|
34
|
-
display: "inline"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const Concept = exports.Concept = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
39
|
-
let {
|
|
40
|
-
copyright,
|
|
41
|
-
visualElement,
|
|
42
|
-
lang,
|
|
43
|
-
children,
|
|
44
|
-
title,
|
|
45
|
-
source,
|
|
46
|
-
previewAlt,
|
|
47
|
-
...rest
|
|
48
|
-
} = _ref;
|
|
49
|
-
const licenseProps = (0, _licenseAttributes.licenseAttributes)(copyright?.license?.license, lang, source);
|
|
50
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledFigure, {
|
|
51
|
-
ref: ref,
|
|
52
|
-
...rest,
|
|
53
|
-
...licenseProps,
|
|
54
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentWrapper, {
|
|
55
|
-
lang: lang,
|
|
56
|
-
children: [!!title && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
57
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("b", {
|
|
58
|
-
children: title
|
|
59
|
-
}), ` – `]
|
|
60
|
-
}), children]
|
|
61
|
-
}), visualElement?.resource === "image" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.ImageEmbed, {
|
|
62
|
-
embed: visualElement,
|
|
63
|
-
lang: lang,
|
|
64
|
-
previewAlt: previewAlt
|
|
65
|
-
}) : visualElement?.resource === "brightcove" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.BrightcoveEmbed, {
|
|
66
|
-
embed: visualElement
|
|
67
|
-
}) : visualElement?.resource === "h5p" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.H5pEmbed, {
|
|
68
|
-
embed: visualElement
|
|
69
|
-
}) : visualElement?.resource === "iframe" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.IframeEmbed, {
|
|
70
|
-
embed: visualElement
|
|
71
|
-
}) : visualElement?.resource === "external" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.ExternalEmbed, {
|
|
72
|
-
embed: visualElement
|
|
73
|
-
}) : null, !!copyright && /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmbedByline.EmbedByline, {
|
|
74
|
-
copyright: copyright,
|
|
75
|
-
type: "concept"
|
|
76
|
-
})]
|
|
77
|
-
});
|
|
78
|
-
});
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.Concept = Concept;
|
|
51
|
+
//# sourceMappingURL=Concept.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Concept.js","names":["Figure","ImageEmbed","BrightcoveEmbed","H5pEmbed","IframeEmbed","ExternalEmbed","EmbedByline"],"sources":["../../src/Concept/Concept.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type ComponentPropsWithRef, type ReactNode, forwardRef } from \"react\";\nimport { Figure } from \"@ndla/primitives\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { IDraftCopyrightDTO as ConceptCopyright } from \"@ndla/types-backend/concept-api\";\nimport type { ConceptVisualElementMeta } from \"@ndla/types-embed\";\nimport { BrightcoveEmbed, ExternalEmbed, H5pEmbed, IframeEmbed, ImageEmbed } from \"../Embed\";\nimport { EmbedByline } from \"../LicenseByline/EmbedByline\";\nimport { licenseAttributes } from \"../utils/licenseAttributes\";\n\nexport interface ConceptProps extends ComponentPropsWithRef<\"figure\"> {\n copyright?: ConceptCopyright;\n visualElement?: ConceptVisualElementMeta;\n lang?: string;\n title?: string;\n children?: ReactNode;\n source?: string;\n previewAlt?: boolean;\n}\n\nconst StyledFigure = styled(Figure, {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"medium\",\n },\n});\n\nconst ContentWrapper = styled(\"div\", {\n base: {\n textStyle: \"body.large\",\n display: \"inline\",\n \"& p\": {\n display: \"inline\",\n },\n },\n});\n\nexport const Concept = forwardRef<HTMLElement, ConceptProps>(\n ({ copyright, visualElement, lang, children, title, source, previewAlt, ...rest }, ref) => {\n const licenseProps = licenseAttributes(copyright?.license?.license, lang, source);\n\n return (\n <StyledFigure ref={ref} {...rest} {...licenseProps}>\n <ContentWrapper lang={lang}>\n {!!title && (\n <>\n <b>{title}</b>\n {` – `}\n </>\n )}\n {children}\n </ContentWrapper>\n {visualElement?.resource === \"image\" ? (\n <ImageEmbed embed={visualElement} lang={lang} previewAlt={previewAlt} />\n ) : visualElement?.resource === \"brightcove\" ? (\n <BrightcoveEmbed embed={visualElement} />\n ) : visualElement?.resource === \"h5p\" ? (\n <H5pEmbed embed={visualElement} />\n ) : visualElement?.resource === \"iframe\" ? (\n <IframeEmbed embed={visualElement} />\n ) : visualElement?.resource === \"external\" ? (\n <ExternalEmbed embed={visualElement} />\n ) : null}\n {!!copyright && <EmbedByline copyright={copyright} type=\"concept\" />}\n </StyledFigure>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;;AA2BA,MAAM,eAAe,qCAAOA,0BAAQ,EAClC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,KAAK;AACN,EACF,EAAC;AAEF,MAAM,iBAAiB,qCAAO,OAAO,EACnC,MAAM;CACJ,WAAW;CACX,SAAS;CACT,OAAO,EACL,SAAS,SACV;AACF,EACF,EAAC;AAEF,MAAa,UAAU,sBACrB,CAAC,EAAE,WAAW,eAAe,MAAM,UAAU,OAAO,QAAQ,WAAY,GAAG,MAAM,EAAE,QAAQ;CACzF,MAAM,eAAe,4CAAkB,WAAW,SAAS,SAAS,MAAM,OAAO;AAEjF,wBACE,4BAAC;EAAkB;EAAK,GAAI;EAAM,GAAI;;mBACpC,4BAAC;IAAqB;iBACjB,yBACD,qFACE,2BAAC,iBAAG,QAAU,GACZ,QACD,EAEJ;KACc;GAChB,eAAe,aAAa,0BAC3B,2BAACC;IAAW,OAAO;IAAqB;IAAkB;KAAc,GACtE,eAAe,aAAa,+BAC9B,2BAACC,mDAAgB,OAAO,gBAAiB,GACvC,eAAe,aAAa,wBAC9B,2BAACC,qCAAS,OAAO,gBAAiB,GAChC,eAAe,aAAa,2BAC9B,2BAACC,2CAAY,OAAO,gBAAiB,GACnC,eAAe,aAAa,6BAC9B,2BAACC,+CAAc,OAAO,gBAAiB,GACrC;KACD,6BAAa,2BAACC;IAAuB;IAAW,MAAK;KAAY;;GACvD;AAElB,EACF"}
|
|
@@ -1,206 +1,147 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _reactI18next = require("react-i18next");
|
|
8
|
-
var _primitives = require("@ndla/primitives");
|
|
9
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
10
|
-
var _EmbedByline = require("../LicenseByline/EmbedByline");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
/**
|
|
13
|
-
* Copyright (c) 2024-present, NDLA.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_EmbedByline = require('../LicenseByline/EmbedByline.js');
|
|
3
|
+
const __ndla_primitives = require_rolldown_runtime.__toESM(require("@ndla/primitives"));
|
|
4
|
+
const __ndla_styled_system_jsx = require_rolldown_runtime.__toESM(require("@ndla/styled-system/jsx"));
|
|
5
|
+
const react_i18next = require_rolldown_runtime.__toESM(require("react-i18next"));
|
|
6
|
+
const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
|
|
19
7
|
|
|
8
|
+
//#region src/ContactBlock/ContactBlock.tsx
|
|
20
9
|
const BackgroundVariant = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
moderate: {
|
|
27
|
-
_before: {
|
|
28
|
-
backgroundColor: "surface.brand.3.moderate"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
subtle: {
|
|
32
|
-
_before: {
|
|
33
|
-
backgroundColor: "surface.brand.3.subtle"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
10
|
+
strong: { _before: { backgroundColor: "surface.brand.3" } },
|
|
11
|
+
moderate: { _before: { backgroundColor: "surface.brand.3.moderate" } },
|
|
12
|
+
subtle: { _before: { backgroundColor: "surface.brand.3.subtle" } }
|
|
36
13
|
};
|
|
37
|
-
const contactBlockBackgrounds =
|
|
38
|
-
const StyledWrapper = (0,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
transform: "rotate(-4deg)",
|
|
89
|
-
zIndex: "hide"
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
variants: {
|
|
93
|
-
variant: BackgroundVariant,
|
|
94
|
-
imageExists: {
|
|
95
|
-
true: {
|
|
96
|
-
tabletDown: {
|
|
97
|
-
_before: {
|
|
98
|
-
display: "none"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
14
|
+
const contactBlockBackgrounds = Object.keys(BackgroundVariant);
|
|
15
|
+
const StyledWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: {
|
|
16
|
+
display: "flex",
|
|
17
|
+
minWidth: "surface.xxsmall",
|
|
18
|
+
padding: "medium",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
justifyContent: "space-between",
|
|
21
|
+
boxShadow: "full",
|
|
22
|
+
border: "1px solid",
|
|
23
|
+
gap: "medium",
|
|
24
|
+
position: "relative",
|
|
25
|
+
borderColor: "stroke.default",
|
|
26
|
+
borderRadius: "xsmall",
|
|
27
|
+
overflow: "hidden",
|
|
28
|
+
background: "surface.default",
|
|
29
|
+
flexDirection: "column-reverse",
|
|
30
|
+
tablet: {
|
|
31
|
+
alignItems: "unset",
|
|
32
|
+
flexDirection: "row"
|
|
33
|
+
}
|
|
34
|
+
} });
|
|
35
|
+
const EmailLink = (0, __ndla_styled_system_jsx.styled)("a", { base: {
|
|
36
|
+
color: "text.default",
|
|
37
|
+
textDecoration: "underline",
|
|
38
|
+
_hover: { textDecoration: "none" },
|
|
39
|
+
_focusVisible: { textDecoration: "none" }
|
|
40
|
+
} });
|
|
41
|
+
const HeaderWrapper = (0, __ndla_styled_system_jsx.styled)("div", {
|
|
42
|
+
base: {
|
|
43
|
+
position: "relative",
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexDirection: "column",
|
|
46
|
+
gap: "3xsmall",
|
|
47
|
+
zIndex: "base",
|
|
48
|
+
_before: {
|
|
49
|
+
content: "\"\"",
|
|
50
|
+
position: "absolute",
|
|
51
|
+
top: "-60px",
|
|
52
|
+
left: "-50px",
|
|
53
|
+
right: "0",
|
|
54
|
+
bottom: "0",
|
|
55
|
+
height: "calc(100% + 50px)",
|
|
56
|
+
width: "surface.3xlarge",
|
|
57
|
+
transform: "rotate(-4deg)",
|
|
58
|
+
zIndex: "hide"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
variants: {
|
|
62
|
+
variant: BackgroundVariant,
|
|
63
|
+
imageExists: { true: { tabletDown: { _before: { display: "none" } } } }
|
|
64
|
+
}
|
|
104
65
|
});
|
|
105
|
-
const ImageWrapper = (0,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
variants: {
|
|
129
|
-
variant: BackgroundVariant
|
|
130
|
-
}
|
|
66
|
+
const ImageWrapper = (0, __ndla_styled_system_jsx.styled)("div", {
|
|
67
|
+
base: {
|
|
68
|
+
display: "flex",
|
|
69
|
+
gap: "xxsmall",
|
|
70
|
+
alignItems: "flex-start",
|
|
71
|
+
justifyContent: "flex-start",
|
|
72
|
+
flexDirection: "column",
|
|
73
|
+
zIndex: "base",
|
|
74
|
+
tabletDown: { _before: {
|
|
75
|
+
content: "\"\"",
|
|
76
|
+
position: "absolute",
|
|
77
|
+
top: "-50px",
|
|
78
|
+
left: "-50px",
|
|
79
|
+
right: "0",
|
|
80
|
+
bottom: "0",
|
|
81
|
+
height: "surface.xxsmall",
|
|
82
|
+
width: "surface.3xlarge",
|
|
83
|
+
transform: "rotate(-4deg)",
|
|
84
|
+
zIndex: "hide"
|
|
85
|
+
} }
|
|
86
|
+
},
|
|
87
|
+
variants: { variant: BackgroundVariant }
|
|
131
88
|
});
|
|
132
|
-
const StyledImage = (0,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
children: email
|
|
186
|
-
})]
|
|
187
|
-
})]
|
|
188
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledDescription, {
|
|
189
|
-
textStyle: "body.large",
|
|
190
|
-
children: description
|
|
191
|
-
})]
|
|
192
|
-
}), !!image && /*#__PURE__*/(0, _jsxRuntime.jsxs)(ImageWrapper, {
|
|
193
|
-
variant: backgroundColor,
|
|
194
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledImage, {
|
|
195
|
-
alt: embedAlt !== undefined ? embedAlt : image.alttext.alttext,
|
|
196
|
-
src: image.image.imageUrl,
|
|
197
|
-
width: 300,
|
|
198
|
-
height: 300
|
|
199
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmbedByline.LicenseContainerContent, {
|
|
200
|
-
type: "image",
|
|
201
|
-
copyright: image.copyright
|
|
202
|
-
})]
|
|
203
|
-
})]
|
|
204
|
-
});
|
|
89
|
+
const StyledImage = (0, __ndla_styled_system_jsx.styled)("img", { base: {
|
|
90
|
+
borderRadius: "xsmall",
|
|
91
|
+
width: "surface.xsmall",
|
|
92
|
+
height: "surface.xsmall",
|
|
93
|
+
objectFit: "cover"
|
|
94
|
+
} });
|
|
95
|
+
const ContentWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: {
|
|
96
|
+
display: "flex",
|
|
97
|
+
flexDirection: "column",
|
|
98
|
+
gap: "medium",
|
|
99
|
+
flex: "1",
|
|
100
|
+
width: "100%"
|
|
101
|
+
} });
|
|
102
|
+
const StyledDescription = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.Text, { base: { fontFamily: "serif" } });
|
|
103
|
+
const ContactBlock = ({ image, jobTitle, description, name, email, embedAlt, lang, backgroundColor = "strong" }) => {
|
|
104
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
105
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledWrapper, {
|
|
106
|
+
"data-embed-type": "contact-block",
|
|
107
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ContentWrapper, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HeaderWrapper, {
|
|
108
|
+
variant: backgroundColor,
|
|
109
|
+
imageExists: !!image,
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
|
|
112
|
+
lang,
|
|
113
|
+
fontWeight: "bold",
|
|
114
|
+
textStyle: "heading.small",
|
|
115
|
+
children: name
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
|
|
118
|
+
lang,
|
|
119
|
+
children: jobTitle
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__ndla_primitives.Text, { children: [`${t("email")}: `, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EmailLink, {
|
|
122
|
+
href: `mailto:${email}`,
|
|
123
|
+
children: email
|
|
124
|
+
})] })
|
|
125
|
+
]
|
|
126
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledDescription, {
|
|
127
|
+
textStyle: "body.large",
|
|
128
|
+
children: description
|
|
129
|
+
})] }), !!image && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ImageWrapper, {
|
|
130
|
+
variant: backgroundColor,
|
|
131
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledImage, {
|
|
132
|
+
alt: embedAlt !== void 0 ? embedAlt : image.alttext.alttext,
|
|
133
|
+
src: image.image.imageUrl,
|
|
134
|
+
width: 300,
|
|
135
|
+
height: 300
|
|
136
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_EmbedByline.LicenseContainerContent, {
|
|
137
|
+
type: "image",
|
|
138
|
+
copyright: image.copyright
|
|
139
|
+
})]
|
|
140
|
+
})]
|
|
141
|
+
});
|
|
205
142
|
};
|
|
206
|
-
|
|
143
|
+
|
|
144
|
+
//#endregion
|
|
145
|
+
exports.ContactBlock = ContactBlock;
|
|
146
|
+
exports.contactBlockBackgrounds = contactBlockBackgrounds;
|
|
147
|
+
//# sourceMappingURL=ContactBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactBlock.js","names":["BackgroundVariant: Record<ContactBlockBackground, SystemStyleObject>","Text","LicenseContainerContent"],"sources":["../../src/ContactBlock/ContactBlock.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useTranslation } from \"react-i18next\";\nimport { Text } from \"@ndla/primitives\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { SystemStyleObject } from \"@ndla/styled-system/types\";\nimport type { IImageMetaInformationV3DTO } from \"@ndla/types-backend/image-api\";\nimport { LicenseContainerContent } from \"../LicenseByline/EmbedByline\";\n\nexport type ContactBlockBackground = \"strong\" | \"moderate\" | \"subtle\";\n\nconst BackgroundVariant: Record<ContactBlockBackground, SystemStyleObject> = {\n strong: { _before: { backgroundColor: \"surface.brand.3\" } },\n moderate: { _before: { backgroundColor: \"surface.brand.3.moderate\" } },\n subtle: { _before: { backgroundColor: \"surface.brand.3.subtle\" } },\n};\n\nexport const contactBlockBackgrounds = Object.keys(BackgroundVariant) as ContactBlockBackground[];\n\nconst StyledWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n minWidth: \"surface.xxsmall\",\n padding: \"medium\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n boxShadow: \"full\",\n border: \"1px solid\",\n gap: \"medium\",\n position: \"relative\",\n borderColor: \"stroke.default\",\n borderRadius: \"xsmall\",\n overflow: \"hidden\",\n background: \"surface.default\",\n flexDirection: \"column-reverse\",\n tablet: {\n alignItems: \"unset\",\n flexDirection: \"row\",\n },\n },\n});\n\nconst EmailLink = styled(\"a\", {\n base: {\n color: \"text.default\",\n textDecoration: \"underline\",\n _hover: { textDecoration: \"none\" },\n _focusVisible: { textDecoration: \"none\" },\n },\n});\n\nconst HeaderWrapper = styled(\"div\", {\n base: {\n position: \"relative\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n zIndex: \"base\",\n _before: {\n content: '\"\"',\n position: \"absolute\",\n top: \"-60px\",\n left: \"-50px\",\n right: \"0\",\n bottom: \"0\",\n height: \"calc(100% + 50px)\",\n width: \"surface.3xlarge\",\n transform: \"rotate(-4deg)\",\n zIndex: \"hide\",\n },\n },\n variants: {\n variant: BackgroundVariant,\n imageExists: {\n true: {\n tabletDown: {\n _before: {\n display: \"none\",\n },\n },\n },\n },\n },\n});\n\nconst ImageWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n gap: \"xxsmall\",\n alignItems: \"flex-start\",\n justifyContent: \"flex-start\",\n flexDirection: \"column\",\n zIndex: \"base\",\n tabletDown: {\n _before: {\n content: '\"\"',\n position: \"absolute\",\n top: \"-50px\",\n left: \"-50px\",\n right: \"0\",\n bottom: \"0\",\n height: \"surface.xxsmall\",\n width: \"surface.3xlarge\",\n transform: \"rotate(-4deg)\",\n zIndex: \"hide\",\n },\n },\n },\n variants: {\n variant: BackgroundVariant,\n },\n});\n\nconst StyledImage = styled(\"img\", {\n base: {\n borderRadius: \"xsmall\",\n width: \"surface.xsmall\",\n height: \"surface.xsmall\",\n objectFit: \"cover\",\n },\n});\n\nconst ContentWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"medium\",\n flex: \"1\",\n width: \"100%\",\n },\n});\n\nconst StyledDescription = styled(Text, {\n base: {\n fontFamily: \"serif\",\n },\n});\n\ninterface Props {\n image?: IImageMetaInformationV3DTO;\n jobTitle: string;\n description: string;\n backgroundColor?: ContactBlockBackground;\n imageWidth?: number;\n name: string;\n email: string;\n embedAlt?: string;\n lang?: string;\n}\n\nexport const ContactBlock = ({\n image,\n jobTitle,\n description,\n name,\n email,\n embedAlt,\n lang,\n backgroundColor = \"strong\",\n}: Props) => {\n const { t } = useTranslation();\n return (\n <StyledWrapper data-embed-type=\"contact-block\">\n <ContentWrapper>\n <HeaderWrapper variant={backgroundColor} imageExists={!!image}>\n <Text lang={lang} fontWeight=\"bold\" textStyle=\"heading.small\">\n {name}\n </Text>\n <Text lang={lang}>{jobTitle}</Text>\n <Text>\n {`${t(\"email\")}: `}\n <EmailLink href={`mailto:${email}`}>{email}</EmailLink>\n </Text>\n </HeaderWrapper>\n <StyledDescription textStyle=\"body.large\">{description}</StyledDescription>\n </ContentWrapper>\n {!!image && (\n <ImageWrapper variant={backgroundColor}>\n <StyledImage\n alt={embedAlt !== undefined ? embedAlt : image.alttext.alttext}\n src={image.image.imageUrl}\n width={300}\n height={300}\n />\n <LicenseContainerContent type=\"image\" copyright={image.copyright} />\n </ImageWrapper>\n )}\n </StyledWrapper>\n );\n};\n"],"mappings":";;;;;;;;AAiBA,MAAMA,oBAAuE;CAC3E,QAAQ,EAAE,SAAS,EAAE,iBAAiB,kBAAmB,EAAE;CAC3D,UAAU,EAAE,SAAS,EAAE,iBAAiB,2BAA4B,EAAE;CACtE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,yBAA0B,EAAE;AACnE;AAED,MAAa,0BAA0B,OAAO,KAAK,kBAAkB;AAErE,MAAM,gBAAgB,qCAAO,OAAO,EAClC,MAAM;CACJ,SAAS;CACT,UAAU;CACV,SAAS;CACT,YAAY;CACZ,gBAAgB;CAChB,WAAW;CACX,QAAQ;CACR,KAAK;CACL,UAAU;CACV,aAAa;CACb,cAAc;CACd,UAAU;CACV,YAAY;CACZ,eAAe;CACf,QAAQ;EACN,YAAY;EACZ,eAAe;CAChB;AACF,EACF,EAAC;AAEF,MAAM,YAAY,qCAAO,KAAK,EAC5B,MAAM;CACJ,OAAO;CACP,gBAAgB;CAChB,QAAQ,EAAE,gBAAgB,OAAQ;CAClC,eAAe,EAAE,gBAAgB,OAAQ;AAC1C,EACF,EAAC;AAEF,MAAM,gBAAgB,qCAAO,OAAO;CAClC,MAAM;EACJ,UAAU;EACV,SAAS;EACT,eAAe;EACf,KAAK;EACL,QAAQ;EACR,SAAS;GACP,SAAS;GACT,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,OAAO;GACP,WAAW;GACX,QAAQ;EACT;CACF;CACD,UAAU;EACR,SAAS;EACT,aAAa,EACX,MAAM,EACJ,YAAY,EACV,SAAS,EACP,SAAS,OACV,EACF,EACF,EACF;CACF;AACF,EAAC;AAEF,MAAM,eAAe,qCAAO,OAAO;CACjC,MAAM;EACJ,SAAS;EACT,KAAK;EACL,YAAY;EACZ,gBAAgB;EAChB,eAAe;EACf,QAAQ;EACR,YAAY,EACV,SAAS;GACP,SAAS;GACT,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,OAAO;GACP,WAAW;GACX,QAAQ;EACT,EACF;CACF;CACD,UAAU,EACR,SAAS,kBACV;AACF,EAAC;AAEF,MAAM,cAAc,qCAAO,OAAO,EAChC,MAAM;CACJ,cAAc;CACd,OAAO;CACP,QAAQ;CACR,WAAW;AACZ,EACF,EAAC;AAEF,MAAM,iBAAiB,qCAAO,OAAO,EACnC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,KAAK;CACL,MAAM;CACN,OAAO;AACR,EACF,EAAC;AAEF,MAAM,oBAAoB,qCAAOC,wBAAM,EACrC,MAAM,EACJ,YAAY,QACb,EACF,EAAC;AAcF,MAAa,eAAe,CAAC,EAC3B,OACA,UACA,aACA,MACA,OACA,UACA,MACA,kBAAkB,UACZ,KAAK;CACX,MAAM,EAAE,GAAG,GAAG,mCAAgB;AAC9B,wBACE,4BAAC;EAAc,mBAAgB;6BAC7B,4BAAC,6CACC,4BAAC;GAAc,SAAS;GAAiB,eAAe;;oBACtD,2BAACA;KAAW;KAAM,YAAW;KAAO,WAAU;eAC3C;MACI;oBACP,2BAACA;KAAW;eAAO;MAAgB;oBACnC,4BAACA,sCACG,EAAE,EAAE,QAAQ,CAAC,qBACf,2BAAC;KAAU,OAAO,SAAS,MAAM;eAAI;MAAkB,IAClD;;IACO,kBAChB,2BAAC;GAAkB,WAAU;aAAc;IAAgC,IAC5D,IACd,yBACD,4BAAC;GAAa,SAAS;8BACrB,2BAAC;IACC,KAAK,sBAAyB,WAAW,MAAM,QAAQ;IACvD,KAAK,MAAM,MAAM;IACjB,OAAO;IACP,QAAQ;KACR,kBACF,2BAACC;IAAwB,MAAK;IAAQ,WAAW,MAAM;KAAa;IACvD;GAEH;AAEnB"}
|
|
@@ -1,57 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_ContentType = require('../model/ContentType.js');
|
|
3
|
+
const react = require_rolldown_runtime.__toESM(require("react"));
|
|
4
|
+
const __ndla_primitives = require_rolldown_runtime.__toESM(require("@ndla/primitives"));
|
|
5
|
+
const react_i18next = require_rolldown_runtime.__toESM(require("react-i18next"));
|
|
6
|
+
const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
|
|
8
|
+
//#region src/ContentTypeBadge/ContentTypeBadge.tsx
|
|
9
|
+
const contentTypeToBadgeVariantMap = {
|
|
10
|
+
[require_ContentType.SUBJECT_MATERIAL]: "brand1",
|
|
11
|
+
[require_ContentType.TASKS_AND_ACTIVITIES]: "brand2",
|
|
12
|
+
[require_ContentType.ASSESSMENT_RESOURCES]: "brand2",
|
|
13
|
+
[require_ContentType.SUBJECT]: "neutral",
|
|
14
|
+
[require_ContentType.SOURCE_MATERIAL]: "brand1",
|
|
15
|
+
[require_ContentType.LEARNING_PATH]: "brand3",
|
|
16
|
+
[require_ContentType.TOPIC]: "neutral",
|
|
17
|
+
[require_ContentType.MULTIDISCIPLINARY]: "neutral",
|
|
18
|
+
[require_ContentType.CONCEPT]: "brand1",
|
|
19
|
+
[require_ContentType.EXTERNAL]: "brand2",
|
|
20
|
+
[require_ContentType.IMAGE]: "brand1",
|
|
21
|
+
[require_ContentType.AUDIO]: "brand1",
|
|
22
|
+
[require_ContentType.PODCAST]: "brand1",
|
|
23
|
+
[require_ContentType.VIDEO]: "brand1",
|
|
24
|
+
[require_ContentType.MISSING]: "neutral",
|
|
25
|
+
[require_ContentType.PODCAST_SERIES]: "brand1",
|
|
26
|
+
[require_ContentType.GLOSS]: "brand1",
|
|
27
|
+
[require_ContentType.PROGRAMME]: "neutral",
|
|
28
|
+
[require_ContentType.FRONTPAGE_ARTICLE]: "brand2"
|
|
29
|
+
};
|
|
30
|
+
const ContentTypeBadge = (0, react.forwardRef)(({ contentType, children,...props }, ref) => {
|
|
31
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
32
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Badge, {
|
|
33
|
+
colorTheme: contentTypeToBadgeVariantMap[contentType ?? "missing"] ?? contentTypeToBadgeVariantMap["missing"],
|
|
34
|
+
...props,
|
|
35
|
+
ref,
|
|
36
|
+
children: children ?? t(`contentTypes.${contentType}`)
|
|
37
|
+
});
|
|
5
38
|
});
|
|
6
|
-
exports.contentTypeToBadgeVariantMap = exports.ContentTypeBadge = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactI18next = require("react-i18next");
|
|
9
|
-
var _primitives = require("@ndla/primitives");
|
|
10
|
-
var contentTypes = _interopRequireWildcard(require("../model/ContentType"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
-
/**
|
|
14
|
-
* Copyright (c) 2024-present, NDLA.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
39
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
[contentTypes.SUBJECT]: "neutral",
|
|
26
|
-
[contentTypes.SOURCE_MATERIAL]: "brand1",
|
|
27
|
-
[contentTypes.LEARNING_PATH]: "brand3",
|
|
28
|
-
[contentTypes.TOPIC]: "neutral",
|
|
29
|
-
[contentTypes.MULTIDISCIPLINARY]: "neutral",
|
|
30
|
-
[contentTypes.CONCEPT]: "brand1",
|
|
31
|
-
[contentTypes.EXTERNAL]: "brand2",
|
|
32
|
-
[contentTypes.IMAGE]: "brand1",
|
|
33
|
-
[contentTypes.AUDIO]: "brand1",
|
|
34
|
-
[contentTypes.PODCAST]: "brand1",
|
|
35
|
-
[contentTypes.VIDEO]: "brand1",
|
|
36
|
-
[contentTypes.MISSING]: "neutral",
|
|
37
|
-
[contentTypes.PODCAST_SERIES]: "brand1",
|
|
38
|
-
[contentTypes.GLOSS]: "brand1",
|
|
39
|
-
[contentTypes.PROGRAMME]: "neutral",
|
|
40
|
-
[contentTypes.FRONTPAGE_ARTICLE]: "brand2"
|
|
41
|
-
};
|
|
42
|
-
const ContentTypeBadge = exports.ContentTypeBadge = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
43
|
-
let {
|
|
44
|
-
contentType,
|
|
45
|
-
children,
|
|
46
|
-
...props
|
|
47
|
-
} = _ref;
|
|
48
|
-
const {
|
|
49
|
-
t
|
|
50
|
-
} = (0, _reactI18next.useTranslation)();
|
|
51
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Badge, {
|
|
52
|
-
colorTheme: contentTypeToBadgeVariantMap[contentType ?? "missing"] ?? contentTypeToBadgeVariantMap["missing"],
|
|
53
|
-
...props,
|
|
54
|
-
ref: ref,
|
|
55
|
-
children: children ?? t(`contentTypes.${contentType}`)
|
|
56
|
-
});
|
|
57
|
-
});
|
|
40
|
+
//#endregion
|
|
41
|
+
exports.ContentTypeBadge = ContentTypeBadge;
|
|
42
|
+
exports.contentTypeToBadgeVariantMap = contentTypeToBadgeVariantMap;
|
|
43
|
+
//# sourceMappingURL=ContentTypeBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentTypeBadge.js","names":["contentTypeToBadgeVariantMap: Record<ContentType, BadgeVariant>","Badge"],"sources":["../../src/ContentTypeBadge/ContentTypeBadge.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { forwardRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Badge, type BadgeProps, type BadgeVariant } from \"@ndla/primitives\";\nimport * as contentTypes from \"../model/ContentType\";\n\nexport interface ContentTypeBadgeProps extends Omit<BadgeProps, \"colorTheme\"> {\n contentType: ContentType | undefined;\n}\n\nexport type StrictContentType =\n | typeof contentTypes.SUBJECT_MATERIAL\n | typeof contentTypes.TASKS_AND_ACTIVITIES\n | typeof contentTypes.ASSESSMENT_RESOURCES\n | typeof contentTypes.SUBJECT\n | typeof contentTypes.SOURCE_MATERIAL\n | typeof contentTypes.LEARNING_PATH\n | typeof contentTypes.TOPIC\n | typeof contentTypes.MULTIDISCIPLINARY\n | typeof contentTypes.CONCEPT\n | typeof contentTypes.EXTERNAL\n | typeof contentTypes.IMAGE\n | typeof contentTypes.AUDIO\n | typeof contentTypes.VIDEO\n | typeof contentTypes.MISSING\n | typeof contentTypes.PODCAST\n | typeof contentTypes.GLOSS\n | typeof contentTypes.PROGRAMME\n | typeof contentTypes.PODCAST_SERIES\n | typeof contentTypes.FRONTPAGE_ARTICLE;\n\nexport type ContentType =\n | StrictContentType\n // This allows for us to fallback to string without getting a ts error, while still keeping intellisense\n | (string & {});\n\nexport const contentTypeToBadgeVariantMap: Record<ContentType, BadgeVariant> = {\n [contentTypes.SUBJECT_MATERIAL]: \"brand1\",\n [contentTypes.TASKS_AND_ACTIVITIES]: \"brand2\",\n [contentTypes.ASSESSMENT_RESOURCES]: \"brand2\",\n [contentTypes.SUBJECT]: \"neutral\",\n [contentTypes.SOURCE_MATERIAL]: \"brand1\",\n [contentTypes.LEARNING_PATH]: \"brand3\",\n [contentTypes.TOPIC]: \"neutral\",\n [contentTypes.MULTIDISCIPLINARY]: \"neutral\",\n [contentTypes.CONCEPT]: \"brand1\",\n [contentTypes.EXTERNAL]: \"brand2\",\n [contentTypes.IMAGE]: \"brand1\",\n [contentTypes.AUDIO]: \"brand1\",\n [contentTypes.PODCAST]: \"brand1\",\n [contentTypes.VIDEO]: \"brand1\",\n [contentTypes.MISSING]: \"neutral\",\n [contentTypes.PODCAST_SERIES]: \"brand1\",\n [contentTypes.GLOSS]: \"brand1\",\n [contentTypes.PROGRAMME]: \"neutral\",\n [contentTypes.FRONTPAGE_ARTICLE]: \"brand2\",\n};\n\nexport const ContentTypeBadge = forwardRef<HTMLDivElement, ContentTypeBadgeProps>(\n ({ contentType, children, ...props }, ref) => {\n const { t } = useTranslation();\n return (\n <Badge\n colorTheme={contentTypeToBadgeVariantMap[contentType ?? \"missing\"] ?? contentTypeToBadgeVariantMap[\"missing\"]}\n {...props}\n ref={ref}\n >\n {children ?? t(`contentTypes.${contentType}`)}\n </Badge>\n );\n },\n);\n"],"mappings":";;;;;;;;AA2CA,MAAaA,+BAAkE;yCAC5C;6CACI;6CACA;gCACb;wCACQ;sCACF;8BACR;0CACY;gCACV;iCACC;8BACH;8BACA;gCACE;8BACF;gCACE;uCACO;8BACT;kCACI;0CACQ;AACnC;AAED,MAAa,mBAAmB,sBAC9B,CAAC,EAAE,aAAa,SAAU,GAAG,OAAO,EAAE,QAAQ;CAC5C,MAAM,EAAE,GAAG,GAAG,mCAAgB;AAC9B,wBACE,2BAACC;EACC,YAAY,6BAA6B,eAAe,cAAc,6BAA6B;EACnG,GAAI;EACC;YAEJ,YAAY,GAAG,eAAe,YAAY,EAAE;GACvC;AAEX,EACF"}
|