@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,57 +1,29 @@
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 __ndla_styled_system_jsx = require_rolldown_runtime.__toESM(require("@ndla/styled-system/jsx"));
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.PdfFile = void 0;
7
- var _primitives = require("@ndla/primitives");
8
- var _jsx2 = require("@ndla/styled-system/jsx");
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 StyledIframe = (0, _jsx2.styled)("iframe", {
19
- base: {
20
- width: "100%"
21
- }
22
- });
23
- const StyledListElement = (0, _jsx2.styled)("li", {
24
- base: {
25
- listStyle: "none"
26
- }
27
- });
28
- const StyledFigure = (0, _jsx2.styled)(_primitives.Figure, {
29
- base: {
30
- display: "flex",
31
- flexDirection: "column",
32
- gap: "xsmall"
33
- }
34
- });
35
- const PdfFile = _ref => {
36
- let {
37
- title,
38
- url
39
- } = _ref;
40
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledListElement, {
41
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledFigure, {
42
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Heading, {
43
- asChild: true,
44
- consumeCss: true,
45
- textStyle: "title.medium",
46
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h4", {
47
- children: title
48
- })
49
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledIframe, {
50
- title: title,
51
- height: "1050",
52
- src: url
53
- })]
54
- })
55
- });
6
+ //#region src/FileList/PdfFile.tsx
7
+ const StyledIframe = (0, __ndla_styled_system_jsx.styled)("iframe", { base: { width: "100%" } });
8
+ const StyledListElement = (0, __ndla_styled_system_jsx.styled)("li", { base: { listStyle: "none" } });
9
+ const StyledFigure = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.Figure, { base: {
10
+ display: "flex",
11
+ flexDirection: "column",
12
+ gap: "xsmall"
13
+ } });
14
+ const PdfFile = ({ title, url }) => {
15
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledListElement, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledFigure, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Heading, {
16
+ asChild: true,
17
+ consumeCss: true,
18
+ textStyle: "title.medium",
19
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", { children: title })
20
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIframe, {
21
+ title,
22
+ height: "1050",
23
+ src: url
24
+ })] }) });
56
25
  };
