@ndla/ui 3.2.1-alpha.3 → 3.2.2

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 (172) hide show
  1. package/es/Article/ArticleAuthorContent.js +1 -2
  2. package/es/AuthorInfo/AuthorInfo.js +1 -2
  3. package/es/BackgroundImage/BackgroundImage.js +5 -15
  4. package/es/ContentLoader/index.js +14 -27
  5. package/es/Dialog/Dialog.js +10 -28
  6. package/es/FactBox/FactBox.js +7 -11
  7. package/es/Figure/Figure.js +9 -41
  8. package/es/Figure/FigureExpandButton.js +2 -11
  9. package/es/Figure/FigureLicense.js +4 -24
  10. package/es/Figure/FigureLicenseDialog.js +2 -20
  11. package/es/FileList/File.js +0 -13
  12. package/es/FileList/FileList.js +0 -13
  13. package/es/Hero/Hero.js +0 -6
  14. package/es/Image/Image.js +4 -27
  15. package/es/Image/ImageLink.js +3 -12
  16. package/es/Image/LazyLoadImage.js +4 -13
  17. package/es/InfoBox/InfoBox.js +0 -4
  18. package/es/InfoWidget/InfoWidget.js +2 -21
  19. package/es/Logo/Logo.js +6 -22
  20. package/es/Logo/SvgLogo.js +4 -12
  21. package/es/Masthead/Masthead.js +12 -33
  22. package/es/NoContentBox/NoContentBox.js +2 -11
  23. package/es/Portrait/Portrait.js +0 -11
  24. package/es/RelatedArticleList/RelatedArticleList.js +4 -23
  25. package/es/Topic/Topic.js +20 -20
  26. package/es/Translation/Translation.js +0 -5
  27. package/es/Translation/TranslationBox.js +7 -3
  28. package/es/Translation/TranslationLine.js +4 -15
  29. package/es/index-javascript.js +1 -18
  30. package/es/index.js +17 -0
  31. package/es/locale/messages-en.js +4 -0
  32. package/es/locale/messages-nb.js +5 -1
  33. package/es/locale/messages-nn.js +5 -1
  34. package/lib/BackgroundImage/BackgroundImage.d.ts +11 -0
  35. package/lib/BackgroundImage/BackgroundImage.js +5 -17
  36. package/lib/BackgroundImage/index.d.ts +2 -0
  37. package/lib/ContentLoader/index.d.ts +20 -0
  38. package/lib/ContentLoader/index.js +14 -28
  39. package/lib/Dialog/Dialog.d.ts +23 -0
  40. package/lib/Dialog/Dialog.js +9 -29
  41. package/lib/Dialog/index.d.ts +10 -0
  42. package/lib/FactBox/FactBox.d.ts +16 -0
  43. package/lib/FactBox/FactBox.js +5 -11
  44. package/lib/FactBox/index.d.ts +2 -0
  45. package/lib/Figure/Figure.d.ts +50 -0
  46. package/lib/Figure/Figure.js +7 -41
  47. package/lib/Figure/FigureExpandButton.d.ts +16 -0
  48. package/lib/Figure/FigureExpandButton.js +2 -13
  49. package/lib/Figure/FigureLicense.d.ts +33 -0
  50. package/lib/Figure/FigureLicense.js +5 -27
  51. package/lib/Figure/FigureLicenseDialog.d.ts +29 -0
  52. package/lib/Figure/FigureLicenseDialog.js +1 -22
  53. package/lib/Figure/index.d.ts +12 -0
  54. package/lib/FileList/File.d.ts +7 -0
  55. package/lib/FileList/File.js +0 -14
  56. package/lib/FileList/FileList.d.ts +17 -0
  57. package/lib/FileList/FileList.js +0 -14
  58. package/lib/FileList/index.d.ts +3 -0
  59. package/lib/Hero/Hero.d.ts +26 -0
  60. package/lib/Hero/Hero.js +0 -8
  61. package/lib/Hero/index.d.ts +8 -0
  62. package/lib/Image/Image.d.ts +25 -0
  63. package/lib/Image/Image.js +4 -28
  64. package/lib/Image/ImageLink.d.ts +18 -0
  65. package/lib/Image/ImageLink.js +3 -15
  66. package/lib/Image/LazyLoadImage.d.ts +17 -0
  67. package/lib/Image/LazyLoadImage.js +3 -13
  68. package/lib/Image/index.d.ts +11 -0
  69. package/lib/InfoBox/InfoBox.d.ts +6 -0
  70. package/lib/InfoBox/InfoBox.js +0 -5
  71. package/{src/InfoBox/index.js → lib/InfoBox/index.d.ts} +0 -0
  72. package/lib/InfoWidget/InfoWidget.d.ts +19 -0
  73. package/lib/InfoWidget/InfoWidget.js +2 -22
  74. package/lib/InfoWidget/index.d.ts +2 -0
  75. package/lib/Logo/Logo.d.ts +24 -0
  76. package/lib/Logo/Logo.js +6 -29
  77. package/lib/Logo/SvgLogo.d.ts +14 -0
  78. package/lib/Logo/SvgLogo.js +4 -13
  79. package/lib/Logo/index.d.ts +9 -0
  80. package/lib/Masthead/Masthead.d.ts +27 -0
  81. package/lib/Masthead/Masthead.js +10 -34
  82. package/lib/Masthead/index.d.ts +10 -0
  83. package/lib/NoContentBox/NoContentBox.d.ts +14 -0
  84. package/lib/NoContentBox/NoContentBox.js +1 -11
  85. package/lib/NoContentBox/index.d.ts +9 -0
  86. package/lib/Portrait/Portrait.d.ts +15 -0
  87. package/lib/Portrait/Portrait.js +0 -12
  88. package/lib/Portrait/index.d.ts +9 -0
  89. package/lib/RelatedArticleList/RelatedArticleList.d.ts +25 -0
  90. package/lib/RelatedArticleList/RelatedArticleList.js +2 -23
  91. package/lib/RelatedArticleList/index.d.ts +10 -0
  92. package/lib/Topic/Topic.d.ts +3 -2
  93. package/lib/Topic/Topic.js +20 -20
  94. package/lib/Translation/Translation.d.ts +14 -0
  95. package/lib/Translation/Translation.js +0 -6
  96. package/lib/Translation/TranslationBox.d.ts +10 -0
  97. package/lib/Translation/TranslationBox.js +6 -2
  98. package/lib/Translation/TranslationLine.d.ts +16 -0
  99. package/lib/Translation/TranslationLine.js +4 -22
  100. package/{src/Translation/index.js → lib/Translation/index.d.ts} +0 -0
  101. package/lib/index-javascript.js +0 -230
  102. package/lib/index.d.ts +17 -0
  103. package/lib/index.js +263 -0
  104. package/lib/locale/messages-en.d.ts +4 -0
  105. package/lib/locale/messages-en.js +4 -0
  106. package/lib/locale/messages-nb.d.ts +4 -0
  107. package/lib/locale/messages-nb.js +5 -1
  108. package/lib/locale/messages-nn.d.ts +4 -0
  109. package/lib/locale/messages-nn.js +5 -1
  110. package/lib/types.d.ts +10 -0
  111. package/lib/utils/createUniversalPortal.d.ts +9 -0
  112. package/package.json +6 -6
  113. package/src/Article/ArticleAuthorContent.tsx +0 -1
  114. package/src/AuthorInfo/AuthorInfo.tsx +0 -1
  115. package/src/BackgroundImage/BackgroundImage.tsx +32 -0
  116. package/src/BackgroundImage/{index.js → index.ts} +0 -0
  117. package/src/ContentLoader/{index.js → index.tsx} +20 -30
  118. package/src/Dialog/{Dialog.jsx → Dialog.tsx} +20 -32
  119. package/src/Dialog/{index.js → index.ts} +0 -0
  120. package/src/FactBox/{FactBox.jsx → FactBox.tsx} +12 -14
  121. package/src/FactBox/{index.js → index.ts} +0 -0
  122. package/src/Figure/{Figure.js → Figure.tsx} +44 -54
  123. package/src/Figure/{FigureExpandButton.js → FigureExpandButton.tsx} +8 -9
  124. package/src/Figure/{FigureLicense.js → FigureLicense.tsx} +32 -30
  125. package/src/Figure/{FigureLicenseDialog.js → FigureLicenseDialog.tsx} +22 -22
  126. package/src/Figure/{index.js → index.ts} +0 -0
  127. package/src/FileList/{File.jsx → File.tsx} +8 -18
  128. package/src/FileList/FileList.tsx +36 -0
  129. package/src/FileList/{index.js → index.ts} +0 -0
  130. package/src/Hero/Hero.tsx +56 -0
  131. package/src/Hero/{index.js → index.ts} +0 -0
  132. package/src/Image/{Image.jsx → Image.tsx} +30 -30
  133. package/src/Image/{ImageLink.js → ImageLink.tsx} +11 -12
  134. package/src/Image/LazyLoadImage.tsx +40 -0
  135. package/src/Image/__tests__/__snapshots__/Image-test.jsx.snap +4 -3
  136. package/src/Image/{index.js → index.ts} +0 -0
  137. package/src/InfoBox/InfoBox.tsx +11 -0
  138. package/src/InfoBox/index.ts +1 -0
  139. package/src/InfoWidget/{InfoWidget.jsx → InfoWidget.tsx} +19 -26
  140. package/src/InfoWidget/{index.js → index.ts} +0 -0
  141. package/src/Logo/{Logo.jsx → Logo.tsx} +21 -28
  142. package/src/Logo/{SvgLogo.jsx → SvgLogo.tsx} +8 -14
  143. package/src/Logo/{index.js → index.ts} +0 -0
  144. package/src/Masthead/{Masthead.jsx → Masthead.tsx} +33 -35
  145. package/src/Masthead/{index.js → index.ts} +0 -0
  146. package/src/NoContentBox/{NoContentBox.jsx → NoContentBox.tsx} +7 -13
  147. package/src/NoContentBox/{index.js → index.ts} +0 -0
  148. package/src/Portrait/{Portrait.jsx → Portrait.tsx} +8 -14
  149. package/src/Portrait/{index.js → index.ts} +0 -0
  150. package/src/RelatedArticleList/{RelatedArticleList.jsx → RelatedArticleList.tsx} +43 -30
  151. package/src/RelatedArticleList/{index.js → index.ts} +0 -0
  152. package/src/Topic/Topic.tsx +3 -2
  153. package/src/Translation/{Translation.jsx → Translation.tsx} +7 -8
  154. package/src/Translation/TranslationBox.tsx +20 -0
  155. package/src/Translation/{TranslationLine.jsx → TranslationLine.tsx} +11 -18
  156. package/src/Translation/index.ts +3 -0
  157. package/src/index-javascript.js +0 -32
  158. package/src/index.ts +41 -0
  159. package/src/locale/messages-en.ts +4 -0
  160. package/src/locale/messages-nb.ts +5 -1
  161. package/src/locale/messages-nn.ts +5 -1
  162. package/src/types.ts +12 -0
  163. package/src/utils/{createUniversalPortal.jsx → createUniversalPortal.tsx} +3 -3
  164. package/es/Image/shapes.js +0 -18
  165. package/lib/Image/shapes.js +0 -33
  166. package/src/BackgroundImage/BackgroundImage.jsx +0 -39
  167. package/src/FileList/FileList.jsx +0 -36
  168. package/src/Hero/Hero.jsx +0 -38
  169. package/src/Image/LazyLoadImage.jsx +0 -39
  170. package/src/Image/shapes.js +0 -21
  171. package/src/InfoBox/InfoBox.jsx +0 -13
  172. package/src/Translation/TranslationBox.jsx +0 -12
