@ndla/ui 44.0.20 → 44.0.22
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/Article.js +3 -3
- package/es/Footer/FooterPrivacy.js +27 -14
- package/es/LearningPaths/LearningPathSticky.js +7 -3
- package/es/Masthead/MastheadSearchModal.js +4 -2
- package/es/ProgrammeCard/ProgrammeCard.js +3 -5
- package/es/ResourceGroup/ResourceItem.js +50 -63
- package/es/ResourceGroup/ResourceList.js +11 -19
- package/es/locale/messages-en.js +2 -2
- package/es/locale/messages-nb.js +2 -2
- package/es/locale/messages-nn.js +2 -2
- package/es/locale/messages-se.js +2 -2
- package/es/locale/messages-sma.js +2 -2
- package/lib/Article/Article.js +3 -3
- package/lib/Footer/FooterPrivacy.js +32 -21
- package/lib/LearningPaths/LearningPathSticky.js +7 -3
- package/lib/Masthead/MastheadSearchModal.js +4 -2
- package/lib/ProgrammeCard/ProgrammeCard.js +3 -5
- package/lib/ResourceGroup/ResourceItem.d.ts +1 -1
- package/lib/ResourceGroup/ResourceItem.js +50 -63
- package/lib/ResourceGroup/ResourceList.js +11 -19
- package/lib/locale/messages-en.js +2 -2
- package/lib/locale/messages-nb.js +2 -2
- package/lib/locale/messages-nn.js +2 -2
- package/lib/locale/messages-se.js +2 -2
- package/lib/locale/messages-sma.js +2 -2
- package/package.json +7 -7
- package/src/Article/Article.tsx +0 -1
- package/src/Footer/FooterPrivacy.tsx +21 -30
- package/src/LearningPaths/LearningPathSticky.tsx +17 -9
- package/src/Masthead/MastheadSearchModal.tsx +6 -1
- package/src/ProgrammeCard/ProgrammeCard.tsx +0 -7
- package/src/ResourceGroup/ResourceItem.tsx +45 -61
- package/src/ResourceGroup/ResourceList.tsx +2 -24
- package/src/locale/messages-en.ts +2 -2
- package/src/locale/messages-nb.ts +2 -2
- package/src/locale/messages-nn.ts +2 -2
- package/src/locale/messages-se.ts +2 -2
- package/src/locale/messages-sma.ts +2 -2
|
@@ -6,14 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
9
|
var _reactI18next = require("react-i18next");
|
|
11
10
|
var _core = require("@ndla/core");
|
|
12
11
|
var _NoContentBox = _interopRequireDefault(require("../NoContentBox"));
|
|
13
12
|
var _ResourceItem = _interopRequireDefault(require("./ResourceItem"));
|
|
14
13
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
15
14
|
var _excluded = ["id"];
|
|
16
|
-
var _templateObject;
|
|
17
15
|
/**
|
|
18
16
|
* Copyright (c) 2017-present, NDLA.
|
|
19
17
|
*
|
|
@@ -29,22 +27,17 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
29
27
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
30
28
|
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; }
|
|
31
29
|
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; }
|
|
32
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
33
|
-
var fakeLoadingAnimation = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0.5;\n }\n 99% {\n opacity: 0.5;\n }\n 100% {\n opacity: 1;\n }\n"])));
|
|
34
30
|
var StyledResourceList = /*#__PURE__*/(0, _base.default)("ul", {
|
|
35
31
|
target: "e1uqs7m20",
|
|
36
32
|
label: "StyledResourceList"
|
|
37
|
-
})("list-style:none;margin:0;padding:0;font-family:", _core.fonts.sans, ";"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
title = _ref2.title,
|
|
46
|
-
showAdditionalResources = _ref2.showAdditionalResources,
|
|
47
|
-
heartButton = _ref2.heartButton;
|
|
33
|
+
})("list-style:none;margin:0;padding:0;font-family:", _core.fonts.sans, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlc291cmNlTGlzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0JvQyIsImZpbGUiOiJSZXNvdXJjZUxpc3QudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMTctcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuXG5pbXBvcnQgeyBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyB1c2VUcmFuc2xhdGlvbiB9IGZyb20gJ3JlYWN0LWkxOG5leHQnO1xuaW1wb3J0IHsgZm9udHMgfSBmcm9tICdAbmRsYS9jb3JlJztcbmltcG9ydCBOb0NvbnRlbnRCb3ggZnJvbSAnLi4vTm9Db250ZW50Qm94JztcbmltcG9ydCBSZXNvdXJjZUl0ZW0gZnJvbSAnLi9SZXNvdXJjZUl0ZW0nO1xuaW1wb3J0IHsgUmVzb3VyY2UgfSBmcm9tICcuLi90eXBlcyc7XG5cbmNvbnN0IFN0eWxlZFJlc291cmNlTGlzdCA9IHN0eWxlZC51bGBcbiAgbGlzdC1zdHlsZTogbm9uZTtcbiAgbWFyZ2luOiAwO1xuICBwYWRkaW5nOiAwO1xuICBmb250LWZhbWlseTogJHtmb250cy5zYW5zfTtcbmA7XG5cbmV4cG9ydCB0eXBlIFJlc291cmNlTGlzdFByb3BzID0ge1xuICByZXNvdXJjZXM6IFJlc291cmNlW107XG4gIG9uQ2xpY2s/OiAoKSA9PiB2b2lkO1xuICBjb250ZW50VHlwZT86IHN0cmluZztcbiAgdGl0bGU/OiBzdHJpbmc7XG4gIHNob3dBZGRpdGlvbmFsUmVzb3VyY2VzPzogYm9vbGVhbjtcbiAgaGVhcnRCdXR0b24/OiAocGF0aDogc3RyaW5nKSA9PiBSZWFjdE5vZGU7XG59O1xuXG5jb25zdCBSZXNvdXJjZUxpc3QgPSAoe1xuICByZXNvdXJjZXMsXG4gIG9uQ2xpY2ssXG4gIGNvbnRlbnRUeXBlLFxuICB0aXRsZSxcbiAgc2hvd0FkZGl0aW9uYWxSZXNvdXJjZXMsXG4gIGhlYXJ0QnV0dG9uLFxufTogUmVzb3VyY2VMaXN0UHJvcHMpID0+IHtcbiAgY29uc3QgeyB0IH0gPSB1c2VUcmFuc2xhdGlvbigpO1xuICBjb25zdCByZW5kZXJBZGRpdGlvbmFsUmVzb3VyY2VUcmlnZ2VyID1cbiAgICAhc2hvd0FkZGl0aW9uYWxSZXNvdXJjZXMgJiZcbiAgICByZXNvdXJjZXMuZmlsdGVyKChyZXMpID0+IHJlcy5hZGRpdGlvbmFsKS5sZW5ndGggPiAwICYmXG4gICAgcmVzb3VyY2VzLmZpbHRlcigocmVzKSA9PiAhcmVzLmFkZGl0aW9uYWwpLmxlbmd0aCA9PT0gMDtcblxuICByZXR1cm4gKFxuICAgIDxkaXY+XG4gICAgICA8U3R5bGVkUmVzb3VyY2VMaXN0PlxuICAgICAgICB7cmVzb3VyY2VzLm1hcCgoeyBpZCwgLi4ucmVzb3VyY2UgfSkgPT4gKFxuICAgICAgICAgIDxSZXNvdXJjZUl0ZW1cbiAgICAgICAgICAgIGlkPXtpZH1cbiAgICAgICAgICAgIGtleT17aWR9XG4gICAgICAgICAgICBjb250ZW50VHlwZT17Y29udGVudFR5cGV9XG4gICAgICAgICAgICBzaG93QWRkaXRpb25hbFJlc291cmNlcz17c2hvd0FkZGl0aW9uYWxSZXNvdXJjZXN9XG4gICAgICAgICAgICBoZWFydEJ1dHRvbj17aGVhcnRCdXR0b259XG4gICAgICAgICAgICB7Li4ucmVzb3VyY2V9XG4gICAgICAgICAgICBjb250ZW50VHlwZURlc2NyaXB0aW9uPXtcbiAgICAgICAgICAgICAgcmVzb3VyY2UuYWRkaXRpb25hbCA/IHQoJ3Jlc291cmNlLnRvb2x0aXBBZGRpdGlvbmFsVG9waWMnKSA6IHQoJ3Jlc291cmNlLnRvb2x0aXBDb3JlVG9waWMnKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIC8+XG4gICAgICAgICkpfVxuICAgICAgICB7cmVuZGVyQWRkaXRpb25hbFJlc291cmNlVHJpZ2dlciAmJiAoXG4gICAgICAgICAgPGxpPlxuICAgICAgICAgICAgPE5vQ29udGVudEJveFxuICAgICAgICAgICAgICBvbkNsaWNrPXtvbkNsaWNrfVxuICAgICAgICAgICAgICBidXR0b25UZXh0PXt0KCdyZXNvdXJjZS50b2dnbGVGaWx0ZXJMYWJlbCcpfVxuICAgICAgICAgICAgICB0ZXh0PXtcbiAgICAgICAgICAgICAgICB0aXRsZVxuICAgICAgICAgICAgICAgICAgPyB0KCdyZXNvdXJjZS5ub0NvcmVSZXNvdXJjZXNBdmFpbGFibGUnLCB7XG4gICAgICAgICAgICAgICAgICAgICAgbmFtZTogdGl0bGUudG9Mb3dlckNhc2UoKSxcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgIDogdCgncmVzb3VyY2Uubm9Db3JlUmVzb3VyY2VzQXZhaWxhYmxlVW5zcGVjaWZpYycpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgPC9saT5cbiAgICAgICAgKX1cbiAgICAgIDwvU3R5bGVkUmVzb3VyY2VMaXN0PlxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgUmVzb3VyY2VMaXN0O1xuIl19 */"));
|
|
34
|
+
var ResourceList = function ResourceList(_ref) {
|
|
35
|
+
var resources = _ref.resources,
|
|
36
|
+
onClick = _ref.onClick,
|
|
37
|
+
contentType = _ref.contentType,
|
|
38
|
+
title = _ref.title,
|
|
39
|
+
showAdditionalResources = _ref.showAdditionalResources,
|
|
40
|
+
heartButton = _ref.heartButton;
|
|
48
41
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
49
42
|
t = _useTranslation.t;
|
|
50
43
|
var renderAdditionalResourceTrigger = !showAdditionalResources && resources.filter(function (res) {
|
|
@@ -54,10 +47,9 @@ var ResourceList = function ResourceList(_ref2) {
|
|
|
54
47
|
}).length === 0;
|
|
55
48
|
return (0, _jsxRuntime.jsx)("div", {
|
|
56
49
|
children: (0, _jsxRuntime.jsxs)(StyledResourceList, {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
resource = _objectWithoutProperties(_ref3, _excluded);
|
|
50
|
+
children: [resources.map(function (_ref2) {
|
|
51
|
+
var id = _ref2.id,
|
|
52
|
+
resource = _objectWithoutProperties(_ref2, _excluded);
|
|
61
53
|
return (0, _jsxRuntime.jsx)(_ResourceItem.default, _objectSpread(_objectSpread({
|
|
62
54
|
id: id,
|
|
63
55
|
contentType: contentType,
|
|
@@ -847,8 +847,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
847
847
|
},
|
|
848
848
|
openMenuTooltip: 'Open menu',
|
|
849
849
|
mobileStepInfo: '{{currentPage}} out of {{totalPages}}',
|
|
850
|
-
nextArrow: '
|
|
851
|
-
previousArrow: '
|
|
850
|
+
nextArrow: 'Go to next step',
|
|
851
|
+
previousArrow: 'Go to previous step'
|
|
852
852
|
},
|
|
853
853
|
dropdown: {
|
|
854
854
|
numberHits: "Search returned {{hits}} hits",
|
|
@@ -845,8 +845,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
845
845
|
},
|
|
846
846
|
openMenuTooltip: 'Vis læringssti',
|
|
847
847
|
mobileStepInfo: '{{currentPage}} av {{totalPages}}',
|
|
848
|
-
nextArrow: '
|
|
849
|
-
previousArrow: '
|
|
848
|
+
nextArrow: 'Gå til neste steg',
|
|
849
|
+
previousArrow: 'Gå til forrige steg'
|
|
850
850
|
},
|
|
851
851
|
dropdown: {
|
|
852
852
|
numberHits: "S\xF8ket gav {{hits}} treff",
|
|
@@ -845,8 +845,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
845
845
|
},
|
|
846
846
|
openMenuTooltip: 'Vis læringssti',
|
|
847
847
|
mobileStepInfo: '{{currentPage}} av {{totalPages}}',
|
|
848
|
-
nextArrow: '
|
|
849
|
-
previousArrow: '
|
|
848
|
+
nextArrow: 'Gå til neste steg',
|
|
849
|
+
previousArrow: 'Gå til førre steg'
|
|
850
850
|
},
|
|
851
851
|
dropdown: {
|
|
852
852
|
numberHits: "S\xF8ket gav {{hits}} treff",
|
|
@@ -845,8 +845,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
845
845
|
},
|
|
846
846
|
openMenuTooltip: 'Čájet oahppobálgá',
|
|
847
847
|
mobileStepInfo: '{{currentPage}} oktiibuot {{totalPages}} siidduin',
|
|
848
|
-
nextArrow: '
|
|
849
|
-
previousArrow: '
|
|
848
|
+
nextArrow: 'Gå til neste steg',
|
|
849
|
+
previousArrow: 'Gå til førre steg'
|
|
850
850
|
},
|
|
851
851
|
dropdown: {
|
|
852
852
|
numberHits: "Ohcamis ledje {{hits}} deaivama",
|
|
@@ -845,8 +845,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
845
845
|
},
|
|
846
846
|
openMenuTooltip: 'Vuesehth lïeremebaalkam',
|
|
847
847
|
mobileStepInfo: '{{currentPage}} ållesth {{totalPages}}:ste',
|
|
848
|
-
nextArrow: '
|
|
849
|
-
previousArrow: '
|
|
848
|
+
nextArrow: 'Gå til neste steg',
|
|
849
|
+
previousArrow: 'Gå til førre steg'
|
|
850
850
|
},
|
|
851
851
|
dropdown: {
|
|
852
852
|
numberHits: "Datne {{hits}} gaavnedimmieh \xE5adtjoejih",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "44.0.
|
|
3
|
+
"version": "44.0.22",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
"types"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/accordion": "^2.2.
|
|
34
|
+
"@ndla/accordion": "^2.2.21",
|
|
35
35
|
"@ndla/article-scripts": "^3.0.20",
|
|
36
|
-
"@ndla/button": "^11.0.
|
|
36
|
+
"@ndla/button": "^11.0.6",
|
|
37
37
|
"@ndla/carousel": "^3.1.15",
|
|
38
38
|
"@ndla/core": "^4.1.6",
|
|
39
39
|
"@ndla/dropdown-menu": "^1.0.4",
|
|
40
|
-
"@ndla/forms": "^4.3.
|
|
40
|
+
"@ndla/forms": "^4.3.21",
|
|
41
41
|
"@ndla/hooks": "^2.0.9",
|
|
42
42
|
"@ndla/icons": "^4.0.5",
|
|
43
43
|
"@ndla/licenses": "^7.1.3",
|
|
44
44
|
"@ndla/modal": "^4.0.4",
|
|
45
|
-
"@ndla/notion": "^5.0.
|
|
46
|
-
"@ndla/safelink": "^4.1.
|
|
45
|
+
"@ndla/notion": "^5.0.20",
|
|
46
|
+
"@ndla/safelink": "^4.1.20",
|
|
47
47
|
"@ndla/select": "^2.4.11",
|
|
48
48
|
"@ndla/switch": "^1.1.11",
|
|
49
49
|
"@ndla/tabs": "^3.0.7",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "10dbdff57880d841b0491bb70dd8bcc2ce95ea2a"
|
|
87
87
|
}
|
package/src/Article/Article.tsx
CHANGED
|
@@ -101,7 +101,6 @@ const ArticleFavoritesButtonWrapper = styled.div`
|
|
|
101
101
|
display: flex;
|
|
102
102
|
justify-content: flex-end;
|
|
103
103
|
transform: translate(${spacing.xsmall}, -${spacing.normal});
|
|
104
|
-
height: 0;
|
|
105
104
|
${mq.range({ from: breakpoints.tablet })} {
|
|
106
105
|
transform: translate(${spacing.normal}, -${spacing.medium});
|
|
107
106
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import styled from '@emotion/styled';
|
|
10
|
-
import { spacing, fonts,
|
|
10
|
+
import { spacing, fonts, mq, breakpoints } from '@ndla/core';
|
|
11
11
|
|
|
12
12
|
type FooterPrivacyProps = {
|
|
13
13
|
privacyLinks: {
|
|
@@ -17,60 +17,51 @@ type FooterPrivacyProps = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const StyledPrivacyLink = styled.a`
|
|
20
|
-
background: none;
|
|
21
20
|
color: #fff;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
box-shadow: ${misc.textLinkBoxShadow};
|
|
25
|
-
cursor: pointer;
|
|
21
|
+
box-shadow: none;
|
|
22
|
+
text-decoration: underline;
|
|
26
23
|
&:hover,
|
|
27
24
|
&:focus {
|
|
28
|
-
|
|
25
|
+
text-decoration: none;
|
|
29
26
|
}
|
|
30
27
|
`;
|
|
31
28
|
|
|
32
29
|
const StyledLinkSpacer = styled.span`
|
|
33
|
-
margin
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
${mq.range({ until: breakpoints.mobileWide })} {
|
|
37
|
-
visibility: hidden;
|
|
30
|
+
margin: 0 ${spacing.small};
|
|
31
|
+
${mq.range({ until: breakpoints.tablet })} {
|
|
32
|
+
display: none;
|
|
38
33
|
}
|
|
39
34
|
`;
|
|
40
35
|
|
|
41
36
|
const StyledFooterText = styled.div`
|
|
42
37
|
display: flex;
|
|
43
|
-
flex-direction: row;
|
|
44
38
|
align-items: center;
|
|
45
39
|
justify-content: center;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
text-align: center;
|
|
49
|
-
}
|
|
50
|
-
${mq.range({ until: breakpoints.tabletWide })} {
|
|
51
|
-
${fonts.sizes(16, 1.5)};
|
|
52
|
-
> span {
|
|
53
|
-
padding: 0;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
${mq.range({ until: breakpoints.mobileWide })} {
|
|
57
|
-
${fonts.sizes(14, 1.3)};
|
|
58
|
-
> span {
|
|
59
|
-
padding-bottom: ${spacing.xsmall};
|
|
60
|
-
}
|
|
40
|
+
${fonts.sizes(16, 1.5)};
|
|
41
|
+
${mq.range({ until: breakpoints.tablet })} {
|
|
61
42
|
flex-direction: column;
|
|
43
|
+
gap: ${spacing.small};
|
|
62
44
|
}
|
|
63
45
|
margin-bottom: ${spacing.large};
|
|
64
46
|
`;
|
|
65
47
|
|
|
48
|
+
const TextWrapper = styled.div`
|
|
49
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
50
|
+
display: flex;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
align-self: flex-start;
|
|
53
|
+
text-align: center;
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
|
|
66
57
|
const FooterPrivacy = ({ privacyLinks }: FooterPrivacyProps) => {
|
|
67
58
|
return (
|
|
68
59
|
<StyledFooterText>
|
|
69
60
|
{privacyLinks.map((link, index) => (
|
|
70
|
-
<
|
|
61
|
+
<TextWrapper key={link.label}>
|
|
71
62
|
{index > 0 && <StyledLinkSpacer aria-hidden>|</StyledLinkSpacer>}
|
|
72
63
|
<StyledPrivacyLink href={link.url}>{link.label}</StyledPrivacyLink>
|
|
73
|
-
</
|
|
64
|
+
</TextWrapper>
|
|
74
65
|
))}
|
|
75
66
|
</StyledFooterText>
|
|
76
67
|
);
|
|
@@ -12,6 +12,7 @@ import { css } from '@emotion/react';
|
|
|
12
12
|
import { colors, spacing, animations, mq, breakpoints } from '@ndla/core';
|
|
13
13
|
import { Back, Forward } from '@ndla/icons/common';
|
|
14
14
|
import SafeLink from '@ndla/safelink';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
15
16
|
|
|
16
17
|
const FOOTER_HEIGHT = '78px';
|
|
17
18
|
const FOOTER_HEIGHT_MOBILE = spacing.large;
|
|
@@ -114,14 +115,21 @@ type PropsSiblings = {
|
|
|
114
115
|
stepId: number;
|
|
115
116
|
};
|
|
116
117
|
|
|
117
|
-
export const LearningPathStickySibling = ({ title, toLearningPathUrl, pathId, stepId, arrow }: PropsSiblings) =>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
118
|
+
export const LearningPathStickySibling = ({ title, toLearningPathUrl, pathId, stepId, arrow }: PropsSiblings) => {
|
|
119
|
+
const { t } = useTranslation();
|
|
120
|
+
return (
|
|
121
|
+
<SafeLink
|
|
122
|
+
to={toLearningPathUrl(pathId, stepId)}
|
|
123
|
+
css={SafeLinkCSS}
|
|
124
|
+
aria-label={arrow === 'left' ? t('learningPath.previousArrow') : t('learningPath.nextArrow')}
|
|
125
|
+
>
|
|
126
|
+
{arrow === 'left' && <Back className="c-icon--medium" />}
|
|
127
|
+
<div>
|
|
128
|
+
<StyledTitle>{title}</StyledTitle>
|
|
129
|
+
</div>
|
|
130
|
+
{arrow === 'right' && <Forward className="c-icon--medium" />}
|
|
131
|
+
</SafeLink>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
126
134
|
|
|
127
135
|
export const LearningPathStickyPlaceholder = () => <div css={SafeLinkCSS} />;
|
|
@@ -71,7 +71,12 @@ const MastheadSearchModal = ({ onClose: onSearchClose, children, ndlaFilm }: Pro
|
|
|
71
71
|
return (
|
|
72
72
|
<Modal open={isOpen} onOpenChange={setIsOpen}>
|
|
73
73
|
<ModalTrigger>
|
|
74
|
-
<ToggleSearchButton
|
|
74
|
+
<ToggleSearchButton
|
|
75
|
+
onClick={() => setIsOpen(true)}
|
|
76
|
+
ndlaFilm={ndlaFilm}
|
|
77
|
+
aria-label={t('masthead.menu.search')}
|
|
78
|
+
title={t('masthead.menu.search')}
|
|
79
|
+
>
|
|
75
80
|
{t('masthead.menu.search')}
|
|
76
81
|
</ToggleSearchButton>
|
|
77
82
|
</ModalTrigger>
|
|
@@ -37,13 +37,6 @@ const StyledCardContainer = styled(SafeLink)`
|
|
|
37
37
|
text-decoration: underline ${colors.text.primary};
|
|
38
38
|
text-underline-offset: 3px;
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
42
|
-
min-height: 350px;
|
|
43
|
-
min-width: 250px;
|
|
44
|
-
max-height: 350px;
|
|
45
|
-
width: 250px;
|
|
46
|
-
}
|
|
47
40
|
`;
|
|
48
41
|
|
|
49
42
|
const StyledImg = styled.img`
|
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ReactNode } from 'react';
|
|
9
|
+
import { CSSProperties, ReactNode, useMemo } from 'react';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
11
|
import styled from '@emotion/styled';
|
|
12
|
-
import {
|
|
12
|
+
import { keyframes } from '@emotion/react';
|
|
13
13
|
import SafeLink from '@ndla/safelink';
|
|
14
14
|
import { Additional, Core, HumanMaleBoard } from '@ndla/icons/common';
|
|
15
|
-
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
16
|
-
import Tooltip from '@ndla/tooltip';
|
|
15
|
+
import { breakpoints, colors, fonts, misc, mq, spacing } from '@ndla/core';
|
|
17
16
|
import { Resource } from '../types';
|
|
18
17
|
import ContentTypeBadge from '../ContentTypeBadge';
|
|
19
18
|
import * as contentTypes from '../model/ContentType';
|
|
@@ -59,54 +58,42 @@ const fadeInAdditionalsKeyframe = keyframes`
|
|
|
59
58
|
}
|
|
60
59
|
`;
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
contentType?: string;
|
|
66
|
-
active?: boolean;
|
|
67
|
-
hidden?: boolean;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const ListElement = styled.li<ListElementProps>`
|
|
71
|
-
border: 1px solid #d1d6db;
|
|
72
|
-
border-radius: 5px;
|
|
61
|
+
const ListElement = styled.li`
|
|
62
|
+
border: 1px solid ${colors.brand.neutral7};
|
|
63
|
+
border-radius: ${misc.borderRadius};
|
|
73
64
|
background: ${colors.white};
|
|
74
65
|
margin-bottom: ${spacing.xsmall};
|
|
75
66
|
display: flex;
|
|
76
67
|
justify-content: space-between;
|
|
77
68
|
align-items: center;
|
|
78
69
|
padding: ${spacing.small};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
animation-fill-mode: forwards;
|
|
86
|
-
animation: ${fadeInAdditionalsKeyframe};
|
|
87
|
-
`}
|
|
88
|
-
${(props) => props.extraBottomMargin && `margin-bottom: ${spacing.large};`}
|
|
70
|
+
&[data-additional='true'] {
|
|
71
|
+
border-style: dashed;
|
|
72
|
+
animation-duration: 0.8s;
|
|
73
|
+
animation-fill-mode: forwards;
|
|
74
|
+
animation: ${fadeInAdditionalsKeyframe};
|
|
75
|
+
}
|
|
89
76
|
|
|
90
77
|
* {
|
|
91
78
|
transition: height ease-out 0.2s, width ease-out 0.2s;
|
|
92
79
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
transform: translate(calc(-${spacing.normal} - ${spacing.small}));
|
|
105
|
-
background-color: ${listElementActiveColor(props.contentType)};
|
|
106
|
-
}
|
|
80
|
+
&[data-active='true'] {
|
|
81
|
+
&:before {
|
|
82
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
83
|
+
content: '';
|
|
84
|
+
display: block;
|
|
85
|
+
position: absolute;
|
|
86
|
+
width: ${spacing.small};
|
|
87
|
+
height: ${spacing.small};
|
|
88
|
+
border-radius: 100%;
|
|
89
|
+
transform: translate(-${spacing.mediumlarge});
|
|
90
|
+
background-color: var(--contentTypeBg);
|
|
107
91
|
}
|
|
108
|
-
|
|
109
|
-
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
&[hidden] {
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
110
97
|
`;
|
|
111
98
|
|
|
112
99
|
const ResourceLink = styled(SafeLink)`
|
|
@@ -223,7 +210,6 @@ const ResourceItem = ({
|
|
|
223
210
|
contentType,
|
|
224
211
|
active,
|
|
225
212
|
additional,
|
|
226
|
-
extraBottomMargin,
|
|
227
213
|
showAdditionalResources,
|
|
228
214
|
access,
|
|
229
215
|
heartButton,
|
|
@@ -234,14 +220,18 @@ const ResourceItem = ({
|
|
|
234
220
|
const additionalId = `${id}-additional`;
|
|
235
221
|
const describedBy = `${coreId} ${additionalId} ${accessId}`;
|
|
236
222
|
const hidden = additional ? !showAdditionalResources : false;
|
|
223
|
+
const listElementVars = useMemo(() => {
|
|
224
|
+
if (!contentType) return {};
|
|
225
|
+
return { '--contentTypeBg': listElementActiveColor(contentType) } as unknown as CSSProperties;
|
|
226
|
+
}, [contentType]);
|
|
227
|
+
|
|
237
228
|
return (
|
|
238
229
|
<ListElement
|
|
239
230
|
aria-current={active ? 'page' : undefined}
|
|
240
|
-
contentType={contentType}
|
|
241
231
|
hidden={hidden && !active}
|
|
242
|
-
active={active}
|
|
243
|
-
additional={additional}
|
|
244
|
-
|
|
232
|
+
data-active={active}
|
|
233
|
+
data-additional={additional}
|
|
234
|
+
style={listElementVars}
|
|
245
235
|
>
|
|
246
236
|
<ResourceWrapper>
|
|
247
237
|
<ContentBadgeWrapper>
|
|
@@ -257,27 +247,21 @@ const ResourceItem = ({
|
|
|
257
247
|
<TypeWrapper>
|
|
258
248
|
{contentTypeName && <ContentTypeName>{contentTypeName}</ContentTypeName>}
|
|
259
249
|
{access && access === 'teacher' && (
|
|
260
|
-
<
|
|
261
|
-
<
|
|
262
|
-
|
|
263
|
-
</IconWrapper>
|
|
264
|
-
</Tooltip>
|
|
250
|
+
<IconWrapper aria-label={t('article.access.onlyTeacher')} title={t('article.access.onlyTeacher')}>
|
|
251
|
+
<HumanMaleBoard id={accessId} />
|
|
252
|
+
</IconWrapper>
|
|
265
253
|
)}
|
|
266
254
|
{showAdditionalResources && contentTypeDescription && (
|
|
267
255
|
<>
|
|
268
256
|
{additional && (
|
|
269
|
-
<
|
|
270
|
-
<
|
|
271
|
-
|
|
272
|
-
</IconWrapper>
|
|
273
|
-
</Tooltip>
|
|
257
|
+
<IconWrapper id={additionalId} aria-label={contentTypeDescription} title={contentTypeDescription}>
|
|
258
|
+
<Additional />
|
|
259
|
+
</IconWrapper>
|
|
274
260
|
)}
|
|
275
261
|
{!additional && (
|
|
276
|
-
<
|
|
277
|
-
<
|
|
278
|
-
|
|
279
|
-
</IconWrapper>
|
|
280
|
-
</Tooltip>
|
|
262
|
+
<IconWrapper id={coreId} aria-label={contentTypeDescription} title={contentTypeDescription}>
|
|
263
|
+
<Core />
|
|
264
|
+
</IconWrapper>
|
|
281
265
|
)}
|
|
282
266
|
</>
|
|
283
267
|
)}
|
|
@@ -8,39 +8,17 @@
|
|
|
8
8
|
|
|
9
9
|
import { ReactNode } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
import { css, keyframes } from '@emotion/react';
|
|
12
11
|
import { useTranslation } from 'react-i18next';
|
|
13
12
|
import { fonts } from '@ndla/core';
|
|
14
13
|
import NoContentBox from '../NoContentBox';
|
|
15
14
|
import ResourceItem from './ResourceItem';
|
|
16
15
|
import { Resource } from '../types';
|
|
17
16
|
|
|
18
|
-
const
|
|
19
|
-
0% {
|
|
20
|
-
opacity: 0.5;
|
|
21
|
-
}
|
|
22
|
-
99% {
|
|
23
|
-
opacity: 0.5;
|
|
24
|
-
}
|
|
25
|
-
100% {
|
|
26
|
-
opacity: 1;
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
type StyledListProps = {
|
|
31
|
-
showAdditionalResources?: boolean;
|
|
32
|
-
};
|
|
33
|
-
const StyledResourceList = styled.ul<StyledListProps>`
|
|
17
|
+
const StyledResourceList = styled.ul`
|
|
34
18
|
list-style: none;
|
|
35
19
|
margin: 0;
|
|
36
20
|
padding: 0;
|
|
37
21
|
font-family: ${fonts.sans};
|
|
38
|
-
${({ showAdditionalResources }) =>
|
|
39
|
-
showAdditionalResources &&
|
|
40
|
-
css`
|
|
41
|
-
animation-name: ${fakeLoadingAnimation};
|
|
42
|
-
animation-duration: 0.4s;
|
|
43
|
-
`}
|
|
44
22
|
`;
|
|
45
23
|
|
|
46
24
|
export type ResourceListProps = {
|
|
@@ -68,7 +46,7 @@ const ResourceList = ({
|
|
|
68
46
|
|
|
69
47
|
return (
|
|
70
48
|
<div>
|
|
71
|
-
<StyledResourceList
|
|
49
|
+
<StyledResourceList>
|
|
72
50
|
{resources.map(({ id, ...resource }) => (
|
|
73
51
|
<ResourceItem
|
|
74
52
|
id={id}
|
|
@@ -882,8 +882,8 @@ const messages = {
|
|
|
882
882
|
},
|
|
883
883
|
openMenuTooltip: 'Open menu',
|
|
884
884
|
mobileStepInfo: '{{currentPage}} out of {{totalPages}}',
|
|
885
|
-
nextArrow: '
|
|
886
|
-
previousArrow: '
|
|
885
|
+
nextArrow: 'Go to next step',
|
|
886
|
+
previousArrow: 'Go to previous step',
|
|
887
887
|
},
|
|
888
888
|
dropdown: {
|
|
889
889
|
numberHits: `Search returned {{hits}} hits`,
|
|
@@ -881,8 +881,8 @@ const messages = {
|
|
|
881
881
|
},
|
|
882
882
|
openMenuTooltip: 'Vis læringssti',
|
|
883
883
|
mobileStepInfo: '{{currentPage}} av {{totalPages}}',
|
|
884
|
-
nextArrow: '
|
|
885
|
-
previousArrow: '
|
|
884
|
+
nextArrow: 'Gå til neste steg',
|
|
885
|
+
previousArrow: 'Gå til forrige steg',
|
|
886
886
|
},
|
|
887
887
|
dropdown: {
|
|
888
888
|
numberHits: `Søket gav {{hits}} treff`,
|
|
@@ -881,8 +881,8 @@ const messages = {
|
|
|
881
881
|
},
|
|
882
882
|
openMenuTooltip: 'Vis læringssti',
|
|
883
883
|
mobileStepInfo: '{{currentPage}} av {{totalPages}}',
|
|
884
|
-
nextArrow: '
|
|
885
|
-
previousArrow: '
|
|
884
|
+
nextArrow: 'Gå til neste steg',
|
|
885
|
+
previousArrow: 'Gå til førre steg',
|
|
886
886
|
},
|
|
887
887
|
dropdown: {
|
|
888
888
|
numberHits: `Søket gav {{hits}} treff`,
|
|
@@ -882,8 +882,8 @@ const messages = {
|
|
|
882
882
|
},
|
|
883
883
|
openMenuTooltip: 'Čájet oahppobálgá',
|
|
884
884
|
mobileStepInfo: '{{currentPage}} oktiibuot {{totalPages}} siidduin',
|
|
885
|
-
nextArrow: '
|
|
886
|
-
previousArrow: '
|
|
885
|
+
nextArrow: 'Gå til neste steg',
|
|
886
|
+
previousArrow: 'Gå til førre steg',
|
|
887
887
|
},
|
|
888
888
|
dropdown: {
|
|
889
889
|
numberHits: `Ohcamis ledje {{hits}} deaivama`,
|
|
@@ -885,8 +885,8 @@ const messages = {
|
|
|
885
885
|
},
|
|
886
886
|
openMenuTooltip: 'Vuesehth lïeremebaalkam',
|
|
887
887
|
mobileStepInfo: '{{currentPage}} ållesth {{totalPages}}:ste',
|
|
888
|
-
nextArrow: '
|
|
889
|
-
previousArrow: '
|
|
888
|
+
nextArrow: 'Gå til neste steg',
|
|
889
|
+
previousArrow: 'Gå til førre steg',
|
|
890
890
|
},
|
|
891
891
|
dropdown: {
|
|
892
892
|
numberHits: `Datne {{hits}} gaavnedimmieh åadtjoejih`,
|