57
- exports.PdfFile = PdfFile;
26
+
27
+ //#endregion
28
+ exports.PdfFile = PdfFile;
29
+ //# sourceMappingURL=PdfFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfFile.js","names":["Figure","Heading"],"sources":["../../src/FileList/PdfFile.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 { Heading, Figure } from \"@ndla/primitives\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\ninterface Props {\n title: string;\n url: string;\n}\n\nconst StyledIframe = styled(\"iframe\", {\n base: {\n width: \"100%\",\n },\n});\n\nconst StyledListElement = styled(\"li\", {\n base: {\n listStyle: \"none\",\n },\n});\n\nconst StyledFigure = styled(Figure, {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n },\n});\n\nexport const PdfFile = ({ title, url }: Props) => {\n return (\n <StyledListElement>\n <StyledFigure>\n <Heading asChild consumeCss textStyle=\"title.medium\">\n <h4>{title}</h4>\n </Heading>\n <StyledIframe title={title} height=\"1050\" src={url} />\n </StyledFigure>\n </StyledListElement>\n );\n};\n"],"mappings":";;;;;;AAgBA,MAAM,eAAe,qCAAO,UAAU,EACpC,MAAM,EACJ,OAAO,OACR,EACF,EAAC;AAEF,MAAM,oBAAoB,qCAAO,MAAM,EACrC,MAAM,EACJ,WAAW,OACZ,EACF,EAAC;AAEF,MAAM,eAAe,qCAAOA,0BAAQ,EAClC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,KAAK;AACN,EACF,EAAC;AAEF,MAAa,UAAU,CAAC,EAAE,OAAO,KAAY,KAAK;AAChD,wBACE,2BAAC,+CACC,4BAAC,2CACC,2BAACC;EAAQ;EAAQ;EAAW,WAAU;4BACpC,2BAAC,kBAAI,QAAW;GACR,kBACV,2BAAC;EAAoB;EAAO,QAAO;EAAO,KAAK;GAAO,IACzC,GACG;AAEvB"}
@@ -1,181 +1,143 @@
1
- "use strict";
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
+ const require_SpeechControl = require('../AudioPlayer/SpeechControl.js');
3
+ const require_GlossExample = require('./GlossExample.js');
4
+ const react = require_rolldown_runtime.__toESM(require("react"));
5
+ const __ndla_primitives = require_rolldown_runtime.__toESM(require("@ndla/primitives"));
6
+ const __ndla_styled_system_jsx = require_rolldown_runtime.__toESM(require("@ndla/styled-system/jsx"));
7
+ const react_i18next = require_rolldown_runtime.__toESM(require("react-i18next"));
8
+ const __ndla_icons = require_rolldown_runtime.__toESM(require("@ndla/icons"));
9
+ const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
10
+ const __ark_ui_react = require_rolldown_runtime.__toESM(require("@ark-ui/react"));
2
11
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _reactI18next = require("react-i18next");
9
- var _react2 = require("@ark-ui/react");
10
- var _icons = require("@ndla/icons");
11
- var _primitives = require("@ndla/primitives");
12
- var _jsx2 = require("@ndla/styled-system/jsx");
13
- var _GlossExample = _interopRequireDefault(require("./GlossExample"));
14
- var _SpeechControl = _interopRequireDefault(require("../AudioPlayer/SpeechControl"));
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- /**
18
- * Copyright (c) 2023-present, NDLA.
19
- *
20
- * This source code is licensed under the GPLv3 license found in the
21
- * LICENSE file in the root directory of this source tree.
22
- *
23
- */
24
-
25
- // TODO: Figure out padding between bordered and simple variant.
26
- // The design says that the content above the accordion content should have enough padding to align with the accordion content.
27
- // When a gloss is bordered there's way too much padding.
12
+ //#region src/Gloss/Gloss.tsx
28
13
  const getFilteredExamples = (glossData, exampleIds, exampleLangs) => {
29
- if (exampleIds !== undefined || exampleLangs !== undefined) {
30
- const exampleIdsList = exampleIds?.toString()?.split(",") ?? [];
31
- const exampleLangsList = exampleLangs?.split(",") ?? [];
32
- const filteredExamples = glossData?.examples?.map((examples, i) => {
33
- if (exampleIdsList.includes(i.toString())) {
34
- return examples.filter(e => exampleLangsList.includes(e.language));
35
- }
36
- return [];
37
- }) ?? [];
38
- const examplesWithoutEmpty = filteredExamples.filter(el => !!el.length);
39
- return examplesWithoutEmpty;
40
- }
41
- return glossData?.examples ?? [];
14
+ if (exampleIds !== void 0 || exampleLangs !== void 0) {
15
+ const exampleIdsList = exampleIds?.toString()?.split(",") ?? [];
16
+ const exampleLangsList = exampleLangs?.split(",") ?? [];
17
+ const filteredExamples = glossData?.examples?.map((examples, i) => {
18
+ if (exampleIdsList.includes(i.toString())) return examples.filter((e) => exampleLangsList.includes(e.language));
19
+ return [];
20
+ }) ?? [];
21
+ const examplesWithoutEmpty = filteredExamples.filter((el) => !!el.length);
22
+ return examplesWithoutEmpty;
23
+ }
24
+ return glossData?.examples ?? [];
42
25
  };
43
- const Container = (0, _jsx2.styled)("div", {
44
- base: {
45
- display: "flex",
46
- alignItems: "center",
47
- justifyContent: "space-between"
48
- }
49
- });
50
- const TextWrapper = (0, _jsx2.styled)("div", {
51
- base: {
52
- display: "flex",
53
- gap: "small"
54
- }
55
- });
56
- const StyledAccordionItemContent = (0, _jsx2.styled)(_primitives.AccordionItemContent, {
57
- base: {
58
- paddingInline: "0"
59
- }
26
+ const Container = (0, __ndla_styled_system_jsx.styled)("div", { base: {
27
+ display: "flex",
28
+ alignItems: "center",
29
+ justifyContent: "space-between"
30
+ } });
31
+ const TextWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: {
32
+ display: "flex",
33
+ gap: "small"
34
+ } });
35
+ const StyledAccordionItemContent = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.AccordionItemContent, { base: { paddingInline: "0" } });
36
+ const StyledContainer = (0, __ndla_styled_system_jsx.styled)(Container, { base: { marginBlockStart: "3xsmall" } });
37
+ const StyledAccordionItem = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.AccordionItem, {
38
+ base: {
39
+ paddingBlock: "small",
40
+ paddingInline: "medium"
41
+ },
42
+ defaultVariants: { variant: "simple" },
43
+ variants: { variant: {
44
+ simple: {},
45
+ bordered: {
46
+ border: "1px solid",
47
+ borderColor: "stroke.subtle",
48
+ borderRadius: "xsmall"
49
+ }
50
+ } }
60
51
  });
