@ndla/ui 56.0.142-alpha.0 → 56.0.144-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 (358) hide show
  1. package/dist/panda.buildinfo.json +2 -3
  2. package/dist/styles.css +5 -9
  3. package/es/Article/Article.mjs +10 -12
  4. package/es/Article/Article.mjs.map +1 -1
  5. package/es/Article/ArticleByline.mjs.map +1 -1
  6. package/es/Article/ArticleFootNotes.mjs.map +1 -1
  7. package/es/AudioPlayer/AudioPlayer.mjs +3 -3
  8. package/es/AudioPlayer/AudioPlayer.mjs.map +1 -1
  9. package/es/AudioPlayer/Controls.mjs +1 -1
  10. package/es/AudioPlayer/Controls.mjs.map +1 -1
  11. package/es/AudioPlayer/SpeechControl.mjs +1 -1
  12. package/es/AudioPlayer/SpeechControl.mjs.map +1 -1
  13. package/es/Breadcrumb/Breadcrumb.mjs +3 -8
  14. package/es/Breadcrumb/Breadcrumb.mjs.map +1 -1
  15. package/es/Breadcrumb/BreadcrumbItem.mjs +7 -18
  16. package/es/Breadcrumb/BreadcrumbItem.mjs.map +1 -1
  17. package/es/Breadcrumb/HomeBreadcrumb.mjs +4 -4
  18. package/es/Breadcrumb/HomeBreadcrumb.mjs.map +1 -1
  19. package/es/CampaignBlock/CampaignBlock.mjs +1 -1
  20. package/es/CampaignBlock/CampaignBlock.mjs.map +1 -1
  21. package/es/CodeBlock/CodeBlock.mjs +1 -1
  22. package/es/CodeBlock/CodeBlock.mjs.map +1 -1
  23. package/es/CodeBlock/codeLanguageOptions.mjs.map +1 -1
  24. package/es/Concept/Concept.mjs +5 -5
  25. package/es/Concept/Concept.mjs.map +1 -1
  26. package/es/ContactBlock/ContactBlock.mjs.map +1 -1
  27. package/es/ContentTypeBadge/ContentTypeBadge.mjs.map +1 -1
  28. package/es/CopyParagraphButton/CopyParagraphButton.mjs +1 -1
  29. package/es/CopyParagraphButton/CopyParagraphButton.mjs.map +1 -1
  30. package/es/Embed/AudioEmbed.mjs +3 -3
  31. package/es/Embed/AudioEmbed.mjs.map +1 -1
  32. package/es/Embed/BrightcoveEmbed.mjs +2 -2
  33. package/es/Embed/BrightcoveEmbed.mjs.map +1 -1
  34. package/es/Embed/CodeEmbed.mjs +3 -4
  35. package/es/Embed/CodeEmbed.mjs.map +1 -1
  36. package/es/Embed/ConceptEmbed.mjs +2 -2
  37. package/es/Embed/ConceptEmbed.mjs.map +1 -1
  38. package/es/Embed/ConceptInlineTriggerButton.mjs.map +1 -1
  39. package/es/Embed/ContentLinkEmbed.mjs +1 -1
  40. package/es/Embed/ContentLinkEmbed.mjs.map +1 -1
  41. package/es/Embed/CopyrightEmbed.mjs +1 -1
  42. package/es/Embed/CopyrightEmbed.mjs.map +1 -1
  43. package/es/Embed/EmbedErrorPlaceholder.mjs +1 -1
  44. package/es/Embed/EmbedErrorPlaceholder.mjs.map +1 -1
  45. package/es/Embed/EmbedWrapper.mjs.map +1 -1
  46. package/es/Embed/ExternalEmbed.mjs +3 -3
  47. package/es/Embed/ExternalEmbed.mjs.map +1 -1
  48. package/es/Embed/FootnoteEmbed.mjs +1 -1
  49. package/es/Embed/FootnoteEmbed.mjs.map +1 -1
  50. package/es/Embed/GlossEmbed.mjs +2 -2
  51. package/es/Embed/GlossEmbed.mjs.map +1 -1
  52. package/es/Embed/H5pEmbed.mjs +2 -2
  53. package/es/Embed/H5pEmbed.mjs.map +1 -1
  54. package/es/Embed/IframeEmbed.mjs +3 -3
  55. package/es/Embed/IframeEmbed.mjs.map +1 -1
  56. package/es/Embed/ImageEmbed.mjs +2 -4
  57. package/es/Embed/ImageEmbed.mjs.map +1 -1
  58. package/es/Embed/InlineTriggerButton.mjs.map +1 -1
  59. package/es/Embed/RelatedContentEmbed.mjs +2 -3
  60. package/es/Embed/RelatedContentEmbed.mjs.map +1 -1
  61. package/es/Embed/UnknownEmbed.mjs +1 -1
  62. package/es/Embed/UnknownEmbed.mjs.map +1 -1
  63. package/es/Embed/UuDisclaimerEmbed.mjs +1 -1
  64. package/es/Embed/UuDisclaimerEmbed.mjs.map +1 -1
  65. package/es/FactBox/FactBox.mjs +1 -1
  66. package/es/FactBox/FactBox.mjs.map +1 -1
  67. package/es/FileList/File.mjs +34 -30
  68. package/es/FileList/File.mjs.map +1 -1
  69. package/es/FileList/FileList.mjs.map +1 -1
  70. package/es/FileList/PdfFile.mjs.map +1 -1
  71. package/es/Gloss/Gloss.mjs +5 -7
  72. package/es/Gloss/Gloss.mjs.map +1 -1
  73. package/es/Gloss/GlossExample.mjs +1 -1
  74. package/es/Gloss/GlossExample.mjs.map +1 -1
  75. package/es/Grid/Grid.mjs.map +1 -1
  76. package/es/Grid/GridParallaxItem.mjs.map +1 -1
  77. package/es/KeyFigure/KeyFigure.mjs +1 -1
  78. package/es/KeyFigure/KeyFigure.mjs.map +1 -1
  79. package/es/LicenseByline/EmbedByline.mjs +1 -2
  80. package/es/LicenseByline/EmbedByline.mjs.map +1 -1
  81. package/es/LicenseByline/LicenseLink.mjs.map +1 -1
  82. package/es/LinkBlock/LinkBlock.mjs +1 -1
  83. package/es/LinkBlock/LinkBlock.mjs.map +1 -1
  84. package/es/LinkBlock/LinkBlockSection.mjs +1 -1
  85. package/es/LinkBlock/LinkBlockSection.mjs.map +1 -1
  86. package/es/Pitch/Pitch.mjs.map +1 -1
  87. package/es/RelatedArticleList/RelatedArticleList.mjs.map +1 -1
  88. package/es/ResourceBox/ResourceBox.mjs +1 -1
  89. package/es/ResourceBox/ResourceBox.mjs.map +1 -1
  90. package/es/TagSelector/TagSelector.mjs.map +1 -1
  91. package/es/ZendeskButton/ZendeskButton.mjs.map +1 -1
  92. package/es/_virtual/rolldown_runtime.mjs +3 -1
  93. package/es/i18n/formatNestedMessages.mjs.map +1 -1
  94. package/es/i18n/useComponentTranslations.mjs +1 -2
  95. package/es/i18n/useComponentTranslations.mjs.map +1 -1
  96. package/es/index.mjs +34 -38
  97. package/es/locale/messages-en.mjs +2 -2
  98. package/es/locale/messages-en.mjs.map +1 -1
  99. package/es/locale/messages-nb.mjs +2 -2
  100. package/es/locale/messages-nb.mjs.map +1 -1
  101. package/es/locale/messages-nn.mjs +2 -2
  102. package/es/locale/messages-nn.mjs.map +1 -1
  103. package/es/locale/messages-se.mjs +2 -2
  104. package/es/locale/messages-se.mjs.map +1 -1
  105. package/es/model/ContentType.mjs.map +1 -1
  106. package/es/model/SubjectCategories.mjs +1 -2
  107. package/es/model/SubjectCategories.mjs.map +1 -1
  108. package/es/model/SubjectTypes.mjs +1 -2
  109. package/es/model/SubjectTypes.mjs.map +1 -1
  110. package/es/model/WordClass.mjs +1 -2
  111. package/es/model/WordClass.mjs.map +1 -1
  112. package/es/model/index.mjs +1 -1
  113. package/es/model/index.mjs.map +1 -1
  114. package/es/utils/licenseAttributes.mjs +1 -2
  115. package/es/utils/licenseAttributes.mjs.map +1 -1
  116. package/es/utils/relativeUrl.mjs.map +1 -1
  117. package/lib/Article/Article.js +24 -20
  118. package/lib/Article/Article.js.map +1 -1
  119. package/lib/Article/ArticleByline.js +18 -10
  120. package/lib/Article/ArticleByline.js.map +1 -1
  121. package/lib/Article/ArticleFootNotes.js +6 -3
  122. package/lib/Article/ArticleFootNotes.js.map +1 -1
  123. package/lib/AudioPlayer/AudioPlayer.js +17 -11
  124. package/lib/AudioPlayer/AudioPlayer.js.map +1 -1
  125. package/lib/AudioPlayer/Controls.js +15 -8
  126. package/lib/AudioPlayer/Controls.js.map +1 -1
  127. package/lib/AudioPlayer/SpeechControl.js +11 -6
  128. package/lib/AudioPlayer/SpeechControl.js.map +1 -1
  129. package/lib/Breadcrumb/Breadcrumb.d.ts +3 -5
  130. package/lib/Breadcrumb/Breadcrumb.js +12 -13
  131. package/lib/Breadcrumb/Breadcrumb.js.map +1 -1
  132. package/lib/Breadcrumb/BreadcrumbItem.d.ts +3 -3
  133. package/lib/Breadcrumb/BreadcrumbItem.js +11 -19
  134. package/lib/Breadcrumb/BreadcrumbItem.js.map +1 -1
  135. package/lib/Breadcrumb/HomeBreadcrumb.js +13 -9
  136. package/lib/Breadcrumb/HomeBreadcrumb.js.map +1 -1
  137. package/lib/CampaignBlock/CampaignBlock.js +17 -10
  138. package/lib/CampaignBlock/CampaignBlock.js.map +1 -1
  139. package/lib/CodeBlock/CodeBlock.js +9 -5
  140. package/lib/CodeBlock/CodeBlock.js.map +1 -1
  141. package/lib/CodeBlock/codeLanguageOptions.js.map +1 -1
  142. package/lib/Concept/Concept.js +19 -15
  143. package/lib/Concept/Concept.js.map +1 -1
  144. package/lib/ContactBlock/ContactBlock.js +10 -6
  145. package/lib/ContactBlock/ContactBlock.js.map +1 -1
  146. package/lib/ContentTypeBadge/ContentTypeBadge.js +28 -24
  147. package/lib/ContentTypeBadge/ContentTypeBadge.js.map +1 -1
  148. package/lib/CopyParagraphButton/CopyParagraphButton.js +13 -7
  149. package/lib/CopyParagraphButton/CopyParagraphButton.js.map +1 -1
  150. package/lib/Embed/AudioEmbed.js +16 -13
  151. package/lib/Embed/AudioEmbed.js.map +1 -1
  152. package/lib/Embed/BrightcoveEmbed.js +19 -13
  153. package/lib/Embed/BrightcoveEmbed.js.map +1 -1
  154. package/lib/Embed/CodeEmbed.js +19 -14
  155. package/lib/Embed/CodeEmbed.js.map +1 -1
  156. package/lib/Embed/ConceptEmbed.js +21 -15
  157. package/lib/Embed/ConceptEmbed.js.map +1 -1
  158. package/lib/Embed/ConceptInlineTriggerButton.js +4 -3
  159. package/lib/Embed/ConceptInlineTriggerButton.js.map +1 -1
  160. package/lib/Embed/ContentLinkEmbed.js +7 -4
  161. package/lib/Embed/ContentLinkEmbed.js.map +1 -1
  162. package/lib/Embed/CopyrightEmbed.js +7 -5
  163. package/lib/Embed/CopyrightEmbed.js.map +1 -1
  164. package/lib/Embed/EmbedErrorPlaceholder.js +13 -8
  165. package/lib/Embed/EmbedErrorPlaceholder.js.map +1 -1
  166. package/lib/Embed/EmbedWrapper.js +10 -5
  167. package/lib/Embed/EmbedWrapper.js.map +1 -1
  168. package/lib/Embed/ExternalEmbed.js +15 -10
  169. package/lib/Embed/ExternalEmbed.js.map +1 -1
  170. package/lib/Embed/FootnoteEmbed.js +7 -4
  171. package/lib/Embed/FootnoteEmbed.js.map +1 -1
  172. package/lib/Embed/GlossEmbed.js +17 -12
  173. package/lib/Embed/GlossEmbed.js.map +1 -1
  174. package/lib/Embed/H5pEmbed.js +11 -7
  175. package/lib/Embed/H5pEmbed.js.map +1 -1
  176. package/lib/Embed/IframeEmbed.js +15 -10
  177. package/lib/Embed/IframeEmbed.js.map +1 -1
  178. package/lib/Embed/ImageEmbed.js +21 -16
  179. package/lib/Embed/ImageEmbed.js.map +1 -1
  180. package/lib/Embed/InlineTriggerButton.js +8 -4
  181. package/lib/Embed/InlineTriggerButton.js.map +1 -1
  182. package/lib/Embed/RelatedContentEmbed.js +12 -11
  183. package/lib/Embed/RelatedContentEmbed.js.map +1 -1
  184. package/lib/Embed/UnknownEmbed.js +7 -4
  185. package/lib/Embed/UnknownEmbed.js.map +1 -1
  186. package/lib/Embed/UuDisclaimerEmbed.js +15 -8
  187. package/lib/Embed/UuDisclaimerEmbed.js.map +1 -1
  188. package/lib/FactBox/FactBox.js +13 -7
  189. package/lib/FactBox/FactBox.js.map +1 -1
  190. package/lib/FileList/File.js +51 -39
  191. package/lib/FileList/File.js.map +1 -1
  192. package/lib/FileList/FileList.js +8 -4
  193. package/lib/FileList/FileList.js.map +1 -1
  194. package/lib/FileList/PdfFile.js +6 -3
  195. package/lib/FileList/PdfFile.js.map +1 -1
  196. package/lib/Gloss/Gloss.js +23 -17
  197. package/lib/Gloss/Gloss.js.map +1 -1
  198. package/lib/Gloss/GlossExample.js +9 -5
  199. package/lib/Gloss/GlossExample.js.map +1 -1
  200. package/lib/Grid/Grid.js +6 -3
  201. package/lib/Grid/Grid.js.map +1 -1
  202. package/lib/Grid/GridParallaxItem.js +6 -3
  203. package/lib/Grid/GridParallaxItem.js.map +1 -1
  204. package/lib/KeyFigure/KeyFigure.js +7 -4
  205. package/lib/KeyFigure/KeyFigure.js.map +1 -1
  206. package/lib/LicenseByline/EmbedByline.js +17 -11
  207. package/lib/LicenseByline/EmbedByline.js.map +1 -1
  208. package/lib/LicenseByline/LicenseLink.js +8 -4
  209. package/lib/LicenseByline/LicenseLink.js.map +1 -1
  210. package/lib/LinkBlock/LinkBlock.js +17 -10
  211. package/lib/LinkBlock/LinkBlock.js.map +1 -1
  212. package/lib/LinkBlock/LinkBlockSection.js +7 -4
  213. package/lib/LinkBlock/LinkBlockSection.js.map +1 -1
  214. package/lib/Pitch/Pitch.js +14 -8
  215. package/lib/Pitch/Pitch.js.map +1 -1
  216. package/lib/RelatedArticleList/RelatedArticleList.js +20 -12
  217. package/lib/RelatedArticleList/RelatedArticleList.js.map +1 -1
  218. package/lib/ResourceBox/ResourceBox.js +14 -7
  219. package/lib/ResourceBox/ResourceBox.js.map +1 -1
  220. package/lib/TagSelector/TagSelector.js +12 -6
  221. package/lib/TagSelector/TagSelector.js.map +1 -1
  222. package/lib/ZendeskButton/ZendeskButton.js +6 -3
  223. package/lib/ZendeskButton/ZendeskButton.js.map +1 -1
  224. package/lib/_virtual/rolldown_runtime.js +5 -13
  225. package/lib/i18n/formatNestedMessages.js.map +1 -1
  226. package/lib/i18n/useComponentTranslations.js +5 -4
  227. package/lib/i18n/useComponentTranslations.js.map +1 -1
  228. package/lib/index.d.ts +51 -30
  229. package/lib/index.js +145 -152
  230. package/lib/locale/messages-en.js +5 -4
  231. package/lib/locale/messages-en.js.map +1 -1
  232. package/lib/locale/messages-nb.js +5 -4
  233. package/lib/locale/messages-nb.js.map +1 -1
  234. package/lib/locale/messages-nn.js +5 -4
  235. package/lib/locale/messages-nn.js.map +1 -1
  236. package/lib/locale/messages-se.js +5 -4
  237. package/lib/locale/messages-se.js.map +1 -1
  238. package/lib/model/ContentType.js.map +1 -1
  239. package/lib/model/SubjectCategories.js +1 -2
  240. package/lib/model/SubjectCategories.js.map +1 -1
  241. package/lib/model/SubjectTypes.js +1 -2
  242. package/lib/model/SubjectTypes.js.map +1 -1
  243. package/lib/model/WordClass.js +1 -2
  244. package/lib/model/WordClass.js.map +1 -1
  245. package/lib/model/index.js +11 -11
  246. package/lib/model/index.js.map +1 -1
  247. package/lib/utils/licenseAttributes.js +3 -3
  248. package/lib/utils/licenseAttributes.js.map +1 -1
  249. package/lib/utils/relativeUrl.js.map +1 -1
  250. package/package.json +8 -8
  251. package/src/Article/Article.tsx +8 -4
  252. package/src/Breadcrumb/Breadcrumb.stories.tsx +1 -16
  253. package/src/Breadcrumb/Breadcrumb.tsx +3 -16
  254. package/src/Breadcrumb/BreadcrumbItem.tsx +9 -28
  255. package/src/Breadcrumb/HomeBreadcrumb.tsx +2 -2
  256. package/src/Concept/Concept.tsx +5 -1
  257. package/src/Embed/AudioEmbed.stories.tsx +1 -1
  258. package/src/Embed/AudioEmbed.tsx +2 -2
  259. package/src/Embed/BrightcoveEmbed.stories.tsx +1 -1
  260. package/src/Embed/BrightcoveEmbed.tsx +1 -1
  261. package/src/Embed/CodeEmbed.tsx +2 -2
  262. package/src/Embed/ConceptEmbed.stories.tsx +1 -1
  263. package/src/Embed/CopyrightEmbed.tsx +1 -1
  264. package/src/Embed/EmbedErrorPlaceholder.tsx +1 -2
  265. package/src/Embed/ExternalEmbed.stories.tsx +1 -1
  266. package/src/Embed/ExternalEmbed.tsx +1 -1
  267. package/src/Embed/FootnoteEmbed.stories.tsx +1 -1
  268. package/src/Embed/GlossEmbed.tsx +1 -1
  269. package/src/Embed/H5pEmbed.stories.tsx +1 -1
  270. package/src/Embed/IframeEmbed.stories.tsx +1 -1
  271. package/src/Embed/IframeEmbed.tsx +1 -1
  272. package/src/Embed/ImageEmbed.stories.tsx +2 -2
  273. package/src/Embed/ImageEmbed.tsx +1 -1
  274. package/src/Embed/RelatedContentEmbed.stories.tsx +2 -2
  275. package/src/Embed/UuDisclaimerEmbed.stories.tsx +3 -3
  276. package/src/FileList/File.tsx +18 -7
  277. package/src/LinkBlock/LinkBlock.stories.tsx +1 -1
  278. package/src/Pitch/Pitch.stories.tsx +2 -2
  279. package/src/index.ts +53 -61
  280. package/es/AudioPlayer/index.mjs +0 -8
  281. package/es/AudioPlayer/index.mjs.map +0 -1
  282. package/es/Breadcrumb/index.mjs +0 -9
  283. package/es/Breadcrumb/index.mjs.map +0 -1
  284. package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.mjs +0 -25
  285. package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.mjs.map +0 -1
  286. package/es/ContentTypeFramedContent/ContentTypeFramedContent.mjs +0 -25
  287. package/es/ContentTypeFramedContent/ContentTypeFramedContent.mjs.map +0 -1
  288. package/es/ContentTypeHero/ContentTypeHero.mjs +0 -39
  289. package/es/ContentTypeHero/ContentTypeHero.mjs.map +0 -1
  290. package/es/CopyParagraphButton/index.mjs +0 -8
  291. package/es/CopyParagraphButton/index.mjs.map +0 -1
  292. package/es/FactBox/index.mjs +0 -8
  293. package/es/FactBox/index.mjs.map +0 -1
  294. package/es/RelatedArticleList/index.mjs +0 -8
  295. package/es/RelatedArticleList/index.mjs.map +0 -1
  296. package/lib/Article/index.d.ts +0 -10
  297. package/lib/AudioPlayer/index.d.ts +0 -9
  298. package/lib/AudioPlayer/index.js +0 -8
  299. package/lib/AudioPlayer/index.js.map +0 -1
  300. package/lib/Breadcrumb/index.d.ts +0 -11
  301. package/lib/Breadcrumb/index.js +0 -9
  302. package/lib/Breadcrumb/index.js.map +0 -1
  303. package/lib/CampaignBlock/index.d.ts +0 -8
  304. package/lib/CodeBlock/index.d.ts +0 -9
  305. package/lib/ContactBlock/index.d.ts +0 -9
  306. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.d.ts +0 -16
  307. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -26
  308. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js.map +0 -1
  309. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.d.ts +0 -16
  310. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -26
  311. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js.map +0 -1
  312. package/lib/ContentTypeHero/ContentTypeHero.d.ts +0 -14
  313. package/lib/ContentTypeHero/ContentTypeHero.js +0 -40
  314. package/lib/ContentTypeHero/ContentTypeHero.js.map +0 -1
  315. package/lib/ContentTypeHero/index.d.ts +0 -9
  316. package/lib/CopyParagraphButton/index.d.ts +0 -10
  317. package/lib/CopyParagraphButton/index.js +0 -8
  318. package/lib/CopyParagraphButton/index.js.map +0 -1
  319. package/lib/Embed/index.d.ts +0 -27
  320. package/lib/FactBox/index.d.ts +0 -9
  321. package/lib/FactBox/index.js +0 -8
  322. package/lib/FactBox/index.js.map +0 -1
  323. package/lib/FileList/index.d.ts +0 -10
  324. package/lib/Gloss/index.d.ts +0 -9
  325. package/lib/Grid/index.d.ts +0 -10
  326. package/lib/KeyFigure/index.d.ts +0 -8
  327. package/lib/LicenseByline/index.d.ts +0 -9
  328. package/lib/LinkBlock/index.d.ts +0 -9
  329. package/lib/Pitch/index.d.ts +0 -8
  330. package/lib/RelatedArticleList/index.d.ts +0 -10
  331. package/lib/RelatedArticleList/index.js +0 -8
  332. package/lib/RelatedArticleList/index.js.map +0 -1
  333. package/lib/ResourceBox/index.d.ts +0 -9
  334. package/lib/i18n/index.d.ts +0 -9
  335. package/src/Article/index.ts +0 -20
  336. package/src/AudioPlayer/index.ts +0 -11
  337. package/src/Breadcrumb/index.ts +0 -15
  338. package/src/CampaignBlock/index.ts +0 -9
  339. package/src/CodeBlock/index.ts +0 -10
  340. package/src/ContactBlock/index.ts +0 -10
  341. package/src/ContentTypeBlockQuote/ContentTypeBlockQuote.tsx +0 -32
  342. package/src/ContentTypeFramedContent/ContentTypeFramedContent.tsx +0 -34
  343. package/src/ContentTypeHero/ContentTypeHero.stories.tsx +0 -75
  344. package/src/ContentTypeHero/ContentTypeHero.tsx +0 -56
  345. package/src/ContentTypeHero/index.ts +0 -10
  346. package/src/CopyParagraphButton/index.tsx +0 -12
  347. package/src/Embed/index.ts +0 -28
  348. package/src/FactBox/index.ts +0 -11
  349. package/src/FileList/index.ts +0 -11
  350. package/src/Gloss/index.tsx +0 -10
  351. package/src/Grid/index.ts +0 -12
  352. package/src/KeyFigure/index.ts +0 -9
  353. package/src/LicenseByline/index.tsx +0 -10
  354. package/src/LinkBlock/index.ts +0 -10
  355. package/src/Pitch/index.ts +0 -9
  356. package/src/RelatedArticleList/index.ts +0 -13
  357. package/src/ResourceBox/index.ts +0 -11
  358. package/src/i18n/index.ts +0 -19
