@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,67 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _reactI18next = require("react-i18next");
8
- var _jsx2 = require("@ndla/styled-system/jsx");
9
- var _BreadcrumbItem = _interopRequireDefault(require("./BreadcrumbItem"));
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- /**
13
- * Copyright (c) 2016-present, NDLA.
14
- *
15
- * This source code is licensed under the GPLv3 license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- *
18
- */
19
-
20
- const StyledList = (0, _jsx2.styled)("ol", {
21
- base: {
22
- display: "flex",
23
- flexWrap: "wrap",
24
- alignItems: "center",
25
- listStyle: "none",
26
- gap: "xxsmall",
27
- mobileDown: {
28
- alignItems: "flex-start",
29
- justifyContent: "center",
30
- flexDirection: "column"
31
- }
32
- }
33
- });
34
- const Breadcrumb = _ref => {
35
- let {
36
- items,
37
- renderItem,
38
- renderSeparator,
39
- collapseFirst,
40
- collapseLast = true
41
- } = _ref;
42
- const {
43
- t
44
- } = (0, _reactI18next.useTranslation)();
45
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("nav", {
46
- "aria-label": t("breadcrumb.breadcrumb"),
47
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledList, {
48
- children: items.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_BreadcrumbItem.default, {
49
- renderItem: renderItem,
50
- renderSeparator: renderSeparator,
51
- ref: element => {
52
- if (element === null || !collapseFirst && index === 0 || !collapseLast && index === items.length - 1) {
53
- if (element) {
54
- element.setMaxWidth("none");
55
- }
56
- }
57
- },
58
- totalCount: items.length,
59
- item: {
60
- ...item,
61
- index
62
- }
63
- }, typeof item.to === "string" ? item.to : item.to.pathname))
64
- })
65
- });
66
- };
67
- var _default = exports.default = Breadcrumb;
@@ -1,68 +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 _icons = require("@ndla/icons");
9
- var _safelink = require("@ndla/safelink");
10
- var _jsx2 = require("@ndla/styled-system/jsx");
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- /**
13
- * Copyright (c) 2016-present, NDLA.
14
- *
15
- * This source code is licensed under the GPLv3 license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- *
18
- */
19
-
20
- const StyledListItem = (0, _jsx2.styled)("li", {
21
- base: {
22
- display: "flex",
23
- color: "inherit",
24
- gap: "3xsmall",
25
- alignItems: "flex-end",
26
- tabletDown: {
27
- display: "block"
28
- },
29
- "& a": {
30
- _visited: {
31
- color: "inherit"
32
- }
33
- }
34
- }
35
- });
36
- const BreadcrumbItem = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
37
- let {
38
- renderItem,
39
- renderSeparator,
40
- item,
41
- totalCount
42
- } = _ref;
43
- const liRef = (0, _react.useRef)(null);
44
- (0, _react.useImperativeHandle)(ref, () => ({
45
- setMaxWidth: maxWidth => {
46
- liRef.current.children[0].style.maxWidth = maxWidth;
47
- }
48
- }));
49
- const {
50
- to,
51
- name,
52
- index
53
- } = item;
54
- const isLast = index === totalCount - 1;
55
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledListItem, {
56
- ref: liRef,
57
- "aria-current": isLast ? "page" : undefined,
58
- children: [renderItem ? renderItem(item, totalCount) : isLast ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
59
- children: name
60
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
61
- to: to,
62
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
63
- children: name
64
- })
65
- }), renderSeparator ? renderSeparator(item, totalCount) : !isLast && /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ArrowRightShortLine, {})]
66
- });
67
- });
68
- var _default = exports.default = BreadcrumbItem;
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _icons = require("@ndla/icons");
8
- var _safelink = require("@ndla/safelink");
9
- var _jsx2 = require("@ndla/styled-system/jsx");
10
- var _Breadcrumb = _interopRequireDefault(require("./Breadcrumb"));
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- /**
14
- * Copyright (c) 2022-present, NDLA.
15
- *
16
- * This source code is licensed under the GPLv3 license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- *
19
- */
20
-
21
- const StyledSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
22
- base: {
23
- color: "inherit",
24
- textDecoration: "underline",
25
- _hover: {
26
- textDecoration: "none"
27
- },
28
- _focusVisible: {
29
- textDecoration: "none"
30
- }
31
- }
32
- });
33
- const StyledArrowRight = (0, _jsx2.styled)(_icons.ArrowRightShortLine, {
34
- base: {
35
- tabletDown: {
36
- display: "none"
37
- }
38
- }
39
- });
40
- const IconSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
41
- base: {
42
- color: "inherit"
43
- }
44
- });
45
- const HomeBreadcrumb = _ref => {
46
- let {
47
- items
48
- } = _ref;
49
- const renderItem = (item, totalCount) => {
50
- if (item.index === totalCount - 1) {
51
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
52
- children: item.name
53
- });
54
- }
55
- if (item.index === 0 && typeof item.name === "string") {
56
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(IconSafeLink, {
57
- "aria-label": item.name,
58
- to: item.to,
59
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.HomeLine, {
60
- title: item.name
61
- })
62
- });
63
- }
64
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSafeLink, {
65
- to: item.to,
66
- children: item.name
67
- });
68
- };
69
- const renderSeparator = (item, totalCount) => {
70
- if (item.index === totalCount - 1) {
71
- return null;
72
- }
73
- if (item.index === 0) {
74
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledArrowRight, {});
75
- }
76
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ArrowRightShortLine, {});
77
- };
78
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Breadcrumb.default, {
79
- items: items,
80
- renderItem: renderItem,
81
- renderSeparator: renderSeparator
82
- });
83
- };
84
- var _default = exports.default = HomeBreadcrumb;
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "HomeBreadcrumb", {
7
- enumerable: true,
8
- get: function () {
9
- return _HomeBreadcrumb.default;
10
- }
11
- });
12
- exports.default = void 0;
13
- var _Breadcrumb = _interopRequireDefault(require("./Breadcrumb"));
14
- var _HomeBreadcrumb = _interopRequireDefault(require("./HomeBreadcrumb"));
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- /**
17
- * Copyright (c) 2016-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
- var _default = exports.default = _Breadcrumb.default;
@@ -1,187 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
8
- var _icons = require("@ndla/icons");
9
- var _primitives = require("@ndla/primitives");
10
- var _safelink = require("@ndla/safelink");
11
- var _jsx2 = require("@ndla/styled-system/jsx");
12
- var _relativeUrl = require("../utils/relativeUrl");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- /**
16
- * Copyright (c) 2023-present, NDLA.
17
- *
18
- * This source code is licensed under the GPLv3 license found in the
19
- * LICENSE file in the root directory of this source tree.
20
- *
21
- */
22
-
23
- const Wrapper = (0, _jsx2.styled)("div", {
24
- base: {
25
- width: "100%",
26
- height: "100%",
27
- containerType: "inline-size"
28
- }
29
- });
30
- const Container = (0, _jsx2.styled)("div", {
31
- base: {
32
- display: "grid",
33
- gridTemplateColumns: "1fr",
34
- border: "1px solid",
35
- borderColor: "stroke.default",
36
- backgroundColor: "background.default",
37
- borderRadius: "xsmall",
38
- boxShadow: "full",
39
- overflow: "hidden"
40
- },
41
- variants: {
42
- imageSide: {
43
- left: {
44
- "@/tablet": {
45
- gridTemplateColumns: "minmax(230px, 455px) auto" //required for campaign block in myNdla
46
- },
47
- "@supports not (container-type: inline-size)": {
48
- tabletWide: {
49
- gridTemplateColumns: "minmax(230px, 455px) auto"
50
- }
51
- }
52
- },
53
- right: {
54
- "@/tablet": {
55
- gridTemplateColumns: "auto minmax(230px, 455px)" //required for campaign block in myNdla
56
- },
57
- "@supports not (container-type: inline-size)": {
58
- tabletWide: {
59
- gridTemplateColumns: "auto minmax(230px, 455px)"
60
- }
61
- }
62
- }
63
- },
64
- background: {
65
- neutral: {},
66
- brand1: {
67
- backgroundColor: "surface.brand.1"
68
- },
69
- brand3: {
70
- backgroundColor: "surface.brand.3"
71
- }
72
- }
73
- },
74
- defaultVariants: {
75
- imageSide: "left",
76
- background: "neutral"
77
- }
78
- });
79
- const StyledImg = (0, _jsx2.styled)("img", {
80
- base: {
81
- objectFit: "cover",
82
- width: "100%",
83
- height: "215px",
84
- "@/tablet": {
85
- height: "340px"
86
- },
87
- "@supports not (container-type: inline-size)": {
88
- tablet: {
89
- height: "265px"
90
- },
91
- tabletWide: {
92
- height: "340px"
93
- }
94
- },
95
- backgroundColor: "background.default"
96
- }
97
- });
98
- const ContentWrapper = (0, _jsx2.styled)("div", {
99
- base: {
100
- width: "100%",
101
- display: "flex",
102
- flexDirection: "column",
103
- gap: "medium",
104
- alignItems: "flex-start",
105
- justifyContent: "center",
106
- paddingBlock: "medium",
107
- paddingInline: "medium",
108
- position: "relative"
109
- }
110
- });
111
- const StyledText = (0, _jsx2.styled)(_primitives.Text, {
112
- base: {
113
- tablet: {
114
- display: "block",
115
- overflow: "hidden",
116
- position: "relative",
117
- lineClamp: 4,
118
- boxOrient: "vertical"
119
- }
120
- }
121
- });
122
- const StyledSafeLinkButton = (0, _jsx2.styled)(_safelink.SafeLinkButton, {
123
- base: {
124
- boxShadow: "full",
125
- border: "1px solid",
126
- borderColor: "stroke.default"
127
- }
128
- });
129
- const LinkButton = _ref => {
130
- let {
131
- url,
132
- children,
133
- path
134
- } = _ref;
135
- if (url) return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSafeLinkButton, {
136
- to: (0, _relativeUrl.getPossiblyRelativeUrl)(url, path),
137
- variant: "secondary",
138
- rel: "noopener noreferrer",
139
- children: children
140
- });
141
- return children;
142
- };
143
- const CampaignBlock = _ref2 => {
144
- let {
145
- title,
146
- image,
147
- imageSide = "left",
148
- description,
149
- headingLevel: InternalHeading = "h2",
150
- url,
151
- path,
152
- className,
153
- background
154
- } = _ref2;
155
- const imageComponent = image && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledImg, {
156
- src: `${image.src}?width=455`,
157
- height: 340,
158
- width: 455,
159
- alt: image.alt
160
- });
161
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
162
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
163
- className: className,
164
- "data-embed-type": "campaign-block",
165
- imageSide: imageSide,
166
- background: background,
167
- children: [imageSide === "left" && imageComponent, /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentWrapper, {
168
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
169
- asChild: true,
170
- consumeCss: true,
171
- textStyle: "heading.small",
172
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalHeading, {
173
- children: (0, _htmlReactParser.default)(title)
174
- })
175
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledText, {
176
- textStyle: "body.xlarge",
177
- children: (0, _htmlReactParser.default)(description)
178
- }), !!url?.url && /*#__PURE__*/(0, _jsxRuntime.jsxs)(LinkButton, {
179
- url: url.url,
180
- path: path,
181
- children: [(0, _htmlReactParser.default)(url.text ?? ""), /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ArrowRightLine, {})]
182
- })]
183
- }), imageSide !== "left" && imageComponent]
184
- })
185
- });
186
- };
187
- var _default = exports.default = CampaignBlock;
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "CampaignBlock", {
7
- enumerable: true,
8
- get: function () {
9
- return _CampaignBlock.default;
10
- }
11
- });
12
- var _CampaignBlock = _interopRequireDefault(require("./CampaignBlock"));
13
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.Codeblock = void 0;
7
- var _react = require("react");
8
- var _css = require("@ndla/styled-system/css");
9
- var _jsx2 = require("@ndla/styled-system/jsx");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * Copyright (c) 2020-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 Pre = (0, _jsx2.styled)("pre", {});
20
- const Codeblock = exports.Codeblock = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
21
- let {
22
- highlightedCode,
23
- format,
24
- className,
25
- ...props
26
- } = _ref;
27
- const codeWithLineNumbers = (0, _react.useMemo)(() => {
28
- return highlightedCode.split("\n").map((line, i) => {
29
- return `<span class="linenumber">${i + 1}</span>${line}`;
30
- }).join("\n");
31
- }, [highlightedCode]);
32
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Pre, {
33
- className: (0, _css.cx)("codeblock", `language-${format}`, className),
34
- ...props,
35
- dangerouslySetInnerHTML: {
36
- __html: codeWithLineNumbers
37
- },
38
- ref: ref
39
- });
40
- });
41
- var _default = exports.default = Codeblock;
@@ -1,90 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.codeLanguageOptions = void 0;
7
- /**
8
- * Copyright (c) 2019-present, NDLA.
9
- *
10
- * This source code is licensed under the GPLv3 license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- *
13
- */
14
-
15
- const codeLanguageOptions = exports.codeLanguageOptions = [{
16
- title: "Bash",
17
- format: "bash"
18
- }, {
19
- title: "C",
20
- format: "c"
21
- }, {
22
- title: "CSharp",
23
- format: "csharp"
24
- }, {
25
- title: "CSS",
26
- format: "css"
27
- }, {
28
- title: "Diff",
29
- format: "diff"
30
- }, {
31
- title: "HTML",
32
- format: "markup"
33
- }, {
34
- title: "Ini",
35
- format: "ini"
36
- }, {
37
- title: "Java",
38
- format: "java"
39
- }, {
40
- title: "Javascript",
41
- format: "js"
42
- }, {
43
- title: "JSON",
44
- format: "json"
45
- }, {
46
- title: "JSX",
47
- format: "jsx"
48
- }, {
49
- title: "Kotlin",
50
- format: "kotlin"
51
- }, {
52
- title: "LUA",
53
- format: "lua"
54
- }, {
55
- title: "Markdown",
56
- format: "markdown"
57
- }, {
58
- title: "Matlab",
59
- format: "matlab"
60
- }, {
61
- title: "NSIS",
62
- format: "nsis"
63
- }, {
64
- title: "PHP",
65
- format: "php"
66
- }, {
67
- title: "Powershell",
68
- format: "powershell"
69
- }, {
70
- title: "Python",
71
- format: "python"
72
- }, {
73
- title: "Ruby",
74
- format: "ruby"
75
- }, {
76
- title: "Rust",
77
- format: "rust"
78
- }, {
79
- title: "SQL",
80
- format: "sql"
81
- }, {
82
- title: "Text",
83
- format: "text"
84
- }, {
85
- title: "VHDL",
86
- format: "vhdl"
87
- }, {
88
- title: "XML",
89
- format: "xml"
90
- }];
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "CodeBlock", {
7
- enumerable: true,
8
- get: function () {
9
- return _CodeBlock.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "codeLanguageOptions", {
13
- enumerable: true,
14
- get: function () {
15
- return _codeLanguageOptions.codeLanguageOptions;
16
- }
17
- });
18
- var _CodeBlock = _interopRequireDefault(require("./CodeBlock"));
19
- var _codeLanguageOptions = require("./codeLanguageOptions");
20
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1,78 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Concept = void 0;
7
- var _react = require("react");
8
- var _primitives = require("@ndla/primitives");
9
- var _jsx2 = require("@ndla/styled-system/jsx");
10
- var _Embed = require("../Embed");
11
- var _EmbedByline = require("../LicenseByline/EmbedByline");
12
- var _licenseAttributes = require("../utils/licenseAttributes");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * Copyright (c) 2024-present, NDLA.
16
- *
17
- * This source code is licensed under the GPLv3 license found in the
18
- * LICENSE file in the root directory of this source tree.
19
- *
20
- */
21
-
22
- const StyledFigure = (0, _jsx2.styled)(_primitives.Figure, {
23
- base: {
24
- display: "flex",
25
- flexDirection: "column",
26
- gap: "medium"
27
- }
28
- });
29
- const ContentWrapper = (0, _jsx2.styled)("div", {
30
- base: {
31
- textStyle: "body.large",
32
- display: "inline",
33
- "& p": {
34
- display: "inline"
35
- }
36
- }
37
- });
38
- const Concept = exports.Concept = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
39
- let {
40
- copyright,
41
- visualElement,
42
- lang,
43
- children,
44
- title,
45
- source,
46
- previewAlt,
47
- ...rest
48
- } = _ref;
49
- const licenseProps = (0, _licenseAttributes.licenseAttributes)(copyright?.license?.license, lang, source);
50
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledFigure, {
51
- ref: ref,
52
- ...rest,
53
- ...licenseProps,
54
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentWrapper, {
55
- lang: lang,
56
- children: [!!title && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
57
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("b", {
58
- children: title
59
- }), ` – `]
60
- }), children]
61
- }), visualElement?.resource === "image" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.ImageEmbed, {
62
- embed: visualElement,
63
- lang: lang,
64
- previewAlt: previewAlt
65
- }) : visualElement?.resource === "brightcove" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.BrightcoveEmbed, {
66
- embed: visualElement
67
- }) : visualElement?.resource === "h5p" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.H5pEmbed, {
68
- embed: visualElement
69
- }) : visualElement?.resource === "iframe" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.IframeEmbed, {
70
- embed: visualElement
71
- }) : visualElement?.resource === "external" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.ExternalEmbed, {
72
- embed: visualElement
73
- }) : null, !!copyright && /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmbedByline.EmbedByline, {
74
- copyright: copyright,
75
- type: "concept"
76
- })]
77
- });
78
- });