@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.
Files changed (347) hide show
  1. package/es/Article/Article.js +122 -194
  2. package/es/Article/Article.js.map +1 -0
  3. package/es/Article/ArticleByline.js +121 -170
  4. package/es/Article/ArticleByline.js.map +1 -0
  5. package/es/Article/ArticleFootNotes.js +38 -58
  6. package/es/Article/ArticleFootNotes.js.map +1 -0
  7. package/es/AudioPlayer/AudioPlayer.js +151 -212
  8. package/es/AudioPlayer/AudioPlayer.js.map +1 -0
  9. package/es/AudioPlayer/Controls.js +246 -324
  10. package/es/AudioPlayer/Controls.js.map +1 -0
  11. package/es/AudioPlayer/SpeechControl.js +36 -52
  12. package/es/AudioPlayer/SpeechControl.js.map +1 -0
  13. package/es/AudioPlayer/index.js +7 -9
  14. package/es/AudioPlayer/index.js.map +1 -0
  15. package/es/Breadcrumb/Breadcrumb.js +42 -58
  16. package/es/Breadcrumb/Breadcrumb.js.map +1 -0
  17. package/es/Breadcrumb/BreadcrumbItem.js +33 -59
  18. package/es/Breadcrumb/BreadcrumbItem.js.map +1 -0
  19. package/es/Breadcrumb/HomeBreadcrumb.js +41 -74
  20. package/es/Breadcrumb/HomeBreadcrumb.js.map +1 -0
  21. package/es/Breadcrumb/index.js +8 -10
  22. package/es/Breadcrumb/index.js.map +1 -0
  23. package/es/CampaignBlock/CampaignBlock.js +124 -173
  24. package/es/CampaignBlock/CampaignBlock.js.map +1 -0
  25. package/es/CodeBlock/CodeBlock.js +21 -31
  26. package/es/CodeBlock/CodeBlock.js.map +1 -0
  27. package/es/CodeBlock/codeLanguageOptions.js +112 -82
  28. package/es/CodeBlock/codeLanguageOptions.js.map +1 -0
  29. package/es/Concept/Concept.js +46 -68
  30. package/es/Concept/Concept.js.map +1 -0
  31. package/es/ContactBlock/ContactBlock.js +137 -191
  32. package/es/ContactBlock/ContactBlock.js.map +1 -0
  33. package/es/ContentTypeBadge/ContentTypeBadge.js +38 -47
  34. package/es/ContentTypeBadge/ContentTypeBadge.js.map +1 -0
  35. package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js +21 -28
  36. package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js.map +1 -0
  37. package/es/ContentTypeFramedContent/ContentTypeFramedContent.js +21 -28
  38. package/es/ContentTypeFramedContent/ContentTypeFramedContent.js.map +1 -0
  39. package/es/ContentTypeHero/ContentTypeHero.js +36 -47
  40. package/es/ContentTypeHero/ContentTypeHero.js.map +1 -0
  41. package/es/CopyParagraphButton/CopyParagraphButton.js +57 -78
  42. package/es/CopyParagraphButton/CopyParagraphButton.js.map +1 -0
  43. package/es/CopyParagraphButton/index.js +7 -10
  44. package/es/CopyParagraphButton/index.js.map +1 -0
  45. package/es/Embed/AudioEmbed.js +49 -73
  46. package/es/Embed/AudioEmbed.js.map +1 -0
  47. package/es/Embed/BrightcoveEmbed.js +90 -127
  48. package/es/Embed/BrightcoveEmbed.js.map +1 -0
  49. package/es/Embed/CodeEmbed.js +55 -73
  50. package/es/Embed/CodeEmbed.js.map +1 -0
  51. package/es/Embed/ConceptEmbed.js +72 -117
  52. package/es/Embed/ConceptEmbed.js.map +1 -0
  53. package/es/Embed/ConceptInlineTriggerButton.js +39 -44
  54. package/es/Embed/ConceptInlineTriggerButton.js.map +1 -0
  55. package/es/Embed/ContentLinkEmbed.js +29 -49
  56. package/es/Embed/ContentLinkEmbed.js.map +1 -0
  57. package/es/Embed/CopyrightEmbed.js +21 -31
  58. package/es/Embed/CopyrightEmbed.js.map +1 -0
  59. package/es/Embed/EmbedErrorPlaceholder.js +40 -55
  60. package/es/Embed/EmbedErrorPlaceholder.js.map +1 -0
  61. package/es/Embed/EmbedWrapper.js +21 -46
  62. package/es/Embed/EmbedWrapper.js.map +1 -0
  63. package/es/Embed/ExternalEmbed.js +50 -70
  64. package/es/Embed/ExternalEmbed.js.map +1 -0
  65. package/es/Embed/FootnoteEmbed.js +25 -42
  66. package/es/Embed/FootnoteEmbed.js.map +1 -0
  67. package/es/Embed/GlossEmbed.js +49 -77
  68. package/es/Embed/GlossEmbed.js.map +1 -0
  69. package/es/Embed/H5pEmbed.js +35 -58
  70. package/es/Embed/H5pEmbed.js.map +1 -0
  71. package/es/Embed/IframeEmbed.js +65 -89
  72. package/es/Embed/IframeEmbed.js.map +1 -0
  73. package/es/Embed/ImageEmbed.js +167 -225
  74. package/es/Embed/ImageEmbed.js.map +1 -0
  75. package/es/Embed/InlineTriggerButton.js +20 -32
  76. package/es/Embed/InlineTriggerButton.js.map +1 -0
  77. package/es/Embed/RelatedContentEmbed.js +36 -53
  78. package/es/Embed/RelatedContentEmbed.js.map +1 -0
  79. package/es/Embed/UnknownEmbed.js +18 -29
  80. package/es/Embed/UnknownEmbed.js.map +1 -0
  81. package/es/Embed/UuDisclaimerEmbed.js +51 -85
  82. package/es/Embed/UuDisclaimerEmbed.js.map +1 -0
  83. package/es/ErrorMessage/ErrorMessage.js +51 -92
  84. package/es/ErrorMessage/ErrorMessage.js.map +1 -0
  85. package/es/ErrorMessage/index.js +7 -9
  86. package/es/ErrorMessage/index.js.map +1 -0
  87. package/es/FactBox/FactBox.js +114 -170
  88. package/es/FactBox/FactBox.js.map +1 -0
  89. package/es/FactBox/index.js +7 -9
  90. package/es/FactBox/index.js.map +1 -0
  91. package/es/FileList/File.js +70 -95
  92. package/es/FileList/File.js.map +1 -0
  93. package/es/FileList/FileList.js +31 -46
  94. package/es/FileList/FileList.js.map +1 -0
  95. package/es/FileList/PdfFile.js +27 -49
  96. package/es/FileList/PdfFile.js.map +1 -0
  97. package/es/Gloss/Gloss.js +133 -166
  98. package/es/Gloss/Gloss.js.map +1 -0
  99. package/es/Gloss/GlossExample.js +42 -60
  100. package/es/Gloss/GlossExample.js.map +1 -0
  101. package/es/Grid/Grid.js +63 -91
  102. package/es/Grid/Grid.js.map +1 -0
  103. package/es/Grid/GridParallaxItem.js +19 -30
  104. package/es/Grid/GridParallaxItem.js.map +1 -0
  105. package/es/KeyFigure/KeyFigure.js +44 -61
  106. package/es/KeyFigure/KeyFigure.js.map +1 -0
  107. package/es/LicenseByline/EmbedByline.js +126 -206
  108. package/es/LicenseByline/EmbedByline.js.map +1 -0
  109. package/es/LicenseByline/LicenseLink.js +28 -53
  110. package/es/LicenseByline/LicenseLink.js.map +1 -0
  111. package/es/LinkBlock/LinkBlock.js +70 -99
  112. package/es/LinkBlock/LinkBlock.js.map +1 -0
  113. package/es/LinkBlock/LinkBlockSection.js +20 -32
  114. package/es/LinkBlock/LinkBlockSection.js.map +1 -0
  115. package/es/Pitch/Pitch.js +59 -80
  116. package/es/Pitch/Pitch.js.map +1 -0
  117. package/es/RelatedArticleList/RelatedArticleList.js +91 -129
  118. package/es/RelatedArticleList/RelatedArticleList.js.map +1 -0
  119. package/es/RelatedArticleList/index.js +7 -10
  120. package/es/RelatedArticleList/index.js.map +1 -0
  121. package/es/ResourceBox/ResourceBox.js +71 -96
  122. package/es/ResourceBox/ResourceBox.js.map +1 -0
  123. package/es/TagSelector/TagSelector.js +93 -136
  124. package/es/TagSelector/TagSelector.js.map +1 -0
  125. package/es/ZendeskButton/ZendeskButton.js +38 -52
  126. package/es/ZendeskButton/ZendeskButton.js.map +1 -0
  127. package/es/_virtual/rolldown_runtime.js +11 -0
  128. package/es/i18n/formatNestedMessages.js +16 -24
  129. package/es/i18n/formatNestedMessages.js.map +1 -0
  130. package/es/i18n/i18n.js +25 -31
  131. package/es/i18n/i18n.js.map +1 -0
  132. package/es/i18n/useComponentTranslations.js +147 -203
  133. package/es/i18n/useComponentTranslations.js.map +1 -0
  134. package/es/index.js +64 -44
  135. package/es/locale/messages-en.js +435 -459
  136. package/es/locale/messages-en.js.map +1 -0
  137. package/es/locale/messages-nb.js +435 -459
  138. package/es/locale/messages-nb.js.map +1 -0
  139. package/es/locale/messages-nn.js +435 -459
  140. package/es/locale/messages-nn.js.map +1 -0
  141. package/es/locale/messages-se.js +435 -459
  142. package/es/locale/messages-se.js.map +1 -0
  143. package/es/model/ContentType.js +69 -65
  144. package/es/model/ContentType.js.map +1 -0
  145. package/es/model/SubjectCategories.js +23 -10
  146. package/es/model/SubjectCategories.js.map +1 -0
  147. package/es/model/SubjectTypes.js +21 -9
  148. package/es/model/SubjectTypes.js.map +1 -0
  149. package/es/model/WordClass.js +51 -43
  150. package/es/model/WordClass.js.map +1 -0
  151. package/es/model/index.js +16 -18
  152. package/es/model/index.js.map +1 -0
  153. package/es/utils/licenseAttributes.js +15 -17
  154. package/es/utils/licenseAttributes.js.map +1 -0
  155. package/es/utils/relativeUrl.js +21 -32
  156. package/es/utils/relativeUrl.js.map +1 -0
  157. package/lib/Article/Article.js +130 -203
  158. package/lib/Article/Article.js.map +1 -0
  159. package/lib/Article/ArticleByline.js +125 -179
  160. package/lib/Article/ArticleByline.js.map +1 -0
  161. package/lib/Article/ArticleFootNotes.js +39 -65
  162. package/lib/Article/ArticleFootNotes.js.map +1 -0
  163. package/lib/AudioPlayer/AudioPlayer.js +155 -221
  164. package/lib/AudioPlayer/AudioPlayer.js.map +1 -0
  165. package/lib/AudioPlayer/Controls.js +249 -332
  166. package/lib/AudioPlayer/Controls.js.map +1 -0
  167. package/lib/AudioPlayer/SpeechControl.js +39 -60
  168. package/lib/AudioPlayer/SpeechControl.js.map +1 -0
  169. package/lib/AudioPlayer/index.js +7 -15
  170. package/lib/AudioPlayer/index.js.map +1 -0
  171. package/lib/Breadcrumb/Breadcrumb.js +43 -65
  172. package/lib/Breadcrumb/Breadcrumb.js.map +1 -0
  173. package/lib/Breadcrumb/BreadcrumbItem.js +34 -65
  174. package/lib/Breadcrumb/BreadcrumbItem.js.map +1 -0
  175. package/lib/Breadcrumb/HomeBreadcrumb.js +43 -82
  176. package/lib/Breadcrumb/HomeBreadcrumb.js.map +1 -0
  177. package/lib/Breadcrumb/index.js +8 -22
  178. package/lib/Breadcrumb/index.js.map +1 -0
  179. package/lib/CampaignBlock/CampaignBlock.js +128 -183
  180. package/lib/CampaignBlock/CampaignBlock.js.map +1 -0
  181. package/lib/CodeBlock/CodeBlock.js +23 -38
  182. package/lib/CodeBlock/CodeBlock.js.map +1 -0
  183. package/lib/CodeBlock/codeLanguageOptions.js +112 -87
  184. package/lib/CodeBlock/codeLanguageOptions.js.map +1 -0
  185. package/lib/Concept/Concept.js +48 -75
  186. package/lib/Concept/Concept.js.map +1 -0
  187. package/lib/ContactBlock/ContactBlock.js +141 -200
  188. package/lib/ContactBlock/ContactBlock.js.map +1 -0
  189. package/lib/ContentTypeBadge/ContentTypeBadge.js +40 -54
  190. package/lib/ContentTypeBadge/ContentTypeBadge.js.map +1 -0
  191. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +23 -35
  192. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js.map +1 -0
  193. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +23 -35
  194. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js.map +1 -0
  195. package/lib/ContentTypeHero/ContentTypeHero.js +37 -54
  196. package/lib/ContentTypeHero/ContentTypeHero.js.map +1 -0
  197. package/lib/CopyParagraphButton/CopyParagraphButton.js +61 -87
  198. package/lib/CopyParagraphButton/CopyParagraphButton.js.map +1 -0
  199. package/lib/CopyParagraphButton/index.js +7 -21
  200. package/lib/CopyParagraphButton/index.js.map +1 -0
  201. package/lib/Embed/AudioEmbed.js +51 -82
  202. package/lib/Embed/AudioEmbed.js.map +1 -0
  203. package/lib/Embed/BrightcoveEmbed.js +93 -138
  204. package/lib/Embed/BrightcoveEmbed.js.map +1 -0
  205. package/lib/Embed/CodeEmbed.js +59 -83
  206. package/lib/Embed/CodeEmbed.js.map +1 -0
  207. package/lib/Embed/ConceptEmbed.js +77 -127
  208. package/lib/Embed/ConceptEmbed.js.map +1 -0
  209. package/lib/Embed/ConceptInlineTriggerButton.js +39 -49
  210. package/lib/Embed/ConceptInlineTriggerButton.js.map +1 -0
  211. package/lib/Embed/ContentLinkEmbed.js +30 -55
  212. package/lib/Embed/ContentLinkEmbed.js.map +1 -0
  213. package/lib/Embed/CopyrightEmbed.js +22 -37
  214. package/lib/Embed/CopyrightEmbed.js.map +1 -0
  215. package/lib/Embed/EmbedErrorPlaceholder.js +42 -62
  216. package/lib/Embed/EmbedErrorPlaceholder.js.map +1 -0
  217. package/lib/Embed/EmbedWrapper.js +24 -54
  218. package/lib/Embed/EmbedWrapper.js.map +1 -0
  219. package/lib/Embed/ExternalEmbed.js +53 -79
  220. package/lib/Embed/ExternalEmbed.js.map +1 -0
  221. package/lib/Embed/FootnoteEmbed.js +26 -48
  222. package/lib/Embed/FootnoteEmbed.js.map +1 -0
  223. package/lib/Embed/GlossEmbed.js +51 -86
  224. package/lib/Embed/GlossEmbed.js.map +1 -0
  225. package/lib/Embed/H5pEmbed.js +37 -66
  226. package/lib/Embed/H5pEmbed.js.map +1 -0
  227. package/lib/Embed/IframeEmbed.js +68 -98
  228. package/lib/Embed/IframeEmbed.js.map +1 -0
  229. package/lib/Embed/ImageEmbed.js +173 -238
  230. package/lib/Embed/ImageEmbed.js.map +1 -0
  231. package/lib/Embed/InlineTriggerButton.js +23 -40
  232. package/lib/Embed/InlineTriggerButton.js.map +1 -0
  233. package/lib/Embed/RelatedContentEmbed.js +37 -59
  234. package/lib/Embed/RelatedContentEmbed.js.map +1 -0
  235. package/lib/Embed/UnknownEmbed.js +19 -35
  236. package/lib/Embed/UnknownEmbed.js.map +1 -0
  237. package/lib/Embed/UuDisclaimerEmbed.js +53 -92
  238. package/lib/Embed/UuDisclaimerEmbed.js.map +1 -0
  239. package/lib/ErrorMessage/ErrorMessage.js +53 -99
  240. package/lib/ErrorMessage/ErrorMessage.js.map +1 -0
  241. package/lib/ErrorMessage/index.js +7 -15
  242. package/lib/ErrorMessage/index.js.map +1 -0
  243. package/lib/FactBox/FactBox.js +118 -180
  244. package/lib/FactBox/FactBox.js.map +1 -0
  245. package/lib/FactBox/index.js +7 -15
  246. package/lib/FactBox/index.js.map +1 -0
  247. package/lib/FileList/File.js +75 -105
  248. package/lib/FileList/File.js.map +1 -0
  249. package/lib/FileList/FileList.js +33 -52
  250. package/lib/FileList/FileList.js.map +1 -0
  251. package/lib/FileList/PdfFile.js +27 -55
  252. package/lib/FileList/PdfFile.js.map +1 -0
  253. package/lib/Gloss/Gloss.js +138 -176
  254. package/lib/Gloss/Gloss.js.map +1 -0
  255. package/lib/Gloss/GlossExample.js +45 -68
  256. package/lib/Gloss/GlossExample.js.map +1 -0
  257. package/lib/Grid/Grid.js +64 -98
  258. package/lib/Grid/Grid.js.map +1 -0
  259. package/lib/Grid/GridParallaxItem.js +19 -36
  260. package/lib/Grid/GridParallaxItem.js.map +1 -0
  261. package/lib/KeyFigure/KeyFigure.js +45 -68
  262. package/lib/KeyFigure/KeyFigure.js.map +1 -0
  263. package/lib/LicenseByline/EmbedByline.js +130 -216
  264. package/lib/LicenseByline/EmbedByline.js.map +1 -0
  265. package/lib/LicenseByline/LicenseLink.js +29 -59
  266. package/lib/LicenseByline/LicenseLink.js.map +1 -0
  267. package/lib/LinkBlock/LinkBlock.js +73 -108
  268. package/lib/LinkBlock/LinkBlock.js.map +1 -0
  269. package/lib/LinkBlock/LinkBlockSection.js +22 -39
  270. package/lib/LinkBlock/LinkBlockSection.js.map +1 -0
  271. package/lib/Pitch/Pitch.js +61 -89
  272. package/lib/Pitch/Pitch.js.map +1 -0
  273. package/lib/RelatedArticleList/RelatedArticleList.js +96 -140
  274. package/lib/RelatedArticleList/RelatedArticleList.js.map +1 -0
  275. package/lib/RelatedArticleList/index.js +7 -20
  276. package/lib/RelatedArticleList/index.js.map +1 -0
  277. package/lib/ResourceBox/ResourceBox.js +73 -104
  278. package/lib/ResourceBox/ResourceBox.js.map +1 -0
  279. package/lib/TagSelector/TagSelector.js +103 -145
  280. package/lib/TagSelector/TagSelector.js.map +1 -0
  281. package/lib/ZendeskButton/ZendeskButton.js +39 -58
  282. package/lib/ZendeskButton/ZendeskButton.js.map +1 -0
  283. package/lib/_virtual/rolldown_runtime.js +42 -0
  284. package/lib/i18n/formatNestedMessages.js +16 -30
  285. package/lib/i18n/formatNestedMessages.js.map +1 -0
  286. package/lib/i18n/i18n.js +28 -38
  287. package/lib/i18n/i18n.js.map +1 -0
  288. package/lib/i18n/useComponentTranslations.js +154 -215
  289. package/lib/i18n/useComponentTranslations.js.map +1 -0
  290. package/lib/index.js +156 -598
  291. package/lib/locale/messages-en.js +436 -466
  292. package/lib/locale/messages-en.js.map +1 -0
  293. package/lib/locale/messages-nb.js +436 -466
  294. package/lib/locale/messages-nb.js.map +1 -0
  295. package/lib/locale/messages-nn.js +436 -466
  296. package/lib/locale/messages-nn.js.map +1 -0
  297. package/lib/locale/messages-se.js +436 -466
  298. package/lib/locale/messages-se.js.map +1 -0
  299. package/lib/model/ContentType.js +90 -70
  300. package/lib/model/ContentType.js.map +1 -0
  301. package/lib/model/SubjectCategories.js +26 -14
  302. package/lib/model/SubjectCategories.js.map +1 -0
  303. package/lib/model/SubjectTypes.js +24 -13
  304. package/lib/model/SubjectTypes.js.map +1 -0
  305. package/lib/model/WordClass.js +55 -48
  306. package/lib/model/WordClass.js.map +1 -0
  307. package/lib/model/index.js +16 -25
  308. package/lib/model/index.js.map +1 -0
  309. package/lib/utils/licenseAttributes.js +14 -22
  310. package/lib/utils/licenseAttributes.js.map +1 -0
  311. package/lib/utils/relativeUrl.js +20 -38
  312. package/lib/utils/relativeUrl.js.map +1 -0
  313. package/package.json +12 -11
  314. package/es/Article/index.js +0 -11
  315. package/es/CampaignBlock/index.js +0 -9
  316. package/es/CodeBlock/index.js +0 -10
  317. package/es/ContactBlock/index.js +0 -9
  318. package/es/ContentTypeHero/index.js +0 -9
  319. package/es/Embed/index.js +0 -25
  320. package/es/Embed/types.js +0 -1
  321. package/es/FileList/index.js +0 -11
  322. package/es/Gloss/index.js +0 -10
  323. package/es/Grid/index.js +0 -10
  324. package/es/KeyFigure/index.js +0 -9
  325. package/es/LicenseByline/index.js +0 -10
  326. package/es/LinkBlock/index.js +0 -10
  327. package/es/Pitch/index.js +0 -9
  328. package/es/ResourceBox/index.js +0 -10
  329. package/es/i18n/index.js +0 -11
  330. package/es/types.js +0 -1
  331. package/lib/Article/index.js +0 -68
  332. package/lib/CampaignBlock/index.js +0 -13
  333. package/lib/CodeBlock/index.js +0 -20
  334. package/lib/ContactBlock/index.js +0 -18
  335. package/lib/ContentTypeHero/index.js +0 -12
  336. package/lib/Embed/index.js +0 -150
  337. package/lib/Embed/types.js +0 -5
  338. package/lib/FileList/index.js +0 -44
  339. package/lib/Gloss/index.js +0 -20
  340. package/lib/Grid/index.js +0 -19
  341. package/lib/KeyFigure/index.js +0 -13
  342. package/lib/LicenseByline/index.js +0 -19
  343. package/lib/LinkBlock/index.js +0 -20
  344. package/lib/Pitch/index.js +0 -12
  345. package/lib/ResourceBox/index.js +0 -13
  346. package/lib/i18n/index.js +0 -68
  347. package/lib/types.js +0 -5
