@ndla/ui 34.3.5 → 34.4.0
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/ArticleByline.js +6 -5
- package/es/BlogPosts/BlogPost.js +6 -5
- package/es/CompetenceGoalTab/CompetenceGoalTab.js +4 -3
- package/es/ContentTypeBadge/ContentTypeBadge.js +3 -6
- package/es/Figure/Figure.js +1 -1
- package/es/Figure/FigureLicense.js +1 -1
- package/es/LearningPaths/LearningPathInformation.js +5 -4
- package/es/LearningPaths/LearningPathMenuAsideCopyright.js +4 -3
- package/es/MediaList/MediaList.js +2 -1
- package/es/SearchTypeResult/ResultNavigation.js +7 -5
- package/es/SearchTypeResult/SearchItem.js +51 -89
- package/es/SearchTypeResult/SearchItems.js +14 -10
- package/es/SearchTypeResult/SearchTypeHeader.js +14 -12
- package/es/SearchTypeResult/SearchTypeResult.js +6 -4
- package/es/SearchTypeResult/components/ItemContexts.js +12 -14
- package/es/SearchTypeResult/components/ItemResourceHeader.js +35 -33
- package/es/SearchTypeResult/components/ItemTopicHeader.js +6 -6
- package/lib/Article/ArticleByline.js +6 -5
- package/lib/BlogPosts/BlogPost.js +6 -5
- package/lib/CompetenceGoalTab/CompetenceGoalTab.js +4 -3
- package/lib/ContentTypeBadge/ContentTypeBadge.d.ts +3 -8
- package/lib/ContentTypeBadge/ContentTypeBadge.js +3 -6
- package/lib/Figure/Figure.js +2 -2
- package/lib/Figure/FigureLicense.js +2 -2
- package/lib/LearningPaths/LearningPathInformation.js +5 -4
- package/lib/LearningPaths/LearningPathMenuAsideCopyright.js +4 -3
- package/lib/MediaList/MediaList.js +2 -1
- package/lib/SearchTypeResult/ResultNavigation.d.ts +4 -1
- package/lib/SearchTypeResult/ResultNavigation.js +7 -5
- package/lib/SearchTypeResult/SearchItem.d.ts +4 -4
- package/lib/SearchTypeResult/SearchItem.js +62 -88
- package/lib/SearchTypeResult/SearchItems.d.ts +2 -2
- package/lib/SearchTypeResult/SearchItems.js +14 -10
- package/lib/SearchTypeResult/SearchTypeHeader.js +14 -12
- package/lib/SearchTypeResult/SearchTypeResult.js +6 -4
- package/lib/SearchTypeResult/components/ItemContexts.js +12 -14
- package/lib/SearchTypeResult/components/ItemResourceHeader.d.ts +2 -2
- package/lib/SearchTypeResult/components/ItemResourceHeader.js +35 -33
- package/lib/SearchTypeResult/components/ItemTopicHeader.d.ts +2 -2
- package/lib/SearchTypeResult/components/ItemTopicHeader.js +6 -6
- package/package.json +5 -5
- package/src/Article/ArticleByline.tsx +2 -1
- package/src/BlogPosts/BlogPost.tsx +2 -1
- package/src/CompetenceGoalTab/CompetenceGoalTab.tsx +2 -1
- package/src/ContentTypeBadge/ContentTypeBadge.tsx +4 -9
- package/src/Figure/Figure.tsx +1 -1
- package/src/Figure/FigureLicense.tsx +1 -1
- package/src/LearningPaths/LearningPathInformation.tsx +2 -1
- package/src/LearningPaths/LearningPathMenuAsideCopyright.tsx +2 -1
- package/src/MediaList/MediaList.tsx +1 -1
- package/src/SearchTypeResult/ResultNavigation.tsx +6 -2
- package/src/SearchTypeResult/SearchItem.tsx +61 -77
- package/src/SearchTypeResult/SearchItems.tsx +25 -16
- package/src/SearchTypeResult/SearchTypeHeader.tsx +9 -3
- package/src/SearchTypeResult/SearchTypeResult.tsx +2 -2
- package/src/SearchTypeResult/components/ItemContexts.tsx +9 -9
- package/src/SearchTypeResult/components/ItemResourceHeader.tsx +33 -31
- package/src/SearchTypeResult/components/ItemTopicHeader.tsx +9 -15
|
@@ -12,18 +12,18 @@ var _ContentTypeBadge = _interopRequireDefault(require("../../ContentTypeBadge")
|
|
|
12
12
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
14
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
15
|
-
var Wrapper = /*#__PURE__*/(0, _base["default"])("
|
|
15
|
+
var Wrapper = /*#__PURE__*/(0, _base["default"])("header", {
|
|
16
16
|
target: "e1kvpkml3",
|
|
17
17
|
label: "Wrapper"
|
|
18
|
-
})("padding:", _core.spacing.small, " ", _core.spacing.normal, "
|
|
18
|
+
})("padding:", _core.spacing.small, " ", _core.spacing.normal, " 0;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkl0ZW1Ub3BpY0hlYWRlci50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBaUI2QiIsImZpbGUiOiJJdGVtVG9waWNIZWFkZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMjEtcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuXG5pbXBvcnQgUmVhY3QsIHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tICdyZWFjdC1pMThuZXh0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNvbG9ycywgZm9udHMsIHNwYWNpbmcgfSBmcm9tICdAbmRsYS9jb3JlJztcblxuaW1wb3J0IHsgU2VhcmNoSXRlbVR5cGUgfSBmcm9tICcuLi9TZWFyY2hJdGVtJztcbmltcG9ydCBDb250ZW50VHlwZUJhZGdlIGZyb20gJy4uLy4uL0Nvb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BpY0hlYWRlcjtcbiJdfQ== */"));
|
|
19
19
|
var Label = /*#__PURE__*/(0, _base["default"])("div", {
|
|
20
20
|
target: "e1kvpkml2",
|
|
21
21
|
label: "Label"
|
|
22
|
-
})(_core.fonts.sizes('12px', '16px'), ";font-weight:", _core.fonts.weight.semibold, ";height:26px;display:flex;align-items:center;margin
|
|
22
|
+
})(_core.fonts.sizes('12px', '16px'), ";font-weight:", _core.fonts.weight.semibold, ";height:26px;display:flex;align-items:center;margin:", _core.spacing.small, " 0;.c-content-type-badge{width:26px;height:26px;margin-right:", _core.spacing.xsmall, ";}svg{width:22px;height:22px;color:", _core.colors.text.primary, "!important;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkl0ZW1Ub3BpY0hlYWRlci50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBcUJ3QiIsImZpbGUiOiJJdGVtVG9waWNIZWFkZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMjEtcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuXG5pbXBvcnQgUmVhY3QsIHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tICdyZWFjdC1pMThuZXh0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNvbG9ycywgZm9udHMsIHNwYWNpbmcgfSBmcm9tICdAbmRsYS9jb3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4gICAgICAgICl9XG4gICAgICA8L0xhYmVsPlxuICAgICAge2NoaWxkcmVufVxuICAgIDwvV3JhcHBlcj5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEl0ZW1Ub3BpY0hlYWRlcjtcbiJdfQ== */"));
|
|
23
23
|
var TopicHeaderVisualElementWrapper = /*#__PURE__*/(0, _base["default"])("div", {
|
|
24
24
|
target: "e1kvpkml1",
|
|
25
25
|
label: "TopicHeaderVisualElementWrapper"
|
|
26
|
-
})("float:right;margin-left:", _core.spacing.small, ";
|
|
26
|
+
})("float:right;margin-left:", _core.spacing.small, ";width:110px;height:110px;display:flex;overflow:hidden;border-radius:50%;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkl0ZW1Ub3BpY0hlYWRlci50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMENrRCIsImZpbGUiOiJJdGVtVG9waWNIZWFkZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMjEtcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuXG5pbXBvcnQgUmVhY3QsIHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tICdyZWFjdC1pMThuZXh0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNvbG9ycywgZm9udHMsIHNwYWNpbmcgfSBmcm9tICdAbm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AgPC8+XG4gICAgICAgICl9XG4gICAgICA8L0xhYmVsPlxuICAgICAge2NoaWxkcmVufVxuICAgIDwvV3JhcHBlcj5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEl0ZW1Ub3BpY0hlYWRlcjtcbiJdfQ== */"));
|
|
27
27
|
var TopicHeaderImage = /*#__PURE__*/(0, _base["default"])("img", {
|
|
28
28
|
target: "e1kvpkml0",
|
|
29
29
|
label: "TopicHeaderImage"
|
|
@@ -33,7 +33,7 @@ var TopicHeaderImage = /*#__PURE__*/(0, _base["default"])("img", {
|
|
|
33
33
|
} : {
|
|
34
34
|
name: "ua5abx",
|
|
35
35
|
styles: "width:100%;height:100%;object-fit:cover;max-width:unset",
|
|
36
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
36
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkl0ZW1Ub3BpY0hlYWRlci50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBb0RtQyIsImZpbGUiOiJJdGVtVG9waWNIZWFkZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMjEtcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuXG5pbXBvcnQgUmVhY3QsIHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tICdyZWFjdC1pMThuZXh0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5b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xuICAgICAgICAgICAge3QoYGNvbnRlbnRUeXBlcy4ke3R5cGV9YCl9XG4gICAgICAgICAgPC8+XG4gICAgICAgICl9XG4gICAgICA8L0xhYmVsPlxuICAgICAge2NoaWxkcmVufVxuICAgIDwvV3JhcHBlcj5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEl0ZW1Ub3BpY0hlYWRlcjtcbiJdfQ== */",
|
|
37
37
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
38
|
});
|
|
39
39
|
var ItemTopicHeader = function ItemTopicHeader(_ref) {
|
|
@@ -47,7 +47,7 @@ var ItemTopicHeader = function ItemTopicHeader(_ref) {
|
|
|
47
47
|
children: (0, _jsxRuntime.jsx)(TopicHeaderImage, {
|
|
48
48
|
className: "topic-header-image",
|
|
49
49
|
src: image.url,
|
|
50
|
-
alt:
|
|
50
|
+
alt: ""
|
|
51
51
|
})
|
|
52
52
|
}), (0, _jsxRuntime.jsx)(Label, {
|
|
53
53
|
className: "topic-label",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "34.
|
|
3
|
+
"version": "34.4.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"@ndla/forms": "^4.2.4",
|
|
39
39
|
"@ndla/hooks": "^1.2.0",
|
|
40
40
|
"@ndla/icons": "^2.2.2",
|
|
41
|
-
"@ndla/licenses": "^
|
|
42
|
-
"@ndla/modal": "^2.2.
|
|
43
|
-
"@ndla/notion": "^4.1
|
|
41
|
+
"@ndla/licenses": "^7.0.0",
|
|
42
|
+
"@ndla/modal": "^2.2.6",
|
|
43
|
+
"@ndla/notion": "^4.2.1",
|
|
44
44
|
"@ndla/safelink": "^4.0.6",
|
|
45
45
|
"@ndla/switch": "^1.0.6",
|
|
46
46
|
"@ndla/tabs": "^2.1.4",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "42968ec92ec2338e003ffab02476338f380293b3"
|
|
87
87
|
}
|
|
@@ -13,7 +13,8 @@ import { CopyButton, ButtonV2 } from '@ndla/button';
|
|
|
13
13
|
import { colors, fonts, spacing } from '@ndla/core';
|
|
14
14
|
import { copyTextToClipboard, printPage } from '@ndla/util';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import {
|
|
16
|
+
import { getLicenseByAbbreviation } from '@ndla/licenses';
|
|
17
|
+
import { LicenseByline } from '@ndla/notion';
|
|
17
18
|
import { TFunction } from 'i18next';
|
|
18
19
|
|
|
19
20
|
const Wrapper = styled.div`
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { spacing, colors, fonts, breakpoints, mq, misc, spacingUnit } from '@ndla/core';
|
|
12
|
-
import { getLicenseByAbbreviation
|
|
12
|
+
import { getLicenseByAbbreviation } from '@ndla/licenses';
|
|
13
|
+
import { LicenseByline } from '@ndla/notion';
|
|
13
14
|
import { Launch as LaunchIcon } from '@ndla/icons/common';
|
|
14
15
|
import SafeLink from '@ndla/safelink';
|
|
15
16
|
|
|
@@ -12,7 +12,8 @@ import { spacing } from '@ndla/core';
|
|
|
12
12
|
import { useTranslation } from 'react-i18next';
|
|
13
13
|
import { ButtonV2 } from '@ndla/button';
|
|
14
14
|
import SafeLink from '@ndla/safelink';
|
|
15
|
-
import { BY, CC
|
|
15
|
+
import { BY, CC } from '@ndla/licenses';
|
|
16
|
+
import { LicenseByline } from '@ndla/notion';
|
|
16
17
|
import Tooltip from '@ndla/tooltip';
|
|
17
18
|
import CompetenceItem, { ListItemProp } from './CompetenceItem';
|
|
18
19
|
|
|
@@ -22,16 +22,16 @@ const classes = new BEMHelper({
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
interface Props {
|
|
25
|
-
size
|
|
25
|
+
size?: 'xx-small' | 'x-small' | 'small' | 'large';
|
|
26
26
|
type: string;
|
|
27
27
|
title?: string;
|
|
28
28
|
background?: boolean;
|
|
29
29
|
border?: boolean;
|
|
30
|
+
className?: string;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
export const ContentTypeBadge = ({ type, background, title, size = 'small', border = true }: Props) => {
|
|
33
|
+
export const ContentTypeBadge = ({ type, background, title, size = 'small', border = true, className }: Props) => {
|
|
33
34
|
const modifiers = [type, size];
|
|
34
|
-
|
|
35
35
|
if (background) {
|
|
36
36
|
modifiers.push('background');
|
|
37
37
|
}
|
|
@@ -71,12 +71,7 @@ export const ContentTypeBadge = ({ type, background, title, size = 'small', bord
|
|
|
71
71
|
default:
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
|
-
return <div {...classes('', modifiers)}>{icon}</div>;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
ContentTypeBadge.defaultProps = {
|
|
78
|
-
size: 'small',
|
|
79
|
-
border: true,
|
|
74
|
+
return <div {...classes('', modifiers, className)}>{icon}</div>;
|
|
80
75
|
};
|
|
81
76
|
|
|
82
77
|
export const SubjectMaterialBadge = (props: Omit<Props, 'type'>) => (
|
package/src/Figure/Figure.tsx
CHANGED
|
@@ -13,7 +13,7 @@ import React, { ReactNode } from 'react';
|
|
|
13
13
|
import BEMHelper from 'react-bem-helper';
|
|
14
14
|
import { isFunction as isFunctionHelper, parseMarkdown } from '@ndla/util';
|
|
15
15
|
import { Link as LinkIcon } from '@ndla/icons/common';
|
|
16
|
-
import { LicenseByline } from '@ndla/
|
|
16
|
+
import { LicenseByline } from '@ndla/notion';
|
|
17
17
|
import SafeLink from '@ndla/safelink';
|
|
18
18
|
import Button from '@ndla/button';
|
|
19
19
|
import { isMobile } from 'react-device-detect';
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import React, { ReactNode } from 'react';
|
|
13
13
|
import BEMHelper from 'react-bem-helper';
|
|
14
14
|
import { uuid } from '@ndla/util';
|
|
15
|
-
import { LicenseDescription } from '@ndla/
|
|
15
|
+
import { LicenseDescription } from '@ndla/notion';
|
|
16
16
|
import { FigureLicense } from './Figure';
|
|
17
17
|
import { Contributor } from '../types';
|
|
18
18
|
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { fonts, spacing, spacingUnit, breakpoints, mq, colors } from '@ndla/core';
|
|
12
|
-
import { getLicenseByAbbreviation
|
|
12
|
+
import { getLicenseByAbbreviation } from '@ndla/licenses';
|
|
13
|
+
import { LicenseByline } from '@ndla/notion';
|
|
13
14
|
|
|
14
15
|
type StyledWrapperProps = {
|
|
15
16
|
invertedStyle?: boolean;
|
|
@@ -10,7 +10,8 @@ import React from 'react';
|
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { User } from '@ndla/icons/common';
|
|
12
12
|
import { spacing, fonts, colors } from '@ndla/core';
|
|
13
|
-
import { getLicenseByAbbreviation
|
|
13
|
+
import { getLicenseByAbbreviation } from '@ndla/licenses';
|
|
14
|
+
import { LicenseByline } from '@ndla/notion';
|
|
14
15
|
|
|
15
16
|
const StyledLearningPathDetails = styled.div`
|
|
16
17
|
${fonts.sizes(14, 1.1)};
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
import React, { ReactNode } from 'react';
|
|
10
10
|
import {
|
|
11
|
-
LicenseDescription,
|
|
12
11
|
getLicenseByAbbreviation,
|
|
13
12
|
getResourceTypeNamespace,
|
|
14
13
|
isCreativeCommonsLicense,
|
|
15
14
|
metaTypes,
|
|
16
15
|
} from '@ndla/licenses';
|
|
16
|
+
import { LicenseDescription } from '@ndla/notion';
|
|
17
17
|
import BEMHelper from 'react-bem-helper';
|
|
18
18
|
import { uuid } from '@ndla/util';
|
|
19
19
|
|
|
@@ -59,7 +59,11 @@ export type PaginationType = {
|
|
|
59
59
|
contentType?: string;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
interface Props extends PaginationType {
|
|
63
|
+
type?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const ResultNavigation = ({ onShowMore, totalCount, toCount, contentType = '', type }: Props) => {
|
|
63
67
|
const { t } = useTranslation();
|
|
64
68
|
const isMore = toCount < totalCount;
|
|
65
69
|
const progress = Math.ceil((toCount / totalCount) * 100);
|
|
@@ -87,7 +91,7 @@ const ResultNavigation = ({ onShowMore, totalCount, toCount, contentType = '' }:
|
|
|
87
91
|
<Progress width={progress} />
|
|
88
92
|
</ProgressBar>
|
|
89
93
|
{isMore ? (
|
|
90
|
-
<Button className="nav" outline onClick={onShowMore}>
|
|
94
|
+
<Button className="nav" outline onClick={onShowMore} aria-describedby={`searchitem-header-${type}`}>
|
|
91
95
|
{t('searchPage.resultType.showMore')}
|
|
92
96
|
</Button>
|
|
93
97
|
) : (
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React, { ReactNode } from 'react';
|
|
9
|
+
import React, { ReactNode, useRef } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import parse from 'html-react-parser';
|
|
12
12
|
|
|
@@ -20,25 +20,19 @@ import ItemTopicHeader from './components/ItemTopicHeader';
|
|
|
20
20
|
import ItemResourceHeader from './components/ItemResourceHeader';
|
|
21
21
|
const { contentTypes } = constants;
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
interface ItemTypeProps {
|
|
24
24
|
contentType?: ContentType;
|
|
25
25
|
isTopic?: boolean;
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
27
|
|
|
28
|
-
const Container = styled.
|
|
28
|
+
const Container = styled.article`
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
position: relative;
|
|
29
31
|
display: flex;
|
|
30
|
-
height: 400px;
|
|
31
|
-
align-items: center;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
const ItemWrapper = styled.div`
|
|
36
32
|
flex-direction: column;
|
|
37
|
-
display: flex;
|
|
38
|
-
width: 100%;
|
|
39
|
-
height: 100%;
|
|
40
|
-
border: 1px solid ${colors.brand.neutral7};
|
|
41
33
|
border-radius: 5px;
|
|
34
|
+
border: 1px solid ${colors.brand.neutral7};
|
|
35
|
+
|
|
42
36
|
img {
|
|
43
37
|
transition: all ${animations.durations.fast} ease-in-out;
|
|
44
38
|
}
|
|
@@ -49,43 +43,36 @@ const ItemWrapper = styled.div`
|
|
|
49
43
|
}
|
|
50
44
|
`;
|
|
51
45
|
|
|
52
|
-
const ItemLink = styled(SafeLink)`
|
|
53
|
-
box-shadow: none;
|
|
54
|
-
color: unset;
|
|
55
|
-
text-decoration: none;
|
|
56
|
-
display: flex;
|
|
57
|
-
flex-direction: column;
|
|
58
|
-
position: relative;
|
|
59
|
-
min-height: 0;
|
|
60
|
-
flex: 1;
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
const TextWrapper = styled.div`
|
|
64
|
-
padding: 0 ${spacing.normal} ${spacing.small};
|
|
65
|
-
`;
|
|
66
|
-
|
|
67
|
-
const ItemTitleWrapper = styled.div<ItemTypeProps>`
|
|
68
|
-
margin-top: ${spacing.small};
|
|
69
|
-
`;
|
|
70
|
-
|
|
71
46
|
const ItemTitle = styled.h3<ItemTypeProps>`
|
|
47
|
+
display: inline;
|
|
72
48
|
${fonts.sizes('24px', '28px')};
|
|
73
49
|
color: ${colors.brand.primary};
|
|
74
|
-
${(props) => props.isTopic &&
|
|
50
|
+
margin-bottom: ${(props) => props.isTopic && spacing.small};
|
|
75
51
|
font-weight: ${fonts.weight.semibold};
|
|
76
|
-
overflow-wrap:
|
|
77
|
-
|
|
78
|
-
${
|
|
79
|
-
box-shadow:
|
|
80
|
-
|
|
52
|
+
overflow-wrap: break-word;
|
|
53
|
+
margin: 0;
|
|
54
|
+
${Container}:hover & {
|
|
55
|
+
box-shadow: 0 -1px inset;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
const StyledLink = styled(SafeLink)`
|
|
60
|
+
box-shadow: none;
|
|
61
|
+
color: ${colors.brand.primary};
|
|
62
|
+
|
|
63
|
+
:after {
|
|
64
|
+
content: '';
|
|
65
|
+
position: absolute;
|
|
66
|
+
z-index: 1;
|
|
67
|
+
top: 0;
|
|
68
|
+
right: 0;
|
|
69
|
+
bottom: 0;
|
|
70
|
+
left: 0;
|
|
81
71
|
}
|
|
82
72
|
`;
|
|
73
|
+
|
|
83
74
|
const ItemText = styled.div<ItemTypeProps>`
|
|
84
|
-
overflow: hidden;
|
|
85
75
|
${fonts.sizes('16px', '24px')};
|
|
86
|
-
word-break: break-word;
|
|
87
|
-
overflow-wrap: anywhere;
|
|
88
|
-
margin-top: ${spacing.small};
|
|
89
76
|
${(props) =>
|
|
90
77
|
props.isTopic &&
|
|
91
78
|
`
|
|
@@ -93,12 +80,14 @@ const ItemText = styled.div<ItemTypeProps>`
|
|
|
93
80
|
`};
|
|
94
81
|
`;
|
|
95
82
|
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
83
|
+
const ContentWrapper = styled.main`
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
gap: ${spacing.small};
|
|
87
|
+
padding: ${spacing.small} ${spacing.normal};
|
|
99
88
|
`;
|
|
100
89
|
|
|
101
|
-
export
|
|
90
|
+
export interface SearchItemProps {
|
|
102
91
|
id: string | number;
|
|
103
92
|
title: string;
|
|
104
93
|
url: string;
|
|
@@ -108,44 +97,39 @@ export type SearchItemProps = {
|
|
|
108
97
|
labels?: string[];
|
|
109
98
|
type?: ContentType;
|
|
110
99
|
children?: ReactNode;
|
|
111
|
-
}
|
|
112
|
-
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface SearchItemType {
|
|
113
103
|
item: SearchItemProps;
|
|
114
104
|
type?: ContentType;
|
|
115
|
-
}
|
|
105
|
+
}
|
|
106
|
+
|
|
116
107
|
const SearchItem = ({ item, type }: SearchItemType) => {
|
|
117
|
-
const { title, url, ingress, contexts, img = null, labels = []
|
|
108
|
+
const { title, url, ingress, contexts = [], img = null, labels = [] } = item;
|
|
109
|
+
const linkRef = useRef<HTMLAnchorElement>(null);
|
|
118
110
|
|
|
119
111
|
const isTopic = type === contentTypes.TOPIC || type === contentTypes.MULTIDISCIPLINARY_TOPIC;
|
|
120
112
|
|
|
121
113
|
return (
|
|
122
114
|
<Container>
|
|
123
|
-
|
|
124
|
-
<
|
|
125
|
-
{
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
</>
|
|
142
|
-
)}
|
|
143
|
-
<ContextWrapper>
|
|
144
|
-
{contexts && contexts.length > 0 && <ItemContexts contexts={contexts} id={item.id} title={item.title} />}
|
|
145
|
-
</ContextWrapper>
|
|
146
|
-
</ItemLink>
|
|
147
|
-
{children}
|
|
148
|
-
</ItemWrapper>
|
|
115
|
+
{isTopic ? (
|
|
116
|
+
<ItemTopicHeader image={img} type={type}>
|
|
117
|
+
<StyledLink to={url} ref={linkRef}>
|
|
118
|
+
<ItemTitle>{title}</ItemTitle>
|
|
119
|
+
</StyledLink>
|
|
120
|
+
</ItemTopicHeader>
|
|
121
|
+
) : (
|
|
122
|
+
<ItemResourceHeader labels={labels} img={img} type={type} />
|
|
123
|
+
)}
|
|
124
|
+
<ContentWrapper>
|
|
125
|
+
{!isTopic && (
|
|
126
|
+
<StyledLink to={url} ref={linkRef}>
|
|
127
|
+
<ItemTitle>{title}</ItemTitle>
|
|
128
|
+
</StyledLink>
|
|
129
|
+
)}
|
|
130
|
+
<ItemText isTopic={isTopic}>{parse(ingress)}</ItemText>
|
|
131
|
+
{contexts.length > 0 && <ItemContexts contexts={contexts} id={item.id} title={item.title} />}
|
|
132
|
+
</ContentWrapper>
|
|
149
133
|
</Container>
|
|
150
134
|
);
|
|
151
135
|
};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import React, { memo } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
+
import { css } from '@emotion/react';
|
|
11
12
|
import { breakpoints, mq, spacing } from '@ndla/core';
|
|
12
13
|
import SearchItem, { SearchItemProps } from './SearchItem';
|
|
13
14
|
import { ContentType } from './SearchTypeResult';
|
|
@@ -18,41 +19,49 @@ const Wrapper = styled.div`
|
|
|
18
19
|
position: relative;
|
|
19
20
|
`;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
interface ContainerProps {
|
|
22
23
|
viewType: Props['viewType'];
|
|
23
|
-
}
|
|
24
|
+
}
|
|
24
25
|
|
|
25
|
-
const Container = styled.
|
|
26
|
+
const Container = styled.ul<ContainerProps>`
|
|
26
27
|
display: grid;
|
|
28
|
+
align-items: flex-start;
|
|
29
|
+
list-style: none;
|
|
27
30
|
row-gap: ${spacing.normal};
|
|
28
31
|
grid-template-columns: repeat(1, 1fr);
|
|
29
32
|
|
|
30
33
|
${(props) =>
|
|
31
34
|
props.viewType === 'grid' &&
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
css`
|
|
36
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
37
|
+
column-gap: ${spacing.normal};
|
|
38
|
+
grid-template-columns: repeat(2, 1fr);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
${mq.range({ from: breakpoints.desktop })} {
|
|
42
|
+
grid-template-columns: repeat(3, 1fr);
|
|
43
|
+
}
|
|
44
|
+
`}
|
|
41
45
|
`;
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
interface Props {
|
|
44
48
|
items: SearchItemProps[];
|
|
45
49
|
type?: ContentType;
|
|
46
50
|
viewType?: 'grid' | 'list';
|
|
47
|
-
}
|
|
51
|
+
}
|
|
52
|
+
|
|
48
53
|
const SearchItems = ({ items, type, viewType = 'grid' }: Props) => {
|
|
49
54
|
return (
|
|
50
55
|
<Wrapper>
|
|
51
|
-
<Container viewType={viewType}>
|
|
56
|
+
<Container aria-labelledby={`searchitem-header-${type}`} viewType={viewType}>
|
|
52
57
|
{items.map((item) => {
|
|
53
58
|
const contentType = type || item.type;
|
|
54
59
|
const Component = viewType === 'list' ? SearchItemList : SearchItem;
|
|
55
|
-
return
|
|
60
|
+
return (
|
|
61
|
+
<li key={`${item.id}`}>
|
|
62
|
+
<Component item={item} type={contentType} />
|
|
63
|
+
</li>
|
|
64
|
+
);
|
|
56
65
|
})}
|
|
57
66
|
</Container>
|
|
58
67
|
</Wrapper>
|
|
@@ -42,10 +42,13 @@ const BadgeWrapper = styled.span`
|
|
|
42
42
|
margin-right: ${spacing.small};
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
|
-
const SubjectName = styled.
|
|
45
|
+
const SubjectName = styled.div`
|
|
46
|
+
display: flex;
|
|
47
|
+
gap: ${spacing.small};
|
|
46
48
|
${fonts.sizes('18px', '24px')};
|
|
47
49
|
margin: 2px 0;
|
|
48
|
-
|
|
50
|
+
h2 {
|
|
51
|
+
margin: 0;
|
|
49
52
|
${fonts.sizes('18px', '24px')};
|
|
50
53
|
margin-right: 4px;
|
|
51
54
|
}
|
|
@@ -97,7 +100,9 @@ const SearchTypeHeader = ({ filters = [], onFilterClick, totalCount, type }: Pro
|
|
|
97
100
|
</BadgeWrapper>
|
|
98
101
|
)}
|
|
99
102
|
<SubjectName>
|
|
100
|
-
<
|
|
103
|
+
<h2 id={`searchitem-header-${type}`}>
|
|
104
|
+
{type ? t(`contentTypes.${type}`) : t(`searchPage.resultType.allContentTypes`)}
|
|
105
|
+
</h2>
|
|
101
106
|
{totalCount && <Count>{t(`searchPage.resultType.hits`, { count: totalCount })}</Count>}
|
|
102
107
|
</SubjectName>
|
|
103
108
|
</TypeWrapper>
|
|
@@ -107,6 +112,7 @@ const SearchTypeHeader = ({ filters = [], onFilterClick, totalCount, type }: Pro
|
|
|
107
112
|
{filters.map((option: FilterOptionsType) => (
|
|
108
113
|
<CategoryTypeButtonWrapper key={option.id}>
|
|
109
114
|
<Button
|
|
115
|
+
aria-current={option.active}
|
|
110
116
|
size="xsmall"
|
|
111
117
|
borderShape="rounded"
|
|
112
118
|
greyLighter={!option.active}
|
|
@@ -16,7 +16,7 @@ import SearchItems from './SearchItems';
|
|
|
16
16
|
import { SearchItemProps } from './SearchItem';
|
|
17
17
|
import ResultNavigation, { PaginationType } from './ResultNavigation';
|
|
18
18
|
|
|
19
|
-
const Wrapper = styled.
|
|
19
|
+
const Wrapper = styled.section`
|
|
20
20
|
display: flex;
|
|
21
21
|
flex-direction: column;
|
|
22
22
|
flex: 1;
|
|
@@ -81,7 +81,7 @@ const SearchTypeResult = ({
|
|
|
81
81
|
)}
|
|
82
82
|
<SearchTypeHeader onFilterClick={onFilterClick} filters={filters} totalCount={totalCount} type={type} />
|
|
83
83
|
<SearchItems items={items} type={type} viewType={viewType} />
|
|
84
|
-
{pagination && <ResultNavigation {...pagination} />}
|
|
84
|
+
{pagination && <ResultNavigation {...pagination} type={type} />}
|
|
85
85
|
{children}
|
|
86
86
|
</Wrapper>
|
|
87
87
|
);
|
|
@@ -11,8 +11,8 @@ import SafeLink from '@ndla/safelink';
|
|
|
11
11
|
import { Additional, Core } from '@ndla/icons/common';
|
|
12
12
|
import styled from '@emotion/styled';
|
|
13
13
|
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import { ButtonV2 } from '@ndla/button';
|
|
15
|
+
import { ModalV2, ModalCloseButton } from '@ndla/modal';
|
|
16
16
|
import { useTranslation } from 'react-i18next';
|
|
17
17
|
|
|
18
18
|
const BreadcrumbPath = styled.div`
|
|
@@ -24,7 +24,9 @@ const BreadcrumbPath = styled.div`
|
|
|
24
24
|
}
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
|
-
const ModalButton = styled(
|
|
27
|
+
const ModalButton = styled(ButtonV2)`
|
|
28
|
+
z-index: 1;
|
|
29
|
+
position: relative;
|
|
28
30
|
${fonts.sizes('14px', '20px')};
|
|
29
31
|
box-shadow: none;
|
|
30
32
|
&:hover {
|
|
@@ -97,19 +99,17 @@ const ItemContexts = ({ contexts, id, title }: ItemContextsType) => {
|
|
|
97
99
|
<Breadcrumb breadcrumb={mainContext.breadcrumb}>
|
|
98
100
|
|
|
99
101
|
{contexts.length > 1 && (
|
|
100
|
-
<
|
|
102
|
+
<ModalV2
|
|
101
103
|
label={t('searchPage.contextModal.ariaLabel')}
|
|
102
104
|
activateButton={
|
|
103
|
-
<ModalButton link>
|
|
105
|
+
<ModalButton variant="link">
|
|
104
106
|
{t('searchPage.contextModal.button', {
|
|
105
107
|
count: contexts.length - 1,
|
|
106
108
|
})}
|
|
107
109
|
</ModalButton>
|
|
108
110
|
}
|
|
109
111
|
animation="subtle"
|
|
110
|
-
animationDuration={50}
|
|
111
|
-
backgroundColor="white"
|
|
112
|
-
size="medium">
|
|
112
|
+
animationDuration={50}>
|
|
113
113
|
{(onClose: () => void) => (
|
|
114
114
|
<>
|
|
115
115
|
<ModalHeader>
|
|
@@ -130,7 +130,7 @@ const ItemContexts = ({ contexts, id, title }: ItemContextsType) => {
|
|
|
130
130
|
</ModalContent>
|
|
131
131
|
</>
|
|
132
132
|
)}
|
|
133
|
-
</
|
|
133
|
+
</ModalV2>
|
|
134
134
|
)}
|
|
135
135
|
</Breadcrumb>
|
|
136
136
|
);
|