@ndla/ui 56.0.121-alpha.0 → 56.0.122-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.
Files changed (206) hide show
  1. package/lib/i18n/index.d.ts +1 -1
  2. package/lib/i18n/useComponentTranslations.d.ts +2 -1
  3. package/lib/index.d.ts +1 -1
  4. package/lib/locale/messages-en.d.ts +34 -0
  5. package/lib/locale/messages-nb.d.ts +34 -0
  6. package/lib/locale/messages-nn.d.ts +34 -0
  7. package/lib/locale/messages-se.d.ts +34 -0
  8. package/package.json +6 -5
  9. package/src/Article/ArticleByline.tsx +1 -1
  10. package/src/i18n/index.ts +1 -0
  11. package/src/i18n/useComponentTranslations.ts +36 -1
  12. package/src/index.ts +1 -0
  13. package/src/locale/messages-en.ts +34 -0
  14. package/src/locale/messages-nb.ts +34 -0
  15. package/src/locale/messages-nn.ts +34 -0
  16. package/src/locale/messages-se.ts +34 -0
  17. package/es/Article/Article.js +0 -199
  18. package/es/Article/ArticleByline.js +0 -182
  19. package/es/Article/ArticleFootNotes.js +0 -60
  20. package/es/Article/index.js +0 -11
  21. package/es/AudioPlayer/AudioPlayer.js +0 -218
  22. package/es/AudioPlayer/Controls.js +0 -332
  23. package/es/AudioPlayer/SpeechControl.js +0 -56
  24. package/es/AudioPlayer/index.js +0 -10
  25. package/es/Breadcrumb/Breadcrumb.js +0 -60
  26. package/es/Breadcrumb/BreadcrumbItem.js +0 -62
  27. package/es/Breadcrumb/HomeBreadcrumb.js +0 -77
  28. package/es/Breadcrumb/index.js +0 -11
  29. package/es/CampaignBlock/CampaignBlock.js +0 -180
  30. package/es/CampaignBlock/index.js +0 -9
  31. package/es/CodeBlock/CodeBlock.js +0 -35
  32. package/es/CodeBlock/codeLanguageOptions.js +0 -84
  33. package/es/CodeBlock/index.js +0 -10
  34. package/es/Concept/Concept.js +0 -72
  35. package/es/ContactBlock/ContactBlock.js +0 -199
  36. package/es/ContactBlock/index.js +0 -9
  37. package/es/ContentTypeBadge/ContentTypeBadge.js +0 -50
  38. package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -32
  39. package/es/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -32
  40. package/es/ContentTypeHero/ContentTypeHero.js +0 -50
  41. package/es/ContentTypeHero/index.js +0 -9
  42. package/es/CopyParagraphButton/CopyParagraphButton.js +0 -83
  43. package/es/CopyParagraphButton/index.js +0 -11
  44. package/es/Embed/AudioEmbed.js +0 -76
  45. package/es/Embed/BrightcoveEmbed.js +0 -133
  46. package/es/Embed/CodeEmbed.js +0 -79
  47. package/es/Embed/ConceptEmbed.js +0 -123
  48. package/es/Embed/ConceptInlineTriggerButton.js +0 -45
  49. package/es/Embed/ContentLinkEmbed.js +0 -51
  50. package/es/Embed/CopyrightEmbed.js +0 -33
  51. package/es/Embed/EmbedErrorPlaceholder.js +0 -58
  52. package/es/Embed/EmbedWrapper.js +0 -51
  53. package/es/Embed/ExternalEmbed.js +0 -74
  54. package/es/Embed/FootnoteEmbed.js +0 -44
  55. package/es/Embed/GlossEmbed.js +0 -80
  56. package/es/Embed/H5pEmbed.js +0 -61
  57. package/es/Embed/IframeEmbed.js +0 -93
  58. package/es/Embed/ImageEmbed.js +0 -238
  59. package/es/Embed/InlineTriggerButton.js +0 -37
  60. package/es/Embed/RelatedContentEmbed.js +0 -55
  61. package/es/Embed/UnknownEmbed.js +0 -31
  62. package/es/Embed/UuDisclaimerEmbed.js +0 -88
  63. package/es/Embed/index.js +0 -25
  64. package/es/Embed/types.js +0 -1
  65. package/es/ErrorMessage/ErrorMessage.js +0 -95
  66. package/es/ErrorMessage/index.js +0 -10
  67. package/es/FactBox/FactBox.js +0 -177
  68. package/es/FactBox/index.js +0 -10
  69. package/es/FileList/File.js +0 -101
  70. package/es/FileList/FileList.js +0 -47
  71. package/es/FileList/PdfFile.js +0 -50
  72. package/es/FileList/index.js +0 -11
  73. package/es/Gloss/Gloss.js +0 -175
  74. package/es/Gloss/GlossExample.js +0 -64
  75. package/es/Gloss/index.js +0 -10
  76. package/es/Grid/Grid.js +0 -94
  77. package/es/Grid/GridParallaxItem.js +0 -32
  78. package/es/Grid/index.js +0 -10
  79. package/es/KeyFigure/KeyFigure.js +0 -63
  80. package/es/KeyFigure/index.js +0 -9
  81. package/es/LicenseByline/EmbedByline.js +0 -212
  82. package/es/LicenseByline/LicenseLink.js +0 -56
  83. package/es/LicenseByline/index.js +0 -10
  84. package/es/LinkBlock/LinkBlock.js +0 -103
  85. package/es/LinkBlock/LinkBlockSection.js +0 -35
  86. package/es/LinkBlock/index.js +0 -10
  87. package/es/Pitch/Pitch.js +0 -83
  88. package/es/Pitch/index.js +0 -9
  89. package/es/RelatedArticleList/RelatedArticleList.js +0 -135
  90. package/es/RelatedArticleList/index.js +0 -11
  91. package/es/ResourceBox/ResourceBox.js +0 -99
  92. package/es/ResourceBox/index.js +0 -10
  93. package/es/TagSelector/TagSelector.js +0 -143
  94. package/es/ZendeskButton/ZendeskButton.js +0 -55
  95. package/es/i18n/formatNestedMessages.js +0 -25
  96. package/es/i18n/i18n.js +0 -35
  97. package/es/i18n/index.js +0 -11
  98. package/es/i18n/useComponentTranslations.js +0 -164
  99. package/es/index.js +0 -45
  100. package/es/locale/messages-en.js +0 -428
  101. package/es/locale/messages-nb.js +0 -428
  102. package/es/locale/messages-nn.js +0 -428
  103. package/es/locale/messages-se.js +0 -428
  104. package/es/model/ContentType.js +0 -68
  105. package/es/model/SubjectCategories.js +0 -12
  106. package/es/model/SubjectTypes.js +0 -11
  107. package/es/model/WordClass.js +0 -45
  108. package/es/model/index.js +0 -21
  109. package/es/types.js +0 -1
  110. package/es/utils/licenseAttributes.js +0 -18
  111. package/es/utils/relativeUrl.js +0 -37
  112. package/lib/Article/Article.js +0 -207
  113. package/lib/Article/ArticleByline.js +0 -189
  114. package/lib/Article/ArticleFootNotes.js +0 -67
  115. package/lib/Article/index.js +0 -68
  116. package/lib/AudioPlayer/AudioPlayer.js +0 -224
  117. package/lib/AudioPlayer/Controls.js +0 -338
  118. package/lib/AudioPlayer/SpeechControl.js +0 -62
  119. package/lib/AudioPlayer/index.js +0 -16
  120. package/lib/Breadcrumb/Breadcrumb.js +0 -67
  121. package/lib/Breadcrumb/BreadcrumbItem.js +0 -68
  122. package/lib/Breadcrumb/HomeBreadcrumb.js +0 -84
  123. package/lib/Breadcrumb/index.js +0 -23
  124. package/lib/CampaignBlock/CampaignBlock.js +0 -187
  125. package/lib/CampaignBlock/index.js +0 -13
  126. package/lib/CodeBlock/CodeBlock.js +0 -41
  127. package/lib/CodeBlock/codeLanguageOptions.js +0 -90
  128. package/lib/CodeBlock/index.js +0 -20
  129. package/lib/Concept/Concept.js +0 -78
  130. package/lib/ContactBlock/ContactBlock.js +0 -206
  131. package/lib/ContactBlock/index.js +0 -18
  132. package/lib/ContentTypeBadge/ContentTypeBadge.js +0 -57
  133. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -38
  134. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -38
  135. package/lib/ContentTypeHero/ContentTypeHero.js +0 -57
  136. package/lib/ContentTypeHero/index.js +0 -12
  137. package/lib/CopyParagraphButton/CopyParagraphButton.js +0 -89
  138. package/lib/CopyParagraphButton/index.js +0 -22
  139. package/lib/Embed/AudioEmbed.js +0 -84
  140. package/lib/Embed/BrightcoveEmbed.js +0 -142
  141. package/lib/Embed/CodeEmbed.js +0 -86
  142. package/lib/Embed/ConceptEmbed.js +0 -131
  143. package/lib/Embed/ConceptInlineTriggerButton.js +0 -51
  144. package/lib/Embed/ContentLinkEmbed.js +0 -57
  145. package/lib/Embed/CopyrightEmbed.js +0 -39
  146. package/lib/Embed/EmbedErrorPlaceholder.js +0 -64
  147. package/lib/Embed/EmbedWrapper.js +0 -57
  148. package/lib/Embed/ExternalEmbed.js +0 -81
  149. package/lib/Embed/FootnoteEmbed.js +0 -50
  150. package/lib/Embed/GlossEmbed.js +0 -88
  151. package/lib/Embed/H5pEmbed.js +0 -68
  152. package/lib/Embed/IframeEmbed.js +0 -100
  153. package/lib/Embed/ImageEmbed.js +0 -248
  154. package/lib/Embed/InlineTriggerButton.js +0 -43
  155. package/lib/Embed/RelatedContentEmbed.js +0 -61
  156. package/lib/Embed/UnknownEmbed.js +0 -37
  157. package/lib/Embed/UuDisclaimerEmbed.js +0 -94
  158. package/lib/Embed/index.js +0 -150
  159. package/lib/Embed/types.js +0 -5
  160. package/lib/ErrorMessage/ErrorMessage.js +0 -101
  161. package/lib/ErrorMessage/index.js +0 -16
  162. package/lib/FactBox/FactBox.js +0 -184
  163. package/lib/FactBox/index.js +0 -16
  164. package/lib/FileList/File.js +0 -108
  165. package/lib/FileList/FileList.js +0 -54
  166. package/lib/FileList/PdfFile.js +0 -57
  167. package/lib/FileList/index.js +0 -44
  168. package/lib/Gloss/Gloss.js +0 -181
  169. package/lib/Gloss/GlossExample.js +0 -70
  170. package/lib/Gloss/index.js +0 -20
  171. package/lib/Grid/Grid.js +0 -101
  172. package/lib/Grid/GridParallaxItem.js +0 -39
  173. package/lib/Grid/index.js +0 -19
  174. package/lib/KeyFigure/KeyFigure.js +0 -70
  175. package/lib/KeyFigure/index.js +0 -13
  176. package/lib/LicenseByline/EmbedByline.js +0 -220
  177. package/lib/LicenseByline/LicenseLink.js +0 -62
  178. package/lib/LicenseByline/index.js +0 -19
  179. package/lib/LinkBlock/LinkBlock.js +0 -110
  180. package/lib/LinkBlock/LinkBlockSection.js +0 -41
  181. package/lib/LinkBlock/index.js +0 -20
  182. package/lib/Pitch/Pitch.js +0 -91
  183. package/lib/Pitch/index.js +0 -12
  184. package/lib/RelatedArticleList/RelatedArticleList.js +0 -143
  185. package/lib/RelatedArticleList/index.js +0 -21
  186. package/lib/ResourceBox/ResourceBox.js +0 -106
  187. package/lib/ResourceBox/index.js +0 -13
  188. package/lib/TagSelector/TagSelector.js +0 -150
  189. package/lib/ZendeskButton/ZendeskButton.js +0 -61
  190. package/lib/i18n/formatNestedMessages.js +0 -32
  191. package/lib/i18n/i18n.js +0 -41
  192. package/lib/i18n/index.js +0 -62
  193. package/lib/i18n/useComponentTranslations.js +0 -176
  194. package/lib/index.js +0 -593
  195. package/lib/locale/messages-en.js +0 -435
  196. package/lib/locale/messages-nb.js +0 -435
  197. package/lib/locale/messages-nn.js +0 -435
  198. package/lib/locale/messages-se.js +0 -435
  199. package/lib/model/ContentType.js +0 -74
  200. package/lib/model/SubjectCategories.js +0 -18
  201. package/lib/model/SubjectTypes.js +0 -17
  202. package/lib/model/WordClass.js +0 -51
  203. package/lib/model/index.js +0 -28
  204. package/lib/types.js +0 -5
  205. package/lib/utils/licenseAttributes.js +0 -25
  206. package/lib/utils/relativeUrl.js +0 -44