@@ -1,72 +1,50 @@
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
-
1
+ import { EmbedByline } from "../LicenseByline/EmbedByline.js";
2
+ import { licenseAttributes } from "../utils/licenseAttributes.js";
3
+ import { ImageEmbed_default } from "../Embed/ImageEmbed.js";
4
+ import { H5pEmbed_default } from "../Embed/H5pEmbed.js";
5
+ import { ExternalEmbed_default } from "../Embed/ExternalEmbed.js";
6
+ import { IframeEmbed_default } from "../Embed/IframeEmbed.js";
7
+ import { BrightcoveEmbed_default } from "../Embed/BrightcoveEmbed.js";
9
8
  import { forwardRef } from "react";
10
9
  import { Figure } from "@ndla/primitives";
11
10
  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
- }
11
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
+
13
+ //#region src/Concept/Concept.tsx
14
+ const StyledFigure = styled(Figure, { base: {
15
+ display: "flex",
16
+ flexDirection: "column",
17
+ gap: "medium"
18
+ } });
19
+ const ContentWrapper = styled("div", { base: {
20
+ textStyle: "body.large",
21
+ display: "inline",
22
+ "& p": { display: "inline" }
23
+ } });
24
+ const Concept = forwardRef(({ copyright, visualElement, lang, children, title, source, previewAlt,...rest }, ref) => {
25
+ const licenseProps = licenseAttributes(copyright?.license?.license, lang, source);
26
+ return /* @__PURE__ */ jsxs(StyledFigure, {
27
+ ref,
28
+ ...rest,
29
+ ...licenseProps,
30
+ children: [
31
+ /* @__PURE__ */ jsxs(ContentWrapper, {
32
+ lang,
33
+ children: [!!title && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("b", { children: title }), ` – `] }), children]
34
+ }),
35
+ visualElement?.resource === "image" ? /* @__PURE__ */ jsx(ImageEmbed_default, {
36
+ embed: visualElement,
37
+ lang,
38
+ previewAlt
39
+ }) : visualElement?.resource === "brightcove" ? /* @__PURE__ */ jsx(BrightcoveEmbed_default, { embed: visualElement }) : visualElement?.resource === "h5p" ? /* @__PURE__ */ jsx(H5pEmbed_default, { embed: visualElement }) : visualElement?.resource === "iframe" ? /* @__PURE__ */ jsx(IframeEmbed_default, { embed: visualElement }) : visualElement?.resource === "external" ? /* @__PURE__ */ jsx(ExternalEmbed_default, { embed: visualElement }) : null,
40
+ !!copyright && /* @__PURE__ */ jsx(EmbedByline, {
41
+ copyright,
42
+ type: "concept"
43
+ })
44
+ ]
45
+ });
31
46
  });
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
- });
47
+
48
+ //#endregion
49
+ export { Concept };
50
+ //# sourceMappingURL=Concept.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Concept.js","names":["ImageEmbed","BrightcoveEmbed","H5pEmbed","IframeEmbed","ExternalEmbed"],"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,OAAO,QAAQ,EAClC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,KAAK;AACN,EACF,EAAC;AAEF,MAAM,iBAAiB,OAAO,OAAO,EACnC,MAAM;CACJ,WAAW;CACX,SAAS;CACT,OAAO,EACL,SAAS,SACV;AACF,EACF,EAAC;AAEF,MAAa,UAAU,WACrB,CAAC,EAAE,WAAW,eAAe,MAAM,UAAU,OAAO,QAAQ,WAAY,GAAG,MAAM,EAAE,QAAQ;CACzF,MAAM,eAAe,kBAAkB,WAAW,SAAS,SAAS,MAAM,OAAO;AAEjF,wBACE,KAAC;EAAkB;EAAK,GAAI;EAAM,GAAI;;mBACpC,KAAC;IAAqB;iBACjB,yBACD,8CACE,IAAC,iBAAG,QAAU,GACZ,QACD,EAEJ;KACc;GAChB,eAAe,aAAa,0BAC3B,IAACA;IAAW,OAAO;IAAqB;IAAkB;KAAc,GACtE,eAAe,aAAa,+BAC9B,IAACC,2BAAgB,OAAO,gBAAiB,GACvC,eAAe,aAAa,wBAC9B,IAACC,oBAAS,OAAO,gBAAiB,GAChC,eAAe,aAAa,2BAC9B,IAACC,uBAAY,OAAO,gBAAiB,GACnC,eAAe,aAAa,6BAC9B,IAACC,yBAAc,OAAO,gBAAiB,GACrC;KACD,6BAAa,IAAC;IAAuB;IAAW,MAAK;KAAY;;GACvD;AAElB,EACF"}
@@ -1,199 +1,145 @@
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";
1
+ import { LicenseContainerContent } from "../LicenseByline/EmbedByline.js";
10
2
  import { Text } from "@ndla/primitives";