@@ -12,10 +12,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
12
12
  *
13
13
  */
14
14
  import React from 'react';
15
- import PropTypes from 'prop-types'; // Lazyload image with lazysizes (https://github.com/aFarkas/lazysizes)
16
-
17
15
  import { jsx as ___EmotionJSX } from "@emotion/core";
18
16
 
17
+ // Lazyload image with lazysizes (https://github.com/aFarkas/lazysizes)
19
18
  var LazyLoadImage = function LazyLoadImage(_ref) {
20
19
  var alt = _ref.alt,
21
20
  src = _ref.src,
@@ -24,14 +23,14 @@ var LazyLoadImage = function LazyLoadImage(_ref) {
24
23
  sizes = _ref.sizes,
25
24
  rest = _objectWithoutProperties(_ref, ["alt", "src", "srcSet", "lazyLoadSrc", "sizes"]);
26
25
 
27
- return [___EmotionJSX("noscript", {
26
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX("noscript", {
28
27
  key: "noscript"
29
28
  }, ___EmotionJSX("img", _extends({
30
29
  alt: alt,
31
30
  src: "".concat(src),
32
31
  srcSet: srcSet,
33
32
  sizes: sizes
34
- }, rest))), ___EmotionJSX("img", _extends({
33
+ }, rest))), ",", ___EmotionJSX("img", _extends({
35
34
  alt: alt,
36
35
  key: "img",
37
36
  style: {
@@ -42,15 +41,7 @@ var LazyLoadImage = function LazyLoadImage(_ref) {
42
41
  "data-src": src,
43
42
  "data-src-set": srcSet,
44
43
  "data-sizes": sizes
45
- }, rest))];
44
+ }, rest)));
46
45
  };