@@ -1,180 +0,0 @@
1
- /**
2
- * Copyright (c) 2023-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import parse from "html-react-parser";
10
- import { ArrowRightLine } from "@ndla/icons";
11
- import { Text } from "@ndla/primitives";
12
- import { SafeLinkButton } from "@ndla/safelink";
13
- import { styled } from "@ndla/styled-system/jsx";
14
- import { getPossiblyRelativeUrl } from "../utils/relativeUrl";
15
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
- const Wrapper = styled("div", {
17
- base: {
18
- width: "100%",
19
- height: "100%",
20
- containerType: "inline-size"
21
- }
22
- });
23
- const Container = styled("div", {
24
- base: {
25
- display: "grid",
26
- gridTemplateColumns: "1fr",
27
- border: "1px solid",
28
- borderColor: "stroke.default",
29
- backgroundColor: "background.default",
30
- borderRadius: "xsmall",
31
- boxShadow: "full",
32
- overflow: "hidden"
33
- },
34
- variants: {
35
- imageSide: {
36
- left: {
37
- "@/tablet": {
38
- gridTemplateColumns: "minmax(230px, 455px) auto" //required for campaign block in myNdla
39
- },
40
- "@supports not (container-type: inline-size)": {
41
- tabletWide: {
42
- gridTemplateColumns: "minmax(230px, 455px) auto"
43
- }
44
- }
45
- },
46
- right: {
47
- "@/tablet": {
48
- gridTemplateColumns: "auto minmax(230px, 455px)" //required for campaign block in myNdla
49
- },
50
- "@supports not (container-type: inline-size)": {
51
- tabletWide: {
52
- gridTemplateColumns: "auto minmax(230px, 455px)"
53
- }
54
- }
55
- }
56
- },
57
- background: {
58
- neutral: {},
59
- brand1: {
60
- backgroundColor: "surface.brand.1"
61
- },
62
- brand3: {
63
- backgroundColor: "surface.brand.3"
64
- }
65
- }
66
- },
67
- defaultVariants: {
68
- imageSide: "left",
69
- background: "neutral"
70
- }
71
- });
72
- const StyledImg = styled("img", {
73
- base: {
74
- objectFit: "cover",
75
- width: "100%",
76
- height: "215px",
77
- "@/tablet": {
78
- height: "340px"
79
- },
80
- "@supports not (container-type: inline-size)": {
81
- tablet: {
82
- height: "265px"
83
- },
84
- tabletWide: {
85
- height: "340px"
86
- }
87
- },
88
- backgroundColor: "background.default"
89
- }
90
- });
91
- const ContentWrapper = styled("div", {
92
- base: {
93
- width: "100%",
94
- display: "flex",
95
- flexDirection: "column",
96
- gap: "medium",
97
- alignItems: "flex-start",
98
- justifyContent: "center",
99
- paddingBlock: "medium",
100
- paddingInline: "medium",
101
- position: "relative"
102
- }
103
- });
104
- const StyledText = styled(Text, {
105
- base: {
106
- tablet: {
107
- display: "block",
108
- overflow: "hidden",
109
- position: "relative",
110
- lineClamp: 4,
111
- boxOrient: "vertical"
112
- }
113
- }
114
- });
115
- const StyledSafeLinkButton = styled(SafeLinkButton, {
116
- base: {
117
- boxShadow: "full",
118
- border: "1px solid",
119
- borderColor: "stroke.default"
120
- }
121
- });
122
- const LinkButton = _ref => {
123
- let {
124
- url,
125
- children,
126
- path
127
- } = _ref;
128
- if (url) return /*#__PURE__*/_jsx(StyledSafeLinkButton, {
129
- to: getPossiblyRelativeUrl(url, path),
130
- variant: "secondary",
131
- rel: "noopener noreferrer",
132
- children: children
133
- });
134
- return children;
135
- };
136
- const CampaignBlock = _ref2 => {
137
- let {
138
- title,
139
- image,
140
- imageSide = "left",
141
- description,
142
- headingLevel: InternalHeading = "h2",
143
- url,
144
- path,
145
- className,
146
- background
147
- } = _ref2;
148
- const imageComponent = image && /*#__PURE__*/_jsx(StyledImg, {
149
- src: `${image.src}?width=455`,
150
- height: 340,
151
- width: 455,
152
- alt: image.alt
153
- });
154
- return /*#__PURE__*/_jsx(Wrapper, {
155
- children: /*#__PURE__*/_jsxs(Container, {
156
- className: className,
157
- "data-embed-type": "campaign-block",
158
- imageSide: imageSide,
159
- background: background,
160
- children: [imageSide === "left" && imageComponent, /*#__PURE__*/_jsxs(ContentWrapper, {
161
- children: [/*#__PURE__*/_jsx(Text, {
162
- asChild: true,
163
- consumeCss: true,
164
- textStyle: "heading.small",
165
- children: /*#__PURE__*/_jsx(InternalHeading, {
166
- children: parse(title)
167
- })
168
- }), /*#__PURE__*/_jsx(StyledText, {
169
- textStyle: "body.xlarge",
170
- children: parse(description)
171
- }), !!url?.url && /*#__PURE__*/_jsxs(LinkButton, {
172
- url: url.url,
173
- path: path,
174
- children: [parse(url.text ?? ""), /*#__PURE__*/_jsx(ArrowRightLine, {})]
175
- })]
176
- }), imageSide !== "left" && imageComponent]
177
- })
178
- });
179
- };
180
- export default CampaignBlock;
@@ -1,9 +0,0 @@
1
- /**
2
- * Copyright (c) 2023-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- export { default as CampaignBlock } from "./CampaignBlock";
@@ -1,35 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { forwardRef, useMemo } from "react";
10
- import { cx } from "@ndla/styled-system/css";
11
- import { styled } from "@ndla/styled-system/jsx";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- const Pre = styled("pre", {});
14
- export const Codeblock = /*#__PURE__*/forwardRef((_ref, ref) => {
15
- let {
16
- highlightedCode,
17
- format,
18
- className,
19
- ...props
20
- } = _ref;
21
- const codeWithLineNumbers = useMemo(() => {
22
- return highlightedCode.split("\n").map((line, i) => {
23
- return `<span class="linenumber">${i + 1}</span>${line}`;
24
- }).join("\n");
25
- }, [highlightedCode]);
26
- return /*#__PURE__*/_jsx(Pre, {
27
- className: cx("codeblock", `language-${format}`, className),
28
- ...props,
29
- dangerouslySetInnerHTML: {
30
- __html: codeWithLineNumbers
31
- },
32
- ref: ref
33
- });
34
- });
35
- export default Codeblock;
@@ -1,84 +0,0 @@
1
- /**
2
- * Copyright (c) 2019-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- export const codeLanguageOptions = [{
10
- title: "Bash",
11
- format: "bash"
12
- }, {
13
- title: "C",
14
- format: "c"
15
- }, {
16
- title: "CSharp",
17
- format: "csharp"
18
- }, {
19
- title: "CSS",
20
- format: "css"
21
- }, {
22
- title: "Diff",
23
- format: "diff"
24
- }, {
25
- title: "HTML",
26
- format: "markup"
27
- }, {
28
- title: "Ini",
29
- format: "ini"
30
- }, {
31
- title: "Java",
32
- format: "java"
33
- }, {
34
- title: "Javascript",
35
- format: "js"
36
- }, {
37
- title: "JSON",
38
- format: "json"
39
- }, {
40
- title: "JSX",
41
- format: "jsx"
42
- }, {
43
- title: "Kotlin",
44
- format: "kotlin"
45
- }, {
46
- title: "LUA",
47
- format: "lua"
48
- }, {
49
- title: "Markdown",
50
- format: "markdown"
51
- }, {
52
- title: "Matlab",
53
- format: "matlab"
54
- }, {
55
- title: "NSIS",
56
- format: "nsis"
57
- }, {
58
- title: "PHP",
59
- format: "php"
60
- }, {
61
- title: "Powershell",
62
- format: "powershell"
63
- }, {
64
- title: "Python",
65
- format: "python"
66
- }, {
67
- title: "Ruby",
68
- format: "ruby"
69
- }, {
70
- title: "Rust",
71
- format: "rust"
72
- }, {
73
- title: "SQL",
74
- format: "sql"
75
- }, {
76
- title: "Text",
77
- format: "text"
78
- }, {
79
- title: "VHDL",
80
- format: "vhdl"
81
- }, {
82
- title: "XML",
83
- format: "xml"
84
- }];
@@ -1,10 +0,0 @@
1
- /**
2
- * Copyright (c) 2024-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- export { default as CodeBlock } from "./CodeBlock";
10
- export { codeLanguageOptions } from "./codeLanguageOptions";
@@ -1,72 +0,0 @@
1
- /**
2
- * Copyright (c) 2024-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { forwardRef } from "react";
10
- import { Figure } from "@ndla/primitives";
11
- import { styled } from "@ndla/styled-system/jsx";
12
- import { BrightcoveEmbed, ExternalEmbed, H5pEmbed, IframeEmbed, ImageEmbed } from "../Embed";
13
- import { EmbedByline } from "../LicenseByline/EmbedByline";
14
- import { licenseAttributes } from "../utils/licenseAttributes";
15
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
16
- const StyledFigure = styled(Figure, {
17
- base: {
18
- display: "flex",
19
- flexDirection: "column",
20
- gap: "medium"
21
- }
22
- });
23
- const ContentWrapper = styled("div", {
24
- base: {
25
- textStyle: "body.large",
26
- display: "inline",
27
- "& p": {
28
- display: "inline"
29
- }
30
- }
31
- });
32
- export const Concept = /*#__PURE__*/forwardRef((_ref, ref) => {
33
- let {
34
- copyright,
35
- visualElement,
36
- lang,
37
- children,
38
- title,
39
- source,
40
- previewAlt,
41
- ...rest
42
- } = _ref;
43
- const licenseProps = licenseAttributes(copyright?.license?.license, lang, source);
44
- return /*#__PURE__*/_jsxs(StyledFigure, {
45
- ref: ref,
46
- ...rest,
47
- ...licenseProps,
48
- children: [/*#__PURE__*/_jsxs(ContentWrapper, {
49
- lang: lang,
50
- children: [!!title && /*#__PURE__*/_jsxs(_Fragment, {
51
- children: [/*#__PURE__*/_jsx("b", {
52
- children: title
53
- }), ` – `]
54
- }), children]
55
- }), visualElement?.resource === "image" ? /*#__PURE__*/_jsx(ImageEmbed, {
56
- embed: visualElement,
57
- lang: lang,
58
- previewAlt: previewAlt
59
- }) : visualElement?.resource === "brightcove" ? /*#__PURE__*/_jsx(BrightcoveEmbed, {
60
- embed: visualElement
61
- }) : visualElement?.resource === "h5p" ? /*#__PURE__*/_jsx(H5pEmbed, {
62
- embed: visualElement
63
- }) : visualElement?.resource === "iframe" ? /*#__PURE__*/_jsx(IframeEmbed, {
64
- embed: visualElement
65
- }) : visualElement?.resource === "external" ? /*#__PURE__*/_jsx(ExternalEmbed, {
66
- embed: visualElement
67
- }) : null, !!copyright && /*#__PURE__*/_jsx(EmbedByline, {
68
- copyright: copyright,
69
- type: "concept"
70
- })]
71
- });
72
- });
@@ -1,199 +0,0 @@
1
- /**
2
- * Copyright (c) 2024-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { useTranslation } from "react-i18next";
10
- import { Text } from "@ndla/primitives";
11
- import { styled } from "@ndla/styled-system/jsx";
12
- import { LicenseContainerContent } from "../LicenseByline/EmbedByline";
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- const BackgroundVariant = {
15
- strong: {
16
- _before: {
17
- backgroundColor: "surface.brand.3"
18
- }
19
- },
20
- moderate: {
21
- _before: {
22
- backgroundColor: "surface.brand.3.moderate"
23
- }
24
- },
25
- subtle: {
26
- _before: {
27
- backgroundColor: "surface.brand.3.subtle"
28
- }
29
- }
30
- };
31
- export const contactBlockBackgrounds = Object.keys(BackgroundVariant);
32
- const StyledWrapper = styled("div", {
33
- base: {
34
- display: "flex",
35
- minWidth: "surface.xxsmall",
36
- padding: "medium",
37
- alignItems: "center",
38
- justifyContent: "space-between",
39
- boxShadow: "full",
40
- border: "1px solid",
41
- gap: "medium",
42
- position: "relative",
43
- borderColor: "stroke.default",
44
- borderRadius: "xsmall",
45
- overflow: "hidden",
46
- background: "surface.default",
47
- flexDirection: "column-reverse",
48
- tablet: {
49
- alignItems: "unset",
50
- flexDirection: "row"
51
- }
52
- }
53
- });
54
- const EmailLink = styled("a", {
55
- base: {
56
- color: "text.default",
57
- textDecoration: "underline",
58
- _hover: {
59
- textDecoration: "none"
60
- },
61
- _focusVisible: {
62
- textDecoration: "none"
63
- }
64
- }
65
- });
66
- const HeaderWrapper = styled("div", {
67
- base: {
68
- position: "relative",
69
- display: "flex",
70
- flexDirection: "column",
71
- gap: "3xsmall",
72
- zIndex: "base",
73
- _before: {
74
- content: '""',
75
- position: "absolute",
76
- top: "-60px",
77
- left: "-50px",
78
- right: "0",
79
- bottom: "0",
80
- height: "calc(100% + 50px)",
81
- width: "surface.3xlarge",
82
- transform: "rotate(-4deg)",
83
- zIndex: "hide"
84
- }
85
- },
86
- variants: {
87
- variant: BackgroundVariant,
88
- imageExists: {
89
- true: {
90
- tabletDown: {
91
- _before: {
92
- display: "none"
93
- }
94
- }
95
- }
96
- }
97
- }
98
- });
99
- const ImageWrapper = styled("div", {
100
- base: {
101
- display: "flex",
102
- gap: "xxsmall",
103
- alignItems: "flex-start",
104
- justifyContent: "flex-start",
105
- flexDirection: "column",
106
- zIndex: "base",
107
- tabletDown: {
108
- _before: {
109
- content: '""',
110
- position: "absolute",
111
- top: "-50px",
112
- left: "-50px",
113
- right: "0",
114
- bottom: "0",
115
- height: "surface.xxsmall",
116
- width: "surface.3xlarge",
117
- transform: "rotate(-4deg)",
118
- zIndex: "hide"
119
- }
120
- }
121
- },
122
- variants: {
123
- variant: BackgroundVariant
124
- }
125
- });
126
- const StyledImage = styled("img", {
127
- base: {
128
- borderRadius: "xsmall",
129
- width: "surface.xsmall",
130
- height: "surface.xsmall",
131
- objectFit: "cover"
132
- }
133
- });
134
- const ContentWrapper = styled("div", {
135
- base: {
136
- display: "flex",
137
- flexDirection: "column",
138
- gap: "medium",
139
- flex: "1",
140
- width: "100%"
141
- }
142
- });
143
- const StyledDescription = styled(Text, {
144
- base: {
145
- fontFamily: "serif"
146
- }
147
- });
148
- export const ContactBlock = _ref => {
149
- let {
150
- image,
151
- jobTitle,
152
- description,
153
- name,
154
- email,
155
- embedAlt,
156
- lang,
157
- backgroundColor = "strong"
158
- } = _ref;
159
- const {
160
- t
161
- } = useTranslation();
162
- return /*#__PURE__*/_jsxs(StyledWrapper, {
163
- "data-embed-type": "contact-block",
164
- children: [/*#__PURE__*/_jsxs(ContentWrapper, {
165
- children: [/*#__PURE__*/_jsxs(HeaderWrapper, {
166
- variant: backgroundColor,
167
- imageExists: !!image,
168
- children: [/*#__PURE__*/_jsx(Text, {
169
- lang: lang,
170
- fontWeight: "bold",
171
- textStyle: "heading.small",
172
- children: name
173
- }), /*#__PURE__*/_jsx(Text, {
174
- lang: lang,
175
- children: jobTitle
176
- }), /*#__PURE__*/_jsxs(Text, {
177
- children: [`${t("email")}: `, /*#__PURE__*/_jsx(EmailLink, {
178
- href: `mailto:${email}`,
179
- children: email
180
- })]
181
- })]
182
- }), /*#__PURE__*/_jsx(StyledDescription, {
183
- textStyle: "body.large",
184
- children: description
185
- })]
186
- }), !!image && /*#__PURE__*/_jsxs(ImageWrapper, {
187
- variant: backgroundColor,
188
- children: [/*#__PURE__*/_jsx(StyledImage, {
189
- alt: embedAlt !== undefined ? embedAlt : image.alttext.alttext,
190
- src: image.image.imageUrl,
191
- width: 300,
192
- height: 300
193
- }), /*#__PURE__*/_jsx(LicenseContainerContent, {
194
- type: "image",
195
- copyright: image.copyright
196
- })]
197
- })]
198
- });
199
- };
@@ -1,9 +0,0 @@
1
- /**
2
- * Copyright (c) 2024-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- export { ContactBlock, contactBlockBackgrounds } from "./ContactBlock";
@@ -1,50 +0,0 @@
1
- /**
2
- * Copyright (c) 2024-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { forwardRef } from "react";
10
- import { useTranslation } from "react-i18next";
11
- import { Badge } from "@ndla/primitives";
12
- import * as contentTypes from "../model/ContentType";
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- export const contentTypeToBadgeVariantMap = {
15
- [contentTypes.SUBJECT_MATERIAL]: "brand1",
16
- [contentTypes.TASKS_AND_ACTIVITIES]: "brand2",
17
- [contentTypes.ASSESSMENT_RESOURCES]: "brand2",
18
- [contentTypes.SUBJECT]: "neutral",
19
- [contentTypes.SOURCE_MATERIAL]: "brand1",
20
- [contentTypes.LEARNING_PATH]: "brand3",
21
- [contentTypes.TOPIC]: "neutral",
22
- [contentTypes.MULTIDISCIPLINARY]: "neutral",
23
- [contentTypes.CONCEPT]: "brand1",
24
- [contentTypes.EXTERNAL]: "brand2",
25
- [contentTypes.IMAGE]: "brand1",
26
- [contentTypes.AUDIO]: "brand1",
27
- [contentTypes.PODCAST]: "brand1",
28
- [contentTypes.VIDEO]: "brand1",
29
- [contentTypes.MISSING]: "neutral",
30
- [contentTypes.PODCAST_SERIES]: "brand1",
31
- [contentTypes.GLOSS]: "brand1",
32
- [contentTypes.PROGRAMME]: "neutral",
33
- [contentTypes.FRONTPAGE_ARTICLE]: "brand2"
34
- };
35
- export const ContentTypeBadge = /*#__PURE__*/forwardRef((_ref, ref) => {
36
- let {
37
- contentType,
38
- children,
39
- ...props
40
- } = _ref;
41
- const {
42
- t
43
- } = useTranslation();
44
- return /*#__PURE__*/_jsx(Badge, {
45
- colorTheme: contentTypeToBadgeVariantMap[contentType ?? "missing"] ?? contentTypeToBadgeVariantMap["missing"],
46
- ...props,
47
- ref: ref,
48
- children: children ?? t(`contentTypes.${contentType}`)
49
- });
50
- });
@@ -1,32 +0,0 @@
1
- /**
2
- * Copyright (c) 2024-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { forwardRef } from "react";
10
- import { BlockQuote } from "@ndla/primitives";
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- const contentTypeToVariantMapping = {
13
- "subject-material": "brand1",
14
- "source-material": "brand1",
15
- concept: "brand1",
16
- "tasks-and-activities": "brand2",
17
- "assessment-resources": "brand2"
18
- };
19
- export const ContentTypeBlockQuote = /*#__PURE__*/forwardRef((_ref, ref) => {
20
- let {
21
- variant,
22
- contentType,
23
- ...props
24
- } = _ref;
25
- const color = contentType ? contentTypeToVariantMapping[contentType] ?? "brand1" : "brand1";
26
- const variantColor = variant === "colored" ? color : undefined;
27
- return /*#__PURE__*/_jsx(BlockQuote, {
28
- ...props,
29
- variant: variantColor,
30
- ref: ref
31
- });
32
- });