11
3
  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";
4
+ import { useTranslation } from "react-i18next";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+
7
+ //#region src/ContactBlock/ContactBlock.tsx
14
8
  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
- }
9
+ strong: { _before: { backgroundColor: "surface.brand.3" } },
10
+ moderate: { _before: { backgroundColor: "surface.brand.3.moderate" } },
11
+ subtle: { _before: { backgroundColor: "surface.brand.3.subtle" } }
30
12
  };
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
- });
13
+ const contactBlockBackgrounds = Object.keys(BackgroundVariant);
14
+ const StyledWrapper = styled("div", { base: {
15
+ display: "flex",
16
+ minWidth: "surface.xxsmall",
17
+ padding: "medium",
18
+ alignItems: "center",
19
+ justifyContent: "space-between",
20
+ boxShadow: "full",
21
+ border: "1px solid",
22
+ gap: "medium",
23
+ position: "relative",
24
+ borderColor: "stroke.default",
25
+ borderRadius: "xsmall",
26
+ overflow: "hidden",
27
+ background: "surface.default",
28
+ flexDirection: "column-reverse",
29
+ tablet: {
30
+ alignItems: "unset",
31
+ flexDirection: "row"
32
+ }
33
+ } });
34
+ const EmailLink = styled("a", { base: {
35
+ color: "text.default",
36
+ textDecoration: "underline",
37
+ _hover: { textDecoration: "none" },
38
+ _focusVisible: { textDecoration: "none" }
39
+ } });
66
40
  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