@@ -1 +1 @@
1
- {"version":3,"file":"RelatedArticleList.js","names":["contentTypes","CardRoot","CardContent","ContentTypeBadge","CardHeading","SafeLink","ExternalLinkLine","Text","Button","Heading"],"sources":["../../src/RelatedArticleList/RelatedArticleList.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 { Children, type ComponentPropsWithoutRef, type ReactElement, type ReactNode, useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { ExternalLinkLine } from \"@ndla/icons\";\nimport { CardContent, CardHeading, CardRoot, Text, Heading, Button } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { linkOverlay } from \"@ndla/styled-system/patterns\";\nimport { ContentTypeBadge } from \"../ContentTypeBadge/ContentTypeBadge\";\nimport { contentTypes } from \"../model/ContentType\";\nimport type { HeadingLevel } from \"../types\";\n\ninterface RelatedArticleProps {\n title: string;\n introduction: string;\n to: string;\n linkInfo?: string;\n target?: string;\n type?: string;\n}\n\nconst StyledSpan = styled(\"span\", {\n base: {\n display: \"flex\",\n gap: \"3xsmall\",\n },\n});\n\nexport const RelatedArticle = ({\n title,\n introduction,\n to,\n linkInfo = \"\",\n target = \"\",\n type = contentTypes.SUBJECT_MATERIAL,\n}: RelatedArticleProps) => {\n return (\n <CardRoot data-embed-type=\"related-article\">\n <CardContent>\n <ContentTypeBadge contentType={type} />\n <CardHeading asChild consumeCss>\n <span>\n <SafeLink\n unstyled\n to={to}\n target={target}\n rel={linkInfo ? \"noopener noreferrer\" : undefined}\n css={linkOverlay.raw()}\n >\n <StyledSpan>\n {title}\n {target === \"_blank\" && <ExternalLinkLine />}\n </StyledSpan>\n </SafeLink>\n </span>\n </CardHeading>\n <Text dangerouslySetInnerHTML={{ __html: introduction }} />\n <Text color=\"text.subtle\" textStyle=\"label.small\">\n {linkInfo}\n </Text>\n </CardContent>\n </CardRoot>\n );\n};\n\nconst HeadingWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n width: \"100%\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n alignSelf: \"flex-start\",\n },\n});\n\nconst ArticlesWrapper = styled(\"div\", {\n base: {\n display: \"grid\",\n width: \"100%\",\n gridTemplateColumns: \"repeat(2, 1fr)\",\n gap: \"medium\",\n tabletDown: {\n gridTemplateColumns: \"1fr\",\n },\n },\n});\n\nconst StyledSection = styled(\"section\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: \"medium\",\n clear: \"both\",\n },\n});\n\nconst StyledButton = styled(Button, {\n base: {\n marginBlockStart: \"xsmall\",\n },\n});\n\ninterface Props extends ComponentPropsWithoutRef<\"section\"> {\n children?: ReactElement[];\n articleCount?: number;\n headingLevel?: HeadingLevel;\n headingButtons?: ReactNode;\n}\n\nexport const RelatedArticleList = ({\n children = [],\n articleCount,\n headingLevel: HeadingElement = \"h2\",\n headingButtons,\n ...rest\n}: Props) => {\n const [expanded, setExpanded] = useState(false);\n const { t } = useTranslation();\n const childCount = useMemo(() => articleCount ?? Children.count(children), [children, articleCount]);\n const childrenToShow = useMemo(\n () => (childCount > 2 && !expanded ? children?.slice(0, 2) : children),\n [childCount, children, expanded],\n );\n\n return (\n <StyledSection {...rest} data-embed-type=\"related-content-list\">\n <HeadingWrapper>\n <Heading asChild consumeCss textStyle=\"title.large\" fontWeight=\"bold\">\n <HeadingElement>{t(\"related.title\")}</HeadingElement>\n </Heading>\n {headingButtons}\n </HeadingWrapper>\n <ArticlesWrapper>{childrenToShow}</ArticlesWrapper>\n {childCount > 2 ? (\n <StyledButton variant=\"secondary\" onClick={() => setExpanded((p) => !p)}>\n {t(`related.show${expanded ? \"Less\" : \"More\"}`)}\n </StyledButton>\n ) : null}\n </StyledSection>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AA4BA,MAAM,aAAa,qCAAO,QAAQ,EAChC,MAAM;CACJ,SAAS;CACT,KAAK;AACN,EACF,EAAC;AAEF,MAAa,iBAAiB,CAAC,EAC7B,OACA,cACA,IACA,WAAW,IACX,SAAS,IACT,OAAOA,mGAAa,kBACA,KAAK;AACzB,wBACE,2BAACC;EAAS,mBAAgB;4BACxB,4BAACC;mBACC,2BAACC,0HAAiB,aAAa,OAAQ;mBACvC,2BAACC;IAAY;IAAQ;8BACnB,2BAAC,oCACC,2BAACC;KACC;KACI;KACI;KACR,KAAK,WAAW;KAChB,KAAK,0CAAY,KAAK;+BAEtB,4BAAC,yBACE,OACA,WAAW,4BAAY,2BAACC,kCAAmB,IACjC;MACJ,GACN;KACK;mBACd,2BAACC,0BAAK,yBAAyB,EAAE,QAAQ,aAAc,IAAI;mBAC3D,2BAACA;IAAK,OAAM;IAAc,WAAU;cACjC;KACI;MACK;GACL;AAEd;AAED,MAAM,iBAAiB,qCAAO,OAAO,EACnC,MAAM;CACJ,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB,YAAY;CACZ,WAAW;AACZ,EACF,EAAC;AAEF,MAAM,kBAAkB,qCAAO,OAAO,EACpC,MAAM;CACJ,SAAS;CACT,OAAO;CACP,qBAAqB;CACrB,KAAK;CACL,YAAY,EACV,qBAAqB,MACtB;AACF,EACF,EAAC;AAEF,MAAM,gBAAgB,qCAAO,WAAW,EACtC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,YAAY;CACZ,KAAK;CACL,OAAO;AACR,EACF,EAAC;AAEF,MAAM,eAAe,qCAAOC,0BAAQ,EAClC,MAAM,EACJ,kBAAkB,SACnB,EACF,EAAC;AASF,MAAa,qBAAqB,CAAC,EACjC,WAAW,CAAE,GACb,cACA,cAAc,iBAAiB,MAC/B,eACA,GAAG,MACG,KAAK;CACX,MAAM,CAAC,UAAU,YAAY,GAAG,oBAAS,MAAM;CAC/C,MAAM,EAAE,GAAG,GAAG,mCAAgB;CAC9B,MAAM,aAAa,mBAAQ,MAAM,gBAAgB,eAAS,MAAM,SAAS,EAAE,CAAC,UAAU,YAAa,EAAC;CACpG,MAAM,iBAAiB,mBACrB,MAAO,aAAa,MAAM,WAAW,UAAU,MAAM,GAAG,EAAE,GAAG,UAC7D;EAAC;EAAY;EAAU;CAAS,EACjC;AAED,wBACE,4BAAC;EAAc,GAAI;EAAM,mBAAgB;;mBACvC,4BAAC,6CACC,2BAACC;IAAQ;IAAQ;IAAW,WAAU;IAAc,YAAW;8BAC7D,2BAAC,4BAAgB,EAAE,gBAAgB,GAAkB;KAC7C,EACT,kBACc;mBACjB,2BAAC,6BAAiB,iBAAiC;GAClD,aAAa,oBACZ,2BAAC;IAAa,SAAQ;IAAY,SAAS,MAAM,YAAY,CAAC,OAAO,EAAE;cACpE,GAAG,cAAc,WAAW,SAAS,OAAO,EAAE;KAClC,GACb;;GACU;AAEnB"}
1
+ {"version":3,"file":"RelatedArticleList.js","names":["contentTypes","CardRoot","CardContent","ContentTypeBadge","CardHeading","SafeLink","linkOverlay","ExternalLinkLine","Text","Button","Children","Heading"],"sources":["../../src/RelatedArticleList/RelatedArticleList.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 { Children, type ComponentPropsWithoutRef, type ReactElement, type ReactNode, useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { ExternalLinkLine } from \"@ndla/icons\";\nimport { CardContent, CardHeading, CardRoot, Text, Heading, Button } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { linkOverlay } from \"@ndla/styled-system/patterns\";\nimport { ContentTypeBadge } from \"../ContentTypeBadge/ContentTypeBadge\";\nimport { contentTypes } from \"../model/ContentType\";\nimport type { HeadingLevel } from \"../types\";\n\ninterface RelatedArticleProps {\n title: string;\n introduction: string;\n to: string;\n linkInfo?: string;\n target?: string;\n type?: string;\n}\n\nconst StyledSpan = styled(\"span\", {\n base: {\n display: \"flex\",\n gap: \"3xsmall\",\n },\n});\n\nexport const RelatedArticle = ({\n title,\n introduction,\n to,\n linkInfo = \"\",\n target = \"\",\n type = contentTypes.SUBJECT_MATERIAL,\n}: RelatedArticleProps) => {\n return (\n <CardRoot data-embed-type=\"related-article\">\n <CardContent>\n <ContentTypeBadge contentType={type} />\n <CardHeading asChild consumeCss>\n <span>\n <SafeLink\n unstyled\n to={to}\n target={target}\n rel={linkInfo ? \"noopener noreferrer\" : undefined}\n css={linkOverlay.raw()}\n >\n <StyledSpan>\n {title}\n {target === \"_blank\" && <ExternalLinkLine />}\n </StyledSpan>\n </SafeLink>\n </span>\n </CardHeading>\n <Text dangerouslySetInnerHTML={{ __html: introduction }} />\n <Text color=\"text.subtle\" textStyle=\"label.small\">\n {linkInfo}\n </Text>\n </CardContent>\n </CardRoot>\n );\n};\n\nconst HeadingWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n width: \"100%\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n alignSelf: \"flex-start\",\n },\n});\n\nconst ArticlesWrapper = styled(\"div\", {\n base: {\n display: \"grid\",\n width: \"100%\",\n gridTemplateColumns: \"repeat(2, 1fr)\",\n gap: \"medium\",\n tabletDown: {\n gridTemplateColumns: \"1fr\",\n },\n },\n});\n\nconst StyledSection = styled(\"section\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: \"medium\",\n clear: \"both\",\n },\n});\n\nconst StyledButton = styled(Button, {\n base: {\n marginBlockStart: \"xsmall\",\n },\n});\n\ninterface Props extends ComponentPropsWithoutRef<\"section\"> {\n children?: ReactElement[];\n articleCount?: number;\n headingLevel?: HeadingLevel;\n headingButtons?: ReactNode;\n}\n\nexport const RelatedArticleList = ({\n children = [],\n articleCount,\n headingLevel: HeadingElement = \"h2\",\n headingButtons,\n ...rest\n}: Props) => {\n const [expanded, setExpanded] = useState(false);\n const { t } = useTranslation();\n const childCount = useMemo(() => articleCount ?? Children.count(children), [children, articleCount]);\n const childrenToShow = useMemo(\n () => (childCount > 2 && !expanded ? children?.slice(0, 2) : children),\n [childCount, children, expanded],\n );\n\n return (\n <StyledSection {...rest} data-embed-type=\"related-content-list\">\n <HeadingWrapper>\n <Heading asChild consumeCss textStyle=\"title.large\" fontWeight=\"bold\">\n <HeadingElement>{t(\"related.title\")}</HeadingElement>\n </Heading>\n {headingButtons}\n </HeadingWrapper>\n <ArticlesWrapper>{childrenToShow}</ArticlesWrapper>\n {childCount > 2 ? (\n <StyledButton variant=\"secondary\" onClick={() => setExpanded((p) => !p)}>\n {t(`related.show${expanded ? \"Less\" : \"More\"}`)}\n </StyledButton>\n ) : null}\n </StyledSection>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,kDAAoB,QAAQ,EAChC,MAAM;CACJ,SAAS;CACT,KAAK;CACN,EACF,CAAC;AAEF,MAAa,kBAAkB,EAC7B,OACA,cACA,IACA,WAAW,IACX,SAAS,IACT,OAAOA,iCAAa,uBACK;AACzB,QACE,2CAACC;EAAS,mBAAgB;YACxB,4CAACC;GACC,2CAACC,6CAAiB,aAAa,OAAQ;GACvC,2CAACC;IAAY;IAAQ;cACnB,2CAAC,oBACC,2CAACC;KACC;KACI;KACI;KACR,KAAK,WAAW,wBAAwB;KACxC,KAAKC,0CAAY,KAAK;eAEtB,4CAAC,yBACE,OACA,WAAW,YAAY,2CAACC,kCAAmB,I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U"}
@@ -1,10 +1,16 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
- const __ndla_primitives = require_rolldown_runtime.__toESM(require("@ndla/primitives"));
3
- const __ndla_styled_system_jsx = require_rolldown_runtime.__toESM(require("@ndla/styled-system/jsx"));
4
- const __ndla_icons = require_rolldown_runtime.__toESM(require("@ndla/icons"));
5
- const __ndla_safelink = require_rolldown_runtime.__toESM(require("@ndla/safelink"));
6
- const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
7
- const __ndla_core = require_rolldown_runtime.__toESM(require("@ndla/core"));
2
+ let __ndla_primitives = require("@ndla/primitives");
3
+ __ndla_primitives = require_rolldown_runtime.__toESM(__ndla_primitives);
4
+ let __ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
5
+ __ndla_styled_system_jsx = require_rolldown_runtime.__toESM(__ndla_styled_system_jsx);
6
+ let __ndla_icons = require("@ndla/icons");
7
+ __ndla_icons = require_rolldown_runtime.__toESM(__ndla_icons);
8
+ let __ndla_safelink = require("@ndla/safelink");
9
+ __ndla_safelink = require_rolldown_runtime.__toESM(__ndla_safelink);
10
+ let react_jsx_runtime = require("react/jsx-runtime");
11
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
12
+ let __ndla_core = require("@ndla/core");
13
+ __ndla_core = require_rolldown_runtime.__toESM(__ndla_core);
8
14
 
9
15
  //#region src/ResourceBox/ResourceBox.tsx
10
16
  const Container = (0, __ndla_styled_system_jsx.styled)("div", { base: {
@@ -71,5 +77,6 @@ const ResourceBox = ({ image, title, caption, url, buttonText }) => {
71
77
  var ResourceBox_default = ResourceBox;
72
78
 
73
79
  //#endregion
74
- exports.ResourceBox_default = ResourceBox_default;
80
+ exports.ResourceBox = ResourceBox;
81
+ exports.default = ResourceBox_default;
75
82
  //# sourceMappingURL=ResourceBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceBox.js","names":["Image","Text","breakpoints","Heading","SafeLinkButton","ShareBoxLine"],"sources":["../../src/ResourceBox/ResourceBox.tsx"],"sourcesContent":["/**\n * Copyright (c) 2022-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 { breakpoints } from \"@ndla/core\";\nimport { ShareBoxLine } from \"@ndla/icons\";\nimport { Heading, Image, Text } from \"@ndla/primitives\";\nimport { SafeLinkButton } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\nconst Container = styled(\"div\", {\n base: {\n display: \"flex\",\n padding: \"medium\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n borderColor: \"stroke.default\",\n boxShadow: \"full\",\n marginBlockEnd: \"medium\",\n gap: \"medium\",\n tabletWideDown: {\n padding: \"xsmall\",\n },\n tabletDown: {\n flexDirection: \"column\",\n gap: \"0\",\n padding: \"0\",\n },\n },\n});\n\nconst ContentWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"xsmall\",\n flex: \"1\",\n tabletDown: {\n padding: \"xsmall\",\n },\n },\n});\n\nconst StyledImage = styled(Image, {\n base: {\n objectFit: \"cover\",\n borderRadius: \"xsmall\",\n width: \"fit-content\",\n aspectRatio: \"1/1\",\n tabletDown: {\n width: \"100%\",\n borderRadius: \"0\",\n },\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n flex: \"1\",\n },\n});\n\ninterface ImageMeta {\n src: string | undefined;\n alt: string;\n}\n\ninterface Props {\n image?: ImageMeta;\n title: string;\n caption: string;\n url: string;\n buttonText: string;\n}\n\nexport const ResourceBox = ({ image, title, caption, url, buttonText }: Props) => {\n return (\n <Container>\n {image ? (\n <StyledImage\n src={image.src}\n alt={image.alt}\n sizes={`(min-width: ${breakpoints.desktop}) 150px, (max-width: ${breakpoints.tablet} ) 400px, 200px`}\n variant=\"rounded\"\n />\n ) : null}\n <ContentWrapper>\n <Heading textStyle=\"label.large\" fontWeight=\"bold\" asChild consumeCss>\n <h3>{title}</h3>\n </Heading>\n <StyledText textStyle=\"body.medium\">{caption}</StyledText>\n <SafeLinkButton to={url} target=\"_blank\" variant=\"secondary\">\n {buttonText}\n <ShareBoxLine />\n </SafeLinkButton>\n </ContentWrapper>\n </Container>\n );\n};\n\nexport default ResourceBox;\n"],"mappings":";;;;;;;;;AAcA,MAAM,YAAY,qCAAO,OAAO,EAC9B,MAAM;CACJ,SAAS;CACT,SAAS;CACT,cAAc;CACd,QAAQ;CACR,aAAa;CACb,WAAW;CACX,gBAAgB;CAChB,KAAK;CACL,gBAAgB,EACd,SAAS,SACV;CACD,YAAY;EACV,eAAe;EACf,KAAK;EACL,SAAS;CACV;AACF,EACF,EAAC;AAEF,MAAM,iBAAiB,qCAAO,OAAO,EACnC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,YAAY;CACZ,KAAK;CACL,MAAM;CACN,YAAY,EACV,SAAS,SACV;AACF,EACF,EAAC;AAEF,MAAM,cAAc,qCAAOA,yBAAO,EAChC,MAAM;CACJ,WAAW;CACX,cAAc;CACd,OAAO;CACP,aAAa;CACb,YAAY;EACV,OAAO;EACP,cAAc;CACf;AACF,EACF,EAAC;AAEF,MAAM,aAAa,qCAAOC,wBAAM,EAC9B,MAAM,EACJ,MAAM,IACP,EACF,EAAC;AAeF,MAAa,cAAc,CAAC,EAAE,OAAO,OAAO,SAAS,KAAK,YAAmB,KAAK;AAChF,wBACE,4BAAC,wBACE,wBACC,2BAAC;EACC,KAAK,MAAM;EACX,KAAK,MAAM;EACX,QAAQ,cAAcC,wBAAY,QAAQ,uBAAuBA,wBAAY,OAAO;EACpF,SAAQ;GACR,GACA,sBACJ,4BAAC;kBACC,2BAACC;GAAQ,WAAU;GAAc,YAAW;GAAO;GAAQ;6BACzD,2BAAC,kBAAI,QAAW;IACR;kBACV,2BAAC;GAAW,WAAU;aAAe;IAAqB;kBAC1D,4BAACC;GAAe,IAAI;GAAK,QAAO;GAAS,SAAQ;cAC9C,4BACD,2BAACC,8BAAe;IACD;KACF,IACP;AAEf;AAED,0BAAe"}
1
+ {"version":3,"file":"ResourceBox.js","names":["Image","Text","breakpoints","Heading","SafeLinkButton","ShareBoxLine"],"sources":["../../src/ResourceBox/ResourceBox.tsx"],"sourcesContent":["/**\n * Copyright (c) 2022-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 { breakpoints } from \"@ndla/core\";\nimport { ShareBoxLine } from \"@ndla/icons\";\nimport { Heading, Image, Text } from \"@ndla/primitives\";\nimport { SafeLinkButton } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\nconst Container = styled(\"div\", {\n base: {\n display: \"flex\",\n padding: \"medium\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n borderColor: \"stroke.default\",\n boxShadow: \"full\",\n marginBlockEnd: \"medium\",\n gap: \"medium\",\n tabletWideDown: {\n padding: \"xsmall\",\n },\n tabletDown: {\n flexDirection: \"column\",\n gap: \"0\",\n padding: \"0\",\n },\n },\n});\n\nconst ContentWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"xsmall\",\n flex: \"1\",\n tabletDown: {\n padding: \"xsmall\",\n },\n },\n});\n\nconst StyledImage = styled(Image, {\n base: {\n objectFit: \"cover\",\n borderRadius: \"xsmall\",\n width: \"fit-content\",\n aspectRatio: \"1/1\",\n tabletDown: {\n width: \"100%\",\n borderRadius: \"0\",\n },\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n flex: \"1\",\n },\n});\n\ninterface ImageMeta {\n src: string | undefined;\n alt: string;\n}\n\ninterface Props {\n image?: ImageMeta;\n title: string;\n caption: string;\n url: string;\n buttonText: string;\n}\n\nexport const ResourceBox = ({ image, title, caption, url, buttonText }: Props) => {\n return (\n <Container>\n {image ? (\n <StyledImage\n src={image.src}\n alt={image.alt}\n sizes={`(min-width: ${breakpoints.desktop}) 150px, (max-width: ${breakpoints.tablet} ) 400px, 200px`}\n variant=\"rounded\"\n />\n ) : null}\n <ContentWrapper>\n <Heading textStyle=\"label.large\" fontWeight=\"bold\" asChild consumeCss>\n <h3>{title}</h3>\n </Heading>\n <StyledText textStyle=\"body.medium\">{caption}</StyledText>\n <SafeLinkButton to={url} target=\"_blank\" variant=\"secondary\">\n {buttonText}\n <ShareBoxLine />\n </SafeLinkButton>\n </ContentWrapper>\n </Container>\n );\n};\n\nexport default ResourceBox;\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,iDAAmB,OAAO,EAC9B,MAAM;CACJ,SAAS;CACT,SAAS;CACT,cAAc;CACd,QAAQ;CACR,aAAa;CACb,WAAW;CACX,gBAAgB;CAChB,KAAK;CACL,gBAAgB,EACd,SAAS,UACV;CACD,YAAY;EACV,eAAe;EACf,KAAK;EACL,SAAS;EACV;CACF,EACF,CAAC;AAEF,MAAM,sDAAwB,OAAO,EACnC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,YAAY;CACZ,KAAK;CACL,MAAM;CACN,YAAY,EACV,SAAS,UACV;CACF,EACF,CAAC;AAEF,MAAM,mDAAqBA,yBAAO,EAChC,MAAM;CACJ,WAAW;CACX,cAAc;CACd,OAAO;CACP,aAAa;CACb,YAAY;EACV,OAAO;EACP,cAAc;EACf;CACF,EACF,CAAC;AAEF,MAAM,kDAAoBC,wBAAM,EAC9B,MAAM,EACJ,MAAM,KACP,EACF,CAAC;AAeF,MAAa,eAAe,EAAE,OAAO,OAAO,SAAS,KAAK,iBAAwB;AAChF,QACE,4CAAC,wBACE,QACC,2CAAC;EACC,KAAK,MAAM;EACX,KAAK,MAAM;EACX,OAAO,eAAeC,wBAAY,QAAQ,uBAAuBA,wBAAY,OAAO;EACpF,SAAQ;GACR,GACA,MACJ,4CAAC;EACC,2CAACC;GAAQ,WAAU;GAAc,YAAW;GAAO;GAAQ;aACzD,2CAAC,kBAAI,QAAW;IACR;EACV,2CAAC;GAAW,WAAU;aAAe;IAAqB;EAC1D,4CAACC;GAAe,IAAI;GAAK,QAAO;GAAS,SAAQ;cAC9C,YACD,2CAACC,8BAAe;IACD;KACF,IACP;;AAIhB,0BAAe"}
@@ -1,10 +1,16 @@
1
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_icons = require_rolldown_runtime.__toESM(require("@ndla/icons"));
5
- const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
6
- const __ndla_util = require_rolldown_runtime.__toESM(require("@ndla/util"));
7
- const __ark_ui_react = require_rolldown_runtime.__toESM(require("@ark-ui/react"));
2
+ let react = require("react");
3
+ react = require_rolldown_runtime.__toESM(react);
4
+ let __ndla_primitives = require("@ndla/primitives");
5
+ __ndla_primitives = require_rolldown_runtime.__toESM(__ndla_primitives);
6
+ let __ndla_icons = require("@ndla/icons");
7
+ __ndla_icons = require_rolldown_runtime.__toESM(__ndla_icons);
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
10
+ let __ndla_util = require("@ndla/util");
11
+ __ndla_util = require_rolldown_runtime.__toESM(__ndla_util);
12
+ let __ark_ui_react = require("@ark-ui/react");
13
+ __ark_ui_react = require_rolldown_runtime.__toESM(__ark_ui_react);
8
14
 
9
15
  //#region src/TagSelector/TagSelector.tsx
10
16
  const TagSelectorRoot = ({ allowCustomValue = true, multiple = true, selectionBehavior = "clear", editable, addOnPaste = false, onValueChange, children, value, translations,...rest }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"TagSelector.js","names":["ComboboxRoot","TagsInputRoot","ComboboxLabel","TagsInputItemInput","ComboboxTrigger","ComboboxControl","TagsInputControl","ComboboxClearTrigger","ComboboxInput","TagsInputInput","TagsInputItem","TagsInputItemPreview","TagsInputItemText","TagsInputItemDeleteTrigger","CloseLine"],"sources":["../../src/TagSelector/TagSelector.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, useEffect, useId, useRef } from \"react\";\nimport { type CollectionItem, useTagsInputContext, useComboboxContext } from \"@ark-ui/react\";\nimport { CloseLine } from \"@ndla/icons\";\nimport {\n ComboboxClearTrigger,\n ComboboxControl,\n type ComboboxControlProps,\n ComboboxInput,\n type ComboboxInputProps,\n ComboboxLabel,\n ComboboxRoot,\n type ComboboxRootProps,\n ComboboxTrigger,\n TagsInputControl,\n type TagsInputControlProps,\n TagsInputInput,\n type TagsInputInputProps,\n TagsInputItem,\n TagsInputItemDeleteTrigger,\n TagsInputItemPreview,\n TagsInputItemText,\n TagsInputRoot,\n type TagsInputRootProps,\n TagsInputItemInput,\n} from \"@ndla/primitives\";\nimport { contains } from \"@ndla/util\";\n\nexport type TagSelectorRootProps<T extends CollectionItem> = ComboboxRootProps<T> & TagsInputRootProps;\n\nexport const TagSelectorRoot = <T extends CollectionItem>({\n allowCustomValue = true,\n multiple = true,\n selectionBehavior = \"clear\",\n editable,\n addOnPaste = false,\n onValueChange,\n children,\n value,\n translations,\n ...rest\n}: TagSelectorRootProps<T>) => {\n const ids = {\n root: useId(),\n input: useId(),\n control: useId(),\n };\n\n const controlRef = useRef<HTMLDivElement | undefined>(undefined);\n\n useEffect(() => {\n if (!controlRef.current) {\n controlRef.current = document.getElementById(ids.control) as HTMLDivElement | undefined;\n }\n }, [ids.control]);\n\n return (\n <ComboboxRoot\n ids={ids}\n asChild\n allowCustomValue={allowCustomValue}\n multiple={multiple}\n selectionBehavior={selectionBehavior}\n onValueChange={onValueChange}\n translations={translations}\n onPointerDownOutside={(event) => {\n if (contains(controlRef.current, event.detail.originalEvent.target)) {\n event.preventDefault();\n }\n }}\n value={value}\n {...rest}\n >\n <TagSelectorTagsInputRoot\n ids={ids}\n value={value}\n editable={editable}\n onValueChange={onValueChange}\n addOnPaste={addOnPaste}\n translations={translations}\n >\n {children}\n </TagSelectorTagsInputRoot>\n </ComboboxRoot>\n );\n};\n\nconst TagSelectorTagsInputRoot = forwardRef<HTMLDivElement, TagsInputRootProps>((props, ref) => {\n const comboboxApi = useComboboxContext();\n return (\n <TagsInputRoot\n ref={ref}\n onInputValueChange={(details) => comboboxApi.setInputValue(details.inputValue)}\n {...props}\n />\n );\n});\n\nexport type TagSelectorControlProps = ComboboxControlProps & TagsInputControlProps;\n\nexport const TagSelectorLabel = ComboboxLabel;\n\nexport const TagSelectorItemInput = TagsInputItemInput;\n\nexport const TagSelectorTrigger = ComboboxTrigger;\n\nexport const TagSelectorControl = forwardRef<HTMLDivElement, TagSelectorControlProps>(({ children, ...props }, ref) => {\n return (\n <ComboboxControl ref={ref} asChild>\n <TagsInputControl {...props}>{children}</TagsInputControl>\n </ComboboxControl>\n );\n});\n\nexport const TagSelectorClearTrigger = ComboboxClearTrigger;\n\nexport type TagSelectorInputProps = ComboboxInputProps & TagsInputInputProps;\n\n// If you need to modify the TagsInputItem, you can use this.\nexport const TagSelectorInputBase = forwardRef<HTMLInputElement, TagSelectorInputProps>(\n ({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n );\n },\n);\n\nexport const TagSelectorInput = forwardRef<HTMLInputElement, TagSelectorInputProps>(({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <>\n {tagsApi.value.map((value, index) => (\n <TagsInputItem index={index} value={value} key={value}>\n <TagsInputItemPreview>\n <TagsInputItemText>{value}</TagsInputItemText>\n <TagsInputItemDeleteTrigger>\n <CloseLine />\n </TagsInputItemDeleteTrigger>\n </TagsInputItemPreview>\n <TagsInputItemInput />\n </TagsInputItem>\n ))}\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n </>\n );\n});\n"],"mappings":";;;;;;;;;AAqCA,MAAa,kBAAkB,CAA2B,EACxD,mBAAmB,MACnB,WAAW,MACX,oBAAoB,SACpB,UACA,aAAa,OACb,eACA,UACA,OACA,aACA,GAAG,MACqB,KAAK;CAC7B,MAAM,MAAM;EACV,MAAM,kBAAO;EACb,OAAO,kBAAO;EACd,SAAS,kBAAO;CACjB;CAED,MAAM,aAAa,yBAA6C;AAEhE,sBAAU,MAAM;AACd,OAAK,WAAW,QACd,YAAW,UAAU,SAAS,eAAe,IAAI,QAAQ;CAE5D,GAAE,CAAC,IAAI,OAAQ,EAAC;AAEjB,wBACE,2BAACA;EACM;EACL;EACkB;EACR;EACS;EACJ;EACD;EACd,sBAAsB,CAAC,UAAU;AAC/B,OAAI,0BAAS,WAAW,SAAS,MAAM,OAAO,cAAc,OAAO,CACjE,OAAM,gBAAgB;EAEzB;EACM;EACP,GAAI;4BAEJ,2BAAC;GACM;GACE;GACG;GACK;GACH;GACE;GAEb;IACwB;GACd;AAElB;AAED,MAAM,2BAA2B,sBAA+C,CAAC,OAAO,QAAQ;CAC9F,MAAM,cAAc,wCAAoB;AACxC,wBACE,2BAACC;EACM;EACL,oBAAoB,CAAC,YAAY,YAAY,cAAc,QAAQ,WAAW;EAC9E,GAAI;GACJ;AAEL,EAAC;AAIF,MAAa,mBAAmBC;AAEhC,MAAa,uBAAuBC;AAEpC,MAAa,qBAAqBC;AAElC,MAAa,qBAAqB,sBAAoD,CAAC,EAAE,SAAU,GAAG,OAAO,EAAE,QAAQ;AACrH,wBACE,2BAACC;EAAqB;EAAK;4BACzB,2BAACC;GAAiB,GAAI;GAAQ;IAA4B;GAC1C;AAErB,EAAC;AAEF,MAAa,0BAA0BC;AAKvC,MAAa,uBAAuB,sBAClC,CAAC,EAAE,SAAU,GAAG,OAAO,EAAE,QAAQ;CAC/B,MAAM,UAAU,yCAAqB;AAErC,wBACE,2BAACC;EAAmB;EAAK;4BACvB,2BAACC;GACC,WAAW,CAAC,UAAU;AACpB,QAAI,MAAM,QAAQ,QAChB,SAAQ,SAAS,QAAQ,WAAW;GAEvC;GACD,GAAI;GAEH;IACc;GACH;AAEnB,EACF;AAED,MAAa,mBAAmB,sBAAoD,CAAC,EAAE,SAAU,GAAG,OAAO,EAAE,QAAQ;CACnH,MAAM,UAAU,yCAAqB;AAErC,wBACE,qEACG,QAAQ,MAAM,IAAI,CAAC,OAAO,0BACzB,4BAACC;EAAqB;EAAc;6BAClC,4BAACC,qEACC,2BAACC,iDAAmB,QAA0B,kBAC9C,2BAACC,0EACC,2BAACC,2BAAY,GACc,IACR,kBACvB,2BAACX,yCAAqB;IAPwB,MAQhC,CAChB,kBACF,2BAACK;EAAmB;EAAK;4BACvB,2BAACC;GACC,WAAW,CAAC,UAAU;AACpB,QAAI,MAAM,QAAQ,QAChB,SAAQ,SAAS,QAAQ,WAAW;GAEvC;GACD,GAAI;GAEH;IACc;GACH,IACf;AAEN,EAAC"}
1
+ {"version":3,"file":"TagSelector.js","names":["ComboboxRoot","TagsInputRoot","ComboboxLabel","TagsInputItemInput","ComboboxTrigger","ComboboxControl","TagsInputControl","ComboboxClearTrigger","ComboboxInput","TagsInputInput","TagsInputItem","TagsInputItemPreview","TagsInputItemText","TagsInputItemDeleteTrigger","CloseLine"],"sources":["../../src/TagSelector/TagSelector.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, useEffect, useId, useRef } from \"react\";\nimport { type CollectionItem, useTagsInputContext, useComboboxContext } from \"@ark-ui/react\";\nimport { CloseLine } from \"@ndla/icons\";\nimport {\n ComboboxClearTrigger,\n ComboboxControl,\n type ComboboxControlProps,\n ComboboxInput,\n type ComboboxInputProps,\n ComboboxLabel,\n ComboboxRoot,\n type ComboboxRootProps,\n ComboboxTrigger,\n TagsInputControl,\n type TagsInputControlProps,\n TagsInputInput,\n type TagsInputInputProps,\n TagsInputItem,\n TagsInputItemDeleteTrigger,\n TagsInputItemPreview,\n TagsInputItemText,\n TagsInputRoot,\n type TagsInputRootProps,\n TagsInputItemInput,\n} from \"@ndla/primitives\";\nimport { contains } from \"@ndla/util\";\n\nexport type TagSelectorRootProps<T extends CollectionItem> = ComboboxRootProps<T> & TagsInputRootProps;\n\nexport const TagSelectorRoot = <T extends CollectionItem>({\n allowCustomValue = true,\n multiple = true,\n selectionBehavior = \"clear\",\n editable,\n addOnPaste = false,\n onValueChange,\n children,\n value,\n translations,\n ...rest\n}: TagSelectorRootProps<T>) => {\n const ids = {\n root: useId(),\n input: useId(),\n control: useId(),\n };\n\n const controlRef = useRef<HTMLDivElement | undefined>(undefined);\n\n useEffect(() => {\n if (!controlRef.current) {\n controlRef.current = document.getElementById(ids.control) as HTMLDivElement | undefined;\n }\n }, [ids.control]);\n\n return (\n <ComboboxRoot\n ids={ids}\n asChild\n allowCustomValue={allowCustomValue}\n multiple={multiple}\n selectionBehavior={selectionBehavior}\n onValueChange={onValueChange}\n translations={translations}\n onPointerDownOutside={(event) => {\n if (contains(controlRef.current, event.detail.originalEvent.target)) {\n event.preventDefault();\n }\n }}\n value={value}\n {...rest}\n >\n <TagSelectorTagsInputRoot\n ids={ids}\n value={value}\n editable={editable}\n onValueChange={onValueChange}\n addOnPaste={addOnPaste}\n translations={translations}\n >\n {children}\n </TagSelectorTagsInputRoot>\n </ComboboxRoot>\n );\n};\n\nconst TagSelectorTagsInputRoot = forwardRef<HTMLDivElement, TagsInputRootProps>((props, ref) => {\n const comboboxApi = useComboboxContext();\n return (\n <TagsInputRoot\n ref={ref}\n onInputValueChange={(details) => comboboxApi.setInputValue(details.inputValue)}\n {...props}\n />\n );\n});\n\nexport type TagSelectorControlProps = ComboboxControlProps & TagsInputControlProps;\n\nexport const TagSelectorLabel = ComboboxLabel;\n\nexport const TagSelectorItemInput = TagsInputItemInput;\n\nexport const TagSelectorTrigger = ComboboxTrigger;\n\nexport const TagSelectorControl = forwardRef<HTMLDivElement, TagSelectorControlProps>(({ children, ...props }, ref) => {\n return (\n <ComboboxControl ref={ref} asChild>\n <TagsInputControl {...props}>{children}</TagsInputControl>\n </ComboboxControl>\n );\n});\n\nexport const TagSelectorClearTrigger = ComboboxClearTrigger;\n\nexport type TagSelectorInputProps = ComboboxInputProps & TagsInputInputProps;\n\n// If you need to modify the TagsInputItem, you can use this.\nexport const TagSelectorInputBase = forwardRef<HTMLInputElement, TagSelectorInputProps>(\n ({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n );\n },\n);\n\nexport const TagSelectorInput = forwardRef<HTMLInputElement, TagSelectorInputProps>(({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <>\n {tagsApi.value.map((value, index) => (\n <TagsInputItem index={index} value={value} key={value}>\n <TagsInputItemPreview>\n <TagsInputItemText>{value}</TagsInputItemText>\n <TagsInputItemDeleteTrigger>\n <CloseLine />\n </TagsInputItemDeleteTrigger>\n </TagsInputItemPreview>\n <TagsInputItemInput />\n </TagsInputItem>\n ))}\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n </>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;AAqCA,MAAa,mBAA6C,EACxD,mBAAmB,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CAACC;EAAqB;EAAc;aAClC,4CAACC,qDACC,2CAACC,iDAAmB,QAA0B,EAC9C,2CAACC,0DACC,2CAACC,2BAAY,GACc,IACR,EACvB,2CAACX,yCAAqB;IAPwB,MAQhC,CAChB,EACF,2CAACK;EAAmB;EAAK;YACvB,2CAACC;GACC,YAAY,UAAU;AACpB,QAAI,MAAM,QAAQ,QAChB,SAAQ,SAAS,QAAQ,WAAW;;GAGxC,GAAI;GAEH;IACc;GACH,IACf;EAEL"}
@@ -1,7 +1,10 @@
1
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 react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
2
+ let react = require("react");
3
+ react = require_rolldown_runtime.__toESM(react);
4
+ let __ndla_primitives = require("@ndla/primitives");
5
+ __ndla_primitives = require_rolldown_runtime.__toESM(__ndla_primitives);
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
5
8
 
6
9
  //#region src/ZendeskButton/ZendeskButton.tsx
7
10
  const ZendeskButton = (0, react.forwardRef)(({ locale, variant = "secondary", widgetKey, children,...rest }, ref) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ZendeskButton.js","names":["Button"],"sources":["../../src/ZendeskButton/ZendeskButton.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, useState } from \"react\";\nimport { Button, type ButtonProps } from \"@ndla/primitives\";\n\n// TODO: Let's consider abandoning `disabled` on the button here. It should instead just open/close the widget based on its current state.\n\nexport interface ZendeskButtonProps extends ButtonProps {\n widgetKey: string;\n locale: string;\n}\n\ndeclare global {\n interface Window {\n zE: (modifier: string, action: string, callback?: (() => void) | string) => void;\n }\n}\n\nexport const ZendeskButton = forwardRef<HTMLButtonElement, ZendeskButtonProps>(\n ({ locale, variant = \"secondary\", widgetKey, children, ...rest }, ref) => {\n const [loading, setLoading] = useState(false);\n const handleClick = () => {\n if (window && !window.zE) {\n setLoading(true);\n // Asynchronously load zendesk scripts for better performance\n const script = document.createElement(\"script\");\n script.id = \"ze-snippet\";\n script.type = \"text/javascript\";\n script.async = true;\n script.onload = () => {\n if (window.zE) {\n window.zE(\"webWidget\", \"setLocale\", locale);\n window.zE(\"webWidget:on\", \"close\", () => {\n setLoading(false);\n });\n window.zE(\"webWidget\", \"open\");\n }\n };\n script.src = `https://static.zdassets.com/ekr/snippet.js?key=${widgetKey}`;\n document.body.appendChild(script);\n } else if (window?.zE) {\n window.zE(\"webWidget\", \"open\");\n }\n };\n\n return (\n <Button onClick={handleClick} variant={variant} id=\"zendeskButton\" disabled={loading} {...rest} ref={ref}>\n {children}\n </Button>\n );\n },\n);\n"],"mappings":";;;;;;AAwBA,MAAa,gBAAgB,sBAC3B,CAAC,EAAE,QAAQ,UAAU,aAAa,WAAW,SAAU,GAAG,MAAM,EAAE,QAAQ;CACxE,MAAM,CAAC,SAAS,WAAW,GAAG,oBAAS,MAAM;CAC7C,MAAM,cAAc,MAAM;AACxB,MAAI,WAAW,OAAO,IAAI;AACxB,cAAW,KAAK;GAEhB,MAAM,SAAS,SAAS,cAAc,SAAS;AAC/C,UAAO,KAAK;AACZ,UAAO,OAAO;AACd,UAAO,QAAQ;AACf,UAAO,SAAS,MAAM;AACpB,QAAI,OAAO,IAAI;AACb,YAAO,GAAG,aAAa,aAAa,OAAO;AAC3C,YAAO,GAAG,gBAAgB,SAAS,MAAM;AACvC,iBAAW,MAAM;KAClB,EAAC;AACF,YAAO,GAAG,aAAa,OAAO;IAC/B;GACF;AACD,UAAO,OAAO,iDAAiD,UAAU;AACzE,YAAS,KAAK,YAAY,OAAO;EAClC,WAAU,QAAQ,GACjB,QAAO,GAAG,aAAa,OAAO;CAEjC;AAED,wBACE,2BAACA;EAAO,SAAS;EAAsB;EAAS,IAAG;EAAgB,UAAU;EAAS,GAAI;EAAW;EAClG;GACM;AAEZ,EACF"}
1
+ {"version":3,"file":"ZendeskButton.js","names":["Button"],"sources":["../../src/ZendeskButton/ZendeskButton.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, useState } from \"react\";\nimport { Button, type ButtonProps } from \"@ndla/primitives\";\n\n// TODO: Let's consider abandoning `disabled` on the button here. It should instead just open/close the widget based on its current state.\n\nexport interface ZendeskButtonProps extends ButtonProps {\n widgetKey: string;\n locale: string;\n}\n\ndeclare global {\n interface Window {\n zE: (modifier: string, action: string, callback?: (() => void) | string) => void;\n }\n}\n\nexport const ZendeskButton = forwardRef<HTMLButtonElement, ZendeskButtonProps>(\n ({ locale, variant = \"secondary\", widgetKey, children, ...rest }, ref) => {\n const [loading, setLoading] = useState(false);\n const handleClick = () => {\n if (window && !window.zE) {\n setLoading(true);\n // Asynchronously load zendesk scripts for better performance\n const script = document.createElement(\"script\");\n script.id = \"ze-snippet\";\n script.type = \"text/javascript\";\n script.async = true;\n script.onload = () => {\n if (window.zE) {\n window.zE(\"webWidget\", \"setLocale\", locale);\n window.zE(\"webWidget:on\", \"close\", () => {\n setLoading(false);\n });\n window.zE(\"webWidget\", \"open\");\n }\n };\n script.src = `https://static.zdassets.com/ekr/snippet.js?key=${widgetKey}`;\n document.body.appendChild(script);\n } else if (window?.zE) {\n window.zE(\"webWidget\", \"open\");\n }\n };\n\n return (\n <Button onClick={handleClick} variant={variant} id=\"zendeskButton\" disabled={loading} {...rest} ref={ref}>\n {children}\n </Button>\n );\n },\n);\n"],"mappings":";;;;;;;;;AAwBA,MAAa,uCACV,EAAE,QAAQ,UAAU,aAAa,WAAW,SAAU,GAAG,QAAQ,QAAQ;CACxE,MAAM,CAAC,SAAS,kCAAuB,MAAM;CAC7C,MAAM,oBAAoB;AACxB,MAAI,UAAU,CAAC,OAAO,IAAI;AACxB,cAAW,KAAK;GAEhB,MAAM,SAAS,SAAS,cAAc,SAAS;AAC/C,UAAO,KAAK;AACZ,UAAO,OAAO;AACd,UAAO,QAAQ;AACf,UAAO,eAAe;AACpB,QAAI,OAAO,IAAI;AACb,YAAO,GAAG,aAAa,aAAa,OAAO;AAC3C,YAAO,GAAG,gBAAgB,eAAe;AACvC,iBAAW,MAAM;OACjB;AACF,YAAO,GAAG,aAAa,OAAO;;;AAGlC,UAAO,MAAM,kDAAkD;AAC/D,YAAS,KAAK,YAAY,OAAO;aACxB,QAAQ,GACjB,QAAO,GAAG,aAAa,OAAO;;AAIlC,QACE,2CAACA;EAAO,SAAS;EAAsB;EAAS,IAAG;EAAgB,UAAU;EAAS,GAAI;EAAW;EAClG;GACM;EAGd"}
@@ -5,11 +5,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
8
+ var __export = (all) => {
9
+ let target = {};
9
10
  for (var name in all) __defProp(target, name, {
10
11
  get: all[name],
11
12
  enumerable: true
12
13
  });
14
+ return target;
13
15
  };
14
16
  var __copyProps = (to, from, except, desc) => {
15
17
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
@@ -28,15 +30,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
30
 
29
31
  //#endregion
30
32
 
31
- Object.defineProperty(exports, '__export', {
32
- enumerable: true,
33
- get: function () {
34
- return __export;
35
- }
36
- });
37
- Object.defineProperty(exports, '__toESM', {
38
- enumerable: true,
39
- get: function () {
40
- return __toESM;
41
- }
42
- });
33
+ exports.__export = __export;
34
+ exports.__toESM = __toESM;
@@ -1 +1 @@
1
- {"version":3,"file":"formatNestedMessages.js","names":["phrases: Phrases","formattedMessages: FormattedMessages","prefix: string"],"sources":["../../src/i18n/formatNestedMessages.ts"],"sourcesContent":["/**\n * Copyright (c) 2017-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\ninterface Phrases {\n [key: string]: string | Phrases;\n}\n\ninterface FormattedMessages {\n [key: string]: string;\n}\n\nexport const formatNestedMessages = (\n phrases: Phrases,\n formattedMessages: FormattedMessages = {},\n prefix: string = \"\",\n) => {\n const messages = formattedMessages;\n\n Object.keys(phrases).forEach((key) => {\n const value = phrases[key];\n if ({}.hasOwnProperty.call(phrases, key)) {\n const keyWithPrefix = prefix ? `${prefix}.${key}` : key;\n if (typeof value === \"object\") {\n formatNestedMessages(value, formattedMessages, keyWithPrefix);\n } else {\n messages[keyWithPrefix] = value;\n }\n }\n });\n\n return messages;\n};\n"],"mappings":";;AAgBA,MAAa,uBAAuB,CAClCA,SACAC,oBAAuC,CAAE,GACzCC,SAAiB,OACd;CACH,MAAM,WAAW;AAEjB,QAAO,KAAK,QAAQ,CAAC,QAAQ,CAAC,QAAQ;EACpC,MAAM,QAAQ,QAAQ;AACtB,MAAI,CAAE,EAAC,eAAe,KAAK,SAAS,IAAI,EAAE;GACxC,MAAM,gBAAgB,UAAU,EAAE,OAAO,GAAG,IAAI,IAAI;AACpD,cAAW,UAAU,SACnB,sBAAqB,OAAO,mBAAmB,cAAc;OAE7D,UAAS,iBAAiB;EAE7B;CACF,EAAC;AAEF,QAAO;AACR"}
1
+ {"version":3,"file":"formatNestedMessages.js","names":[],"sources":["../../src/i18n/formatNestedMessages.ts"],"sourcesContent":["/**\n * Copyright (c) 2017-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\ninterface Phrases {\n [key: string]: string | Phrases;\n}\n\ninterface FormattedMessages {\n [key: string]: string;\n}\n\nexport const formatNestedMessages = (\n phrases: Phrases,\n formattedMessages: FormattedMessages = {},\n prefix: string = \"\",\n) => {\n const messages = formattedMessages;\n\n Object.keys(phrases).forEach((key) => {\n const value = phrases[key];\n if ({}.hasOwnProperty.call(phrases, key)) {\n const keyWithPrefix = prefix ? `${prefix}.${key}` : key;\n if (typeof value === \"object\") {\n formatNestedMessages(value, formattedMessages, keyWithPrefix);\n } else {\n messages[keyWithPrefix] = value;\n }\n }\n });\n\n return messages;\n};\n"],"mappings":";;AAgBA,MAAa,wBACX,SACA,oBAAuC,EAAE,EACzC,SAAiB,OACd;CACH,MAAM,WAAW;AAEjB,QAAO,KAAK,QAAQ,CAAC,SAAS,QAAQ;EACpC,MAAM,QAAQ,QAAQ;AACtB,MAAI,EAAE,CAAC,eAAe,KAAK,SAAS,IAAI,EAAE;GACxC,MAAM,gBAAgB,SAAS,GAAG,OAAO,GAAG,QAAQ;AACpD,OAAI,OAAO,UAAU,SACnB,sBAAqB,OAAO,mBAAmB,cAAc;OAE7D,UAAS,iBAAiB;;GAG9B;AAEF,QAAO"}
@@ -1,6 +1,8 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
- const react = require_rolldown_runtime.__toESM(require("react"));
3
- const react_i18next = require_rolldown_runtime.__toESM(require("react-i18next"));
2
+ let react = require("react");
3
+ react = require_rolldown_runtime.__toESM(react);
4
+ let react_i18next = require("react-i18next");
5
+ react_i18next = require_rolldown_runtime.__toESM(react_i18next);
4
6
 
5
7
  //#region src/i18n/useComponentTranslations.ts
6
8
  const useTagsInputTranslations = (translations) => {
@@ -45,8 +47,7 @@ const usePaginationTranslations = (translations) => {
45
47
  prevTriggerLabel: t("prevTriggerLabel"),
46
48
  nextTriggerLabel: t("nextTriggerLabel"),
47
49
  itemLabel: (details) => {
48
- const lastPage = details.totalPages > 1 && details.page === details.totalPages;
49
- return lastPage ? t("lastPage", { page: details.page }) : t("page", { page: details.page });
50
+ return details.totalPages > 1 && details.page === details.totalPages ? t("lastPage", { page: details.page }) : t("page", { page: details.page });
50
51
  },
51
52
  ...translations
52
53
  }), [translations, t]);
@@ -1 +1 @@
1
- {"version":3,"file":"useComponentTranslations.js","names":["translations?: Partial<TagsInputRootProps[\"translations\"]>","translations?: Partial<ComboboxRootProps<T>[\"translations\"]>","translations?: Partial<TagSelectorRootProps<T>[\"translations\"]>","translations?: Partial<PaginationRootProps[\"translations\"]>","translations: DeepPartial<ImageSearchTranslations>","translations: DeepPartial<AudioSearchTranslations>","translations?: Partial<VideoTranslations>","translations?: Partial<DatePickerRootProps[\"translations\"]>"],"sources":["../../src/i18n/useComponentTranslations.ts"],"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 type { CollectionItem } from \"@ark-ui/react\";\nimport type { ComboboxRootProps, PaginationRootProps, TagsInputRootProps, DatePickerRootProps } from \"@ndla/primitives\";\nimport { type TagSelectorRootProps } from \"../TagSelector/TagSelector\";\nimport { useMemo } from \"react\";\n\ntype DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\nexport const useTagsInputTranslations = (\n translations?: Partial<TagsInputRootProps[\"translations\"]>,\n): TagsInputRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.tagsInput\" });\n\n return useMemo(\n () => ({\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n deleteTagTriggerLabel: (tag) => t(\"deleteTagTriggerLabel\", { tag }),\n tagAdded: (tag) => t(\"tagAdded\", { tag }),\n tagsPasted: (tag) => t(\"tagsPasted\", { length: tag.length }),\n tagEdited: (tag) => t(\"tagEdited\", { tag }),\n tagUpdated: (tag) => t(\"tagUpdated\", { tag }),\n tagDeleted: (tag) => t(\"tagDeleted\", { tag }),\n tagSelected: (tag) => t(\"tagSelected\", { tag }),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useComboboxTranslations = <T extends CollectionItem>(\n translations?: Partial<ComboboxRootProps<T>[\"translations\"]>,\n): ComboboxRootProps<T>[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.combobox\" });\n\n return useMemo(\n () => ({\n triggerLabel: t(\"triggerLabel\"),\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useTagSelectorTranslations = <T extends CollectionItem>(\n translations?: Partial<TagSelectorRootProps<T>[\"translations\"]>,\n): TagSelectorRootProps<T>[\"translations\"] => {\n const tagsInputTranslations = useTagsInputTranslations();\n const comboboxTranslations = useComboboxTranslations();\n\n return useMemo(\n () =>\n ({\n ...comboboxTranslations,\n ...tagsInputTranslations,\n ...translations,\n }) as TagSelectorRootProps<T>[\"translations\"],\n [comboboxTranslations, tagsInputTranslations, translations],\n );\n};\n\nexport const usePaginationTranslations = (\n translations?: Partial<PaginationRootProps[\"translations\"]>,\n): PaginationRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.pagination\" });\n\n return useMemo(\n () => ({\n rootLabel: t(\"rootLabel\"),\n prevTriggerLabel: t(\"prevTriggerLabel\"),\n nextTriggerLabel: t(\"nextTriggerLabel\"),\n itemLabel: (details) => {\n const lastPage = details.totalPages > 1 && details.page === details.totalPages;\n return lastPage ? t(\"lastPage\", { page: details.page }) : t(\"page\", { page: details.page });\n },\n ...translations,\n }),\n [translations, t],\n );\n};\n\n// TODO: Deduplicate this and place it somewhere smart. Maybe core?\ninterface AudioSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n useAudio: string;\n noResults: string;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\ninterface VideoTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n loadMoreVideos: string;\n noResults: string;\n is360Video: string;\n previewVideo: string;\n addVideo: string;\n close: string;\n}\ninterface PreviewTranslations {\n creatorsLabel: string;\n license: string;\n caption: string;\n altText: string;\n modelRelease: string;\n tags: string;\n close: string;\n checkboxLabel?: string;\n missingTitleFallback?: string;\n useImageTitle: string;\n}\n\ninterface ImageSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n imagePreview: PreviewTranslations;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\nexport const useImageSearchTranslations = (\n translations: DeepPartial<ImageSearchTranslations> = {},\n): ImageSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.imageSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { imagePreview, paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n imagePreview: {\n creatorsLabel: t(\"imagePreview.creatorsLabel\"),\n license: t(\"imagePreview.license\"),\n caption: t(\"imagePreview.caption\"),\n altText: t(\"imagePreview.altText\"),\n modelRelease: t(\"imagePreview.modelRelease\"),\n tags: t(\"imagePreview.tags\"),\n close: t(\"close\"),\n checkboxLabel: t(\"imagePreview.checkboxLabel\"),\n useImageTitle: t(\"imagePreview.useImageTitle\"),\n ...imagePreview,\n },\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, imagePreview, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useAudioSearchTranslations = (\n translations: DeepPartial<AudioSearchTranslations> = {},\n): AudioSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.audioSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n useAudio: t(\"useAudio\"),\n noResults: t(\"noResults\"),\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useVideoSearchTranslations = (translations?: Partial<VideoTranslations>): VideoTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.videoSearch\" });\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n loadMoreVideos: t(\"loadMoreVideos\"),\n noResults: t(\"noResults\"),\n is360Video: t(\"is360Video\"),\n previewVideo: t(\"previewVideo\"),\n addVideo: t(\"addVideo\"),\n close: t(\"close\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useDatePickerTranslations = (\n translations?: Partial<DatePickerRootProps[\"translations\"]>,\n): NonNullable<DatePickerRootProps[\"translations\"]> => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.datePicker\" });\n\n return useMemo(\n () => ({\n dayCell: (state) => {\n if (state.unavailable) {\n return t(\"dayCell.unavailable\", { date: state.formattedDate });\n } else if (state.selected) {\n return t(\"dayCell.selected\", { date: state.formattedDate });\n } else return t(\"dayCell.select\", { date: state.formattedDate });\n },\n nextTrigger: (view) => t(`nextTrigger.${view}`),\n prevTrigger: (view) => t(`prevTrigger.${view}`),\n monthSelect: t(\"monthSelect\"),\n yearSelect: t(\"yearSelect\"),\n viewTrigger: (view) => t(`viewTrigger.${view}`),\n presetTrigger: (value) => {\n if (Array.isArray(value)) {\n return t(\"presetTrigger.range\", { start: value[0], end: value[1] });\n } else return t(\"presetTrigger.single\", { date: value });\n },\n clearTrigger: t(\"clearTrigger\"),\n trigger: (open) => t(`trigger.${open ? \"close\" : \"open\"}`),\n content: t(\"content\"),\n placeholder: (_locale) => {\n return { day: \"dd\", month: \"mm\", year: \"yyyy\" };\n },\n }),\n [t, translations],\n );\n};\n"],"mappings":";;;;;AAkBA,MAAa,2BAA2B,CACtCA,iBACuC;CACvC,MAAM,EAAE,GAAG,GAAG,kCAAe,eAAe,EAAE,WAAW,sBAAuB,E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C/B,SAAS,CAAC,SAAS,GAAG,UAAU,OAAO,UAAU,OAAO,EAAE;EAC1D,SAAS,EAAE,UAAU;EACrB,aAAa,CAAC,YAAY;AACxB,UAAO;IAAE,KAAK;IAAM,OAAO;IAAM,MAAM;GAAQ;EAChD;CACF,IACD,CAAC,GAAG,YAAa,EAClB;AACF"}
1
+ {"version":3,"file":"useComponentTranslations.js","names":[],"sources":["../../src/i18n/useComponentTranslations.ts"],"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 type { CollectionItem } from \"@ark-ui/react\";\nimport type { ComboboxRootProps, PaginationRootProps, TagsInputRootProps, DatePickerRootProps } from \"@ndla/primitives\";\nimport { type TagSelectorRootProps } from \"../TagSelector/TagSelector\";\nimport { useMemo } from \"react\";\n\ntype DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\nexport const useTagsInputTranslations = (\n translations?: Partial<TagsInputRootProps[\"translations\"]>,\n): TagsInputRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.tagsInput\" });\n\n return useMemo(\n () => ({\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n deleteTagTriggerLabel: (tag) => t(\"deleteTagTriggerLabel\", { tag }),\n tagAdded: (tag) => t(\"tagAdded\", { tag }),\n tagsPasted: (tag) => t(\"tagsPasted\", { length: tag.length }),\n tagEdited: (tag) => t(\"tagEdited\", { tag }),\n tagUpdated: (tag) => t(\"tagUpdated\", { tag }),\n tagDeleted: (tag) => t(\"tagDeleted\", { tag }),\n tagSelected: (tag) => t(\"tagSelected\", { tag }),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useComboboxTranslations = <T extends CollectionItem>(\n translations?: Partial<ComboboxRootProps<T>[\"translations\"]>,\n): ComboboxRootProps<T>[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.combobox\" });\n\n return useMemo(\n () => ({\n triggerLabel: t(\"triggerLabel\"),\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useTagSelectorTranslations = <T extends CollectionItem>(\n translations?: Partial<TagSelectorRootProps<T>[\"translations\"]>,\n): TagSelectorRootProps<T>[\"translations\"] => {\n const tagsInputTranslations = useTagsInputTranslations();\n const comboboxTranslations = useComboboxTranslations();\n\n return useMemo(\n () =>\n ({\n ...comboboxTranslations,\n ...tagsInputTranslations,\n ...translations,\n }) as TagSelectorRootProps<T>[\"translations\"],\n [comboboxTranslations, tagsInputTranslations, translations],\n );\n};\n\nexport const usePaginationTranslations = (\n translations?: Partial<PaginationRootProps[\"translations\"]>,\n): PaginationRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.pagination\" });\n\n return useMemo(\n () => ({\n rootLabel: t(\"rootLabel\"),\n prevTriggerLabel: t(\"prevTriggerLabel\"),\n nextTriggerLabel: t(\"nextTriggerLabel\"),\n itemLabel: (details) => {\n const lastPage = details.totalPages > 1 && details.page === details.totalPages;\n return lastPage ? t(\"lastPage\", { page: details.page }) : t(\"page\", { page: details.page });\n },\n ...translations,\n }),\n [translations, t],\n );\n};\n\n// TODO: Deduplicate this and place it somewhere smart. Maybe core?\ninterface AudioSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n useAudio: string;\n noResults: string;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\ninterface VideoTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n loadMoreVideos: string;\n noResults: string;\n is360Video: string;\n previewVideo: string;\n addVideo: string;\n close: string;\n}\ninterface PreviewTranslations {\n creatorsLabel: string;\n license: string;\n caption: string;\n altText: string;\n modelRelease: string;\n tags: string;\n close: string;\n checkboxLabel?: string;\n missingTitleFallback?: string;\n useImageTitle: string;\n}\n\ninterface ImageSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n imagePreview: PreviewTranslations;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\nexport const useImageSearchTranslations = (\n translations: DeepPartial<ImageSearchTranslations> = {},\n): ImageSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.imageSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { imagePreview, paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n imagePreview: {\n creatorsLabel: t(\"imagePreview.creatorsLabel\"),\n license: t(\"imagePreview.license\"),\n caption: t(\"imagePreview.caption\"),\n altText: t(\"imagePreview.altText\"),\n modelRelease: t(\"imagePreview.modelRelease\"),\n tags: t(\"imagePreview.tags\"),\n close: t(\"close\"),\n checkboxLabel: t(\"imagePreview.checkboxLabel\"),\n useImageTitle: t(\"imagePreview.useImageTitle\"),\n ...imagePreview,\n },\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, imagePreview, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useAudioSearchTranslations = (\n translations: DeepPartial<AudioSearchTranslations> = {},\n): AudioSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.audioSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n useAudio: t(\"useAudio\"),\n noResults: t(\"noResults\"),\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useVideoSearchTranslations = (translations?: Partial<VideoTranslations>): VideoTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.videoSearch\" });\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n loadMoreVideos: t(\"loadMoreVideos\"),\n noResults: t(\"noResults\"),\n is360Video: t(\"is360Video\"),\n previewVideo: t(\"previewVideo\"),\n addVideo: t(\"addVideo\"),\n close: t(\"close\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useDatePickerTranslations = (\n translations?: Partial<DatePickerRootProps[\"translations\"]>,\n): NonNullable<DatePickerRootProps[\"translations\"]> => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.datePicker\" });\n\n return useMemo(\n () => ({\n dayCell: (state) => {\n if (state.unavailable) {\n return t(\"dayCell.unavailable\", { date: state.formattedDate });\n } else if (state.selected) {\n return t(\"dayCell.selected\", { date: state.formattedDate });\n } else return t(\"dayCell.select\", { date: state.formattedDate });\n },\n nextTrigger: (view) => t(`nextTrigger.${view}`),\n prevTrigger: (view) => t(`prevTrigger.${view}`),\n monthSelect: t(\"monthSelect\"),\n yearSelect: t(\"yearSelect\"),\n viewTrigger: (view) => t(`viewTrigger.${view}`),\n presetTrigger: (value) => {\n if (Array.isArray(value)) {\n return t(\"presetTrigger.range\", { start: value[0], end: value[1] });\n } else return t(\"presetTrigger.single\", { date: value });\n },\n clearTrigger: t(\"clearTrigger\"),\n trigger: (open) => t(`trigger.${open ? \"close\" : \"open\"}`),\n content: t(\"content\"),\n placeholder: (_locale) => {\n return { day: \"dd\", month: \"mm\", year: \"yyyy\" };\n },\n }),\n [t, translations],\n );\n};\n"],"mappings":";;;;;;;AAkBA,MAAa,4BACX,iBACuC;CACvC,MAAM,EAAE,wCAAqB,eAAe,EAAE,WAAW,uBAAuB,CAAC;AAEjF,kCACS;EACL,mBAAmB,EAAE,oBAAoB;EACzC,wBAAwB,QAAQ,EAAE,yBAAyB,EAAE,KAAK,CAAC;EACnE,WAAW,QAAQ,EAAE,YAAY,EAAE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GAAG;EACJ,GACD,CAAC,GAAG,aAAa,CAClB;;AAGH,MAAa,6BACX,iBACqD;CACrD,MAAM,EAAE,wCAAqB,eAAe,EAAE,WAAW,wBAAwB,CAAC;AAElF,kCACS;EACL,UAAU,UAAU;AAClB,OAAI,MAAM,YACR,QAAO,EAAE,uBAAuB,EAAE,MAAM,MAAM,eAAe,CAAC;YACrD,MAAM,SACf,QAAO,EAAE,oBAAoB,EAAE,MAAM,MAAM,eAAe,CAAC;OACtD,QAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,eAAe,CAAC;;EAElE,cAAc,SAAS,EAAE,eAAe,OAAO;EAC/C,cAAc,SAAS,EAAE,eAAe,OAAO;EAC/C,aAAa,EAAE,cAAc;EAC7B,YAAY,EAAE,aAAa;EAC3B,cAAc,SAAS,EAAE,eAAe,OAAO;EAC/C,gBAAgB,UAAU;AACxB,OAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,EAAE,uBAAuB;IAAE,OAAO,MAAM;IAAI,KAAK,MAAM;IAAI,CAAC;OAC9D,QAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;;EAE1D,cAAc,EAAE,eAAe;EAC/B,UAAU,SAAS,EAAE,WAAW,OAAO,UAAU,SAAS;EAC1D,SAAS,EAAE,UAAU;EACrB,cAAc,YAAY;AACxB,UAAO;IAAE,KAAK;IAAM,OAAO;IAAM,MAAM;IAAQ;;EAElD,GACD,CAAC,GAAG,aAAa,CAClB"}
package/lib/index.d.ts CHANGED
@@ -6,47 +6,68 @@
6
6
  *
7
7
  */
8
8
  export { Concept } from "./Concept/Concept";
9
- export { ImageEmbed, getCrop, getFocalPoint, AudioEmbed, H5pEmbed, ExternalEmbed, IframeEmbed, FootnoteEmbed, BrightcoveEmbed, ContentLinkEmbed, RelatedContentEmbed, ConceptEmbed, UnknownEmbed, InlineConcept, BlockConcept, UuDisclaimerEmbed, CopyrightEmbed, CodeEmbed, InlineTriggerButton, ConceptInlineTriggerButton, EmbedWrapper, } from "./Embed";
10
- export type { EmbedWrapperProps, EmbedWrapperVariantProps } from "./Embed";
11
- export { LicenseLink, EmbedByline } from "./LicenseByline";
12
- export { ArticleByline, ArticleBylineAccordionItem, ArticleFootNotes, ArticleWrapper, Article, ArticleFooter, ArticleHeader, ArticleContent, ArticleHGroup, ArticleTitle, } from "./Article";
9
+ export { default as ImageEmbed, getCrop, getFocalPoint } from "./Embed/ImageEmbed";
10
+ export { InlineTriggerButton } from "./Embed/InlineTriggerButton";
11
+ export { default as AudioEmbed } from "./Embed/AudioEmbed";
12
+ export { default as H5pEmbed } from "./Embed/H5pEmbed";
13
+ export { default as ExternalEmbed } from "./Embed/ExternalEmbed";
14
+ export { default as IframeEmbed } from "./Embed/IframeEmbed";
15
+ export { default as FootnoteEmbed } from "./Embed/FootnoteEmbed";
16
+ export { default as BrightcoveEmbed } from "./Embed/BrightcoveEmbed";
17
+ export { default as ContentLinkEmbed } from "./Embed/ContentLinkEmbed";
18
+ export { default as RelatedContentEmbed } from "./Embed/RelatedContentEmbed";
19
+ export { ConceptEmbed, InlineConcept, BlockConcept } from "./Embed/ConceptEmbed";
20
+ export { default as UnknownEmbed } from "./Embed/UnknownEmbed";
21
+ export { default as UuDisclaimerEmbed } from "./Embed/UuDisclaimerEmbed";
22
+ export { default as CopyrightEmbed } from "./Embed/CopyrightEmbed";
23
+ export { default as CodeEmbed } from "./Embed/CodeEmbed";
24
+ export { ConceptInlineTriggerButton } from "./Embed/ConceptInlineTriggerButton";
25
+ export { EmbedWrapper } from "./Embed/EmbedWrapper";
26
+ export type { EmbedWrapperVariantProps, EmbedWrapperProps } from "./Embed/EmbedWrapper";
27
+ export type { HeartButtonType, CanonicalUrlFuncs, RenderContext } from "./Embed/types";
28
+ export { LicenseLink } from "./LicenseByline/LicenseLink";
29
+ export { EmbedByline } from "./LicenseByline/EmbedByline";
30
+ export { ArticleWrapper, Article, ArticleFooter, ArticleHeader, ArticleContent, ArticleHGroup, ArticleTitle, } from "./Article/Article";
31
+ export { ArticleByline, ArticleBylineAccordionItem } from "./Article/ArticleByline";
32
+ export { ArticleFootNotes } from "./Article/ArticleFootNotes";
13
33
  export { getPossiblyRelativeUrl } from "./utils/relativeUrl";
14
- export { default as RelatedArticleList, RelatedArticle } from "./RelatedArticleList";
15
- export { FileListEmbed, File, PdfFile, FileListItem, FileListElement, FileListWrapper } from "./FileList";
16
- export { default as FactBox } from "./FactBox";
17
- export type { ContentTypeHeroProps } from "./ContentTypeHero";
18
- export { ContentTypeHero } from "./ContentTypeHero";
19
- export { ResourceBox } from "./ResourceBox";
20
- export { default as AudioPlayer } from "./AudioPlayer";
34
+ export { RelatedArticleList, RelatedArticle } from "./RelatedArticleList/RelatedArticleList";
35
+ export { FileListEmbed, FileListItem, FileListWrapper } from "./FileList/FileList";
36
+ export { File, FileListElement } from "./FileList/File";
37
+ export { PdfFile } from "./FileList/PdfFile";
38
+ export { default as FactBox } from "./FactBox/FactBox";
39
+ export { ResourceBox } from "./ResourceBox/ResourceBox";
40
+ export { default as AudioPlayer } from "./AudioPlayer/AudioPlayer";
21
41
  export { default as constants } from "./model";
22
42
  export { default as messagesNB } from "./locale/messages-nb";
23
43
  export { default as messagesNN } from "./locale/messages-nn";
24
44
  export { default as messagesEN } from "./locale/messages-en";
25
45
  export { default as messagesSE } from "./locale/messages-se";
26
- export { default as Breadcrumb, HomeBreadcrumb } from "./Breadcrumb";
27
- export type { SimpleBreadcrumbItem, IndexedBreadcrumbItem } from "./Breadcrumb";
28
- export { formatNestedMessages, useTagsInputTranslations, useTagSelectorTranslations, useComboboxTranslations, usePaginationTranslations, useAudioSearchTranslations, useImageSearchTranslations, useVideoSearchTranslations, useDatePickerTranslations, } from "./i18n";
46
+ export { default as Breadcrumb } from "./Breadcrumb/Breadcrumb";
47
+ export { default as HomeBreadcrumb } from "./Breadcrumb/HomeBreadcrumb";
48
+ export type { SimpleBreadcrumbItem, IndexedBreadcrumbItem } from "./Breadcrumb/BreadcrumbItem";
49
+ export { formatNestedMessages } from "./i18n/formatNestedMessages";
50
+ export { useTagsInputTranslations, useTagSelectorTranslations, useComboboxTranslations, usePaginationTranslations, useAudioSearchTranslations, useImageSearchTranslations, useVideoSearchTranslations, useDatePickerTranslations, } from "./i18n/useComponentTranslations";
29
51
  export type { ContentTypeBadgeProps, StrictContentType, ContentType } from "./ContentTypeBadge/ContentTypeBadge";
30
52
  export { ContentTypeBadge, contentTypeToBadgeVariantMap } from "./ContentTypeBadge/ContentTypeBadge";
31
- export { ContentTypeBlockQuote } from "./ContentTypeBlockQuote/ContentTypeBlockQuote";
32
- export { type ContentTypeBlockQuoteVariant } from "./ContentTypeBlockQuote/ContentTypeBlockQuote";
33
- export { ContentTypeFramedContent } from "./ContentTypeFramedContent/ContentTypeFramedContent";
34
- export { type ContentTypeFramedContentVariant } from "./ContentTypeFramedContent/ContentTypeFramedContent";
35
- export { default as CopyParagraphButton } from "./CopyParagraphButton";
53
+ export { default as CopyParagraphButton } from "./CopyParagraphButton/CopyParagraphButton";
36
54
  export type { TagSelectorControlProps, TagSelectorInputProps, TagSelectorRootProps } from "./TagSelector/TagSelector";
37
55
  export { TagSelectorRoot, TagSelectorLabel, TagSelectorItemInput, TagSelectorTrigger, TagSelectorControl, TagSelectorClearTrigger, TagSelectorInputBase, TagSelectorInput, } from "./TagSelector/TagSelector";
38
- export { Pitch } from "./Pitch";
39
- export { KeyFigure } from "./KeyFigure";
40
- export { ContactBlock, contactBlockBackgrounds } from "./ContactBlock";
41
- export type { ContactBlockBackground } from "./ContactBlock";
42
- export type { HeartButtonType, CanonicalUrlFuncs, RenderContext } from "./Embed";
43
- export { CampaignBlock } from "./CampaignBlock";
44
- export { Grid, GridParallaxItem } from "./Grid";
45
- export type { GridType } from "./Grid";
46
- export { Gloss, GlossExample } from "./Gloss";
47
- export { LinkBlock, LinkBlockSection } from "./LinkBlock";
56
+ export { Pitch } from "./Pitch/Pitch";
57
+ export { default as KeyFigure } from "./KeyFigure/KeyFigure";
58
+ export { ContactBlock, contactBlockBackgrounds } from "./ContactBlock/ContactBlock";
59
+ export type { ContactBlockBackground } from "./ContactBlock/ContactBlock";
60
+ export { default as CampaignBlock } from "./CampaignBlock/CampaignBlock";
61
+ export { Grid } from "./Grid/Grid";
62
+ export { GridParallaxItem } from "./Grid/GridParallaxItem";
63
+ export type { GridProps as GridType } from "./Grid/Grid";
64
+ export { default as Gloss } from "./Gloss/Gloss";
65
+ export { default as GlossExample } from "./Gloss/GlossExample";
66
+ export { default as LinkBlock } from "./LinkBlock/LinkBlock";
67
+ export { default as LinkBlockSection } from "./LinkBlock/LinkBlockSection";
48
68
  export type { Article as ArticleType, HeadingLevel } from "./types";
49
- export { CodeBlock, codeLanguageOptions } from "./CodeBlock";
69
+ export { default as CodeBlock } from "./CodeBlock/CodeBlock";
70
+ export { codeLanguageOptions } from "./CodeBlock/codeLanguageOptions";
50
71
  export { ZendeskButton } from "./ZendeskButton/ZendeskButton";
51
72
  export type { ZendeskButtonProps } from "./ZendeskButton/ZendeskButton";
52
73
  export { licenseAttributes } from "./utils/licenseAttributes";