@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,37 +1,21 @@
1
- "use strict";
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
+ const __ndla_primitives = require_rolldown_runtime.__toESM(require("@ndla/primitives"));
3
+ const react_i18next = require_rolldown_runtime.__toESM(require("react-i18next"));
4
+ const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
2
5
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _reactI18next = require("react-i18next");
8
- var _primitives = require("@ndla/primitives");
9
- var _jsxRuntime = require("react/jsx-runtime");
10
- /**
11
- * Copyright (c) 2023-present, NDLA.
12
- *
13
- * This source code is licensed under the GPLv3 license found in the
14
- * LICENSE file in the root directory of this source tree.
15
- *
16
- */
17
-
18
- const UnknownEmbed = _ref => {
19
- let {
20
- embed
21
- } = _ref;
22
- const {
23
- t
24
- } = (0, _reactI18next.useTranslation)();
25
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
26
- color: "text.error",
27
- asChild: true,
28
- consumeCss: true,
29
- "data-embed-type": "unknown",
30
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
31
- children: t("embed.unsupported", {
32
- type: embed.resource
33
- })
34
- })
35
- });
6
+ //#region src/Embed/UnknownEmbed.tsx
7
+ const UnknownEmbed = ({ embed }) => {
8
+ const { t } = (0, react_i18next.useTranslation)();
9
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
10
+ color: "text.error",
11
+ asChild: true,
12
+ consumeCss: true,
13
+ "data-embed-type": "unknown",
14
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("embed.unsupported", { type: embed.resource }) })
15
+ });
36
16
  };