61
- const StyledContainer = (0, _jsx2.styled)(Container, {
62
- base: {
63
- marginBlockStart: "3xsmall"
64
- }
65
- });
66
- const StyledAccordionItem = (0, _jsx2.styled)(_primitives.AccordionItem, {
67
- base: {
68
- paddingBlock: "small",
69
- paddingInline: "medium"
70
- },
71
- defaultVariants: {
72
- variant: "simple"
73
- },
74
- variants: {
75
- variant: {
76
- simple: {},
77
- bordered: {
78
- border: "1px solid",
79
- borderColor: "stroke.subtle",
80
- borderRadius: "xsmall"
81
- }
82
- }
83
- }
84
- });
85
- const Gloss = _ref => {
86
- let {
87
- title,
88
- glossData,
89
- audio,
90
- exampleIds,
91
- exampleLangs,
92
- variant
93
- } = _ref;
94
- const {
95
- t
96
- } = (0, _reactI18next.useTranslation)();
97
- const filteredExamples = (0, _react.useMemo)(() => getFilteredExamples(glossData, exampleIds, exampleLangs), [exampleIds, exampleLangs, glossData]);
98
- if (!glossData) return null;
99
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.AccordionRoot, {
100
- multiple: true,
101
- variant: "clean",
102
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledAccordionItem, {
103
- value: "gloss",
104
- variant: variant,
105
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
106
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(TextWrapper, {
107
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
108
- textStyle: "label.medium",
109
- fontWeight: "bold",
110
- asChild: true,
111
- consumeCss: true,
112
- lang: glossData.originalLanguage,
113
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
114
- children: glossData.gloss
115
- })
116
- }), !!glossData.transcriptions.traditional && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
117
- textStyle: "label.medium",
118
- asChild: true,
119
- consumeCss: true,
120
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
121
- "aria-label": t("gloss.transcriptions.traditional"),
122
- lang: glossData.originalLanguage,
123
- children: glossData.transcriptions.traditional
124
- }, t("gloss.transcriptions.traditional"))
125
- }), !!glossData.transcriptions.pinyin && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
126
- textStyle: "label.medium",
127
- asChild: true,
128
- consumeCss: true,
129
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
130
- "data-pinyin": "",
131
- "aria-label": t("gloss.transcriptions.pinyin"),
132
- lang: glossData.originalLanguage,
133
- children: glossData.transcriptions.pinyin
134
- }, t("gloss.transcriptions.pinyin"))
135
- }), !!glossData.wordClass && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
136
- textStyle: "label.medium",
137
- asChild: true,
138
- consumeCss: true,
139
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
140
- "aria-label": t("gloss.wordClass"),
141
- children: t(`wordClass.${glossData.wordClass}`).toLowerCase()
142
- })
143
- })]
144
- }), !!audio?.src && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SpeechControl.default, {
145
- src: audio.src,
146
- title: audio.title,
147
- type: "gloss"
148
- })]
149
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledContainer, {
150
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
151
- textStyle: "label.medium",
152
- asChild: true,
153
- consumeCss: true,
154
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
155
- lang: title.language,
156
- children: title.title
157
- })
158
- }), !!filteredExamples.length && /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.AccordionItemTrigger, {
159
- asChild: true,
160
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.IconButton, {
161
- variant: "tertiary",
162
- "aria-label": t("gloss.showExamples"),
163
- title: t("gloss.showExamples"),
164
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.AccordionItemIndicator, {
165
- asChild: true,
166
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ArrowDownShortLine, {
167
- size: "medium"
168
- })
169
- })
170
- })
171
- })]
172
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledAccordionItemContent, {
173
- children: filteredExamples.map((examples, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlossExample.default, {
174
- examples: examples,
175
- originalLanguage: glossData.originalLanguage
176
- }, `gloss-example-${index}`))
177
- })]
178
- })
179
- });
52
+ const Gloss = ({ title, glossData, audio, exampleIds, exampleLangs, variant }) => {
53
+ const { t } = (0, react_i18next.useTranslation)();
54
+ const filteredExamples = (0, react.useMemo)(() => getFilteredExamples(glossData, exampleIds, exampleLangs), [
55
+ exampleIds,
56
+ exampleLangs,
57
+ glossData
58
+ ]);
59
+ if (!glossData) return null;
60
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.AccordionRoot, {
61
+ multiple: true,
62
+ variant: "clean",
63
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledAccordionItem, {
64
+ value: "gloss",
65
+ variant,
66
+ children: [
67
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TextWrapper, { children: [
68
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
69
+ textStyle: "label.medium",
70
+ fontWeight: "bold",
71
+ asChild: true,
72
+ consumeCss: true,
73
+ lang: glossData.originalLanguage,
74
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: glossData.gloss })
75
+ }),
76
+ !!glossData.transcriptions.traditional && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
77
+ textStyle: "label.medium",
78
+ asChild: true,
79
+ consumeCss: true,
80
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
81
+ "aria-label": t("gloss.transcriptions.traditional"),
82
+ lang: glossData.originalLanguage,
83
+ children: glossData.transcriptions.traditional
84
+ }, t("gloss.transcriptions.traditional"))
85
+ }),
86
+ !!glossData.transcriptions.pinyin && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
87
+ textStyle: "label.medium",
88
+ asChild: true,
89
+ consumeCss: true,
90
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
91
+ "data-pinyin": "",
92
+ "aria-label": t("gloss.transcriptions.pinyin"),
93
+ lang: glossData.originalLanguage,
94
+ children: glossData.transcriptions.pinyin
95
+ }, t("gloss.transcriptions.pinyin"))
96
+ }),
97
+ !!glossData.wordClass && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
98
+ textStyle: "label.medium",
99
+ asChild: true,
100
+ consumeCss: true,
101
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
102
+ "aria-label": t("gloss.wordClass"),
103
+ children: t(`wordClass.${glossData.wordClass}`).toLowerCase()
104
+ })
105
+ })
106
+ ] }), !!audio?.src && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SpeechControl.SpeechControl_default, {
107
+ src: audio.src,
108
+ title: audio.title,
109
+ type: "gloss"
110
+ })] }),
111
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledContainer, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
112
+ textStyle: "label.medium",
113
+ asChild: true,
114
+ consumeCss: true,
115
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
116
+ lang: title.language,
117
+ children: title.title
118
+ })
119
+ }), !!filteredExamples.length && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react.AccordionItemTrigger, {
120
+ asChild: true,
121
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.IconButton, {
122
+ variant: "tertiary",
123
+ "aria-label": t("gloss.showExamples"),
124
+ title: t("gloss.showExamples"),
125
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.AccordionItemIndicator, {
126
+ asChild: true,
127
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_icons.ArrowDownShortLine, { size: "medium" })
128
+ })
129
+ })
130
+ })] }),
131
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAccordionItemContent, { children: filteredExamples.map((examples, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_GlossExample.GlossExample_default, {
132
+ examples,
133
+ originalLanguage: glossData.originalLanguage
134
+ }, `gloss-example-${index}`)) })
135
+ ]
136
+ })
137
+ });
180
138
  };
