@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.
- package/es/Article/ArticleAuthorContent.js +1 -2
- package/es/AuthorInfo/AuthorInfo.js +1 -2
- package/es/BackgroundImage/BackgroundImage.js +5 -15
- package/es/ContentLoader/index.js +14 -27
- package/es/Dialog/Dialog.js +10 -28
- package/es/FactBox/FactBox.js +7 -11
- package/es/Figure/Figure.js +9 -41
- package/es/Figure/FigureExpandButton.js +2 -11
- package/es/Figure/FigureLicense.js +4 -24
- package/es/Figure/FigureLicenseDialog.js +2 -20
- package/es/FileList/File.js +0 -13
- package/es/FileList/FileList.js +0 -13
- package/es/Hero/Hero.js +0 -6
- package/es/Image/Image.js +4 -27
- package/es/Image/ImageLink.js +3 -12
- package/es/Image/LazyLoadImage.js +4 -13
- package/es/InfoBox/InfoBox.js +0 -4
- package/es/InfoWidget/InfoWidget.js +2 -21
- package/es/Logo/Logo.js +6 -22
- package/es/Logo/SvgLogo.js +4 -12
- package/es/Masthead/Masthead.js +12 -33
- package/es/NoContentBox/NoContentBox.js +2 -11
- package/es/Portrait/Portrait.js +0 -11
- package/es/RelatedArticleList/RelatedArticleList.js +4 -23
- package/es/Topic/Topic.js +20 -20
- package/es/Translation/Translation.js +0 -5
- package/es/Translation/TranslationBox.js +7 -3
- package/es/Translation/TranslationLine.js +4 -15
- 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.d.ts +11 -0
- package/lib/BackgroundImage/BackgroundImage.js +5 -17
- package/lib/BackgroundImage/index.d.ts +2 -0
- package/lib/ContentLoader/index.d.ts +20 -0
- package/lib/ContentLoader/index.js +14 -28
- package/lib/Dialog/Dialog.d.ts +23 -0
- package/lib/Dialog/Dialog.js +9 -29
- package/lib/Dialog/index.d.ts +10 -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.d.ts +50 -0
- package/lib/Figure/Figure.js +7 -41
- package/lib/Figure/FigureExpandButton.d.ts +16 -0
- package/lib/Figure/FigureExpandButton.js +2 -13
- package/lib/Figure/FigureLicense.d.ts +33 -0
- package/lib/Figure/FigureLicense.js +5 -27
- package/lib/Figure/FigureLicenseDialog.d.ts +29 -0
- package/lib/Figure/FigureLicenseDialog.js +1 -22
- package/lib/Figure/index.d.ts +12 -0
- package/lib/FileList/File.d.ts +7 -0
- package/lib/FileList/File.js +0 -14
- package/lib/FileList/FileList.d.ts +17 -0
- package/lib/FileList/FileList.js +0 -14
- package/lib/FileList/index.d.ts +3 -0
- package/lib/Hero/Hero.d.ts +26 -0
- package/lib/Hero/Hero.js +0 -8
- package/lib/Hero/index.d.ts +8 -0
- package/lib/Image/Image.d.ts +25 -0
- package/lib/Image/Image.js +4 -28
- package/lib/Image/ImageLink.d.ts +18 -0
- package/lib/Image/ImageLink.js +3 -15
- package/lib/Image/LazyLoadImage.d.ts +17 -0
- package/lib/Image/LazyLoadImage.js +3 -13
- package/lib/Image/index.d.ts +11 -0
- package/lib/InfoBox/InfoBox.d.ts +6 -0
- package/lib/InfoBox/InfoBox.js +0 -5
- package/{src/InfoBox/index.js → lib/InfoBox/index.d.ts} +0 -0
- package/lib/InfoWidget/InfoWidget.d.ts +19 -0
- package/lib/InfoWidget/InfoWidget.js +2 -22
- package/lib/InfoWidget/index.d.ts +2 -0
- package/lib/Logo/Logo.d.ts +24 -0
- package/lib/Logo/Logo.js +6 -29
- package/lib/Logo/SvgLogo.d.ts +14 -0
- package/lib/Logo/SvgLogo.js +4 -13
- package/lib/Logo/index.d.ts +9 -0
- package/lib/Masthead/Masthead.d.ts +27 -0
- package/lib/Masthead/Masthead.js +10 -34
- package/lib/Masthead/index.d.ts +10 -0
- package/lib/NoContentBox/NoContentBox.d.ts +14 -0
- package/lib/NoContentBox/NoContentBox.js +1 -11
- package/lib/NoContentBox/index.d.ts +9 -0
- package/lib/Portrait/Portrait.d.ts +15 -0
- package/lib/Portrait/Portrait.js +0 -12
- package/lib/Portrait/index.d.ts +9 -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.d.ts +3 -2
- package/lib/Topic/Topic.js +20 -20
- package/lib/Translation/Translation.d.ts +14 -0
- package/lib/Translation/Translation.js +0 -6
- package/lib/Translation/TranslationBox.d.ts +10 -0
- package/lib/Translation/TranslationBox.js +6 -2
- package/lib/Translation/TranslationLine.d.ts +16 -0
- package/lib/Translation/TranslationLine.js +4 -22
- package/{src/Translation/index.js → lib/Translation/index.d.ts} +0 -0
- package/lib/index-javascript.js +0 -230
- package/lib/index.d.ts +17 -0
- package/lib/index.js +263 -0
- package/lib/locale/messages-en.d.ts +4 -0
- package/lib/locale/messages-en.js +4 -0
- package/lib/locale/messages-nb.d.ts +4 -0
- package/lib/locale/messages-nb.js +5 -1
- package/lib/locale/messages-nn.d.ts +4 -0
- package/lib/locale/messages-nn.js +5 -1
- package/lib/types.d.ts +10 -0
- package/lib/utils/createUniversalPortal.d.ts +9 -0
- package/package.json +6 -6
- package/src/Article/ArticleAuthorContent.tsx +0 -1
- package/src/AuthorInfo/AuthorInfo.tsx +0 -1
- package/src/BackgroundImage/BackgroundImage.tsx +32 -0
- package/src/BackgroundImage/{index.js → index.ts} +0 -0
- package/src/ContentLoader/{index.js → index.tsx} +20 -30
- package/src/Dialog/{Dialog.jsx → Dialog.tsx} +20 -32
- package/src/Dialog/{index.js → index.ts} +0 -0
- package/src/FactBox/{FactBox.jsx → FactBox.tsx} +12 -14
- package/src/FactBox/{index.js → index.ts} +0 -0
- package/src/Figure/{Figure.js → Figure.tsx} +44 -54
- package/src/Figure/{FigureExpandButton.js → FigureExpandButton.tsx} +8 -9
- package/src/Figure/{FigureLicense.js → FigureLicense.tsx} +32 -30
- package/src/Figure/{FigureLicenseDialog.js → FigureLicenseDialog.tsx} +22 -22
- package/src/Figure/{index.js → index.ts} +0 -0
- package/src/FileList/{File.jsx → File.tsx} +8 -18
- package/src/FileList/FileList.tsx +36 -0
- package/src/FileList/{index.js → index.ts} +0 -0
- package/src/Hero/Hero.tsx +56 -0
- package/src/Hero/{index.js → index.ts} +0 -0
- package/src/Image/{Image.jsx → Image.tsx} +30 -30
- package/src/Image/{ImageLink.js → ImageLink.tsx} +11 -12
- package/src/Image/LazyLoadImage.tsx +40 -0
- package/src/Image/__tests__/__snapshots__/Image-test.jsx.snap +4 -3
- package/src/Image/{index.js → index.ts} +0 -0
- package/src/InfoBox/InfoBox.tsx +11 -0
- package/src/InfoBox/index.ts +1 -0
- package/src/InfoWidget/{InfoWidget.jsx → InfoWidget.tsx} +19 -26
- package/src/InfoWidget/{index.js → index.ts} +0 -0
- package/src/Logo/{Logo.jsx → Logo.tsx} +21 -28
- package/src/Logo/{SvgLogo.jsx → SvgLogo.tsx} +8 -14
- package/src/Logo/{index.js → index.ts} +0 -0
- package/src/Masthead/{Masthead.jsx → Masthead.tsx} +33 -35
- package/src/Masthead/{index.js → index.ts} +0 -0
- package/src/NoContentBox/{NoContentBox.jsx → NoContentBox.tsx} +7 -13
- package/src/NoContentBox/{index.js → index.ts} +0 -0
- package/src/Portrait/{Portrait.jsx → Portrait.tsx} +8 -14
- package/src/Portrait/{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/Topic/Topic.tsx +3 -2
- package/src/Translation/{Translation.jsx → Translation.tsx} +7 -8
- package/src/Translation/TranslationBox.tsx +20 -0
- package/src/Translation/{TranslationLine.jsx → TranslationLine.tsx} +11 -18
- package/src/Translation/index.ts +3 -0
- package/src/index-javascript.js +0 -32
- package/src/index.ts +41 -0
- package/src/locale/messages-en.ts +4 -0
- package/src/locale/messages-nb.ts +5 -1
- package/src/locale/messages-nn.ts +5 -1
- package/src/types.ts +12 -0
- package/src/utils/{createUniversalPortal.jsx → createUniversalPortal.tsx} +3 -3
- package/es/Image/shapes.js +0 -18
- package/lib/Image/shapes.js +0 -33
- package/src/BackgroundImage/BackgroundImage.jsx +0 -39
- package/src/FileList/FileList.jsx +0 -36
- package/src/Hero/Hero.jsx +0 -38
- package/src/Image/LazyLoadImage.jsx +0 -39
- package/src/Image/shapes.js +0 -21
- package/src/InfoBox/InfoBox.jsx +0 -13
- 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
|
|
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;
|
package/es/InfoBox/InfoBox.js
CHANGED
|
@@ -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
|
|
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;
|
package/es/Logo/SvgLogo.js
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/es/Masthead/Masthead.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
10
|
-
|
|
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;
|
package/es/Portrait/Portrait.js
CHANGED
|
@@ -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
|
|
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;
|