47
46
 
48
- LazyLoadImage.propTypes = {
49
- alt: PropTypes.string.isRequired,
50
- src: PropTypes.string.isRequired,
51
- sizes: PropTypes.string,
52
- contentType: PropTypes.string,
53
- srcSet: PropTypes.string,
54
- lazyLoadSrc: PropTypes.string.isRequired
55
- };
56
47
  export default LazyLoadImage;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import BEMHelper from 'react-bem-helper';
4
3
  import { jsx as ___EmotionJSX } from "@emotion/core";
5
4
  var classes = BEMHelper('c-info-box');
@@ -9,7 +8,4 @@ var InfoBox = function InfoBox(_ref) {
9
8
  return ___EmotionJSX("div", classes(), children);
10
9
  };
11
10
 
12
- InfoBox.propTypes = {
13
- children: PropTypes.node.isRequired
14
- };
15
11
  export default InfoBox;
@@ -1,7 +1,6 @@
1
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
2
 
3
3
  import React from 'react';
4
- import PropTypes from 'prop-types';
5
4
  import BEMHelper from 'react-bem-helper';
6
5
  import { Forward } from '@ndla/icons/common';
7
6
  import SafeLink from '@ndla/safelink';
@@ -14,7 +13,8 @@ var InfoWidget = function InfoWidget(_ref) {
14
13
  description = _ref.description,
15
14
  mainLink = _ref.mainLink,
16
15
  iconLinks = _ref.iconLinks,
17
- center = _ref.center;
16
+ _ref$center = _ref.center,
17
+ center = _ref$center === void 0 ? false : _ref$center;
18
18
  return ___EmotionJSX("section", classes('', {
19
19
  center: center
20
20
  }), ___EmotionJSX(SectionHeading, {
@@ -54,23 +54,4 @@ var InfoWidget = function InfoWidget(_ref) {
54
54
  }), mainLink.name)));