- }
41
+ base: {
42
+ position: "relative",
43
+ display: "flex",
44
+ flexDirection: "column",
45
+ gap: "3xsmall",
46
+ zIndex: "base",
47
+ _before: {
48
+ content: "\"\"",
49
+ position: "absolute",
50
+ top: "-60px",
51
+ left: "-50px",
52
+ right: "0",
53
+ bottom: "0",
54
+ height: "calc(100% + 50px)",
55
+ width: "surface.3xlarge",
56
+ transform: "rotate(-4deg)",
57
+ zIndex: "hide"
58
+ }
59
+ },
60
+ variants: {
61
+ variant: BackgroundVariant,
62
+ imageExists: { true: { tabletDown: { _before: { display: "none" } } } }
63
+ }
98
64
  });
99
65
  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
- }
66
+ base: {
67
+ display: "flex",
68
+ gap: "xxsmall",
69
+ alignItems: "flex-start",
70
+ justifyContent: "flex-start",
71
+ flexDirection: "column",
72
+ zIndex: "base",
73
+ tabletDown: { _before: {
74
+ content: "\"\"",
75
+ position: "absolute",
76
+ top: "-50px",
77
+ left: "-50px",
78
+ right: "0",
79
+ bottom: "0",
80
+ height: "surface.xxsmall",
81
+ width: "surface.3xlarge",
82
+ transform: "rotate(-4deg)",
83
+ zIndex: "hide"
84
+ } }
85
+ },
86
+ variants: { variant: BackgroundVariant }
125
87
  });
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
- };
88
+ const StyledImage = styled("img", { base: {
89
+ borderRadius: "xsmall",
90
+ width: "surface.xsmall",
91
+ height: "surface.xsmall",
92
+ objectFit: "cover"
93
+ } });
94
+ const ContentWrapper = styled("div", { base: {
95
+ display: "flex",
96
+ flexDirection: "column",
97
+ gap: "medium",
98
+ flex: "1",
99
+ width: "100%"
100
+ } });
101
+ const StyledDescription = styled(Text, { base: { fontFamily: "serif" } });
102
+ const ContactBlock = ({ image, jobTitle, description, name, email, embedAlt, lang, backgroundColor = "strong" }) => {
103
+ const { t } = useTranslation();
104
+ return /* @__PURE__ */ jsxs(StyledWrapper, {
105
+ "data-embed-type": "contact-block",
106
+ children: [/* @__PURE__ */ jsxs(ContentWrapper, { children: [/* @__PURE__ */ jsxs(HeaderWrapper, {
107
+ variant: backgroundColor,
108
+ imageExists: !!image,
109
+ children: [
110
+ /* @__PURE__ */ jsx(Text, {
111
+ lang,
112
+ fontWeight: "bold",
113
+ textStyle: "heading.small",
114
+ children: name
115
+ }),
116
+ /* @__PURE__ */ jsx(Text, {
117
+ lang,
118
+ children: jobTitle
119
+ }),
120
+ /* @__PURE__ */ jsxs(Text, { children: [`${t("email")}: `, /* @__PURE__ */ jsx(EmailLink, {
121
+ href: `mailto:${email}`,
122
+ children: email
123
+ })] })
124
+ ]
125
+ }), /* @__PURE__ */ jsx(StyledDescription, {
126
+ textStyle: "body.large",
127
+ children: description
128
+ })] }), !!image && /* @__PURE__ */ jsxs(ImageWrapper, {
129
+ variant: backgroundColor,
130
+ children: [/* @__PURE__ */ jsx(StyledImage, {
131
+ alt: embedAlt !== void 0 ? embedAlt : image.alttext.alttext,
132
+ src: image.image.imageUrl,
133
+ width: 300,
134
+ height: 300
135
+ }), /* @__PURE__ */ jsx(LicenseContainerContent, {
136
+ type: "image",
137
+ copyright: image.copyright
138
+ })]
139
+ })]
140
+ });
141
+ };
142
+
143
+ //#endregion
144
+ export { ContactBlock, contactBlockBackgrounds };
145
+ //# sourceMappingURL=ContactBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContactBlock.js","names":["BackgroundVariant: Record<ContactBlockBackground, SystemStyleObject>"],"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,OAAO,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,OAAO,KAAK,EAC5B,MAAM;CACJ,OAAO;CACP,gBAAgB;CAChB,QAAQ,EAAE,gBAAgB,OAAQ;CAClC,eAAe,EAAE,gBAAgB,OAAQ;AAC1C,EACF,EAAC;AAEF,MAAM,gBAAgB,OAAO,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,OAAO,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,OAAO,OAAO,EAChC,MAAM;CACJ,cAAc;CACd,OAAO;CACP,QAAQ;CACR,WAAW;AACZ,EACF,EAAC;AAEF,MAAM,iBAAiB,OAAO,OAAO,EACnC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,KAAK;CACL,MAAM;CACN,OAAO;AACR,EACF,EAAC;AAEF,MAAM,oBAAoB,OAAO,MAAM,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,gBAAgB;AAC9B,wBACE,KAAC;EAAc,mBAAgB;6BAC7B,KAAC,6CACC,KAAC;GAAc,SAAS;GAAiB,eAAe;;oBACtD,IAAC;KAAW;KAAM,YAAW;KAAO,WAAU;eAC3C;MACI;oBACP,IAAC;KAAW;eAAO;MAAgB;oBACnC,KAAC,oBACG,EAAE,EAAE,QAAQ,CAAC,qBACf,IAAC;KAAU,OAAO,SAAS,MAAM;eAAI;MAAkB,IAClD;;IACO,kBAChB,IAAC;GAAkB,WAAU;aAAc;IAAgC,IAC5D,IACd,yBACD,KAAC;GAAa,SAAS;8BACrB,IAAC;IACC,KAAK,sBAAyB,WAAW,MAAM,QAAQ;IACvD,KAAK,MAAM,MAAM;IACjB,OAAO;IACP,QAAQ;KACR,kBACF,IAAC;IAAwB,MAAK;IAAQ,WAAW,MAAM;KAAa;IACvD;GAEH;AAEnB"}
@@ -1,50 +1,41 @@
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
-
1
+ import { ASSESSMENT_RESOURCES, AUDIO, CONCEPT, EXTERNAL, FRONTPAGE_ARTICLE, GLOSS, IMAGE, LEARNING_PATH, MISSING, MULTIDISCIPLINARY, PODCAST, PODCAST_SERIES, PROGRAMME, SOURCE_MATERIAL, SUBJECT, SUBJECT_MATERIAL, TASKS_AND_ACTIVITIES, TOPIC, VIDEO } from "../model/ContentType.js";
9
2
  import { forwardRef } from "react";
