@ndla/ui 22.3.0 → 24.1.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/ArticleAuthorContent.js +2 -4
- package/es/Article/ArticleFavoritesButton.js +2 -2
- package/es/AuthorInfo/AuthorInfo.js +29 -16
- package/es/ContentCard/ContentCard.js +66 -25
- package/es/FileList/File.js +34 -8
- package/es/FileList/FileList.js +29 -3
- package/es/InfoBox/InfoBox.js +10 -3
- package/es/InfoWidget/InfoWidget.js +67 -22
- package/es/MyNdla/Resource/FolderInput.js +19 -6
- package/es/NoContentBox/NoContentBox.js +1 -6
- package/es/Portrait/Portrait.js +19 -13
- package/es/Resource/BlockResource.js +7 -6
- package/es/Resource/ListResource.js +8 -7
- package/es/ResourceBox/ResourceBox.js +7 -35
- package/es/Search/ActiveFilterContent.js +4 -14
- package/es/Search/ActiveFilters.js +8 -19
- package/es/Search/SearchField.js +31 -52
- package/es/Search/SearchResult.js +113 -136
- package/es/Search/ToggleSearchButton.js +34 -43
- package/es/Search/index.js +2 -8
- package/es/TreeStructure/FolderItems.js +3 -3
- package/es/TreeStructure/FolderNameInput.js +32 -14
- package/es/all.css +1 -1
- package/es/index-javascript.js +0 -1
- package/es/index.js +2 -1
- package/es/locale/messages-en.js +3 -3
- package/es/locale/messages-nb.js +3 -3
- package/es/locale/messages-nn.js +3 -3
- package/es/locale/messages-se.js +3 -3
- package/es/locale/messages-sma.js +3 -3
- package/lib/Article/ArticleAuthorContent.js +9 -4
- package/lib/Article/ArticleFavoritesButton.js +2 -2
- package/lib/AuthorInfo/AuthorInfo.d.ts +1 -11
- package/lib/AuthorInfo/AuthorInfo.js +36 -20
- package/lib/ContentCard/ContentCard.d.ts +1 -15
- package/lib/ContentCard/ContentCard.js +60 -28
- package/lib/FileList/File.js +36 -12
- package/lib/FileList/FileList.js +28 -5
- package/lib/InfoBox/InfoBox.js +12 -5
- package/lib/InfoWidget/InfoWidget.js +61 -25
- package/lib/MyNdla/Resource/FolderInput.js +18 -5
- package/lib/NoContentBox/NoContentBox.js +1 -8
- package/lib/Portrait/Portrait.js +19 -14
- package/lib/Resource/BlockResource.js +7 -6
- package/lib/Resource/ListResource.js +8 -7
- package/lib/ResourceBox/ResourceBox.d.ts +1 -4
- package/lib/ResourceBox/ResourceBox.js +15 -35
- package/lib/Search/ActiveFilterContent.d.ts +13 -0
- package/lib/Search/ActiveFilterContent.js +4 -15
- package/lib/Search/ActiveFilters.d.ts +13 -0
- package/lib/Search/ActiveFilters.js +8 -20
- package/lib/Search/SearchField.d.ts +19 -0
- package/lib/Search/SearchField.js +32 -56
- package/lib/Search/SearchResult.d.ts +36 -0
- package/lib/Search/SearchResult.js +116 -159
- package/lib/Search/ToggleSearchButton.d.ts +16 -0
- package/lib/Search/ToggleSearchButton.js +36 -46
- package/lib/Search/index.d.ts +12 -0
- package/lib/Search/index.js +0 -54
- package/lib/SearchTypeResult/SearchTypeHeader.d.ts +1 -1
- package/lib/TreeStructure/FolderItems.js +3 -3
- package/lib/TreeStructure/FolderNameInput.js +34 -14
- package/lib/TreeStructure/types.d.ts +1 -1
- package/lib/all.css +1 -1
- package/lib/index-javascript.js +0 -74
- package/lib/index.d.ts +1 -0
- package/lib/index.js +38 -1
- package/lib/locale/messages-en.js +3 -3
- package/lib/locale/messages-nb.js +3 -3
- package/lib/locale/messages-nn.js +3 -3
- package/lib/locale/messages-se.js +3 -3
- package/lib/locale/messages-sma.js +3 -3
- package/package.json +10 -10
- package/src/Article/ArticleAuthorContent.tsx +1 -1
- package/src/Article/ArticleFavoritesButton.tsx +2 -2
- package/src/AuthorInfo/AuthorInfo.tsx +53 -19
- package/src/ContentCard/ContentCard.tsx +127 -35
- package/src/FileList/File.tsx +47 -17
- package/src/FileList/FileList.tsx +37 -8
- package/src/InfoBox/InfoBox.tsx +24 -4
- package/src/InfoWidget/InfoWidget.tsx +83 -34
- package/src/MyNdla/Resource/FolderInput.tsx +18 -3
- package/src/NoContentBox/NoContentBox.tsx +2 -7
- package/src/Portrait/Portrait.tsx +25 -10
- package/src/Resource/BlockResource.tsx +1 -1
- package/src/Resource/ListResource.tsx +3 -1
- package/src/ResourceBox/ResourceBox.tsx +1 -20
- package/src/Search/{ActiveFilterContent.jsx → ActiveFilterContent.tsx} +11 -12
- package/src/Search/{ActiveFilters.jsx → ActiveFilters.tsx} +20 -17
- package/src/Search/{SearchField.jsx → SearchField.tsx} +58 -68
- package/src/Search/SearchResult.tsx +360 -0
- package/src/Search/ToggleSearchButton.tsx +73 -0
- package/src/Search/component.search.scss +0 -4
- package/src/Search/index.ts +16 -0
- package/src/SectionHeading/SectionHeading.tsx +1 -0
- package/src/TreeStructure/FolderItems.tsx +1 -1
- package/src/TreeStructure/FolderNameInput.tsx +33 -9
- package/src/TreeStructure/types.ts +1 -1
- package/src/all.scss +0 -1
- package/src/index-javascript.js +0 -15
- package/src/index.ts +2 -0
- package/src/locale/messages-en.ts +3 -3
- package/src/locale/messages-nb.ts +3 -3
- package/src/locale/messages-nn.ts +3 -3
- package/src/locale/messages-se.ts +3 -3
- package/src/locale/messages-sma.ts +3 -3
- package/src/main.scss +0 -8
- package/es/BackgroundImage/BackgroundImage.js +0 -27
- package/es/BackgroundImage/index.js +0 -2
- package/es/Search/SearchFilter.js +0 -72
- package/es/Search/SearchFilterList.js +0 -115
- package/es/Search/SearchOverlay.js +0 -39
- package/es/Search/SearchPage.js +0 -178
- package/es/Search/SearchPopoverFilter.js +0 -152
- package/es/Search/SearchResultAuthor.js +0 -51
- package/lib/BackgroundImage/BackgroundImage.d.ts +0 -12
- package/lib/BackgroundImage/BackgroundImage.js +0 -40
- package/lib/BackgroundImage/index.d.ts +0 -2
- package/lib/BackgroundImage/index.js +0 -13
- package/lib/Search/SearchFilter.js +0 -88
- package/lib/Search/SearchFilterList.js +0 -137
- package/lib/Search/SearchOverlay.js +0 -62
- package/lib/Search/SearchPage.js +0 -207
- package/lib/Search/SearchPopoverFilter.js +0 -172
- package/lib/Search/SearchResultAuthor.js +0 -60
- package/src/AuthorInfo/component.author-info.scss +0 -54
- package/src/BackgroundImage/BackgroundImage.tsx +0 -32
- package/src/BackgroundImage/component.background-image.scss +0 -52
- package/src/BackgroundImage/index.ts +0 -3
- package/src/ContentCard/component.content-card.scss +0 -109
- package/src/FileList/component.file-list.scss +0 -102
- package/src/InfoBox/component.info-box.scss +0 -21
- package/src/InfoWidget/component.info-widget.scss +0 -52
- package/src/NoContentBox/component.no-content-box.scss +0 -17
- package/src/Portrait/component.portrait.scss +0 -29
- package/src/Search/SearchFilter.jsx +0 -82
- package/src/Search/SearchFilterList.jsx +0 -110
- package/src/Search/SearchOverlay.jsx +0 -38
- package/src/Search/SearchPage.jsx +0 -178
- package/src/Search/SearchPopoverFilter.jsx +0 -109
- package/src/Search/SearchResult.jsx +0 -239
- package/src/Search/SearchResultAuthor.jsx +0 -54
- package/src/Search/ToggleSearchButton.jsx +0 -64
- package/src/Search/component.search-filter.scss +0 -67
- package/src/Search/component.search-overlay.scss +0 -103
- package/src/Search/component.search-page.scss +0 -125
- package/src/Search/component.search-result-author.scss +0 -65
- package/src/Search/index.js +0 -34
|
@@ -14,6 +14,9 @@ import { spacing, colors, misc, animations } from '@ndla/core';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { isMobile } from 'react-device-detect';
|
|
16
16
|
import { Spinner } from '@ndla/icons';
|
|
17
|
+
import { IconButton } from '@ndla/button';
|
|
18
|
+
import { Cross } from '@ndla/icons/action';
|
|
19
|
+
import { Done } from '@ndla/icons/editor';
|
|
17
20
|
|
|
18
21
|
const ArrowRight = styled(ArrowDropDownRaw)`
|
|
19
22
|
color: ${colors.text.primary};
|
|
@@ -29,15 +32,19 @@ const NewFolderWrapper = styled.div`
|
|
|
29
32
|
}
|
|
30
33
|
`;
|
|
31
34
|
|
|
35
|
+
const Row = styled.div`
|
|
36
|
+
display: flex;
|
|
37
|
+
gap: ${spacing.xxsmall};
|
|
38
|
+
padding-right: ${spacing.xsmall};
|
|
39
|
+
`;
|
|
40
|
+
|
|
32
41
|
const InputWrapper = styled.div<{ loading?: boolean }>`
|
|
33
|
-
margin: ${spacing.xxsmall} ${spacing.small} ${spacing.xxsmall} 0;
|
|
34
42
|
display: flex;
|
|
43
|
+
margin: ${spacing.xxsmall} 0;
|
|
35
44
|
align-items: center;
|
|
36
45
|
border: 1px solid ${({ loading }) => (loading ? colors.brand.lighter : colors.brand.primary)};
|
|
37
46
|
border-style: dashed;
|
|
38
47
|
border-radius: ${misc.borderRadius};
|
|
39
|
-
padding-right: ${spacing.normal};
|
|
40
|
-
padding-left: ${spacing.xsmall};
|
|
41
48
|
color: ${colors.brand.primary};
|
|
42
49
|
`;
|
|
43
50
|
|
|
@@ -45,8 +52,7 @@ const StyledInput = styled.input`
|
|
|
45
52
|
flex-grow: 1;
|
|
46
53
|
border: 0;
|
|
47
54
|
outline: none;
|
|
48
|
-
|
|
49
|
-
padding-left: ${spacing.xsmall};
|
|
55
|
+
min-width: 0;
|
|
50
56
|
background: transparent;
|
|
51
57
|
color: ${colors.text.primary};
|
|
52
58
|
scroll-margin-top: 100px;
|
|
@@ -74,15 +80,16 @@ const FolderNameInput = ({ onSaveNewFolder, parentId, onCancelNewFolder, loading
|
|
|
74
80
|
return (
|
|
75
81
|
<NewFolderWrapper>
|
|
76
82
|
<InputWrapper loading={loading}>
|
|
77
|
-
<
|
|
78
|
-
|
|
83
|
+
<Row>
|
|
84
|
+
<ArrowRight />
|
|
85
|
+
<FolderOutlined />
|
|
86
|
+
</Row>
|
|
79
87
|
<StyledInput
|
|
80
88
|
ref={inputRef}
|
|
81
89
|
autoFocus
|
|
82
90
|
placeholder={t('treeStructure.newFolder.placeholder')}
|
|
83
91
|
disabled={loading}
|
|
84
92
|
value={name}
|
|
85
|
-
onBlur={() => onCancelNewFolder()}
|
|
86
93
|
onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => {
|
|
87
94
|
if (e.key === 'Escape') {
|
|
88
95
|
onCancelNewFolder();
|
|
@@ -93,7 +100,24 @@ const FolderNameInput = ({ onSaveNewFolder, parentId, onCancelNewFolder, loading
|
|
|
93
100
|
}}
|
|
94
101
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setName(e.target.value)}
|
|
95
102
|
/>
|
|
96
|
-
|
|
103
|
+
<Row>
|
|
104
|
+
{!loading ? (
|
|
105
|
+
<>
|
|
106
|
+
<IconButton aria-label={t('close')} size="xsmall" ghostPill onClick={onCancelNewFolder}>
|
|
107
|
+
<Cross />
|
|
108
|
+
</IconButton>
|
|
109
|
+
<IconButton
|
|
110
|
+
aria-label={t('save')}
|
|
111
|
+
size="xsmall"
|
|
112
|
+
ghostPill
|
|
113
|
+
onClick={() => onSaveNewFolder(name, parentId)}>
|
|
114
|
+
<Done />
|
|
115
|
+
</IconButton>
|
|
116
|
+
</>
|
|
117
|
+
) : (
|
|
118
|
+
<Spinner size="small" margin="0" />
|
|
119
|
+
)}
|
|
120
|
+
</Row>
|
|
97
121
|
</InputWrapper>
|
|
98
122
|
</NewFolderWrapper>
|
|
99
123
|
);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { MouseEvent, ReactNode } from 'react';
|
|
10
10
|
import { IFolder, IResource } from '@ndla/types-learningpath-api';
|
|
11
|
-
import { MenuItemProps } from '@ndla/button
|
|
11
|
+
import { MenuItemProps } from '@ndla/button';
|
|
12
12
|
|
|
13
13
|
export interface FolderType extends IFolder {
|
|
14
14
|
icon?: ReactNode;
|
package/src/all.scss
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
@import './main';
|
|
4
4
|
@import '~@ndla/tabs/scss/tabs';
|
|
5
5
|
@import '~@ndla/core/scss/utilities';
|
|
6
|
-
@import '~@ndla/audio-search/scss/audio-search';
|
|
7
6
|
@import '~@ndla/video-search/scss/video-search';
|
|
8
7
|
@import '~@ndla/button/src/all.scss';
|
|
9
8
|
@import '~@ndla/tooltip/src/all.css';
|
package/src/index-javascript.js
CHANGED
|
@@ -8,21 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
export { FilterList, FilterListPhone, FilterButtons } from './Filter';
|
|
10
10
|
|
|
11
|
-
export {
|
|
12
|
-
SearchOverlay,
|
|
13
|
-
SearchField,
|
|
14
|
-
SearchPage,
|
|
15
|
-
SearchResult,
|
|
16
|
-
SearchResultAuthor,
|
|
17
|
-
SearchResultList,
|
|
18
|
-
SearchResultItem,
|
|
19
|
-
SearchFilter,
|
|
20
|
-
SearchFilterList,
|
|
21
|
-
SearchPopoverFilter,
|
|
22
|
-
ActiveFilters,
|
|
23
|
-
ToggleSearchButton,
|
|
24
|
-
} from './Search';
|
|
25
|
-
|
|
26
11
|
export { default as TopicIntroductionList } from './TopicIntroductionList';
|
|
27
12
|
export { default as TopicMenu, TopicMenuButton } from './TopicMenu';
|
|
28
13
|
export {
|
package/src/index.ts
CHANGED
|
@@ -245,3 +245,5 @@ export type { Snack, SnackContext } from './SnackBar';
|
|
|
245
245
|
export { InfoBlock } from './InfoBlock';
|
|
246
246
|
export { TreeStructure } from './TreeStructure';
|
|
247
247
|
export type { FolderType, TreeStructureProps, TreeStructureMenuProps } from './TreeStructure';
|
|
248
|
+
|
|
249
|
+
export { SearchField, SearchResultList, SearchResultItem, ActiveFilters, ToggleSearchButton } from './Search';
|
|
@@ -1023,7 +1023,7 @@ const messages = {
|
|
|
1023
1023
|
more: 'More options',
|
|
1024
1024
|
listView: 'List view',
|
|
1025
1025
|
detailView: 'Detailed listview',
|
|
1026
|
-
shortView: '
|
|
1026
|
+
shortView: 'Card view',
|
|
1027
1027
|
myPage: {
|
|
1028
1028
|
confirmDeleteAccount: 'Are you sure you want to delete your account?',
|
|
1029
1029
|
confirmDeleteAccountButton: 'Delete account',
|
|
@@ -1050,7 +1050,7 @@ const messages = {
|
|
|
1050
1050
|
|
|
1051
1051
|
storageInfo: {
|
|
1052
1052
|
title: 'How to save your favourite resources from NDLA',
|
|
1053
|
-
text: 'When you wish to save a resource, you can do so by clicking the heart
|
|
1053
|
+
text: 'When you wish to save a resource, you can do so by clicking the heart button. You will then get an option to store the resource in a folder',
|
|
1054
1054
|
},
|
|
1055
1055
|
folderInfo: {
|
|
1056
1056
|
title: 'How to organise your favourite resources in folders',
|
|
@@ -1070,7 +1070,7 @@ const messages = {
|
|
|
1070
1070
|
linkCopied: 'Copied to clipboard',
|
|
1071
1071
|
addToMyNdla: 'Add to My NDLA',
|
|
1072
1072
|
addedToMyNdla: 'Added to My NDLA',
|
|
1073
|
-
addedToFolder: 'Resource added to
|
|
1073
|
+
addedToFolder: 'Resource added to ',
|
|
1074
1074
|
removedFromFolder: 'Removed from "{{folderName}}"',
|
|
1075
1075
|
titleUpdated: 'Title updated',
|
|
1076
1076
|
tagsUpdated: 'Tags updated',
|
|
@@ -1021,7 +1021,7 @@ const messages = {
|
|
|
1021
1021
|
more: 'Flere valg',
|
|
1022
1022
|
listView: 'Listevisning',
|
|
1023
1023
|
detailView: 'Detaljrik listevisning',
|
|
1024
|
-
shortView: '
|
|
1024
|
+
shortView: 'Kortvisning',
|
|
1025
1025
|
myPage: {
|
|
1026
1026
|
confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
|
|
1027
1027
|
confirmDeleteAccountButton: 'Slett konto',
|
|
@@ -1048,7 +1048,7 @@ const messages = {
|
|
|
1048
1048
|
feide: 'Dette henter vi om deg fra Feide',
|
|
1049
1049
|
storageInfo: {
|
|
1050
1050
|
title: 'Slik lagrer du dine favorittressurser fra NDLA',
|
|
1051
|
-
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på
|
|
1051
|
+
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på hjerteknappen der den er tilgjengelig. Du vil da få mulighet til å lagre ressursen i en mappe.',
|
|
1052
1052
|
},
|
|
1053
1053
|
folderInfo: {
|
|
1054
1054
|
title: 'Slik organiserer du dine favorittressurser i mapper',
|
|
@@ -1068,7 +1068,7 @@ const messages = {
|
|
|
1068
1068
|
linkCopied: 'Kopiert til utklippstavle',
|
|
1069
1069
|
addToMyNdla: 'Legg i Min NDLA',
|
|
1070
1070
|
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1071
|
-
addedToFolder: 'Ressurs er lagt i
|
|
1071
|
+
addedToFolder: 'Ressurs er lagt i ',
|
|
1072
1072
|
removedFromFolder: 'Fjernet fra "{{folderName}}"',
|
|
1073
1073
|
titleUpdated: 'Tittel oppdatert',
|
|
1074
1074
|
tagsUpdated: 'Tags oppdatert',
|
|
@@ -1022,7 +1022,7 @@ const messages = {
|
|
|
1022
1022
|
more: 'Fleire val',
|
|
1023
1023
|
listView: 'Listevisning',
|
|
1024
1024
|
detailView: 'Detaljrik listevisning',
|
|
1025
|
-
shortView: '
|
|
1025
|
+
shortView: 'Kortvisning',
|
|
1026
1026
|
myPage: {
|
|
1027
1027
|
confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
|
|
1028
1028
|
confirmDeleteAccountButton: 'Slett konto',
|
|
@@ -1048,7 +1048,7 @@ const messages = {
|
|
|
1048
1048
|
feide: 'Dette henter vi om deg fra Feide',
|
|
1049
1049
|
storageInfo: {
|
|
1050
1050
|
title: 'Slik lagrer du dine favorittressurser fra NDLA',
|
|
1051
|
-
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på
|
|
1051
|
+
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på hjerteknappen der den er tilgjengeleg. Du vil da få mulighet til å lagre ressursen i en mappe.',
|
|
1052
1052
|
},
|
|
1053
1053
|
folderInfo: {
|
|
1054
1054
|
title: 'Slik organiserer du dine favorittressurser i mapper',
|
|
@@ -1068,7 +1068,7 @@ const messages = {
|
|
|
1068
1068
|
linkCopied: 'Kopiert til utklippstavla',
|
|
1069
1069
|
addToMyNdla: 'Legg i Min NDLA',
|
|
1070
1070
|
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1071
|
-
addedToFolder: 'Ressurs er lagt i
|
|
1071
|
+
addedToFolder: 'Ressurs er lagt i ',
|
|
1072
1072
|
removedFromFolder: 'Fjernet fra "{{folderName}}"',
|
|
1073
1073
|
titleUpdated: 'Tittel oppdatert',
|
|
1074
1074
|
tagsUpdated: 'Tags oppdatert',
|
|
@@ -1021,7 +1021,7 @@ const messages = {
|
|
|
1021
1021
|
more: 'Flere valg',
|
|
1022
1022
|
listView: 'Listevisning',
|
|
1023
1023
|
detailView: 'Detaljrik listevisning',
|
|
1024
|
-
shortView: '
|
|
1024
|
+
shortView: 'Kortvisning',
|
|
1025
1025
|
myPage: {
|
|
1026
1026
|
confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
|
|
1027
1027
|
confirmDeleteAccountButton: 'Slett konto',
|
|
@@ -1048,7 +1048,7 @@ const messages = {
|
|
|
1048
1048
|
feide: 'Dette henter vi om deg fra Feide',
|
|
1049
1049
|
storageInfo: {
|
|
1050
1050
|
title: 'Slik lagrer du dine favorittressurser fra NDLA',
|
|
1051
|
-
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på
|
|
1051
|
+
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på hjerteknappen der den er tilgjengeleg. Du vil da få mulighet til å lagre ressursen i en mappe.',
|
|
1052
1052
|
},
|
|
1053
1053
|
folderInfo: {
|
|
1054
1054
|
title: 'Slik organiserer du dine favorittressurser i mapper',
|
|
@@ -1068,7 +1068,7 @@ const messages = {
|
|
|
1068
1068
|
linkCopied: 'Kopiert til utklippstavla',
|
|
1069
1069
|
addToMyNdla: 'Legg i Min NDLA',
|
|
1070
1070
|
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1071
|
-
addedToFolder: 'Ressurs er lagt i
|
|
1071
|
+
addedToFolder: 'Ressurs er lagt i ',
|
|
1072
1072
|
removedFromFolder: 'Fjernet fra "{{folderName}}"',
|
|
1073
1073
|
titleUpdated: 'Tittel oppdatert',
|
|
1074
1074
|
tagsUpdated: 'Tags oppdatert',
|
|
@@ -1021,7 +1021,7 @@ const messages = {
|
|
|
1021
1021
|
more: 'Flere valg',
|
|
1022
1022
|
listView: 'Listevisning',
|
|
1023
1023
|
detailView: 'Detaljrik listevisning',
|
|
1024
|
-
shortView: '
|
|
1024
|
+
shortView: 'Kortvisning',
|
|
1025
1025
|
myPage: {
|
|
1026
1026
|
confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
|
|
1027
1027
|
confirmDeleteAccountButton: 'Slett konto',
|
|
@@ -1048,7 +1048,7 @@ const messages = {
|
|
|
1048
1048
|
feide: 'Dette henter vi om deg fra Feide',
|
|
1049
1049
|
storageInfo: {
|
|
1050
1050
|
title: 'Slik lagrer du dine favorittressurser fra NDLA',
|
|
1051
|
-
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på
|
|
1051
|
+
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på hjerteknappen der den er tilgjengeleg. Du vil da få mulighet til å lagre ressursen i en mappe.',
|
|
1052
1052
|
},
|
|
1053
1053
|
folderInfo: {
|
|
1054
1054
|
title: 'Slik organiserer du dine favorittressurser i mapper',
|
|
@@ -1068,7 +1068,7 @@ const messages = {
|
|
|
1068
1068
|
linkCopied: 'Kopiert til utklippstavla',
|
|
1069
1069
|
addToMyNdla: 'Legg i Min NDLA',
|
|
1070
1070
|
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1071
|
-
addedToFolder: 'Ressurs er lagt i
|
|
1071
|
+
addedToFolder: 'Ressurs er lagt i ',
|
|
1072
1072
|
removedFromFolder: 'Fjernet fra "{{folderName}}"',
|
|
1073
1073
|
titleUpdated: 'Tittel oppdatert',
|
|
1074
1074
|
tagsUpdated: 'Tags oppdatert',
|
package/src/main.scss
CHANGED
|
@@ -15,9 +15,6 @@
|
|
|
15
15
|
@import 'FactBox/component.factbox';
|
|
16
16
|
@import 'Aside/component.aside';
|
|
17
17
|
@import 'Article/component.footnotes';
|
|
18
|
-
@import 'NoContentBox/component.no-content-box.scss';
|
|
19
|
-
@import 'BackgroundImage/component.background-image';
|
|
20
|
-
@import 'Portrait/component.portrait.scss';
|
|
21
18
|
@import 'global/components/component.logo';
|
|
22
19
|
@import 'MediaList/component.medialist';
|
|
23
20
|
@import 'RelatedArticleList/component.related-articles';
|
|
@@ -32,12 +29,7 @@
|
|
|
32
29
|
@import 'Translation/component.translation-box';
|
|
33
30
|
@import 'Search/component.search';
|
|
34
31
|
@import 'Subject/component.subject';
|
|
35
|
-
@import 'InfoBox/component.info-box';
|
|
36
32
|
@import 'CompetenceGoals/component.competence-goals';
|
|
37
|
-
@import 'ContentCard/component.content-card';
|
|
38
|
-
@import 'InfoWidget/component.info-widget';
|
|
39
33
|
@import 'Carousel/component.carousel';
|
|
40
|
-
@import 'FileList/component.file-list';
|
|
41
34
|
@import 'SectionHeading/component.section-heading';
|
|
42
|
-
@import 'AuthorInfo/component.author-info';
|
|
43
35
|
@import 'NDLAFilm/component.film-movielist';
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import BEMHelper from 'react-bem-helper';
|
|
5
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
6
|
-
var classes = BEMHelper('c-background-image');
|
|
7
|
-
|
|
8
|
-
var BackgroundImage = function BackgroundImage(_ref) {
|
|
9
|
-
var images = _ref.images,
|
|
10
|
-
_ref$showOverlay = _ref.showOverlay,
|
|
11
|
-
showOverlay = _ref$showOverlay === void 0 ? false : _ref$showOverlay;
|
|
12
|
-
return ___EmotionJSX("div", classes('', {
|
|
13
|
-
showOverlay: showOverlay
|
|
14
|
-
}), images && images.map(function (image) {
|
|
15
|
-
return image.types.map(function (type) {
|
|
16
|
-
return ___EmotionJSX("div", _extends({
|
|
17
|
-
key: "".concat(image.url).concat(type)
|
|
18
|
-
}, classes('background', type), {
|
|
19
|
-
style: {
|
|
20
|
-
backgroundImage: "url(".concat(image.url, ")")
|
|
21
|
-
}
|
|
22
|
-
}));
|
|
23
|
-
});
|
|
24
|
-
}));
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default BackgroundImage;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import BEMHelper from 'react-bem-helper';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { FilterList } from '../Filter';
|
|
5
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
6
|
-
var searchFilterClasses = BEMHelper({
|
|
7
|
-
prefix: 'c-',
|
|
8
|
-
name: 'search-filter',
|
|
9
|
-
outputIsString: true
|
|
10
|
-
});
|
|
11
|
-
var valueShape = PropTypes.oneOfType([PropTypes.string, PropTypes.number]);
|
|
12
|
-
|
|
13
|
-
var SearchFilter = function SearchFilter(_ref) {
|
|
14
|
-
var label = _ref.label,
|
|
15
|
-
options = _ref.options,
|
|
16
|
-
values = _ref.values,
|
|
17
|
-
defaultVisibleCount = _ref.defaultVisibleCount,
|
|
18
|
-
showLabel = _ref.showLabel,
|
|
19
|
-
hideLabel = _ref.hideLabel,
|
|
20
|
-
narrowScreenOnly = _ref.narrowScreenOnly,
|
|
21
|
-
contextFilter = _ref.contextFilter,
|
|
22
|
-
onChange = _ref.onChange,
|
|
23
|
-
noFilterSelectedLabel = _ref.noFilterSelectedLabel,
|
|
24
|
-
children = _ref.children;
|
|
25
|
-
var modifiers = [];
|
|
26
|
-
|
|
27
|
-
if (narrowScreenOnly) {
|
|
28
|
-
modifiers.push('narrow-screen-only');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (contextFilter) {
|
|
32
|
-
modifiers.push('context-filter');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return ___EmotionJSX("div", {
|
|
36
|
-
className: searchFilterClasses('', modifiers)
|
|
37
|
-
}, ___EmotionJSX(FilterList, {
|
|
38
|
-
options: options,
|
|
39
|
-
label: label,
|
|
40
|
-
labelNotVisible: contextFilter,
|
|
41
|
-
values: values,
|
|
42
|
-
defaultVisibleCount: defaultVisibleCount,
|
|
43
|
-
modifiers: !contextFilter ? 'search' : null,
|
|
44
|
-
showLabel: showLabel,
|
|
45
|
-
hideLabel: hideLabel,
|
|
46
|
-
onChange: onChange,
|
|
47
|
-
alignedGroup: true,
|
|
48
|
-
noFilterSelectedLabel: noFilterSelectedLabel
|
|
49
|
-
}), children);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
SearchFilter.propTypes = {
|
|
53
|
-
label: PropTypes.string.isRequired,
|
|
54
|
-
options: PropTypes.arrayOf(PropTypes.shape({
|
|
55
|
-
value: valueShape.isRequired,
|
|
56
|
-
title: PropTypes.string.isRequired,
|
|
57
|
-
noResults: PropTypes.bool
|
|
58
|
-
})).isRequired,
|
|
59
|
-
values: PropTypes.arrayOf(valueShape),
|
|
60
|
-
defaultVisibleCount: PropTypes.number,
|
|
61
|
-
onChange: PropTypes.func,
|
|
62
|
-
showLabel: PropTypes.string,
|
|
63
|
-
hideLabel: PropTypes.string,
|
|
64
|
-
narrowScreenOnly: PropTypes.bool,
|
|
65
|
-
noFilterSelectedLabel: PropTypes.string,
|
|
66
|
-
contextFilter: PropTypes.bool,
|
|
67
|
-
children: PropTypes.node
|
|
68
|
-
};
|
|
69
|
-
SearchFilter.defaultProps = {
|
|
70
|
-
values: []
|
|
71
|
-
};
|
|
72
|
-
export default SearchFilter;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
var _this = this;
|
|
2
|
-
|
|
3
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
-
|
|
5
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
|
|
9
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
10
|
-
|
|
11
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
-
|
|
13
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
|
-
|
|
15
|
-
import React, { Fragment } from 'react';
|
|
16
|
-
import BEMHelper from 'react-bem-helper';
|
|
17
|
-
import PropTypes from 'prop-types';
|
|
18
|
-
import { FilterList, ToggleItem } from '../Filter';
|
|
19
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
20
|
-
var searchFilterClasses = BEMHelper({
|
|
21
|
-
prefix: 'c-',
|
|
22
|
-
name: 'search-filter',
|
|
23
|
-
outputIsString: true
|
|
24
|
-
});
|
|
25
|
-
var valueShape = PropTypes.oneOfType([PropTypes.string, PropTypes.number]);
|
|
26
|
-
|
|
27
|
-
var SearchFilterList = function SearchFilterList(_ref) {
|
|
28
|
-
var label = _ref.label,
|
|
29
|
-
options = _ref.options,
|
|
30
|
-
values = _ref.values,
|
|
31
|
-
narrowScreenOnly = _ref.narrowScreenOnly,
|
|
32
|
-
_onChange = _ref.onChange,
|
|
33
|
-
onSubfilterChange = _ref.onSubfilterChange,
|
|
34
|
-
preid = _ref.preid,
|
|
35
|
-
noFilterSelectedLabel = _ref.noFilterSelectedLabel,
|
|
36
|
-
subjectValues = _ref.subjectValues,
|
|
37
|
-
children = _ref.children;
|
|
38
|
-
return ___EmotionJSX("div", {
|
|
39
|
-
className: searchFilterClasses('')
|
|
40
|
-
}, ___EmotionJSX("div", null, options.map(function (option, index) {
|
|
41
|
-
var itemModifiers = [];
|
|
42
|
-
var checked = values.some(function (value) {
|
|
43
|
-
return value === option.value;
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
if (!checked && index + 1 > _this.state.visibleCount) {
|
|
47
|
-
itemModifiers.push('hidden');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
var disabled = option.noResults || option.hits === 0;
|
|
51
|
-
|
|
52
|
-
if (disabled) {
|
|
53
|
-
itemModifiers.push('no-results');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return ___EmotionJSX(Fragment, {
|
|
57
|
-
key: option.value
|
|
58
|
-
}, ___EmotionJSX(ToggleItem, {
|
|
59
|
-
modifiers: itemModifiers,
|
|
60
|
-
id: preid + option.value,
|
|
61
|
-
value: option.value,
|
|
62
|
-
disabled: disabled,
|
|
63
|
-
tabIndex: disabled ? -1 : 0,
|
|
64
|
-
checked: checked,
|
|
65
|
-
icon: option.icon,
|
|
66
|
-
label: option.title,
|
|
67
|
-
component: "div",
|
|
68
|
-
onChange: function onChange(event) {
|
|
69
|
-
var newValues = null;
|
|
70
|
-
|
|
71
|
-
if (event.currentTarget.checked) {
|
|
72
|
-
newValues = [].concat(_toConsumableArray(values), [option.value]);
|
|
73
|
-
} else {
|
|
74
|
-
newValues = values.filter(function (value) {
|
|
75
|
-
return value !== option.value;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (_onChange) {
|
|
80
|
-
_onChange(newValues, option.value);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}), ___EmotionJSX("div", {
|
|
84
|
-
className: searchFilterClasses()
|
|
85
|
-
}, ___EmotionJSX(FilterList, {
|
|
86
|
-
options: option.subjectFilters,
|
|
87
|
-
label: label,
|
|
88
|
-
labelNotVisible: true,
|
|
89
|
-
values: subjectValues[option.value],
|
|
90
|
-
onChange: function onChange(subjectFilters, subjectFilter) {
|
|
91
|
-
return onSubfilterChange(option.value, subjectFilters, subjectFilter);
|
|
92
|
-
},
|
|
93
|
-
alignedGroup: true,
|
|
94
|
-
noFilterSelectedLabel: noFilterSelectedLabel
|
|
95
|
-
})));
|
|
96
|
-
})), children);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
SearchFilterList.propTypes = {
|
|
100
|
-
label: PropTypes.string.isRequired,
|
|
101
|
-
options: PropTypes.arrayOf(PropTypes.shape({
|
|
102
|
-
value: valueShape.isRequired,
|
|
103
|
-
title: PropTypes.string.isRequired,
|
|
104
|
-
noResults: PropTypes.bool
|
|
105
|
-
})).isRequired,
|
|
106
|
-
values: PropTypes.arrayOf(valueShape),
|
|
107
|
-
onChange: PropTypes.func,
|
|
108
|
-
onSubfilterChange: PropTypes.func,
|
|
109
|
-
noFilterSelectedLabel: PropTypes.string,
|
|
110
|
-
children: PropTypes.node
|
|
111
|
-
};
|
|
112
|
-
SearchFilterList.defaultProps = {
|
|
113
|
-
values: []
|
|
114
|
-
};
|
|
115
|
-
export default SearchFilterList;
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
|
|
3
|
-
import React, { Fragment } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import BEMHelper from 'react-bem-helper';
|
|
6
|
-
import { Cross } from '@ndla/icons/action';
|
|
7
|
-
import { CSSTransition } from 'react-transition-group';
|
|
8
|
-
import Fade from '../Animation/Fade';
|
|
9
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
10
|
-
var classes = BEMHelper({
|
|
11
|
-
prefix: 'c-',
|
|
12
|
-
name: 'search-overlay'
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
var SearchOverlay = function SearchOverlay(_ref) {
|
|
16
|
-
var close = _ref.close,
|
|
17
|
-
isOpen = _ref.isOpen,
|
|
18
|
-
children = _ref.children;
|
|
19
|
-
return ___EmotionJSX(Fragment, null, ___EmotionJSX(Fade, {
|
|
20
|
-
"in": isOpen
|
|
21
|
-
}, ___EmotionJSX("div", {
|
|
22
|
-
className: "o-backdrop"
|
|
23
|
-
})), ___EmotionJSX(CSSTransition, {
|
|
24
|
-
timeout: 300,
|
|
25
|
-
classNames: classes().className,
|
|
26
|
-
unmountOnExit: true,
|
|
27
|
-
"in": isOpen
|
|
28
|
-
}, ___EmotionJSX("div", classes(), ___EmotionJSX("div", classes('container o-wrapper'), children, ___EmotionJSX("button", _extends({}, classes('close-button'), {
|
|
29
|
-
type: "button",
|
|
30
|
-
onClick: close
|
|
31
|
-
}), ___EmotionJSX(Cross, null))))));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
SearchOverlay.propTypes = {
|
|
35
|
-
isOpen: PropTypes.bool.isRequired,
|
|
36
|
-
close: PropTypes.func,
|
|
37
|
-
children: PropTypes.node.isRequired
|
|
38
|
-
};
|
|
39
|
-
export default SearchOverlay;
|