55
55
  };
56
56
 
57
- InfoWidget.propTypes = {
58
- heading: PropTypes.string.isRequired,
59
- description: PropTypes.string.isRequired,
60
- mainLink: PropTypes.shape({
61
- name: PropTypes.string.isRequired,
62
- url: PropTypes.string,
63
- href: PropTypes.string
64
- }).isRequired,
65
- iconLinks: PropTypes.arrayOf(PropTypes.shape({
66
- name: PropTypes.string.isRequired,
67
- url: PropTypes.string,
68
- href: PropTypes.string,
69
- icon: PropTypes.node.isRequired
70
- })),
71
- center: PropTypes.bool
72
- };
73
- InfoWidget.defaultProps = {
74
- center: false
75
- };
76
57
  export default InfoWidget;
package/es/Logo/Logo.js CHANGED
@@ -7,8 +7,7 @@
7
7
  */
8
8
 
9
9
  /* eslint-disable max-len */
10
- import React, { Fragment } from 'react';
11
- import PropTypes from 'prop-types';
10
+ import React from 'react';
12
11
  import BEMHelper from 'react-bem-helper';
13
12
  import SafeLink from '@ndla/safelink';
14
13
  import SvgLogo from './SvgLogo';
@@ -18,11 +17,13 @@ export var logoClasses = new BEMHelper({
18
17
  prefix: 'c-'
19
18
  });