181
- var _default = exports.default = Gloss;
139
+ var Gloss_default = Gloss;
140
+
141
+ //#endregion
142
+ exports.Gloss_default = Gloss_default;
143
+ //# sourceMappingURL=Gloss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gloss.js","names":["glossData: IGlossDataDTO | undefined","exampleIds: string | undefined","exampleLangs: string | undefined","AccordionItemContent","AccordionItem","AccordionRoot","Text","SpeechControl","AccordionItemTrigger","IconButton","AccordionItemIndicator","ArrowDownShortLine","GlossExample"],"sources":["../../src/Gloss/Gloss.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 { useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { AccordionItemTrigger } from \"@ark-ui/react\";\nimport { ArrowDownShortLine } from \"@ndla/icons\";\nimport {\n AccordionItem,\n AccordionItemContent,\n AccordionItemIndicator,\n AccordionRoot,\n IconButton,\n Text,\n} from \"@ndla/primitives\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { StyledVariantProps } from \"@ndla/styled-system/types\";\nimport type { IGlossDataDTO, IGlossExampleDTO } from \"@ndla/types-backend/concept-api\";\nimport GlossExample from \"./GlossExample\";\nimport SpeechControl from \"../AudioPlayer/SpeechControl\";\n\n// TODO: Figure out padding between bordered and simple variant.\n// The design says that the content above the accordion content should have enough padding to align with the accordion content.\n// When a gloss is bordered there's way too much padding.\n\nconst getFilteredExamples = (\n glossData: IGlossDataDTO | undefined,\n exampleIds: string | undefined,\n exampleLangs: string | undefined,\n): IGlossExampleDTO[][] => {\n if (exampleIds !== undefined || exampleLangs !== undefined) {\n const exampleIdsList = exampleIds?.toString()?.split(\",\") ?? [];\n const exampleLangsList = exampleLangs?.split(\",\") ?? [];\n\n const filteredExamples =\n glossData?.examples?.map((examples, i) => {\n if (exampleIdsList.includes(i.toString())) {\n return examples.filter((e) => exampleLangsList.includes(e.language));\n }\n return [];\n }) ?? [];\n const examplesWithoutEmpty = filteredExamples.filter((el) => !!el.length);\n return examplesWithoutEmpty;\n }\n return glossData?.examples ?? [];\n};\n\nconst Container = styled(\"div\", {\n base: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n },\n});\n\nconst TextWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n gap: \"small\",\n },\n});\n\nconst StyledAccordionItemContent = styled(AccordionItemContent, {\n base: {\n paddingInline: \"0\",\n },\n});\n\nconst StyledContainer = styled(Container, {\n base: {\n marginBlockStart: \"3xsmall\",\n },\n});\n\nconst StyledAccordionItem = styled(AccordionItem, {\n base: {\n paddingBlock: \"small\",\n paddingInline: \"medium\",\n },\n defaultVariants: {\n variant: \"simple\",\n },\n variants: {\n variant: {\n simple: {},\n bordered: {\n border: \"1px solid\",\n borderColor: \"stroke.subtle\",\n borderRadius: \"xsmall\",\n },\n },\n },\n});\n\ntype GlossVariantProps = StyledVariantProps<typeof StyledAccordionItem>;\n\nexport interface Props {\n title: {\n title: string;\n language: string;\n };\n glossData?: IGlossDataDTO;\n audio?: {\n title: string;\n src?: string;\n };\n exampleIds?: string;\n exampleLangs?: string;\n}\n\nconst Gloss = ({ title, glossData, audio, exampleIds, exampleLangs, variant }: Props & GlossVariantProps) => {\n const { t } = useTranslation();\n\n const filteredExamples = useMemo(\n () => getFilteredExamples(glossData, exampleIds, exampleLangs),\n [exampleIds, exampleLangs, glossData],\n );\n\n if (!glossData) return null;\n\n return (\n <AccordionRoot multiple variant=\"clean\">\n <StyledAccordionItem value=\"gloss\" variant={variant}>\n <Container>\n <TextWrapper>\n <Text textStyle=\"label.medium\" fontWeight=\"bold\" asChild consumeCss lang={glossData.originalLanguage}>\n <span>{glossData.gloss}</span>\n </Text>\n {!!glossData.transcriptions.traditional && (\n <Text textStyle=\"label.medium\" asChild consumeCss>\n <span\n key={t(\"gloss.transcriptions.traditional\")}\n aria-label={t(\"gloss.transcriptions.traditional\")}\n lang={glossData.originalLanguage}\n >\n {glossData.transcriptions.traditional}\n </span>\n </Text>\n )}\n {!!glossData.transcriptions.pinyin && (\n <Text textStyle=\"label.medium\" asChild consumeCss>\n <span\n data-pinyin=\"\"\n key={t(\"gloss.transcriptions.pinyin\")}\n aria-label={t(\"gloss.transcriptions.pinyin\")}\n lang={glossData.originalLanguage}\n >\n {glossData.transcriptions.pinyin}\n </span>\n </Text>\n )}\n {!!glossData.wordClass && (\n <Text textStyle=\"label.medium\" asChild consumeCss>\n <span aria-label={t(\"gloss.wordClass\")}>{t(`wordClass.${glossData.wordClass}`).toLowerCase()}</span>\n </Text>\n )}\n </TextWrapper>\n {!!audio?.src && <SpeechControl src={audio.src} title={audio.title} type=\"gloss\" />}\n </Container>\n <StyledContainer>\n <Text textStyle=\"label.medium\" asChild consumeCss>\n <span lang={title.language}>{title.title}</span>\n </Text>\n {!!filteredExamples.length && (\n <AccordionItemTrigger asChild>\n <IconButton variant=\"tertiary\" aria-label={t(\"gloss.showExamples\")} title={t(\"gloss.showExamples\")}>\n <AccordionItemIndicator asChild>\n <ArrowDownShortLine size=\"medium\" />\n </AccordionItemIndicator>\n </IconButton>\n </AccordionItemTrigger>\n )}\n </StyledContainer>\n <StyledAccordionItemContent>\n {filteredExamples.map((examples, index) => (\n <GlossExample\n key={`gloss-example-${index}`}\n examples={examples}\n originalLanguage={glossData.originalLanguage}\n />\n ))}\n </StyledAccordionItemContent>\n </StyledAccordionItem>\n </AccordionRoot>\n );\n};\n\nexport default Gloss;\n"],"mappings":"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"}
@@ -1,70 +1,47 @@
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_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
2
6
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _primitives = require("@ndla/primitives");
9
- var _jsx2 = require("@ndla/styled-system/jsx");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * Copyright (c) 2023-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
- */
18
-
19
- const StyledGlossExample = (0, _jsx2.styled)("div", {
20
- base: {
21
- borderTop: "1px solid",
22
- borderColor: "stroke.subtle",
23
- paddingBlock: "xsmall",
24
- paddingInline: "medium",
25
- _first: {
26
- background: "surface.brand.1.subtle",
27
- borderColor: "stroke.default",
28
- "& p": {
29
- fontWeight: "bold"
30
- }
31
- }
32
- }
33
- });
34
- const PinyinText = (0, _jsx2.styled)(_primitives.Text, {
35
- base: {
36
- fontStyle: "italic"
37
- }
38
- });
39
- const GlossExample = _ref => {
40
- let {
41
- examples,
42
- originalLanguage
43
- } = _ref;
44
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
45
- children: examples.map((examples, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
46
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledGlossExample, {
47
- lang: examples.language,
48
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
49
- textStyle: "label.medium",
50
- lang: examples.language,
51
- children: examples.example
52
- })
53
- }), !!examples.transcriptions.pinyin && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledGlossExample, {
54
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PinyinText, {
55
- "data-pinyin": "",
56
- lang: originalLanguage,
57
- textStyle: "label.medium",
58
- children: examples.transcriptions?.pinyin
59
- })
60
- }), !!examples.transcriptions?.traditional && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledGlossExample, {
61
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
62
- textStyle: "label.medium",
63
- lang: originalLanguage,
64
- children: examples.transcriptions.traditional
65
- })
66
- })]
67
- }, index))
68
- });
7
+ //#region src/Gloss/GlossExample.tsx
8
+ const StyledGlossExample = (0, __ndla_styled_system_jsx.styled)("div", { base: {
9
+ borderTop: "1px solid",
10
+ borderColor: "stroke.subtle",
11
+ paddingBlock: "xsmall",
12
+ paddingInline: "medium",
13
+ _first: {
14
+ background: "surface.brand.1.subtle",
15
+ borderColor: "stroke.default",
16
+ "& p": { fontWeight: "bold" }
17
+ }
18
+ } });
19
+ const PinyinText = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.Text, { base: { fontStyle: "italic" } });
20
+ const GlossExample = ({ examples, originalLanguage }) => {
21
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: examples.map((examples$1, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [
22
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledGlossExample, {
23
+ lang: examples$1.language,
24
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
25
+ textStyle: "label.medium",
26
+ lang: examples$1.language,
27
+ children: examples$1.example
28
+ })
29
+ }),
30
+ !!examples$1.transcriptions.pinyin && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledGlossExample, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinyinText, {
31
+ "data-pinyin": "",
32
+ lang: originalLanguage,
33
+ textStyle: "label.medium",
34
+ children: examples$1.transcriptions?.pinyin
35
+ }) }),
36
+ !!examples$1.transcriptions?.traditional && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledGlossExample, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
37
+ textStyle: "label.medium",
38
+ lang: originalLanguage,
39
+ children: examples$1.transcriptions.traditional
40
+ }) })
41
+ ] }, index)) });
69
42
  };
