@ndla/ui 3.2.1 → 3.2.5

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 (141) hide show
  1. package/es/Article/ArticleAuthorContent.js +1 -2
  2. package/es/Article/ArticleSideBar.js +42 -14
  3. package/es/BackgroundImage/BackgroundImage.js +27 -0
  4. package/es/BackgroundImage/index.js +2 -0
  5. package/es/ContentLoader/index.js +83 -0
  6. package/es/Dialog/Dialog.js +64 -0
  7. package/es/Dialog/index.js +10 -0
  8. package/es/FactBox/FactBox.js +7 -11
  9. package/es/Figure/Figure.js +97 -0
  10. package/es/Figure/FigureExpandButton.js +28 -0
  11. package/es/Figure/FigureLicense.js +54 -0
  12. package/es/Figure/FigureLicenseDialog.js +43 -0
  13. package/es/Figure/index.js +12 -0
  14. package/es/FileList/File.js +48 -0
  15. package/es/FileList/FileList.js +20 -0
  16. package/es/FileList/index.js +3 -0
  17. package/es/Hero/Hero.js +64 -0
  18. package/es/Hero/index.js +8 -0
  19. package/es/Image/Image.js +96 -0
  20. package/es/Image/ImageLink.js +46 -0
  21. package/es/Image/LazyLoadImage.js +47 -0
  22. package/es/Image/index.js +11 -0
  23. package/es/InfoBox/InfoBox.js +11 -0
  24. package/es/InfoBox/index.js +1 -0
  25. package/es/InfoWidget/InfoWidget.js +57 -0
  26. package/es/InfoWidget/index.js +2 -0
  27. package/es/Logo/Logo.js +51 -0
  28. package/es/Logo/SvgLogo.js +54 -0
  29. package/es/Logo/index.js +9 -0
  30. package/es/Masthead/Masthead.js +67 -0
  31. package/es/Masthead/index.js +10 -0
  32. package/es/NoContentBox/NoContentBox.js +26 -0
  33. package/es/NoContentBox/index.js +9 -0
  34. package/es/Portrait/Portrait.js +30 -0
  35. package/es/Portrait/index.js +9 -0
  36. package/es/RelatedArticleList/RelatedArticleList.js +4 -23
  37. package/es/ResourcesWrapper/ResourcesTitle.js +0 -4
  38. package/es/ResourcesWrapper/ResourcesTopicTitle.js +12 -25
  39. package/es/ResourcesWrapper/ResourcesWrapper.js +2 -11
  40. package/es/Topic/Topic.js +21 -22
  41. package/es/Translation/Translation.js +22 -0
  42. package/es/Translation/TranslationBox.js +17 -0
  43. package/es/Translation/TranslationLine.js +37 -0
  44. package/es/Translation/index.js +3 -0
  45. package/es/index-javascript.js +1 -19
  46. package/es/index.js +18 -0
  47. package/es/locale/messages-en.js +4 -0
  48. package/es/locale/messages-nb.js +5 -1
  49. package/es/locale/messages-nn.js +5 -1
  50. package/lib/Article/ArticleSideBar.d.ts +2 -1
  51. package/lib/Article/ArticleSideBar.js +43 -14
  52. package/lib/BackgroundImage/BackgroundImage.js +40 -0
  53. package/lib/BackgroundImage/index.js +13 -0
  54. package/lib/ContentLoader/index.js +88 -0
  55. package/lib/Dialog/Dialog.d.ts +1 -1
  56. package/lib/Dialog/Dialog.js +70 -0
  57. package/lib/Dialog/index.js +24 -0
  58. package/lib/FactBox/FactBox.d.ts +16 -0
  59. package/lib/FactBox/FactBox.js +5 -11
  60. package/lib/FactBox/index.d.ts +2 -0
  61. package/lib/Figure/Figure.d.ts +3 -4
  62. package/lib/Figure/Figure.js +109 -0
  63. package/lib/Figure/FigureExpandButton.js +41 -0
  64. package/lib/Figure/FigureLicense.js +66 -0
  65. package/lib/Figure/FigureLicenseDialog.js +48 -0
  66. package/lib/Figure/index.js +49 -0
  67. package/lib/FileList/File.js +63 -0
  68. package/lib/FileList/FileList.js +34 -0
  69. package/lib/FileList/index.js +21 -0
  70. package/lib/Hero/Hero.d.ts +2 -1
  71. package/lib/Hero/Hero.js +100 -0
  72. package/lib/Hero/index.d.ts +1 -0
  73. package/lib/Hero/index.js +55 -0
  74. package/lib/Image/Image.d.ts +10 -1
  75. package/lib/Image/Image.js +105 -0
  76. package/lib/Image/ImageLink.d.ts +1 -1
  77. package/lib/Image/ImageLink.js +50 -0
  78. package/lib/Image/LazyLoadImage.js +51 -0
  79. package/lib/Image/index.d.ts +1 -0
  80. package/lib/Image/index.js +38 -0
  81. package/lib/InfoBox/InfoBox.js +24 -0
  82. package/lib/InfoBox/index.js +15 -0
  83. package/lib/InfoWidget/InfoWidget.js +73 -0
  84. package/lib/InfoWidget/index.js +13 -0
  85. package/lib/Logo/Logo.js +70 -0
  86. package/lib/Logo/SvgLogo.js +59 -0
  87. package/lib/Logo/index.js +20 -0
  88. package/lib/Masthead/Masthead.js +82 -0
  89. package/lib/Masthead/index.js +30 -0
  90. package/lib/NoContentBox/NoContentBox.js +43 -0
  91. package/lib/NoContentBox/index.js +20 -0
  92. package/lib/Portrait/Portrait.js +43 -0
  93. package/lib/Portrait/index.js +20 -0
  94. package/lib/RelatedArticleList/RelatedArticleList.d.ts +25 -0
  95. package/lib/RelatedArticleList/RelatedArticleList.js +2 -23
  96. package/lib/RelatedArticleList/index.d.ts +10 -0
  97. package/lib/ResourcesWrapper/ResourcesTitle.d.ts +13 -0
  98. package/lib/ResourcesWrapper/ResourcesTitle.js +0 -5
  99. package/lib/ResourcesWrapper/ResourcesTopicTitle.d.ts +13 -0
  100. package/lib/ResourcesWrapper/ResourcesTopicTitle.js +11 -26
  101. package/lib/ResourcesWrapper/ResourcesWrapper.d.ts +18 -0
  102. package/lib/ResourcesWrapper/ResourcesWrapper.js +2 -12
  103. package/lib/ResourcesWrapper/index.d.ts +11 -0
  104. package/lib/Topic/Topic.d.ts +1 -1
  105. package/lib/Topic/Topic.js +20 -20
  106. package/lib/Translation/Translation.js +35 -0
  107. package/lib/Translation/TranslationBox.d.ts +1 -1
  108. package/lib/Translation/TranslationBox.js +29 -0
  109. package/lib/Translation/TranslationLine.js +42 -0
  110. package/lib/Translation/index.js +31 -0
  111. package/lib/index-javascript.js +0 -250
  112. package/lib/index.d.ts +4 -0
  113. package/lib/index.js +286 -0
  114. package/lib/locale/messages-en.js +4 -0
  115. package/lib/locale/messages-nb.js +5 -1
  116. package/lib/locale/messages-nn.js +5 -1
  117. package/lib/types.d.ts +0 -10
  118. package/lib/utils/createUniversalPortal.d.ts +9 -0
  119. package/package.json +6 -6
  120. package/src/Article/ArticleSideBar.tsx +31 -3
  121. package/src/FactBox/{FactBox.jsx → FactBox.tsx} +12 -14
  122. package/src/FactBox/{index.js → index.ts} +0 -0
  123. package/src/Figure/Figure.tsx +7 -4
  124. package/src/Figure/FigureLicense.tsx +1 -1
  125. package/src/Hero/Hero.tsx +14 -12
  126. package/src/Hero/index.ts +2 -0
  127. package/src/Image/Image.tsx +11 -1
  128. package/src/Image/ImageLink.tsx +1 -1
  129. package/src/Image/index.ts +1 -0
  130. package/src/RelatedArticleList/{RelatedArticleList.jsx → RelatedArticleList.tsx} +43 -30
  131. package/src/RelatedArticleList/{index.js → index.ts} +0 -0
  132. package/src/ResourcesWrapper/{ResourcesTitle.jsx → ResourcesTitle.tsx} +5 -7
  133. package/src/ResourcesWrapper/{ResourcesTopicTitle.jsx → ResourcesTopicTitle.tsx} +23 -22
  134. package/src/ResourcesWrapper/{ResourcesWrapper.jsx → ResourcesWrapper.tsx} +9 -14
  135. package/src/ResourcesWrapper/{index.js → index.ts} +0 -0
  136. package/src/Topic/Topic.tsx +1 -3
  137. package/src/Translation/TranslationBox.tsx +1 -1
  138. package/src/index-javascript.js +0 -4
  139. package/src/index.ts +8 -0
  140. package/src/types.ts +0 -12
  141. package/src/utils/{createUniversalPortal.jsx → createUniversalPortal.tsx} +3 -3