20
19
  export var Logo = function Logo(_ref) {
21
- var name = _ref.name,
20
+ var _ref$name = _ref.name,
21
+ name = _ref$name === void 0 ? true : _ref$name,
22
22
  to = _ref.to,
23
23
  cssModifier = _ref.cssModifier,
24
24
  color = _ref.color,
25
- large = _ref.large,
25
+ _ref$large = _ref.large,
26
+ large = _ref$large === void 0 ? false : _ref$large,
26
27
  locale = _ref.locale,
27
28
  label = _ref.label;
28
29
  var modifiers = {
@@ -40,28 +41,11 @@ export var Logo = function Logo(_ref) {
40
41
  name: name,
41
42
  color: color,
42
43
  locale: locale
43
- })) : ___EmotionJSX(Fragment, null, ___EmotionJSX(SvgLogo, {
44
+ })) : ___EmotionJSX(React.Fragment, null, ___EmotionJSX(SvgLogo, {
44
45
  name: name,
45
46
  color: color,
46
47
  locale: locale
47
48
  }));
48
49
  return ___EmotionJSX("div", logoClasses('', modifiers), logo);
49
50
  };
50
- Logo.propTypes = {
51
- to: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
52
- pathname: PropTypes.string.isRequired,
53
- search: PropTypes.string,
54
- hash: PropTypes.string
55
- })]),
56
- label: PropTypes.string.isRequired,
57
- locale: PropTypes.string,
58
- cssModifier: PropTypes.string,
59
- large: PropTypes.bool,
60
- name: PropTypes.bool,
61
- color: PropTypes.string
62
- };
63
- Logo.defaultProps = {
64
- name: true,
65
- large: false
66
- };
67
51
  export default Logo;
@@ -10,7 +10,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
10
10
 
11
11
  /* eslint-disable max-len */
12
12
  import React from 'react';
13
- import PropTypes from 'prop-types';
14
13
  import { logoClasses } from './Logo';
15
14
  import { jsx as ___EmotionJSX } from "@emotion/core";
16
15
 
@@ -29,8 +28,10 @@ var LogoText = function LogoText(locale) {
29
28
  };
30
29
 