37
- var _default = exports.default = UnknownEmbed;
17
+ var UnknownEmbed_default = UnknownEmbed;
18
+
19
+ //#endregion
20
+ exports.UnknownEmbed_default = UnknownEmbed_default;
21
+ //# sourceMappingURL=UnknownEmbed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnknownEmbed.js","names":["Text"],"sources":["../../src/Embed/UnknownEmbed.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-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 type { MetaData } from \"@ndla/types-embed\";\n\ninterface Props {\n embed: MetaData<any, any>;\n}\n\nconst UnknownEmbed = ({ embed }: Props) => {\n const { t } = useTranslation();\n return (\n <Text color=\"text.error\" asChild consumeCss data-embed-type=\"unknown\">\n <span>{t(\"embed.unsupported\", { type: embed.resource })}</span>\n </Text>\n );\n};\n\nexport default UnknownEmbed;\n"],"mappings":";;;;;;AAgBA,MAAM,eAAe,CAAC,EAAE,OAAc,KAAK;CACzC,MAAM,EAAE,GAAG,GAAG,mCAAgB;AAC9B,wBACE,2BAACA;EAAK,OAAM;EAAa;EAAQ;EAAW,mBAAgB;4BAC1D,2BAAC,oBAAM,EAAE,qBAAqB,EAAE,MAAM,MAAM,SAAU,EAAC,GAAQ;GAC1D;AAEV;AAED,2BAAe"}
@@ -1,94 +1,55 @@
1
- "use strict";
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
+ const react = require_rolldown_runtime.__toESM(require("react"));
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 __ndla_icons = require_rolldown_runtime.__toESM(require("@ndla/icons"));
7
+ const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
8
+ const __ark_ui_react = require_rolldown_runtime.__toESM(require("@ark-ui/react"));
2
9
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _reactI18next = require("react-i18next");
8
- var _react = require("@ark-ui/react");
9
- var _icons = require("@ndla/icons");
10
- var _primitives = require("@ndla/primitives");
11
- var _jsx2 = require("@ndla/styled-system/jsx");
12
- var _jsxRuntime = require("react/jsx-runtime");
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
-
21
- const DisclaimerWrapper = (0, _jsx2.styled)("div", {
22
- base: {
23
- display: "flex",
24
- flexDirection: "column",
25
- gap: "3xsmall",
26
- clear: "both"
27
- }
28
- });
29
- const StyledIconButton = (0, _jsx2.styled)(_primitives.IconButton, {
30
- base: {
31
- alignSelf: "flex-end"
32
- }
33
- });
34
- const StyledErrorWarningFill = (0, _jsx2.styled)(_icons.ErrorWarningFill, {
35
- base: {
36
- alignSelf: "flex-end",
37
- fill: "icon.subtle"
38
- }
39
- });
40
- const StyledPopoverContent = (0, _jsx2.styled)(_primitives.PopoverContent, {
41
- base: {
42
- width: "surface.xlarge",
43
- maxHeight: "50vh",
44
- overflowY: "auto"
45
- }
46
- });
47
- const UuDisclaimerEmbed = _ref => {
48
- let {
49
- embed,
50
- transformedDisclaimer,
51
- children
52
- } = _ref;
53
- const {
54
- t
55
- } = (0, _reactI18next.useTranslation)();
56
- if (embed.status === "error") {
57
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(DisclaimerWrapper, {
58
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledErrorWarningFill, {
59
- "aria-label": t("embed.embedError", {
60
- type: t("embed.type.disclaimer")
61
- }),
62
- title: t("embed.embedError", {
63
- type: t("embed.type.disclaimer")
64
- })
65
- }), children]
66
- });
67
- }
68
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(DisclaimerWrapper, {
69
- role: "region",
70
- "data-embed-type": "uu-disclaimer",
71
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.PopoverRoot, {
72
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.PopoverTrigger, {
73
- asChild: true,
74
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledIconButton, {
75
- size: "small",
76
- variant: "secondary",
77
- "aria-label": t("uuDisclaimer.title"),
78
- title: t("uuDisclaimer.title"),
79
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.AccessibilityFill, {})
80
- })
81
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Portal, {
82
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledPopoverContent, {
83
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
84
- children: transformedDisclaimer
85
- })
86
- })
87
- })]
88
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
89
- "data-uu-content": "",
90
- children: children
91
- })]
92
- });
10
+ //#region src/Embed/UuDisclaimerEmbed.tsx
11
+ const DisclaimerWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: {
12
+ display: "flex",
13
+ flexDirection: "column",
14
+ gap: "3xsmall",
15
+ clear: "both"
16
+ } });
17
+ const StyledIconButton = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.IconButton, { base: { alignSelf: "flex-end" } });
18
+ const StyledErrorWarningFill = (0, __ndla_styled_system_jsx.styled)(__ndla_icons.ErrorWarningFill, { base: {
19
+ alignSelf: "flex-end",
20
+ fill: "icon.subtle"
21
+ } });
22
+ const StyledPopoverContent = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.PopoverContent, { base: {
23
+ width: "surface.xlarge",
24
+ maxHeight: "50vh",
25
+ overflowY: "auto"
26
+ } });
27
+ const UuDisclaimerEmbed = ({ embed, transformedDisclaimer, children }) => {
28
+ const { t } = (0, react_i18next.useTranslation)();
29
+ if (embed.status === "error") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DisclaimerWrapper, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledErrorWarningFill, {
30
+ "aria-label": t("embed.embedError", { type: t("embed.type.disclaimer") }),
31
+ title: t("embed.embedError", { type: t("embed.type.disclaimer") })
32
+ }), children] });
33
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DisclaimerWrapper, {
34
+ role: "region",
35
+ "data-embed-type": "uu-disclaimer",
36
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__ndla_primitives.PopoverRoot, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.PopoverTrigger, {
37
+ asChild: true,
38
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIconButton, {
39
+ size: "small",
40
+ variant: "secondary",
41
+ "aria-label": t("uuDisclaimer.title"),
42
+ title: t("uuDisclaimer.title"),
43
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_icons.AccessibilityFill, {})
44
+ })
45
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledPopoverContent, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: transformedDisclaimer }) }) })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
46
+ "data-uu-content": "",
47
+ children
48
+ })]
49
+ });
93
50
  };