70
- var _default = exports.default = GlossExample;
43
+ var GlossExample_default = GlossExample;
44
+
45
+ //#endregion
46
+ exports.GlossExample_default = GlossExample_default;
47
+ //# sourceMappingURL=GlossExample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlossExample.js","names":["Text","examples","Fragment"],"sources":["../../src/Gloss/GlossExample.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 { Fragment } from \"react\";\nimport { Text } from \"@ndla/primitives\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { IGlossExampleDTO } from \"@ndla/types-backend/concept-api\";\n\ninterface Props {\n examples: IGlossExampleDTO[];\n originalLanguage: string | undefined;\n}\n\nconst StyledGlossExample = styled(\"div\", {\n base: {\n borderTop: \"1px solid\",\n borderColor: \"stroke.subtle\",\n paddingBlock: \"xsmall\",\n paddingInline: \"medium\",\n _first: {\n background: \"surface.brand.1.subtle\",\n borderColor: \"stroke.default\",\n \"& p\": {\n fontWeight: \"bold\",\n },\n },\n },\n});\n\nconst PinyinText = styled(Text, {\n base: {\n fontStyle: \"italic\",\n },\n});\n\nconst GlossExample = ({ examples, originalLanguage }: Props) => {\n return (\n <div>\n {examples.map((examples, index) => (\n <Fragment key={index}>\n <StyledGlossExample lang={examples.language}>\n <Text textStyle=\"label.medium\" lang={examples.language}>\n {examples.example}\n </Text>\n </StyledGlossExample>\n {!!examples.transcriptions.pinyin && (\n <StyledGlossExample>\n <PinyinText data-pinyin=\"\" lang={originalLanguage} textStyle=\"label.medium\">\n {examples.transcriptions?.pinyin}\n </PinyinText>\n </StyledGlossExample>\n )}\n {!!examples.transcriptions?.traditional && (\n <StyledGlossExample>\n <Text textStyle=\"label.medium\" lang={originalLanguage}>\n {examples.transcriptions.traditional}\n </Text>\n </StyledGlossExample>\n )}\n </Fragment>\n ))}\n </div>\n );\n};\n\nexport default GlossExample;\n"],"mappings":";;;;;;;AAkBA,MAAM,qBAAqB,qCAAO,OAAO,EACvC,MAAM;CACJ,WAAW;CACX,aAAa;CACb,cAAc;CACd,eAAe;CACf,QAAQ;EACN,YAAY;EACZ,aAAa;EACb,OAAO,EACL,YAAY,OACb;CACF;AACF,EACF,EAAC;AAEF,MAAM,aAAa,qCAAOA,wBAAM,EAC9B,MAAM,EACJ,WAAW,SACZ,EACF,EAAC;AAEF,MAAM,eAAe,CAAC,EAAE,UAAU,kBAAyB,KAAK;AAC9D,wBACE,2BAAC,mBACE,SAAS,IAAI,CAACC,YAAU,0BACvB,4BAACC;kBACC,2BAAC;GAAmB,MAAMD,WAAS;6BACjC,2BAACD;IAAK,WAAU;IAAe,MAAMC,WAAS;cAC3CA,WAAS;KACL;IACY;IAClBA,WAAS,eAAe,0BACzB,2BAAC,gDACC,2BAAC;GAAW,eAAY;GAAG,MAAM;GAAkB,WAAU;aAC1DA,WAAS,gBAAgB;IACf,GACM;IAEpBA,WAAS,gBAAgB,+BAC1B,2BAAC,gDACC,2BAACD;GAAK,WAAU;GAAe,MAAM;aAClCC,WAAS,eAAe;IACpB,GACY;MAlBV,MAoBJ,CACX,GACE;AAET;AAED,2BAAe"}