31
30
  export var SvgLogo = function SvgLogo(_ref) {
32
- var name = _ref.name,
33
- color = _ref.color,
31
+ var _ref$name = _ref.name,
32
+ name = _ref$name === void 0 ? true : _ref$name,
33
+ _ref$color = _ref.color,
34
+ color = _ref$color === void 0 ? '#000000' : _ref$color,
34
35
  locale = _ref.locale;
35
36
  return ___EmotionJSX("svg", _extends({}, logoClasses('graphic'), {
36
37
  xmlns: "http://www.w3.org/2000/svg",
@@ -50,13 +51,4 @@ export var SvgLogo = function SvgLogo(_ref) {
50
51
  points: "18 51 18 118 0 118 0 33 101 33 101 118 83 118 83 51"
51
52
  }), name && LogoText(locale));
52
53
  };
53
- SvgLogo.propTypes = {
54
- name: PropTypes.bool,
55
- color: PropTypes.string,
56
- locale: PropTypes.string
57
- };
58
- SvgLogo.defaultProps = {
59
- name: true,
60
- color: '#000000'
61
- };
62
54
  export default SvgLogo;
@@ -9,8 +9,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  *
11
11
  */
12
- import React from 'react';
13
- import PropTypes from 'prop-types';
12
+ import React from 'react'; //@ts-ignore
13
+
14
14
  import classNames from 'classnames';
15
15
  import BEMHelper from 'react-bem-helper';
16
16
  import { withTranslation } from 'react-i18next';
@@ -23,37 +23,27 @@ var classes = new BEMHelper({
23
23
  export var MastheadItem = function MastheadItem(_ref) {
24
24
  var children = _ref.children,
25
25
  className = _ref.className,
26
- left = _ref.left,
27
- right = _ref.right;
26
+ _ref$left = _ref.left,
27
+ left = _ref$left === void 0 ? false : _ref$left,
28
+ _ref$right = _ref.right,
29
+ right = _ref$right === void 0 ? false : _ref$right;
28
30
  var itemClassNames = classNames(_defineProperty({}, classes('left').className, left), _defineProperty({}, classes('right').className, right), className);
29
31
  return ___EmotionJSX("div", {
30
32
  className: itemClassNames
31
33
  }, children);
32
34
  };
33
- MastheadItem.propTypes = {
34
- children: PropTypes.node,
35
- className: PropTypes.string,
36
- right: PropTypes.bool,
37
- left: PropTypes.bool
38
- };
39
- MastheadItem.defaultProps = {
40
- right: false,
41
- left: false
42
- };
43
35
 
44
36
  var MastheadInfo = function MastheadInfo(_ref2) {
45
37
  var children = _ref2.children;
46
38
  return ___EmotionJSX("div", classes('info'), ___EmotionJSX("div", classes('info-content'), children));
47
39
  };
48
40
 
49
- MastheadInfo.propTypes = {
50
- children: PropTypes.node.isRequired
51
- };
52
41
  export var Masthead = function Masthead(_ref3) {
53
42
  var children = _ref3.children,
54
43
  fixed = _ref3.fixed,
55
44
  infoContent = _ref3.infoContent,
56
- showLoaderWhenNeeded = _ref3.showLoaderWhenNeeded,
45
+ _ref3$showLoaderWhenN = _ref3.showLoaderWhenNeeded,
46
+ showLoaderWhenNeeded = _ref3$showLoaderWhenN === void 0 ? true : _ref3$showLoaderWhenN,
57
47
  ndlaFilm = _ref3.ndlaFilm,
58
48
  skipToMainContentId = _ref3.skipToMainContentId,
59
49
  t = _ref3.t;
@@ -61,12 +51,12 @@ export var Masthead = function Masthead(_ref3) {
61
51
  tabIndex: 0,
62
52
  href: "#".concat(skipToMainContentId)
63
53
  }, classes('skip-to-main-content')), t('masthead.skipToContent')), ___EmotionJSX("div", classes('placeholder', {
64
- infoContent: infoContent
54
+ infoContent: !!infoContent
65
55
  })), ___EmotionJSX("div", classes('', {
66
- fixed: fixed,
67
- infoContent: infoContent,
56
+ fixed: !!fixed,
57
+ infoContent: !!infoContent,
68
58
  showLoaderWhenNeeded: showLoaderWhenNeeded,
69
- ndlaFilm: ndlaFilm
59
+ ndlaFilm: !!ndlaFilm
70
60
  }), infoContent && ___EmotionJSX(DisplayOnPageYOffset, {
71
61
  yOffsetMin: 0,
72
62
  yOffsetMax: 90
@@ -74,15 +64,4 @@ export var Masthead = function Masthead(_ref3) {
74
64
  className: "u-1/1 ".concat(classes('content').className)
75
65
  }, children)));
76
66
  };
77
- Masthead.propTypes = {
78
- children: PropTypes.node,
79
- fixed: PropTypes.bool,
80
- showLoaderWhenNeeded: PropTypes.bool,
81
- infoContent: PropTypes.node,
82
- ndlaFilm: PropTypes.bool,
83
- skipToMainContentId: PropTypes.string
84
- };
85
- Masthead.defaultProps = {
86
- showLoaderWhenNeeded: true
87
- };
88
67
  export default withTranslation()(Masthead);
@@ -6,8 +6,8 @@
6
6
  *
7
7
  */
8
8
  import React from 'react';
9
- import PropTypes from 'prop-types';
10
- import BEMHelper from 'react-bem-helper';
9
+ import BEMHelper from 'react-bem-helper'; //@ts-ignore
10
+
11
11
  import Button from '@ndla/button';
12
12
  import { jsx as ___EmotionJSX } from "@emotion/core";
13
13
  var classes = new BEMHelper({
@@ -23,13 +23,4 @@ export var NoContentBox = function NoContentBox(_ref) {
23
23
  onClick: onClick
24
24
  }, buttonText))));
