@ndla/ui 56.0.121-alpha.0 → 56.0.122-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 (206) hide show
  1. package/lib/i18n/index.d.ts +1 -1
  2. package/lib/i18n/useComponentTranslations.d.ts +2 -1
  3. package/lib/index.d.ts +1 -1
  4. package/lib/locale/messages-en.d.ts +34 -0
  5. package/lib/locale/messages-nb.d.ts +34 -0
  6. package/lib/locale/messages-nn.d.ts +34 -0
  7. package/lib/locale/messages-se.d.ts +34 -0
  8. package/package.json +6 -5
  9. package/src/Article/ArticleByline.tsx +1 -1
  10. package/src/i18n/index.ts +1 -0
  11. package/src/i18n/useComponentTranslations.ts +36 -1
  12. package/src/index.ts +1 -0
  13. package/src/locale/messages-en.ts +34 -0
  14. package/src/locale/messages-nb.ts +34 -0
  15. package/src/locale/messages-nn.ts +34 -0
  16. package/src/locale/messages-se.ts +34 -0
  17. package/es/Article/Article.js +0 -199
  18. package/es/Article/ArticleByline.js +0 -182
  19. package/es/Article/ArticleFootNotes.js +0 -60
  20. package/es/Article/index.js +0 -11
  21. package/es/AudioPlayer/AudioPlayer.js +0 -218
  22. package/es/AudioPlayer/Controls.js +0 -332
  23. package/es/AudioPlayer/SpeechControl.js +0 -56
  24. package/es/AudioPlayer/index.js +0 -10
  25. package/es/Breadcrumb/Breadcrumb.js +0 -60
  26. package/es/Breadcrumb/BreadcrumbItem.js +0 -62
  27. package/es/Breadcrumb/HomeBreadcrumb.js +0 -77
  28. package/es/Breadcrumb/index.js +0 -11
  29. package/es/CampaignBlock/CampaignBlock.js +0 -180
  30. package/es/CampaignBlock/index.js +0 -9
  31. package/es/CodeBlock/CodeBlock.js +0 -35
  32. package/es/CodeBlock/codeLanguageOptions.js +0 -84
  33. package/es/CodeBlock/index.js +0 -10
  34. package/es/Concept/Concept.js +0 -72
  35. package/es/ContactBlock/ContactBlock.js +0 -199
  36. package/es/ContactBlock/index.js +0 -9
  37. package/es/ContentTypeBadge/ContentTypeBadge.js +0 -50
  38. package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -32
  39. package/es/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -32
  40. package/es/ContentTypeHero/ContentTypeHero.js +0 -50
  41. package/es/ContentTypeHero/index.js +0 -9
  42. package/es/CopyParagraphButton/CopyParagraphButton.js +0 -83
  43. package/es/CopyParagraphButton/index.js +0 -11
  44. package/es/Embed/AudioEmbed.js +0 -76
  45. package/es/Embed/BrightcoveEmbed.js +0 -133
  46. package/es/Embed/CodeEmbed.js +0 -79
  47. package/es/Embed/ConceptEmbed.js +0 -123
  48. package/es/Embed/ConceptInlineTriggerButton.js +0 -45
  49. package/es/Embed/ContentLinkEmbed.js +0 -51
  50. package/es/Embed/CopyrightEmbed.js +0 -33
  51. package/es/Embed/EmbedErrorPlaceholder.js +0 -58
  52. package/es/Embed/EmbedWrapper.js +0 -51
  53. package/es/Embed/ExternalEmbed.js +0 -74
  54. package/es/Embed/FootnoteEmbed.js +0 -44
  55. package/es/Embed/GlossEmbed.js +0 -80
  56. package/es/Embed/H5pEmbed.js +0 -61
  57. package/es/Embed/IframeEmbed.js +0 -93
  58. package/es/Embed/ImageEmbed.js +0 -238
  59. package/es/Embed/InlineTriggerButton.js +0 -37
  60. package/es/Embed/RelatedContentEmbed.js +0 -55
  61. package/es/Embed/UnknownEmbed.js +0 -31
  62. package/es/Embed/UuDisclaimerEmbed.js +0 -88
  63. package/es/Embed/index.js +0 -25
  64. package/es/Embed/types.js +0 -1
  65. package/es/ErrorMessage/ErrorMessage.js +0 -95
  66. package/es/ErrorMessage/index.js +0 -10
  67. package/es/FactBox/FactBox.js +0 -177
  68. package/es/FactBox/index.js +0 -10
  69. package/es/FileList/File.js +0 -101
  70. package/es/FileList/FileList.js +0 -47
  71. package/es/FileList/PdfFile.js +0 -50
  72. package/es/FileList/index.js +0 -11
  73. package/es/Gloss/Gloss.js +0 -175
  74. package/es/Gloss/GlossExample.js +0 -64
  75. package/es/Gloss/index.js +0 -10
  76. package/es/Grid/Grid.js +0 -94
  77. package/es/Grid/GridParallaxItem.js +0 -32
  78. package/es/Grid/index.js +0 -10
  79. package/es/KeyFigure/KeyFigure.js +0 -63
  80. package/es/KeyFigure/index.js +0 -9
  81. package/es/LicenseByline/EmbedByline.js +0 -212
  82. package/es/LicenseByline/LicenseLink.js +0 -56
  83. package/es/LicenseByline/index.js +0 -10
  84. package/es/LinkBlock/LinkBlock.js +0 -103
  85. package/es/LinkBlock/LinkBlockSection.js +0 -35
  86. package/es/LinkBlock/index.js +0 -10
  87. package/es/Pitch/Pitch.js +0 -83
  88. package/es/Pitch/index.js +0 -9
  89. package/es/RelatedArticleList/RelatedArticleList.js +0 -135
  90. package/es/RelatedArticleList/index.js +0 -11
  91. package/es/ResourceBox/ResourceBox.js +0 -99
  92. package/es/ResourceBox/index.js +0 -10
  93. package/es/TagSelector/TagSelector.js +0 -143
  94. package/es/ZendeskButton/ZendeskButton.js +0 -55
  95. package/es/i18n/formatNestedMessages.js +0 -25
  96. package/es/i18n/i18n.js +0 -35
  97. package/es/i18n/index.js +0 -11
  98. package/es/i18n/useComponentTranslations.js +0 -164
  99. package/es/index.js +0 -45
  100. package/es/locale/messages-en.js +0 -428
  101. package/es/locale/messages-nb.js +0 -428
  102. package/es/locale/messages-nn.js +0 -428
  103. package/es/locale/messages-se.js +0 -428
  104. package/es/model/ContentType.js +0 -68
  105. package/es/model/SubjectCategories.js +0 -12
  106. package/es/model/SubjectTypes.js +0 -11
  107. package/es/model/WordClass.js +0 -45
  108. package/es/model/index.js +0 -21
  109. package/es/types.js +0 -1
  110. package/es/utils/licenseAttributes.js +0 -18
  111. package/es/utils/relativeUrl.js +0 -37
  112. package/lib/Article/Article.js +0 -207
  113. package/lib/Article/ArticleByline.js +0 -189
  114. package/lib/Article/ArticleFootNotes.js +0 -67
  115. package/lib/Article/index.js +0 -68
  116. package/lib/AudioPlayer/AudioPlayer.js +0 -224
  117. package/lib/AudioPlayer/Controls.js +0 -338
  118. package/lib/AudioPlayer/SpeechControl.js +0 -62
  119. package/lib/AudioPlayer/index.js +0 -16
  120. package/lib/Breadcrumb/Breadcrumb.js +0 -67
  121. package/lib/Breadcrumb/BreadcrumbItem.js +0 -68
  122. package/lib/Breadcrumb/HomeBreadcrumb.js +0 -84
  123. package/lib/Breadcrumb/index.js +0 -23
  124. package/lib/CampaignBlock/CampaignBlock.js +0 -187
  125. package/lib/CampaignBlock/index.js +0 -13
  126. package/lib/CodeBlock/CodeBlock.js +0 -41
  127. package/lib/CodeBlock/codeLanguageOptions.js +0 -90
  128. package/lib/CodeBlock/index.js +0 -20
  129. package/lib/Concept/Concept.js +0 -78
  130. package/lib/ContactBlock/ContactBlock.js +0 -206
  131. package/lib/ContactBlock/index.js +0 -18
  132. package/lib/ContentTypeBadge/ContentTypeBadge.js +0 -57
  133. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -38
  134. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -38
  135. package/lib/ContentTypeHero/ContentTypeHero.js +0 -57
  136. package/lib/ContentTypeHero/index.js +0 -12
  137. package/lib/CopyParagraphButton/CopyParagraphButton.js +0 -89
  138. package/lib/CopyParagraphButton/index.js +0 -22
  139. package/lib/Embed/AudioEmbed.js +0 -84
  140. package/lib/Embed/BrightcoveEmbed.js +0 -142
  141. package/lib/Embed/CodeEmbed.js +0 -86
  142. package/lib/Embed/ConceptEmbed.js +0 -131
  143. package/lib/Embed/ConceptInlineTriggerButton.js +0 -51
  144. package/lib/Embed/ContentLinkEmbed.js +0 -57
  145. package/lib/Embed/CopyrightEmbed.js +0 -39
  146. package/lib/Embed/EmbedErrorPlaceholder.js +0 -64
  147. package/lib/Embed/EmbedWrapper.js +0 -57
  148. package/lib/Embed/ExternalEmbed.js +0 -81
  149. package/lib/Embed/FootnoteEmbed.js +0 -50
  150. package/lib/Embed/GlossEmbed.js +0 -88
  151. package/lib/Embed/H5pEmbed.js +0 -68
  152. package/lib/Embed/IframeEmbed.js +0 -100
  153. package/lib/Embed/ImageEmbed.js +0 -248
  154. package/lib/Embed/InlineTriggerButton.js +0 -43
  155. package/lib/Embed/RelatedContentEmbed.js +0 -61
  156. package/lib/Embed/UnknownEmbed.js +0 -37
  157. package/lib/Embed/UuDisclaimerEmbed.js +0 -94
  158. package/lib/Embed/index.js +0 -150
  159. package/lib/Embed/types.js +0 -5
  160. package/lib/ErrorMessage/ErrorMessage.js +0 -101
  161. package/lib/ErrorMessage/index.js +0 -16
  162. package/lib/FactBox/FactBox.js +0 -184
  163. package/lib/FactBox/index.js +0 -16
  164. package/lib/FileList/File.js +0 -108
  165. package/lib/FileList/FileList.js +0 -54
  166. package/lib/FileList/PdfFile.js +0 -57
  167. package/lib/FileList/index.js +0 -44
  168. package/lib/Gloss/Gloss.js +0 -181
  169. package/lib/Gloss/GlossExample.js +0 -70
  170. package/lib/Gloss/index.js +0 -20
  171. package/lib/Grid/Grid.js +0 -101
  172. package/lib/Grid/GridParallaxItem.js +0 -39
  173. package/lib/Grid/index.js +0 -19
  174. package/lib/KeyFigure/KeyFigure.js +0 -70
  175. package/lib/KeyFigure/index.js +0 -13
  176. package/lib/LicenseByline/EmbedByline.js +0 -220
  177. package/lib/LicenseByline/LicenseLink.js +0 -62
  178. package/lib/LicenseByline/index.js +0 -19
  179. package/lib/LinkBlock/LinkBlock.js +0 -110
  180. package/lib/LinkBlock/LinkBlockSection.js +0 -41
  181. package/lib/LinkBlock/index.js +0 -20
  182. package/lib/Pitch/Pitch.js +0 -91
  183. package/lib/Pitch/index.js +0 -12
  184. package/lib/RelatedArticleList/RelatedArticleList.js +0 -143
  185. package/lib/RelatedArticleList/index.js +0 -21
  186. package/lib/ResourceBox/ResourceBox.js +0 -106
  187. package/lib/ResourceBox/index.js +0 -13
  188. package/lib/TagSelector/TagSelector.js +0 -150
  189. package/lib/ZendeskButton/ZendeskButton.js +0 -61
  190. package/lib/i18n/formatNestedMessages.js +0 -32
  191. package/lib/i18n/i18n.js +0 -41
  192. package/lib/i18n/index.js +0 -62
  193. package/lib/i18n/useComponentTranslations.js +0 -176
  194. package/lib/index.js +0 -593
  195. package/lib/locale/messages-en.js +0 -435
  196. package/lib/locale/messages-nb.js +0 -435
  197. package/lib/locale/messages-nn.js +0 -435
  198. package/lib/locale/messages-se.js +0 -435
  199. package/lib/model/ContentType.js +0 -74
  200. package/lib/model/SubjectCategories.js +0 -18
  201. package/lib/model/SubjectTypes.js +0 -17
  202. package/lib/model/WordClass.js +0 -51
  203. package/lib/model/index.js +0 -28
  204. package/lib/types.js +0 -5
  205. package/lib/utils/licenseAttributes.js +0 -25
  206. package/lib/utils/relativeUrl.js +0 -44
