@ndla/ui 3.2.1 → 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 (104) hide show
  1. package/es/Article/ArticleAuthorContent.js +1 -2
  2. package/es/BackgroundImage/BackgroundImage.js +27 -0
  3. package/es/BackgroundImage/index.js +2 -0
  4. package/es/ContentLoader/index.js +83 -0
  5. package/es/Dialog/Dialog.js +64 -0
  6. package/es/Dialog/index.js +10 -0
  7. package/es/FactBox/FactBox.js +7 -11
  8. package/es/Figure/Figure.js +93 -0
  9. package/es/Figure/FigureExpandButton.js +28 -0
  10. package/es/Figure/FigureLicense.js +54 -0
  11. package/es/Figure/FigureLicenseDialog.js +43 -0
  12. package/es/Figure/index.js +12 -0
  13. package/es/FileList/File.js +48 -0
  14. package/es/FileList/FileList.js +20 -0
  15. package/es/FileList/index.js +3 -0
  16. package/es/Hero/Hero.js +64 -0
  17. package/es/Hero/index.js +8 -0
  18. package/es/Image/Image.js +96 -0
  19. package/es/Image/ImageLink.js +46 -0
  20. package/es/Image/LazyLoadImage.js +47 -0
  21. package/es/Image/index.js +11 -0
  22. package/es/InfoBox/InfoBox.js +11 -0
  23. package/es/InfoBox/index.js +1 -0
  24. package/es/InfoWidget/InfoWidget.js +57 -0
  25. package/es/InfoWidget/index.js +2 -0
  26. package/es/Logo/Logo.js +51 -0
  27. package/es/Logo/SvgLogo.js +54 -0
  28. package/es/Logo/index.js +9 -0
  29. package/es/Masthead/Masthead.js +67 -0
  30. package/es/Masthead/index.js +10 -0
  31. package/es/NoContentBox/NoContentBox.js +26 -0
  32. package/es/NoContentBox/index.js +9 -0
  33. package/es/Portrait/Portrait.js +30 -0
  34. package/es/Portrait/index.js +9 -0
  35. package/es/RelatedArticleList/RelatedArticleList.js +4 -23
  36. package/es/Topic/Topic.js +20 -20
  37. package/es/Translation/Translation.js +22 -0
  38. package/es/Translation/TranslationBox.js +17 -0
  39. package/es/Translation/TranslationLine.js +37 -0
  40. package/es/Translation/index.js +3 -0
  41. package/es/index-javascript.js +1 -18
  42. package/es/index.js +17 -0
  43. package/es/locale/messages-en.js +4 -0
  44. package/es/locale/messages-nb.js +5 -1
  45. package/es/locale/messages-nn.js +5 -1
  46. package/lib/BackgroundImage/BackgroundImage.js +40 -0
  47. package/lib/BackgroundImage/index.js +13 -0
  48. package/lib/ContentLoader/index.js +88 -0
  49. package/lib/Dialog/Dialog.d.ts +1 -1
  50. package/lib/Dialog/Dialog.js +70 -0
  51. package/lib/Dialog/index.js +24 -0
  52. package/lib/FactBox/FactBox.d.ts +16 -0
  53. package/lib/FactBox/FactBox.js +5 -11
  54. package/lib/FactBox/index.d.ts +2 -0
  55. package/lib/Figure/Figure.js +105 -0
  56. package/lib/Figure/FigureExpandButton.js +41 -0
  57. package/lib/Figure/FigureLicense.js +66 -0
  58. package/lib/Figure/FigureLicenseDialog.js +48 -0
  59. package/lib/Figure/index.js +49 -0
  60. package/lib/FileList/File.js +63 -0
  61. package/lib/FileList/FileList.js +34 -0
  62. package/lib/FileList/index.js +21 -0
  63. package/lib/Hero/Hero.js +100 -0
  64. package/lib/Hero/index.js +55 -0
  65. package/lib/Image/Image.js +105 -0
  66. package/lib/Image/ImageLink.js +50 -0
  67. package/lib/Image/LazyLoadImage.js +51 -0
  68. package/lib/Image/index.js +38 -0
  69. package/lib/InfoBox/InfoBox.js +24 -0
  70. package/lib/InfoBox/index.js +15 -0
  71. package/lib/InfoWidget/InfoWidget.js +73 -0
  72. package/lib/InfoWidget/index.js +13 -0
  73. package/lib/Logo/Logo.js +70 -0
  74. package/lib/Logo/SvgLogo.js +59 -0
  75. package/lib/Logo/index.js +20 -0
  76. package/lib/Masthead/Masthead.js +82 -0
  77. package/lib/Masthead/index.js +30 -0
  78. package/lib/NoContentBox/NoContentBox.js +43 -0
  79. package/lib/NoContentBox/index.js +20 -0
  80. package/lib/Portrait/Portrait.js +43 -0
  81. package/lib/Portrait/index.js +20 -0
  82. package/lib/RelatedArticleList/RelatedArticleList.d.ts +25 -0
  83. package/lib/RelatedArticleList/RelatedArticleList.js +2 -23
  84. package/lib/RelatedArticleList/index.d.ts +10 -0
  85. package/lib/Topic/Topic.js +20 -20
  86. package/lib/Translation/Translation.js +35 -0
  87. package/lib/Translation/TranslationBox.js +29 -0
  88. package/lib/Translation/TranslationLine.js +42 -0
  89. package/lib/Translation/index.js +31 -0
  90. package/lib/index-javascript.js +0 -230
  91. package/lib/index.d.ts +3 -0
  92. package/lib/index.js +263 -0
  93. package/lib/locale/messages-en.js +4 -0
  94. package/lib/locale/messages-nb.js +5 -1
  95. package/lib/locale/messages-nn.js +5 -1
  96. package/lib/utils/createUniversalPortal.d.ts +9 -0
  97. package/package.json +4 -4
  98. package/src/FactBox/{FactBox.jsx → FactBox.tsx} +12 -14
  99. package/src/FactBox/{index.js → index.ts} +0 -0
  100. package/src/RelatedArticleList/{RelatedArticleList.jsx → RelatedArticleList.tsx} +43 -30
  101. package/src/RelatedArticleList/{index.js → index.ts} +0 -0
  102. package/src/index-javascript.js +0 -3
  103. package/src/index.ts +6 -0
  104. package/src/utils/{createUniversalPortal.jsx → createUniversalPortal.tsx} +3 -3
@@ -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;