25
25
  };
26
- NoContentBox.propTypes = {
27
- onClick: PropTypes.func,
28
- buttonText: PropTypes.string,
29
- text: PropTypes.string.isRequired
30
- };
31
- NoContentBox.defaultProps = {
32
- onClick: null,
33
- buttonText: undefined
34
- };
35
26
  export default NoContentBox;
@@ -6,7 +6,6 @@
6
6
  *
7
7
  */
8
8
  import React from 'react';
9
- import PropTypes from 'prop-types';
10
9
  import BEMHelper from 'react-bem-helper';
11
10
  import { jsx as ___EmotionJSX } from "@emotion/core";
12
11
  var classes = new BEMHelper({
@@ -28,14 +27,4 @@ var Portrait = function Portrait(_ref) {
28
27
  }));
29
28
  };
30
29
 
31
- Portrait.propTypes = {
32
- src: PropTypes.string.isRequired,
33
- alt: PropTypes.string.isRequired,
34
- className: PropTypes.string,
35
- modifier: PropTypes.oneOf(['small', 'large'])
36
- };
37
- Portrait.defaultProps = {
38
- className: null,
39
- modifier: null
40
- };
41
30
  export default Portrait;
@@ -1,8 +1,8 @@
1
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
2
 
3
3
  import React, { cloneElement } from 'react';
4
- import PropTypes from 'prop-types';
5
- import BEMHelper from 'react-bem-helper';
4
+ import BEMHelper from 'react-bem-helper'; //@ts-ignore
5
+
6
6
  import Button from '@ndla/button';
7
7
  import SafeLink from '@ndla/safelink';
8
8
  import SectionHeading from '../SectionHeading';
@@ -28,29 +28,20 @@ export var RelatedArticle = function RelatedArticle(_ref) {
28
28
  to: to
29
29
  }, classes('link'), {
30
30
  target: target,
31
- rel: linkInfo ? 'noopener noreferrer' : null
31
+ rel: linkInfo ? 'noopener noreferrer' : undefined
32
32
  }), title))), ___EmotionJSX("p", _extends({}, classes('description'), {
33
33
  dangerouslySetInnerHTML: {
34
34
  __html: introduction
35
35
  }
36
36
  })), linkInfo && ___EmotionJSX("p", classes('link-info'), linkInfo));
37
37
  };
38
- RelatedArticle.propTypes = {
39
- icon: PropTypes.node.isRequired,
40
- title: PropTypes.string.isRequired,
41
- modifier: PropTypes.string,
42
- introduction: PropTypes.string.isRequired,
43
- to: PropTypes.string.isRequired,
44
- linkInfo: PropTypes.string,
45
- target: PropTypes.string
46
- };
47
38
 
48
39
  var RelatedArticleList = function RelatedArticleList(_ref2) {
49
40
  var messages = _ref2.messages,
50
41
  children = _ref2.children,
51
42
  articleCount = _ref2.articleCount,
52
43
  dangerouslySetInnerHTML = _ref2.dangerouslySetInnerHTML;
53
- var clonedChildren = !dangerouslySetInnerHTML ? React.Children.map(children, function (article, i) {
44
+ var clonedChildren = !dangerouslySetInnerHTML && children ? React.Children.map(children, function (article, i) {
54
45
  return /*#__PURE__*/React.cloneElement(article, {
55
46
  modifier: i >= 2 ? "".concat(article.props.modifier, " hidden") : article.props.modifier
56
47
  });
@@ -68,14 +59,4 @@ var RelatedArticleList = function RelatedArticleList(_ref2) {
68
59
  }, messages.showMore));
69
60
  };
70
61
 
71
- RelatedArticleList.propTypes = {
72
- children: PropTypes.node,
73
- messages: PropTypes.shape({
74
- title: PropTypes.string.isRequired
75
- }),
76
- dangerouslySetInnerHTML: PropTypes.shape({
77
- __html: PropTypes.string.isRequired
78
- }),
79
- articleCount: PropTypes.number
80
- };
81
62
  export default RelatedArticleList;