@@ -1,108 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.FileListElement = exports.File = void 0;
7
- var _react = require("react");
8
- var _reactI18next = require("react-i18next");
9
- var _icons = require("@ndla/icons");
10
- var _primitives = require("@ndla/primitives");
11
- var _safelink = require("@ndla/safelink");
12
- var _jsx2 = require("@ndla/styled-system/jsx");
13
- var _patterns = require("@ndla/styled-system/patterns");
14
- var _ = require(".");
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- /**
17
- * Copyright (c) 2023-present, NDLA.
18
- *
19
- * This source code is licensed under the GPLv3 license found in the
20
- * LICENSE file in the root directory of this source tree.
21
- *
22
- */
23
-
24
- const StyledSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
25
- base: {
26
- textUnderlineOffset: "2px",
27
- textDecoration: "underline",
28
- _hover: {
29
- textDecoration: "none"
30
- }
31
- }
32
- });
33
- const StyledHStack = (0, _jsx2.styled)(_jsx2.HStack, {
34
- base: {
35
- position: "relative",
36
- paddingBlock: "small",
37
- paddingInlineEnd: "medium",
38
- paddingInlineStart: "small",
39
- width: "100%"
40
- }
41
- });
42
- const File = exports.File = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
43
- let {
44
- title,
45
- url,
46
- fileExists,
47
- fileType,
48
- fileSize,
49
- ...rest
50
- } = _ref;
51
- const {
52
- t
53
- } = (0, _reactI18next.useTranslation)();
54
- const filename = `${title}-${url.split("/").pop() ?? ""}`;
55
- const downloadUrl = `${url}?download=${filename}`;
56
- const tooltip = `${t("download")} ${filename}`;
57
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledHStack, {
58
- justify: "space-between",
59
- ref: ref,
60
- ...rest,
61
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsx2.HStack, {
62
- gap: "xxsmall",
63
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.DownloadLine, {}), fileExists ? /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSafeLink, {
64
- unstyled: true,
65
- css: _patterns.linkOverlay.raw(),
66
- to: downloadUrl,
67
- title: tooltip,
68
- children: title
69
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
70
- textStyle: "label.medium",
71
- children: title
72
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
73
- textStyle: "label.large",
74
- asChild: true,
75
- consumeCss: true,
76
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
77
- children: ["(", fileType?.toUpperCase(), ")"]
78
- })
79
- })]
80
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
81
- textStyle: "label.large",
82
- asChild: true,
83
- consumeCss: true,
84
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
85
- children: fileSize
86
- })
87
- })]
88
- });
89
- });
90
- const FileListElement = _ref2 => {
91
- let {
92
- title,
93
- url,
94
- fileExists,
95
- fileType,
96
- fileSize
97
- } = _ref2;
98
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.FileListItem, {
99
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(File, {
100
- title: title,
101
- url: url,
102
- fileExists: fileExists,
103
- fileType: fileType,
104
- fileSize: fileSize
105
- })
106
- });
107
- };
108
- exports.FileListElement = FileListElement;
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.FileListWrapper = exports.FileListItem = exports.FileListEmbed = void 0;
7
- var _react = require("@ark-ui/react");
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 FileListWrapper = exports.FileListWrapper = (0, _jsx2.styled)(_react.ark.ul, {
19
- base: {
20
- display: "flex",
21
- flexDirection: "column",
22
- gap: "xsmall",
23
- clear: "both"
24
- }
25
- }, {
26
- baseComponent: true
27
- });
28
- const FileListItem = exports.FileListItem = (0, _jsx2.styled)(_react.ark.li, {
29
- base: {
30
- listStyle: "none",
31
- background: "surface.infoSubtle",
32
- borderBlockEnd: "1px solid",
33
- borderColor: "stroke.default",
34
- display: "flex",
35
- justifyContent: "space-between",
36
- _hover: {
37
- backgroundColor: "surface.infoSubtle.hover"
38
- }
39
- }
40
- }, {
41
- baseComponent: true
42
- });
43
- const FileListEmbed = _ref => {
44
- let {
45
- children,
46
- ...rest
47
- } = _ref;
48
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(FileListWrapper, {
49
- ...rest,
50
- "data-embed-type": "file-list",
51
- children: children
52
- });
53
- };
54
- exports.FileListEmbed = FileListEmbed;
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
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
- });
56
- };
57
- exports.PdfFile = PdfFile;
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "File", {
7
- enumerable: true,
8
- get: function () {
9
- return _File.File;
10
- }
11
- });
12
- Object.defineProperty(exports, "FileListElement", {
13
- enumerable: true,
14
- get: function () {
15
- return _File.FileListElement;
16
- }
17
- });
18
- Object.defineProperty(exports, "FileListEmbed", {
19
- enumerable: true,
20
- get: function () {
21
- return _FileList.FileListEmbed;
22
- }
23
- });
24
- Object.defineProperty(exports, "FileListItem", {
25
- enumerable: true,
26
- get: function () {
27
- return _FileList.FileListItem;
28
- }
29
- });
30
- Object.defineProperty(exports, "FileListWrapper", {
31
- enumerable: true,
32
- get: function () {
33
- return _FileList.FileListWrapper;
34
- }
35
- });
36
- Object.defineProperty(exports, "PdfFile", {
37
- enumerable: true,
38
- get: function () {
39
- return _PdfFile.PdfFile;
40
- }
41
- });
42
- var _FileList = require("./FileList");
43
- var _File = require("./File");
44
- var _PdfFile = require("./PdfFile");
@@ -1,181 +0,0 @@
1
- "use strict";
2
-
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.
28
- 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 ?? [];
42
- };
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
- }
60
- });
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
- });
180
- };
181
- var _default = exports.default = Gloss;
@@ -1,70 +0,0 @@
1
- "use strict";
2
-
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
- });
69
- };
70
- var _default = exports.default = GlossExample;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Gloss", {
7
- enumerable: true,
8
- get: function () {
9
- return _Gloss.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "GlossExample", {
13
- enumerable: true,
14
- get: function () {
15
- return _GlossExample.default;
16
- }
17
- });
18
- var _Gloss = _interopRequireDefault(require("./Gloss"));
19
- var _GlossExample = _interopRequireDefault(require("./GlossExample"));
20
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
package/lib/Grid/Grid.js DELETED
@@ -1,101 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Grid = void 0;
7
- var _jsx2 = require("@ndla/styled-system/jsx");
8
- var _jsxRuntime = require("react/jsx-runtime");
9
- /**
10
- * Copyright (c) 2023-present, NDLA.
11
- *
12
- * This source code is licensed under the GPLv3 license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- *
15
- */
16
-
17
- const GridContainer = (0, _jsx2.styled)("div", {
18
- base: {
19
- display: "grid",
20
- justifyContent: "center",
21
- borderRadius: "xsmall",
22
- gridRowGap: "large",
23
- gridColumnGap: "medium",
24
- width: "100%",
25
- backgroundColor: "background.subtle",
26
- minWidth: "surface.xxsmall",
27
- gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
28
- "& :not(div[data-parallax-cell='true']) > div[data-embed-type='pitch']": {
29
- height: "100%",
30
- "& > :last-child": {
31
- marginTop: "auto"
32
- }
33
- },
34
- tabletDown: {
35
- gridTemplateColumns: "repeat(1, minmax(0, 1fr))"
36
- },
37
- tabletToDesktop: {
38
- gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
39
- "& > div:nth-child(3):last-child": {
40
- display: "flex",
41
- flexFlow: "column",
42
- justifyContent: "center",
43
- alignItems: "center",
44
- gridColumn: "span 2"
45
- }
46
- }
47
- },
48
- variants: {
49
- columns: {
50
- "2": {},
51
- "2x2": {},
52
- "3": {
53
- desktop: {
54
- gridTemplateColumns: "repeat(3, minmax(0, 1fr))"
55
- }
56
- },
57
- "4": {
58
- desktop: {
59
- gridTemplateColumns: "repeat(4, minmax(0, 1fr))"
60
- }
61
- }
62
- },
63
- background: {
64
- white: {
65
- backgroundColor: "surface.default"
66
- },
67
- transparent: {
68
- backgroundColor: "transparent"
69
- },
70
- gray: {
71
- backgroundColor: "background.subtle"
72
- }
73
- },
74
- border: {
75
- lightBlue: {
76
- padding: "xsmall",
77
- border: "1px solid",
78
- borderColor: "surface.brand.2"
79
- }
80
- }
81
- }
82
- });
83
- const Grid = _ref => {
84
- let {
85
- columns,
86
- border,
87
- children,
88
- background = "gray",
89
- ...rest
90
- } = _ref;
91
- const amountOfColumns = children?.length === 3 ? "3" : columns;
92
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridContainer, {
93
- "data-embed-type": "grid",
94
- border: border === "none" ? undefined : border,
95
- columns: amountOfColumns,
96
- background: background,
97
- ...rest,
98
- children: children
99
- });
100
- };
101
- exports.Grid = Grid;
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.GridParallaxItem = void 0;
7
- var _jsx2 = require("@ndla/styled-system/jsx");
8
- var _jsxRuntime = require("react/jsx-runtime");
9
- /**
10
- * Copyright (c) 2024-present, NDLA.
11
- *
12
- * This source code is licensed under the GPLv3 license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- *
15
- */
16
-
17
- const StyledGridParallaxItem = (0, _jsx2.styled)("div", {
18
- base: {
19
- position: "relative",
20
- "& > div": {
21
- top: "var(--masthead-height, 0px)",
22
- position: "sticky"
23
- }
24
- }
25
- });
26
- const GridParallaxItem = _ref => {
27
- let {
28
- children,
29
- ...rest
30
- } = _ref;
31
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledGridParallaxItem, {
32
- ...rest,
33
- "data-embed-type": "grid-parallax",
34
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
35
- children: children
36
- })
37
- });
38
- };
39
- exports.GridParallaxItem = GridParallaxItem;
package/lib/Grid/index.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Grid", {
7
- enumerable: true,
8
- get: function () {
9
- return _Grid.Grid;
10
- }
11
- });
12
- Object.defineProperty(exports, "GridParallaxItem", {
13
- enumerable: true,
14
- get: function () {
15
- return _GridParallaxItem.GridParallaxItem;
16
- }
17
- });
18
- var _Grid = require("./Grid");
19
- var _GridParallaxItem = require("./GridParallaxItem");