10
- import { useTranslation } from "react-i18next";
11
3
  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"
4
+ import { useTranslation } from "react-i18next";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/ContentTypeBadge/ContentTypeBadge.tsx
8
+ const contentTypeToBadgeVariantMap = {
9
+ [SUBJECT_MATERIAL]: "brand1",
10
+ [TASKS_AND_ACTIVITIES]: "brand2",
11
+ [ASSESSMENT_RESOURCES]: "brand2",
12
+ [SUBJECT]: "neutral",
13
+ [SOURCE_MATERIAL]: "brand1",
14
+ [LEARNING_PATH]: "brand3",
15
+ [TOPIC]: "neutral",
16
+ [MULTIDISCIPLINARY]: "neutral",
17
+ [CONCEPT]: "brand1",
18
+ [EXTERNAL]: "brand2",
19
+ [IMAGE]: "brand1",
20
+ [AUDIO]: "brand1",
21
+ [PODCAST]: "brand1",
22
+ [VIDEO]: "brand1",
23
+ [MISSING]: "neutral",
24
+ [PODCAST_SERIES]: "brand1",
25
+ [GLOSS]: "brand1",
26
+ [PROGRAMME]: "neutral",
27
+ [FRONTPAGE_ARTICLE]: "brand2"
34
28
  };
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
- });
29
+ const ContentTypeBadge = forwardRef(({ contentType, children,...props }, ref) => {
30
+ const { t } = useTranslation();
31
+ return /* @__PURE__ */ jsx(Badge, {
32
+ colorTheme: contentTypeToBadgeVariantMap[contentType ?? "missing"] ?? contentTypeToBadgeVariantMap["missing"],
33
+ ...props,
34
+ ref,
35
+ children: children ?? t(`contentTypes.${contentType}`)
36
+ });
37
+ });
38
+
39
+ //#endregion
40
+ export { ContentTypeBadge, contentTypeToBadgeVariantMap };
41
+ //# sourceMappingURL=ContentTypeBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentTypeBadge.js","names":["contentTypeToBadgeVariantMap: Record<ContentType, BadgeVariant>"],"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;qBAC5C;yBACI;yBACA;YACb;oBACQ;kBACF;UACR;sBACY;YACV;aACC;UACH;UACA;YACE;UACF;YACE;mBACO;UACT;cACI;sBACQ;AACnC;AAED,MAAa,mBAAmB,WAC9B,CAAC,EAAE,aAAa,SAAU,GAAG,OAAO,EAAE,QAAQ;CAC5C,MAAM,EAAE,GAAG,GAAG,gBAAgB;AAC9B,wBACE,IAAC;EACC,YAAY,6BAA6B,eAAe,cAAc,6BAA6B;EACnG,GAAI;EACC;YAEJ,YAAY,GAAG,eAAe,YAAY,EAAE;GACvC;AAEX,EACF"}
@@ -1,32 +1,25 @@
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
1
  import { forwardRef } from "react";
10
2
  import { BlockQuote } from "@ndla/primitives";
11
- import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/ContentTypeBlockQuote/ContentTypeBlockQuote.tsx
12
6
  const contentTypeToVariantMapping = {
13
- "subject-material": "brand1",
14
- "source-material": "brand1",
15
- concept: "brand1",
16
- "tasks-and-activities": "brand2",
17
- "assessment-resources": "brand2"
7
+ "subject-material": "brand1",
8
+ "source-material": "brand1",
9
+ concept: "brand1",
10
+ "tasks-and-activities": "brand2",
11
+ "assessment-resources": "brand2"
18
12
  };
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
- });
13
+ const ContentTypeBlockQuote = forwardRef(({ variant, contentType,...props }, ref) => {
14
+ const color = contentType ? contentTypeToVariantMapping[contentType] ?? "brand1" : "brand1";
15
+ const variantColor = variant === "colored" ? color : void 0;
16
+ return /* @__PURE__ */ jsx(BlockQuote, {
17
+ ...props,
18
+ variant: variantColor,
19
+ ref
20
+ });
21
+ });
22
+
23
+ //#endregion
24
+ export { ContentTypeBlockQuote };
25
+ //# sourceMappingURL=ContentTypeBlockQuote.js.map