@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.
- package/es/Article/ArticleAuthorContent.js +1 -2
- package/es/BackgroundImage/BackgroundImage.js +27 -0
- package/es/BackgroundImage/index.js +2 -0
- package/es/ContentLoader/index.js +83 -0
- package/es/Dialog/Dialog.js +64 -0
- package/es/Dialog/index.js +10 -0
- package/es/FactBox/FactBox.js +7 -11
- package/es/Figure/Figure.js +93 -0
- package/es/Figure/FigureExpandButton.js +28 -0
- package/es/Figure/FigureLicense.js +54 -0
- package/es/Figure/FigureLicenseDialog.js +43 -0
- package/es/Figure/index.js +12 -0
- package/es/FileList/File.js +48 -0
- package/es/FileList/FileList.js +20 -0
- package/es/FileList/index.js +3 -0
- package/es/Hero/Hero.js +64 -0
- package/es/Hero/index.js +8 -0
- package/es/Image/Image.js +96 -0
- package/es/Image/ImageLink.js +46 -0
- package/es/Image/LazyLoadImage.js +47 -0
- package/es/Image/index.js +11 -0
- package/es/InfoBox/InfoBox.js +11 -0
- package/es/InfoBox/index.js +1 -0
- package/es/InfoWidget/InfoWidget.js +57 -0
- package/es/InfoWidget/index.js +2 -0
- package/es/Logo/Logo.js +51 -0
- package/es/Logo/SvgLogo.js +54 -0
- package/es/Logo/index.js +9 -0
- package/es/Masthead/Masthead.js +67 -0
- package/es/Masthead/index.js +10 -0
- package/es/NoContentBox/NoContentBox.js +26 -0
- package/es/NoContentBox/index.js +9 -0
- package/es/Portrait/Portrait.js +30 -0
- package/es/Portrait/index.js +9 -0
- package/es/RelatedArticleList/RelatedArticleList.js +4 -23
- package/es/Topic/Topic.js +20 -20
- package/es/Translation/Translation.js +22 -0
- package/es/Translation/TranslationBox.js +17 -0
- package/es/Translation/TranslationLine.js +37 -0
- package/es/Translation/index.js +3 -0
- package/es/index-javascript.js +1 -18
- package/es/index.js +17 -0
- package/es/locale/messages-en.js +4 -0
- package/es/locale/messages-nb.js +5 -1
- package/es/locale/messages-nn.js +5 -1
- package/lib/BackgroundImage/BackgroundImage.js +40 -0
- package/lib/BackgroundImage/index.js +13 -0
- package/lib/ContentLoader/index.js +88 -0
- package/lib/Dialog/Dialog.d.ts +1 -1
- package/lib/Dialog/Dialog.js +70 -0
- package/lib/Dialog/index.js +24 -0
- package/lib/FactBox/FactBox.d.ts +16 -0
- package/lib/FactBox/FactBox.js +5 -11
- package/lib/FactBox/index.d.ts +2 -0
- package/lib/Figure/Figure.js +105 -0
- package/lib/Figure/FigureExpandButton.js +41 -0
- package/lib/Figure/FigureLicense.js +66 -0
- package/lib/Figure/FigureLicenseDialog.js +48 -0
- package/lib/Figure/index.js +49 -0
- package/lib/FileList/File.js +63 -0
- package/lib/FileList/FileList.js +34 -0
- package/lib/FileList/index.js +21 -0
- package/lib/Hero/Hero.js +100 -0
- package/lib/Hero/index.js +55 -0
- package/lib/Image/Image.js +105 -0
- package/lib/Image/ImageLink.js +50 -0
- package/lib/Image/LazyLoadImage.js +51 -0
- package/lib/Image/index.js +38 -0
- package/lib/InfoBox/InfoBox.js +24 -0
- package/lib/InfoBox/index.js +15 -0
- package/lib/InfoWidget/InfoWidget.js +73 -0
- package/lib/InfoWidget/index.js +13 -0
- package/lib/Logo/Logo.js +70 -0
- package/lib/Logo/SvgLogo.js +59 -0
- package/lib/Logo/index.js +20 -0
- package/lib/Masthead/Masthead.js +82 -0
- package/lib/Masthead/index.js +30 -0
- package/lib/NoContentBox/NoContentBox.js +43 -0
- package/lib/NoContentBox/index.js +20 -0
- package/lib/Portrait/Portrait.js +43 -0
- package/lib/Portrait/index.js +20 -0
- package/lib/RelatedArticleList/RelatedArticleList.d.ts +25 -0
- package/lib/RelatedArticleList/RelatedArticleList.js +2 -23
- package/lib/RelatedArticleList/index.d.ts +10 -0
- package/lib/Topic/Topic.js +20 -20
- package/lib/Translation/Translation.js +35 -0
- package/lib/Translation/TranslationBox.js +29 -0
- package/lib/Translation/TranslationLine.js +42 -0
- package/lib/Translation/index.js +31 -0
- package/lib/index-javascript.js +0 -230
- package/lib/index.d.ts +3 -0
- package/lib/index.js +263 -0
- package/lib/locale/messages-en.js +4 -0
- package/lib/locale/messages-nb.js +5 -1
- package/lib/locale/messages-nn.js +5 -1
- package/lib/utils/createUniversalPortal.d.ts +9 -0
- package/package.json +4 -4
- package/src/FactBox/{FactBox.jsx → FactBox.tsx} +12 -14
- package/src/FactBox/{index.js → index.ts} +0 -0
- package/src/RelatedArticleList/{RelatedArticleList.jsx → RelatedArticleList.tsx} +43 -30
- package/src/RelatedArticleList/{index.js → index.ts} +0 -0
- package/src/index-javascript.js +0 -3
- package/src/index.ts +6 -0
- 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
|
|
5
|
-
|
|
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' :
|
|
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;
|