@@ -0,0 +1,54 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /**
4
+ * Copyright (c) 2018-present, NDLA.
5
+ *
6
+ * This source code is licensed under the GPLv3 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ *
9
+ */
10
+ // N.B This component is used to render static markup serverside
11
+ // Any interactivty is added by scripts located in the ndla-article-scripts package
12
+ import React from 'react';
13
+ import BEMHelper from 'react-bem-helper';
14
+ import { uuid } from '@ndla/util';
15
+ import { LicenseDescription } from '@ndla/licenses';
16
+ import { jsx as ___EmotionJSX } from "@emotion/core";
17
+ export var classLicenses = new BEMHelper({
18
+ name: 'figure-license',
19
+ prefix: 'c-'
20
+ });
21
+ export var FigureLicenseCta = function FigureLicenseCta(_ref) {
22
+ var children = _ref.children,
23
+ messages = _ref.messages,
24
+ authors = _ref.authors,
25
+ origin = _ref.origin,
26
+ title = _ref.title;
27
+ return ___EmotionJSX("div", classLicenses('cta-wrapper'), ___EmotionJSX("ul", classLicenses('list'), title && ___EmotionJSX("li", classLicenses('item'), "".concat(messages.title, ": ").concat(title)), authors === null || authors === void 0 ? void 0 : authors.map(function (author) {
28
+ return ___EmotionJSX("li", _extends({
29
+ key: uuid()
30
+ }, classLicenses('item')), "".concat(author.type, ": ").concat(author.name));
31
+ }), origin && ___EmotionJSX("li", classLicenses('item'), messages.source, ":", ' ', origin.startsWith('http') ? ___EmotionJSX("a", {
32
+ href: origin,
33
+ target: "_blank",
34
+ rel: "noopener noreferrer"
35
+ }, origin) : origin)), ___EmotionJSX("div", classLicenses('cta-block'), children));
36
+ };
37
+ export var FigureLicenseByline = function FigureLicenseByline(_ref2) {
38
+ var messages = _ref2.messages,
39
+ license = _ref2.license,
40
+ locale = _ref2.locale;
41
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(LicenseDescription, {
42
+ key: "byline",
43
+ highlightCC: true,
44
+ locale: locale,
45
+ messages: messages,
46
+ licenseRights: license.rights
47
+ }), ___EmotionJSX("a", _extends({
48
+ key: "link"
49
+ }, classLicenses('link'), {
50
+ target: "_blank",
51
+ rel: "noopener noreferrer",
52
+ href: license.url
53
+ }), license.linkText));
54
+ };
@@ -0,0 +1,43 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /**
4
+ * Copyright (c) 2017-present, NDLA.
5
+ *
6
+ * This source code is licensed under the GPLv3 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ *
9
+ */
10
+ // N.B This component is used to render static markup serverside
11
+ // Any interactivty is added by scripts located in the ndla-article-scripts package
12
+ import React from 'react'; //@ts-ignore
13
+
14
+ import Dialog from '../Dialog';
15
+ import { classLicenses, FigureLicenseByline, FigureLicenseCta } from './FigureLicense';
16
+ import { jsx as ___EmotionJSX } from "@emotion/core";
17
+ export var FigureLicenseDialog = function FigureLicenseDialog(_ref) {
18
+ var children = _ref.children,
19
+ messages = _ref.messages,
20
+ id = _ref.id,
21
+ authors = _ref.authors,
22
+ origin = _ref.origin,
23
+ title = _ref.title,
24
+ locale = _ref.locale,
25
+ license = _ref.license;
26
+ var headingLabelId = "heading-".concat(id);
27
+ return ___EmotionJSX(Dialog, {
28
+ id: id,
29
+ labelledby: headingLabelId,
30
+ messages: messages
31
+ }, ___EmotionJSX("div", classLicenses(), ___EmotionJSX("h3", _extends({
32
+ id: headingLabelId
33
+ }, classLicenses('title')), messages.rulesForUse), ___EmotionJSX(FigureLicenseByline, {
34
+ license: license,
35
+ messages: messages,
36
+ locale: locale
37
+ }), ___EmotionJSX(FigureLicenseCta, {
38
+ authors: authors,
39
+ title: title,
40
+ origin: origin,
41
+ messages: messages
42
+ }, children)));
43
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) 2017-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
+ import Figure, { FigureCaption } from './Figure';
9
+ export { Figure, FigureCaption };
10
+ export { FigureLicenseDialog } from './FigureLicenseDialog';
11
+ export { FigureExpandButton } from './FigureExpandButton';
12
+ export { FigureBylineExpandButton } from './FigureBylineExpandButton';
@@ -0,0 +1,48 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ import BEMHelper from 'react-bem-helper';
5
+ import { Download } from '@ndla/icons/common';
6
+ import SafeLink from '@ndla/safelink';
7
+ import { jsx as ___EmotionJSX } from "@emotion/core";
8
+ var classes = BEMHelper('c-file-list');
9
+
10
+ var renderFormat = function renderFormat(format, title, isPrimary, id, isDeadLink) {
11
+ var titleWithFormat = "".concat(title, " (").concat(format.fileType.toUpperCase(), ")");
12
+ var formatId = "".concat(id, "_").concat(format.fileType);
13
+
14
+ if (isDeadLink) {
15
+ return ___EmotionJSX("span", {
16
+ key: format.url
17
+ }, ___EmotionJSX(Download, null), ___EmotionJSX("span", null, isPrimary ? titleWithFormat : "(".concat(format.fileType.toUpperCase(), ")")), ___EmotionJSX("span", _extends({}, classes('tooltip'), {
18
+ "aria-hidden": true,
19
+ role: "tooltip",
20
+ id: formatId
21
+ }), ___EmotionJSX("span", classes('tooltip-text'), format.tooltip)));
22
+ }
23
+
24
+ return ___EmotionJSX(SafeLink, _extends({}, classes('link'), {
25
+ key: format.url,
26
+ to: format.url,
27
+ target: "_blank",
28
+ "aria-label": titleWithFormat,
29
+ "aria-describedby": formatId
30
+ }), ___EmotionJSX(Download, null), ___EmotionJSX("span", classes('link-text'), ___EmotionJSX("span", null, isPrimary ? titleWithFormat : "(".concat(format.fileType.toUpperCase(), ")"))), ___EmotionJSX("span", _extends({}, classes('tooltip'), {
31
+ "aria-hidden": true,
32
+ role: "tooltip",
33
+ id: formatId
34
+ }), ___EmotionJSX("span", classes('tooltip-text'), format.tooltip)));
35
+ };
36
+
37
+ var File = function File(_ref) {
38
+ var file = _ref.file,
39
+ id = _ref.id;
40
+ var formatLinks = file.formats.map(function (format, index) {
41
+ return renderFormat(format, file.title, index === 0, id, !file.fileExists);
42
+ });
43
+ return ___EmotionJSX("li", _extends({}, classes('item'), {
44
+ key: file.title
45
+ }), formatLinks);
46
+ };
47
+
48
+ export default File;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import BEMHelper from 'react-bem-helper';
3
+ import File from './File';
4
+ import { jsx as ___EmotionJSX } from "@emotion/core";
5
+ var classes = BEMHelper('c-file-list');
6
+
7
+ var FileList = function FileList(_ref) {
8
+ var files = _ref.files,
9
+ heading = _ref.heading,
10
+ id = _ref.id;
11
+ return ___EmotionJSX("section", classes(), ___EmotionJSX("h1", classes('heading'), heading), ___EmotionJSX("ul", classes('files'), files.map(function (file) {
12
+ return ___EmotionJSX(File, {
13
+ key: "file-".concat(id, "-").concat(file.title),
14
+ file: file,
15
+ id: id
16
+ });
17
+ })));
18
+ };
19
+
20
+ export default FileList;
@@ -0,0 +1,3 @@
1
+ import FileList from './FileList';
2
+ export { default as File } from './File';
3
+ export default FileList;
@@ -0,0 +1,64 @@
1
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
2
+
3
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+
5
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
+
7
+ /**
8
+ * Copyright (c) 2016-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
+ import React from 'react';
15
+ import BEMHelper from 'react-bem-helper';
16
+ import * as contentTypes from '../model/ContentType';
17
+ import { jsx as ___EmotionJSX } from "@emotion/core";
18
+ var classes = new BEMHelper({
19
+ name: 'hero',
20
+ prefix: 'c-'
21
+ });
22
+ export var Hero = function Hero(_ref) {
23
+ var children = _ref.children,
24
+ contentType = _ref.contentType;
25
+ return ___EmotionJSX("div", classes('', contentType), children || null);
26
+ };
27
+ export var SubjectMaterialHero = function SubjectMaterialHero(props) {
28
+ return ___EmotionJSX(Hero, _extends({
29
+ contentType: contentTypes.SUBJECT_MATERIAL
30
+ }, props));
31
+ };
32
+ export var TasksAndActivitiesHero = function TasksAndActivitiesHero(props) {
33
+ return ___EmotionJSX(Hero, _extends({
34
+ contentType: contentTypes.TASKS_AND_ACTIVITIES
35
+ }, props));
36
+ };
37
+ export var AssessmentResourcesHero = function AssessmentResourcesHero(props) {
38
+ return ___EmotionJSX(Hero, _extends({
39
+ contentType: contentTypes.ASSESSMENT_RESOURCES
40
+ }, props));
41
+ };
42
+ export var SubjectHero = function SubjectHero(props) {
43
+ return ___EmotionJSX(Hero, _extends({
44
+ contentType: contentTypes.SUBJECT
45
+ }, props));
46
+ };
47
+ export var ExternalLearningResourcesHero = function ExternalLearningResourcesHero(props) {
48
+ return ___EmotionJSX(Hero, _extends({
49
+ contentType: contentTypes.EXTERNAL_LEARNING_RESOURCES
50
+ }, props));
51
+ };
52
+ export var SourceMaterialHero = function SourceMaterialHero(props) {
53
+ return ___EmotionJSX(Hero, _extends({
54
+ contentType: contentTypes.SOURCE_MATERIAL
55
+ }, props));
56
+ };
57
+ export var NdlaFilmHero = function NdlaFilmHero(_ref2) {
58
+ var hasImage = _ref2.hasImage,
59
+ rest = _objectWithoutProperties(_ref2, ["hasImage"]);
60
+
61
+ return ___EmotionJSX(Hero, _extends({}, rest, {
62
+ contentType: hasImage ? 'ndla-film has-image' : 'ndla-film'
63
+ }));
64
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2018-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
+ export { SubjectMaterialHero, TasksAndActivitiesHero, AssessmentResourcesHero, SubjectHero, ExternalLearningResourcesHero, SourceMaterialHero, Hero, NdlaFilmHero } from './Hero';
@@ -0,0 +1,96 @@
1
+ import _styled from "@emotion/styled-base";
2
+
3
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+
5
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6
+
7
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
8
+
9
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
10
+
11
+ /**
12
+ * Copyright (c) 2017-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
+ import React from 'react';
19
+ import defined from 'defined';
20
+ import LazyLoadImage from './LazyLoadImage';
21
+ import { jsx as ___EmotionJSX } from "@emotion/core";
22
+ export var makeSrcQueryString = function makeSrcQueryString(width, crop, focalPoint) {
23
+ var widthParams = width && "width=".concat(width);
24
+ var cropParams = crop && "cropStartX=".concat(crop.startX, "&cropEndX=").concat(crop.endX, "&cropStartY=").concat(crop.startY, "&cropEndY=").concat(crop.endY);
25
+ var focalPointParams = focalPoint && "focalX=".concat(focalPoint.x, "&focalY=").concat(focalPoint.y);
26
+ var params = [widthParams, cropParams, focalPointParams].filter(function (p) {
27
+ return p;
28
+ }).join('&');
29
+ return params;
30
+ };
31
+
32
+ var getSrcSet = function getSrcSet(src, crop, focalPoint) {
33
+ var widths = [2720, 2080, 1760, 1440, 1120, 1000, 960, 800, 640, 480, 320, 240, 180];
34
+ return widths.map(function (width) {
35
+ return "".concat(src, "?").concat(makeSrcQueryString(width, crop, focalPoint), " ").concat(width, "w");
36
+ }).join(', ');
37
+ };
38
+
39
+ var StyledImageWrapper = _styled("div", {
40
+ target: "ejtxxex0",
41
+ label: "StyledImageWrapper"
42
+ })(process.env.NODE_ENV === "production" ? {
43
+ name: "79elbk",
44
+ styles: "position:relative;"
45
+ } : {
46
+ name: "79elbk",
47
+ styles: "position:relative;",
48
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkltYWdlLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1Q3FDIiwiZmlsZSI6IkltYWdlLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h0IChjKSAyMDE3LXByZXNlbnQsIE5ETEEuXG4gKlxuICogVGhpcyBzb3VyY2UgY29kZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgR1BMdjMgbGljZW5zZSBmb3VuZCBpbiB0aGVcbiAqIExJQ0VOU0UgZmlsZSBpbiB0aGUgcm9vdCBkaXJlY3Rvcnkgb2YgdGhpcyBzb3VyY2UgdHJlZS5cbiAqXG4gKi9cblxuaW1wb3J0IFJlYWN0LCB7I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0eWxlZEltYWdlV3JhcHBlcj5cbiAgICAgIDxwaWN0dXJlPlxuICAgICAgICA8c291cmNlIHR5cGU9e2NvbnRlbnRUeXBlfSBzcmNTZXQ9e3NyY1NldH0gc2l6ZXM9e3NpemVzfSAvPlxuICAgICAgICA8aW1nIGFsdD17YWx0fSBzcmM9e2Ake3NyY30/JHtxdWVyeVN0cmluZ31gfSB7Li4ucmVzdH0gLz5cbiAgICAgIDwvcGljdHVyZT5cbiAgICAgIHtleHBhbmRCdXR0b259XG4gICAgPC9TdHlsZWRJbWFnZVdyYXBwZXI+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBJbWFnZTtcbiJdfQ== */",
49
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
50
+ });
51
+
52
+ var Image = function Image(_ref) {
53
+ var alt = _ref.alt,
54
+ src = _ref.src,
55
+ lazyLoad = _ref.lazyLoad,
56
+ lazyLoadSrc = _ref.lazyLoadSrc,
57
+ crop = _ref.crop,
58
+ focalPoint = _ref.focalPoint,
59
+ contentType = _ref.contentType,
60
+ _ref$sizes = _ref.sizes,
61
+ sizes = _ref$sizes === void 0 ? '(min-width: 1024px) 1024px, 100vw' : _ref$sizes,
62
+ expandButton = _ref.expandButton,
63
+ rest = _objectWithoutProperties(_ref, ["alt", "src", "lazyLoad", "lazyLoadSrc", "crop", "focalPoint", "contentType", "sizes", "expandButton"]);
64
+
65
+ var srcSet = defined(rest.srcSet, getSrcSet(src, crop, focalPoint));
66
+ var fallbackWidth = defined(rest.fallbackWidth, 1024);
67
+ var queryString = makeSrcQueryString(fallbackWidth, crop, focalPoint);
68
+
69
+ if (contentType && contentType === 'image/gif') {
70
+ return ___EmotionJSX(StyledImageWrapper, null, ___EmotionJSX("img", _extends({
71
+ alt: alt,
72
+ src: "".concat(src)
73
+ }, rest)));
74
+ }
75
+
76
+ if (lazyLoad) {
77
+ return ___EmotionJSX(StyledImageWrapper, null, ___EmotionJSX(LazyLoadImage, {
78
+ alt: alt,
79
+ src: "".concat(src, "?").concat(queryString),
80
+ srcSet: srcSet,
81
+ sizes: sizes,
82
+ lazyLoadSrc: lazyLoadSrc
83
+ }));
84
+ }
85
+
86
+ return ___EmotionJSX(StyledImageWrapper, null, ___EmotionJSX("picture", null, ___EmotionJSX("source", {
87
+ type: contentType,
88
+ srcSet: srcSet,
89
+ sizes: sizes
90
+ }), ___EmotionJSX("img", _extends({
91
+ alt: alt,
92
+ src: "".concat(src, "?").concat(queryString)
93
+ }, rest))), expandButton);
94
+ };
95
+
96
+ export default Image;
@@ -0,0 +1,46 @@
1
+ import _styled from "@emotion/styled-base";
2
+
3
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+
5
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6
+
7
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
8
+
9
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
10
+
11
+ /**
12
+ * Copyright (c) 2019-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
+ import React from 'react';
19
+ import { makeSrcQueryString } from './Image';
20
+ import { jsx as ___EmotionJSX } from "@emotion/core";
21
+
22
+ var StyledLink = _styled("a", {
23
+ target: "eo3pjlm0",
24
+ label: "StyledLink"
25
+ })(process.env.NODE_ENV === "production" ? {
26
+ name: "17viinn",
27
+ styles: "box-shadow:inset 0 0;"
28
+ } : {
29
+ name: "17viinn",
30
+ styles: "box-shadow:inset 0 0;",
31
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkltYWdlTGluay50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBYTJCIiwiZmlsZSI6IkltYWdlTGluay50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAxOS1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFIGZpbGUgaW4gdGhlIHJvb3QgZGlyZWN0b3J5IG9mIHRoaXMgc291cmNlIHRyZWUuXG4gKlxuICovXG5cbmltcG9ydCBSZWFjdCwgeyBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBtYWtlU3JjUXVlcnlTdHJpbmcgfSBmcm9tICcuL0ltYWdlJztcbmltcG9ydCB7IEltYWdlQ3JvcCwgSW1hZ2VGb2NhbFBvaW50IH0gZnJvbSAnLic7XG5cbmNvbnN0IFN0eWxlZExpbmsgPSBzdHlsZWQuYWBcbiAgYm94LXNoYWRvdzogaW5zZXQgMCAwO1xuYDtcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgc3JjOiBzdHJpbmc7XG4gIGNoaWxkcmVuOiBSZWFjdE5vZGU7XG4gIHNpemVzPzogc3RyaW5nO1xuICBjcm9wPzogSW1hZ2VDcm9wO1xuICBmb2NhbFBvaW50PzogSW1hZ2VGb2NhbFBvaW50O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gSW1hZ2VMaW5rKHsgc3JjLCBjcm9wLCBjaGlsZHJlbiwgLi4ucmVzdCB9OiBQcm9wcykge1xuICByZXR1cm4gKFxuICAgIDxTdHlsZWRMaW5rXG4gICAgICB0YXJnZXQ9XCJfYmxhbmtcIlxuICAgICAgaHJlZj17YCR7c3JjfT8ke21ha2VTcmNRdWVyeVN0cmluZyh1bmRlZmluZWQsIGNyb3ApfWB9XG4gICAgICByZWw9XCJub29wZW5lciBub3JlZmVycmVyXCJcbiAgICAgIHsuLi5yZXN0fT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L1N0eWxlZExpbms+XG4gICk7XG59XG4iXX0= */",
32
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
33
+ });
34
+
35
+ export function ImageLink(_ref) {
36
+ var src = _ref.src,
37
+ crop = _ref.crop,
38
+ children = _ref.children,
39
+ rest = _objectWithoutProperties(_ref, ["src", "crop", "children"]);
40
+
41
+ return ___EmotionJSX(StyledLink, _extends({
42
+ target: "_blank",
43
+ href: "".concat(src, "?").concat(makeSrcQueryString(undefined, crop)),
44
+ rel: "noopener noreferrer"
45
+ }, rest), children);
46
+ }
@@ -0,0 +1,47 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+
5
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
+
7
+ /**
8
+ * Copyright (c) 2017-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
+ import React from 'react';
15
+ import { jsx as ___EmotionJSX } from "@emotion/core";
16
+
17
+ // Lazyload image with lazysizes (https://github.com/aFarkas/lazysizes)
18
+ var LazyLoadImage = function LazyLoadImage(_ref) {
19
+ var alt = _ref.alt,
20
+ src = _ref.src,
21
+ srcSet = _ref.srcSet,
22
+ lazyLoadSrc = _ref.lazyLoadSrc,
23
+ sizes = _ref.sizes,
24
+ rest = _objectWithoutProperties(_ref, ["alt", "src", "srcSet", "lazyLoadSrc", "sizes"]);
25
+
26
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX("noscript", {
27
+ key: "noscript"
28
+ }, ___EmotionJSX("img", _extends({
29
+ alt: alt,
30
+ src: "".concat(src),
31
+ srcSet: srcSet,
32
+ sizes: sizes
33
+ }, rest))), ",", ___EmotionJSX("img", _extends({
34
+ alt: alt,
35
+ key: "img",
36
+ style: {
37
+ width: '100%'
38
+ },
39
+ className: "lazyload",
40
+ src: lazyLoadSrc,
41
+ "data-src": src,
42
+ "data-src-set": srcSet,
43
+ "data-sizes": sizes
44
+ }, rest)));
45
+ };
46
+
47
+ export default LazyLoadImage;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright (c) 2017-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
+ import Image from './Image';
9
+ export { makeSrcQueryString } from './Image';
10
+ export { ImageLink } from './ImageLink';
11
+ export default Image;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import BEMHelper from 'react-bem-helper';
3
+ import { jsx as ___EmotionJSX } from "@emotion/core";
4
+ var classes = BEMHelper('c-info-box');
5
+
6
+ var InfoBox = function InfoBox(_ref) {
7
+ var children = _ref.children;
8
+ return ___EmotionJSX("div", classes(), children);
9
+ };
10
+
11
+ export default InfoBox;
@@ -0,0 +1 @@
1
+ export { default as InfoBox } from './InfoBox';
@@ -0,0 +1,57 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ import BEMHelper from 'react-bem-helper';
5
+ import { Forward } from '@ndla/icons/common';
6
+ import SafeLink from '@ndla/safelink';
7
+ import SectionHeading from '../SectionHeading';
8
+ import { jsx as ___EmotionJSX } from "@emotion/core";
9
+ var classes = BEMHelper('c-info-widget');
10
+
11
+ var InfoWidget = function InfoWidget(_ref) {
12
+ var heading = _ref.heading,
13
+ description = _ref.description,
14
+ mainLink = _ref.mainLink,
15
+ iconLinks = _ref.iconLinks,
16
+ _ref$center = _ref.center,
17
+ center = _ref$center === void 0 ? false : _ref$center;
18
+ return ___EmotionJSX("section", classes('', {
19
+ center: center
20
+ }), ___EmotionJSX(SectionHeading, {
21
+ large: true,
22
+ className: classes('heading').className
23
+ }, heading), ___EmotionJSX("div", classes('description'), ___EmotionJSX("p", null, description)), ___EmotionJSX("div", classes('links'), iconLinks && iconLinks.map(function (link) {
24
+ if (link.url) {
25
+ return ___EmotionJSX(SafeLink, _extends({
26
+ key: link.url
27
+ }, classes('icon-link'), {
28
+ to: link.url,
29
+ "aria-label": link.name
30
+ }), link.icon);
31
+ }
32
+
33
+ if (link.href) {
34
+ return ___EmotionJSX("a", _extends({
35
+ key: link.href,
36
+ href: link.href
37
+ }, classes('icon-link'), {
38
+ "aria-label": link.name
39
+ }), link.icon);
40
+ }
41
+
42
+ return ___EmotionJSX("span", _extends({
43
+ key: link.name
44
+ }, classes('icon-link'), {
45
+ "aria-label": link.name
46
+ }), link.icon);
47
+ }), mainLink.url ? ___EmotionJSX("div", {
48
+ className: "o-text-link__wrapper o-text-link__wrapper--right"
49
+ }, ___EmotionJSX(SafeLink, {
50
+ className: "o-text-link",
51
+ to: mainLink.url
52
+ }, ___EmotionJSX("span", null, mainLink.name), " ", ___EmotionJSX(Forward, null))) : ___EmotionJSX("a", _extends({}, classes('main-link'), {
53
+ href: mainLink.href
54
+ }), mainLink.name)));
55
+ };
56
+
57
+ export default InfoWidget;
@@ -0,0 +1,2 @@
1
+ import InfoWidget from './InfoWidget';
2
+ export default InfoWidget;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright (c) 2016-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
+ /* eslint-disable max-len */
10
+ import React from 'react';
11
+ import BEMHelper from 'react-bem-helper';
12
+ import SafeLink from '@ndla/safelink';
13
+ import SvgLogo from './SvgLogo';
14
+ import { jsx as ___EmotionJSX } from "@emotion/core";
15
+ export var logoClasses = new BEMHelper({
16
+ name: 'logo',
17
+ prefix: 'c-'
18
+ });
19
+ export var Logo = function Logo(_ref) {
20
+ var _ref$name = _ref.name,
21
+ name = _ref$name === void 0 ? true : _ref$name,
22
+ to = _ref.to,
23
+ cssModifier = _ref.cssModifier,
24
+ color = _ref.color,
25
+ _ref$large = _ref.large,
26
+ large = _ref$large === void 0 ? false : _ref$large,
27
+ locale = _ref.locale,
28
+ label = _ref.label;
29
+ var modifiers = {
30
+ large: large
31
+ };
32
+
33
+ if (cssModifier) {
34
+ modifiers[cssModifier] = true;
35
+ }
36
+
37
+ var logo = to ? ___EmotionJSX(SafeLink, {
38
+ to: to,
39
+ "aria-label": label
40
+ }, ___EmotionJSX(SvgLogo, {
41
+ name: name,
42
+ color: color,
43
+ locale: locale
44
+ })) : ___EmotionJSX(React.Fragment, null, ___EmotionJSX(SvgLogo, {
45
+ name: name,
46
+ color: color,
47
+ locale: locale
48
+ }));
49
+ return ___EmotionJSX("div", logoClasses('', modifiers), logo);
50
+ };
51
+ export default Logo;