94
- var _default = exports.default = UuDisclaimerEmbed;
51
+ var UuDisclaimerEmbed_default = UuDisclaimerEmbed;
52
+
53
+ //#endregion
54
+ exports.UuDisclaimerEmbed_default = UuDisclaimerEmbed_default;
55
+ //# sourceMappingURL=UuDisclaimerEmbed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UuDisclaimerEmbed.js","names":["IconButton","ErrorWarningFill","PopoverContent","PopoverRoot","PopoverTrigger","AccessibilityFill","Portal"],"sources":["../../src/Embed/UuDisclaimerEmbed.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 ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Portal } from \"@ark-ui/react\";\nimport { AccessibilityFill, ErrorWarningFill } from \"@ndla/icons\";\nimport { IconButton, PopoverContent, PopoverRoot, PopoverTrigger } from \"@ndla/primitives\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { UuDisclaimerMetaData } from \"@ndla/types-embed\";\n\ninterface Props {\n embed: UuDisclaimerMetaData;\n transformedDisclaimer: ReactNode;\n children?: ReactNode;\n}\n\nconst DisclaimerWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n clear: \"both\",\n },\n});\n\nconst StyledIconButton = styled(IconButton, {\n base: {\n alignSelf: \"flex-end\",\n },\n});\n\nconst StyledErrorWarningFill = styled(ErrorWarningFill, {\n base: {\n alignSelf: \"flex-end\",\n fill: \"icon.subtle\",\n },\n});\n\nconst StyledPopoverContent = styled(PopoverContent, {\n base: {\n width: \"surface.xlarge\",\n maxHeight: \"50vh\",\n overflowY: \"auto\",\n },\n});\n\nconst UuDisclaimerEmbed = ({ embed, transformedDisclaimer, children }: Props) => {\n const { t } = useTranslation();\n if (embed.status === \"error\") {\n return (\n <DisclaimerWrapper>\n <StyledErrorWarningFill\n aria-label={t(\"embed.embedError\", { type: t(\"embed.type.disclaimer\") })}\n title={t(\"embed.embedError\", { type: t(\"embed.type.disclaimer\") })}\n />\n {children}\n </DisclaimerWrapper>\n );\n }\n\n return (\n <DisclaimerWrapper role=\"region\" data-embed-type=\"uu-disclaimer\">\n <PopoverRoot>\n <PopoverTrigger asChild>\n <StyledIconButton\n size=\"small\"\n variant=\"secondary\"\n aria-label={t(\"uuDisclaimer.title\")}\n title={t(\"uuDisclaimer.title\")}\n >\n <AccessibilityFill />\n </StyledIconButton>\n </PopoverTrigger>\n <Portal>\n <StyledPopoverContent>\n <div>{transformedDisclaimer}</div>\n </StyledPopoverContent>\n </Portal>\n </PopoverRoot>\n <div data-uu-content=\"\">{children}</div>\n </DisclaimerWrapper>\n );\n};\n\nexport default UuDisclaimerEmbed;\n"],"mappings":";;;;;;;;;;AAsBA,MAAM,oBAAoB,qCAAO,OAAO,EACtC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,KAAK;CACL,OAAO;AACR,EACF,EAAC;AAEF,MAAM,mBAAmB,qCAAOA,8BAAY,EAC1C,MAAM,EACJ,WAAW,WACZ,EACF,EAAC;AAEF,MAAM,yBAAyB,qCAAOC,+BAAkB,EACtD,MAAM;CACJ,WAAW;CACX,MAAM;AACP,EACF,EAAC;AAEF,MAAM,uBAAuB,qCAAOC,kCAAgB,EAClD,MAAM;CACJ,OAAO;CACP,WAAW;CACX,WAAW;AACZ,EACF,EAAC;AAEF,MAAM,oBAAoB,CAAC,EAAE,OAAO,uBAAuB,UAAiB,KAAK;CAC/E,MAAM,EAAE,GAAG,GAAG,mCAAgB;AAC9B,KAAI,MAAM,WAAW,QACnB,wBACE,4BAAC,gDACC,2BAAC;EACC,cAAY,EAAE,oBAAoB,EAAE,MAAM,EAAE,wBAAwB,CAAE,EAAC;EACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,wBAAwB,CAAE,EAAC;GAClE,EACD,YACiB;AAIxB,wBACE,4BAAC;EAAkB,MAAK;EAAS,mBAAgB;6BAC/C,4BAACC,4DACC,2BAACC;GAAe;6BACd,2BAAC;IACC,MAAK;IACL,SAAQ;IACR,cAAY,EAAE,qBAAqB;IACnC,OAAO,EAAE,qBAAqB;8BAE9B,2BAACC,mCAAoB;KACJ;IACJ,kBACjB,2BAACC,mDACC,2BAAC,kDACC,2BAAC,mBAAK,wBAA4B,GACb,GAChB,IACG,kBACd,2BAAC;GAAI,mBAAgB;GAAI;IAAe;GACtB;AAEvB;AAED,gCAAe"}
@@ -1,101 +1,55 @@
1
- "use strict";
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
+ const react = require_rolldown_runtime.__toESM(require("react"));
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 __ndla_safelink = require_rolldown_runtime.__toESM(require("@ndla/safelink"));
6
+ const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
2
7
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.ErrorMessage = void 0;
7
- var _primitives = require("@ndla/primitives");
8
- var _safelink = require("@ndla/safelink");
9
- var _jsx2 = require("@ndla/styled-system/jsx");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * Copyright (c) 2019-present, NDLA.
13
- *
14
- * This source code is licensed under the GPLv3 license found in the
15
- * LICENSE file in the root directory of this source tree.
16
- *
17
- */
8
+ //#region src/ErrorMessage/ErrorMessage.tsx
9
+ const StyledErrorMessage = (0, __ndla_styled_system_jsx.styled)("article", { base: {
10
+ textAlign: "center",
11
+ "& a": { color: "text.strong" },
12
+ "& h1": { marginTop: "0" }
13
+ } });
14
+ const IllustrationWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: {
15
+ display: "flex",
16
+ justifyContent: "center",
17
+ marginBottom: "medium",
18
+ tablet: { marginTop: "xxlarge" }
19
+ } });
20
+ const Description = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.Text, { base: {
21
+ marginBottom: "medium",
22
+ tablet: { marginBottom: "xxlarge" }
23
+ } });
24
+ const CustomElementWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: { marginBlock: "xxlarge" } });
25
+ const MessageWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: { marginTop: "3xsmall" } });
26
+ const ErrorMessage = ({ children, messages, illustration, illustrationElement, customElement }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledErrorMessage, { children: [
27
+ !!illustration && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IllustrationWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
28
+ src: illustration.url,
29
+ alt: illustration.altText
30
+ }) }),
31
+ !!illustrationElement && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IllustrationWrapper, { children: illustrationElement }),
32
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", { children: messages.title }),
33
+ !!messages.description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Description, { children: messages.description }),
34
+ !!customElement && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomElementWrapper, { children: customElement }),
35
+ !!messages.linksTitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: messages.linksTitle }),
36
+ !!messages.back && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_safelink.SafeLink, {
37
+ to: `/#${encodeURI(messages.back)}`,
38
+ onClick: () => window.history.back(),
39
+ children: messages.back
40
+ }),
41
+ !!messages.goToFrontPage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_safelink.SafeLink, {
42
+ to: "/",
43
+ children: messages.goToFrontPage
44
+ }) }),
45
+ !!messages.logInFailed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_safelink.SafeLink, {
46
+ to: "/minndla",
47
+ children: messages.logInFailed
48
+ }) }),
49
+ children
50
+ ] });
51
+ var ErrorMessage_default = ErrorMessage;
18
52
 
