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