19
- // TODO: This has not been redesignet yet. This is just a rewrite of the previous design in panda
20
- const StyledErrorMessage = (0, _jsx2.styled)("article", {
21
- base: {
22
- textAlign: "center",
23
- "& a": {
24
- color: "text.strong"
25
- },
26
- "& h1": {
27
- marginTop: "0"
28
- }
29
- }
30
- });
31
- const IllustrationWrapper = (0, _jsx2.styled)("div", {
32
- base: {
33
- display: "flex",
34
- justifyContent: "center",
35
- marginBottom: "medium",
36
- tablet: {
37
- marginTop: "xxlarge"
38
- }
39
- }
40
- });
41
- const Description = (0, _jsx2.styled)(_primitives.Text, {
42
- base: {
43
- marginBottom: "medium",
44
- tablet: {
45
- marginBottom: "xxlarge"
46
- }
47
- }
48
- });
49
- const CustomElementWrapper = (0, _jsx2.styled)("div", {
50
- base: {
51
- marginBlock: "xxlarge"
52
- }
53
- });
54
- const MessageWrapper = (0, _jsx2.styled)("div", {
55
- base: {
56
- marginTop: "3xsmall"
57
- }
58
- });
59
- const ErrorMessage = _ref => {
60
- let {
61
- children,
62
- messages,
63
- illustration,
64
- illustrationElement,
65
- customElement
66
- } = _ref;
67
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledErrorMessage, {
68
- children: [!!illustration && /*#__PURE__*/(0, _jsxRuntime.jsx)(IllustrationWrapper, {
69
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
70
- src: illustration.url,
71
- alt: illustration.altText
72
- })
73
- }), !!illustrationElement && /*#__PURE__*/(0, _jsxRuntime.jsx)(IllustrationWrapper, {
74
- children: illustrationElement
75
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
76
- children: messages.title
77
- }), !!messages.description && /*#__PURE__*/(0, _jsxRuntime.jsx)(Description, {
78
- children: messages.description
79
- }), !!customElement && /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomElementWrapper, {
80
- children: customElement
81
- }), !!messages.linksTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
82
- children: messages.linksTitle
83
- }), !!messages.back && /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
84
- to: `/#${encodeURI(messages.back)}`,
85
- onClick: () => window.history.back(),
86
- children: messages.back
87
- }), !!messages.goToFrontPage && /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageWrapper, {
88
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
89
- to: "/",
90
- children: messages.goToFrontPage
91
- })
92
- }), !!messages.logInFailed && /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageWrapper, {
93
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
94
- to: "/minndla",
95
- children: messages.logInFailed
96
- })
97
- }), children]
98
- });
99
- };
100
- exports.ErrorMessage = ErrorMessage;
101
- var _default = exports.default = ErrorMessage;
53
+ //#endregion
54
+ exports.ErrorMessage_default = ErrorMessage_default;
55
+ //# sourceMappingURL=ErrorMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorMessage.js","names":["Text","SafeLink"],"sources":["../../src/ErrorMessage/ErrorMessage.tsx"],"sourcesContent":["/**\n * Copyright (c) 2019-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 ReactNode } from \"react\";\nimport { Text } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\n// TODO: This has not been redesignet yet. This is just a rewrite of the previous design in panda\n\nconst StyledErrorMessage = styled(\"article\", {\n base: {\n textAlign: \"center\",\n \"& a\": {\n color: \"text.strong\",\n },\n \"& h1\": {\n marginTop: \"0\",\n },\n },\n});\n\nconst IllustrationWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n marginBottom: \"medium\",\n tablet: {\n marginTop: \"xxlarge\",\n },\n },\n});\n\nconst Description = styled(Text, {\n base: {\n marginBottom: \"medium\",\n tablet: {\n marginBottom: \"xxlarge\",\n },\n },\n});\n\nconst CustomElementWrapper = styled(\"div\", {\n base: {\n marginBlock: \"xxlarge\",\n },\n});\n\nconst MessageWrapper = styled(\"div\", {\n base: {\n marginTop: \"3xsmall\",\n },\n});\n\ninterface Props {\n messages: {\n title: string;\n description?: string;\n linksTitle?: string;\n back?: string;\n goToFrontPage?: string;\n logInFailed?: string;\n };\n illustration?: {\n url: string;\n altText: string;\n };\n illustrationElement?: ReactNode;\n customElement?: ReactNode;\n children?: ReactNode;\n}\nexport const ErrorMessage = ({ children, messages, illustration, illustrationElement, customElement }: Props) => (\n <StyledErrorMessage>\n {!!illustration && (\n <IllustrationWrapper>\n <img src={illustration.url} alt={illustration.altText} />\n </IllustrationWrapper>\n )}\n {!!illustrationElement && <IllustrationWrapper>{illustrationElement}</IllustrationWrapper>}\n <h1>{messages.title}</h1>\n {!!messages.description && <Description>{messages.description}</Description>}\n {!!customElement && <CustomElementWrapper>{customElement}</CustomElementWrapper>}\n {!!messages.linksTitle && <h2>{messages.linksTitle}</h2>}\n {!!messages.back && (\n <SafeLink to={`/#${encodeURI(messages.back)}`} onClick={() => window.history.back()}>\n {messages.back}\n </SafeLink>\n )}\n {!!messages.goToFrontPage && (\n <MessageWrapper>\n <SafeLink to=\"/\">{messages.goToFrontPage}</SafeLink>\n </MessageWrapper>\n )}\n {!!messages.logInFailed && (\n <MessageWrapper>\n <SafeLink to=\"/minndla\">{messages.logInFailed}</SafeLink>\n </MessageWrapper>\n )}\n {children}\n </StyledErrorMessage>\n);\n\nexport default ErrorMessage;\n"],"mappings":";;;;;;;;AAeA,MAAM,qBAAqB,qCAAO,WAAW,EAC3C,MAAM;CACJ,WAAW;CACX,OAAO,EACL,OAAO,cACR;CACD,QAAQ,EACN,WAAW,IACZ;AACF,EACF,EAAC;AAEF,MAAM,sBAAsB,qCAAO,OAAO,EACxC,MAAM;CACJ,SAAS;CACT,gBAAgB;CAChB,cAAc;CACd,QAAQ,EACN,WAAW,UACZ;AACF,EACF,EAAC;AAEF,MAAM,cAAc,qCAAOA,wBAAM,EAC/B,MAAM;CACJ,cAAc;CACd,QAAQ,EACN,cAAc,UACf;AACF,EACF,EAAC;AAEF,MAAM,uBAAuB,qCAAO,OAAO,EACzC,MAAM,EACJ,aAAa,UACd,EACF,EAAC;AAEF,MAAM,iBAAiB,qCAAO,OAAO,EACnC,MAAM,EACJ,WAAW,UACZ,EACF,EAAC;AAmBF,MAAa,eAAe,CAAC,EAAE,UAAU,UAAU,cAAc,qBAAqB,eAAsB,qBAC1G,4BAAC;GACI,gCACD,2BAAC,iDACC,2BAAC;EAAI,KAAK,aAAa;EAAK,KAAK,aAAa;GAAW,GACrC;GAErB,uCAAuB,2BAAC,iCAAqB,sBAA0C;iBAC1F,2BAAC,kBAAI,SAAS,QAAW;GACtB,SAAS,+BAAe,2BAAC,yBAAa,SAAS,cAA0B;GACzE,iCAAiB,2BAAC,kCAAsB,gBAAqC;GAC7E,SAAS,8BAAc,2BAAC,kBAAI,SAAS,aAAgB;GACrD,SAAS,wBACV,2BAACC;EAAS,KAAK,IAAI,UAAU,SAAS,KAAK,CAAC;EAAG,SAAS,MAAM,OAAO,QAAQ,MAAM;YAChF,SAAS;GACD;GAEV,SAAS,iCACV,2BAAC,4CACC,2BAACA;EAAS,IAAG;YAAK,SAAS;GAAyB,GACrC;GAEhB,SAAS,+BACV,2BAAC,4CACC,2BAACA;EAAS,IAAG;YAAY,SAAS;GAAuB,GAC1C;CAElB;IACkB;AAGvB,2BAAe"}
@@ -1,16 +1,8 @@
1
- "use strict";
1
+ const require_ErrorMessage = require('./ErrorMessage.js');
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- /**
10
- * Copyright (c) 2019-present, NDLA.
11
- *
12
- * This source code is licensed under the GPLv3 license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- *
15
- */
16
- var _default = exports.default = _ErrorMessage.default;
3
+ //#region src/ErrorMessage/index.ts
4
+ var ErrorMessage_default$1 = require_ErrorMessage.ErrorMessage_default;
5
+
6
+ //#endregion
7
+ exports.ErrorMessage_default = ErrorMessage_default$1;
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ErrorMessage"],"sources":["../../src/ErrorMessage/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2019-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 ErrorMessage from \"./ErrorMessage\";\n\nexport default ErrorMessage;\n"],"mappings":";;;AAUA,6BAAeA"}