@ndla/ui 23.0.0 → 24.1.1
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/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/TagSelector/SuggestionInput.js +9 -19
- package/es/TreeStructure/FolderItems.js +3 -3
- package/es/TreeStructure/FolderNameInput.js +33 -14
- package/es/TreeStructure/TreeStructure.js +3 -2
- 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 +11 -5
- package/es/locale/messages-nb.js +9 -3
- package/es/locale/messages-nn.js +11 -5
- package/es/locale/messages-se.js +29 -23
- package/es/locale/messages-sma.js +43 -37
- 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/MediaList/MediaList.d.ts +1 -1
- 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/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/TagSelector/SuggestionInput.js +9 -19
- package/lib/TreeStructure/FolderItems.js +3 -3
- package/lib/TreeStructure/FolderNameInput.js +35 -14
- package/lib/TreeStructure/TreeStructure.js +3 -2
- 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.d.ts +7 -1
- package/lib/locale/messages-en.js +11 -5
- package/lib/locale/messages-nb.d.ts +6 -0
- package/lib/locale/messages-nb.js +9 -3
- package/lib/locale/messages-nn.d.ts +7 -1
- package/lib/locale/messages-nn.js +11 -5
- package/lib/locale/messages-se.d.ts +7 -1
- package/lib/locale/messages-se.js +29 -23
- package/lib/locale/messages-sma.d.ts +12 -6
- package/lib/locale/messages-sma.js +43 -37
- 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/MediaList/MediaList.tsx +1 -1
- 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/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/TagSelector/SuggestionInput.tsx +0 -9
- package/src/TreeStructure/FolderItems.tsx +1 -1
- package/src/TreeStructure/FolderNameInput.tsx +34 -9
- package/src/TreeStructure/TreeStructure.tsx +1 -0
- 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 +10 -4
- package/src/locale/messages-nb.ts +9 -3
- package/src/locale/messages-nn.ts +10 -4
- package/src/locale/messages-se.ts +29 -23
- package/src/locale/messages-sma.ts +41 -35
- package/src/main.scss +0 -7
- 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/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/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
|
@@ -424,11 +424,12 @@ var messages = _objectSpread(_objectSpread({
|
|
|
424
424
|
files: 'Filer',
|
|
425
425
|
embedlink: 'Innbyggingslenke',
|
|
426
426
|
concept: 'Forklaringer',
|
|
427
|
+
podcast: 'Podkast',
|
|
427
428
|
other: 'Annet innhold'
|
|
428
429
|
},
|
|
429
430
|
embedlink: {
|
|
430
431
|
heading: 'Slik viser du artikkelen i annet innhold',
|
|
431
|
-
description: 'Denne lenken viser artikkelen uten kontekst(meny og bunntekst)',
|
|
432
|
+
description: 'Denne lenken viser artikkelen uten kontekst (meny og bunntekst)',
|
|
432
433
|
copyTitle: 'Kopier lenke',
|
|
433
434
|
hasCopiedTitle: 'Lenke kopiert'
|
|
434
435
|
},
|
|
@@ -460,6 +461,11 @@ var messages = _objectSpread(_objectSpread({
|
|
|
460
461
|
description: 'Husk å kopiere teksten som skal legges ved lydfilen der du bruker den.',
|
|
461
462
|
rules: 'Regler for bruk av lydfilen:'
|
|
462
463
|
},
|
|
464
|
+
podcast: {
|
|
465
|
+
heading: 'Slik gjenbruker du podkaster',
|
|
466
|
+
description: 'Husk å kopiere teksten som skal legges ved podkasten der du bruker den.',
|
|
467
|
+
rules: 'Regler for bruk av podkasten:'
|
|
468
|
+
},
|
|
463
469
|
video: {
|
|
464
470
|
heading: 'Slik gjenbruker du videoer',
|
|
465
471
|
description: 'Husk å kopiere teksten som skal legges ved videoen der du bruker den.',
|
|
@@ -481,16 +487,16 @@ var messages = _objectSpread(_objectSpread({
|
|
|
481
487
|
rules: 'Regler for bruk av H5P:'
|
|
482
488
|
},
|
|
483
489
|
concept: {
|
|
484
|
-
embedlink: {
|
|
485
|
-
heading: 'Slik viser du forklaringa i anna innhald',
|
|
486
|
-
description: 'Denne lenka viser forklaringa utan kontekst (meny og botntekst)',
|
|
487
|
-
copyTitle: 'Kopier innbyggingslenke',
|
|
488
|
-
hasCopiedTitle: 'Innbyggingslenke kopiert'
|
|
489
|
-
},
|
|
490
490
|
heading: 'Slik gjenbruker du forklaringer',
|
|
491
491
|
description: 'Du finner retningslinjene for bruk av innholdet i forklaring-elementet',
|
|
492
492
|
rules: 'Regler for bruk av forklaring:',
|
|
493
|
-
title: 'Tittel'
|
|
493
|
+
title: 'Tittel',
|
|
494
|
+
embedlink: {
|
|
495
|
+
heading: 'Slik viser du forklaringen i annet innhold',
|
|
496
|
+
description: 'Denne lenken viser forklaringen uten kontekst (meny og bunntekst)',
|
|
497
|
+
copyTitle: 'Kopier innbyggingslenke',
|
|
498
|
+
hasCopiedTitle: 'Innbyggingslenke kopiert'
|
|
499
|
+
}
|
|
494
500
|
},
|
|
495
501
|
files: {
|
|
496
502
|
heading: 'Slik gjenbruker du filer',
|
|
@@ -501,10 +507,10 @@ var messages = _objectSpread(_objectSpread({
|
|
|
501
507
|
}
|
|
502
508
|
},
|
|
503
509
|
title: 'Tittel',
|
|
504
|
-
originator: '
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
510
|
+
originator: 'Opphaver',
|
|
511
|
+
published: 'Publiseringsdato',
|
|
512
|
+
rightsholder: 'Rettighetshaver',
|
|
513
|
+
source: 'Kilde'
|
|
508
514
|
},
|
|
509
515
|
errorMessage: {
|
|
510
516
|
title: 'Ops, noe gikk galt',
|
|
@@ -773,12 +779,12 @@ var messages = _objectSpread(_objectSpread({
|
|
|
773
779
|
content: 'Ressursen',
|
|
774
780
|
text: 'er hentet fra',
|
|
775
781
|
concept: {
|
|
776
|
-
content: '
|
|
777
|
-
text: 'er
|
|
782
|
+
content: 'Forklaringen',
|
|
783
|
+
text: 'er utarbeidet av'
|
|
778
784
|
},
|
|
779
785
|
listing: {
|
|
780
|
-
content: '
|
|
781
|
-
text: 'er
|
|
786
|
+
content: 'Listen',
|
|
787
|
+
text: 'er utarbeidet av'
|
|
782
788
|
}
|
|
783
789
|
},
|
|
784
790
|
fagfornyelse: {
|
|
@@ -829,24 +835,24 @@ var messages = _objectSpread(_objectSpread({
|
|
|
829
835
|
open: 'Åpne meny',
|
|
830
836
|
close: 'Lukk meny'
|
|
831
837
|
},
|
|
832
|
-
cancel: 'Avbryt',
|
|
833
838
|
close: 'Lukk',
|
|
834
839
|
title: 'Tittel',
|
|
840
|
+
cancel: 'Avbryt',
|
|
835
841
|
save: 'Lagre',
|
|
836
842
|
image: {
|
|
837
843
|
altText: 'Alt-tekst',
|
|
838
|
-
caption: '
|
|
844
|
+
caption: 'Bildetekst',
|
|
839
845
|
type: 'Filtype',
|
|
840
|
-
width: '
|
|
841
|
-
height: '
|
|
846
|
+
width: 'Bredde',
|
|
847
|
+
height: 'Høyde',
|
|
842
848
|
size: 'Størrelse (bytes)',
|
|
843
849
|
modelReleased: {
|
|
844
850
|
label: 'Modellklarert',
|
|
845
851
|
yes: 'Ja',
|
|
846
852
|
no: 'Nei',
|
|
847
|
-
'not-applicable': '
|
|
848
|
-
'not-set': '
|
|
849
|
-
description: 'Om bildet er modellklarert eller
|
|
853
|
+
'not-applicable': 'Ikke relevant',
|
|
854
|
+
'not-set': 'Ikke valgt',
|
|
855
|
+
description: 'Om bildet er modellklarert eller ikke:'
|
|
850
856
|
},
|
|
851
857
|
download: 'Last ned bildet',
|
|
852
858
|
reuse: 'Bruk bildet',
|
|
@@ -936,10 +942,10 @@ var messages = _objectSpread(_objectSpread({
|
|
|
936
942
|
resource: {
|
|
937
943
|
accessDenied: 'Vi beklager, men denne ressursen er bare for lærere innlogget med Feide.'
|
|
938
944
|
},
|
|
939
|
-
primarySchool: '
|
|
940
|
-
name: '
|
|
945
|
+
primarySchool: 'Hovedskole',
|
|
946
|
+
name: 'Navn',
|
|
941
947
|
mail: 'E-post',
|
|
942
|
-
username: '
|
|
948
|
+
username: 'Brukernavn',
|
|
943
949
|
groupTypes: {
|
|
944
950
|
basic: 'Basisgruppe',
|
|
945
951
|
teaching: 'Undervisningsgruppe',
|
|
@@ -966,7 +972,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
966
972
|
"delete": 'Slett',
|
|
967
973
|
edit: 'Rediger',
|
|
968
974
|
missingName: 'Mappenavn er påkrevd',
|
|
969
|
-
folderDeleted: '"{{folderName}}" er
|
|
975
|
+
folderDeleted: '"{{folderName}}" er slettet'
|
|
970
976
|
},
|
|
971
977
|
tags: '{{count}} tag',
|
|
972
978
|
tags_plural: '{{count}} tags',
|
|
@@ -985,15 +991,15 @@ var messages = _objectSpread(_objectSpread({
|
|
|
985
991
|
more: 'Flere valg',
|
|
986
992
|
listView: 'Listevisning',
|
|
987
993
|
detailView: 'Detaljrik listevisning',
|
|
988
|
-
shortView: '
|
|
994
|
+
shortView: 'Kortvisning',
|
|
989
995
|
myPage: {
|
|
990
996
|
confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
|
|
991
997
|
confirmDeleteAccountButton: 'Slett konto',
|
|
992
998
|
myPage: 'Min side',
|
|
993
999
|
deleteAccount: 'Slett Min NDLA',
|
|
994
1000
|
logout: 'Logg ut av Min NDLA',
|
|
995
|
-
loginTerms: 'Logg på med Feide for å få tilgang. Ved å logge på
|
|
996
|
-
loginResourcePitch: 'Ønsker du å favorittmerke denne
|
|
1001
|
+
loginTerms: 'Logg på med Feide for å få tilgang. Ved å logge på godkjenner du våre vilkår for bruk',
|
|
1002
|
+
loginResourcePitch: 'Ønsker du å favorittmerke denne siden?',
|
|
997
1003
|
loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på <i>din</i> måte!',
|
|
998
1004
|
welcome: 'Velkommen til Min NDLA! Nå kan du lagre dine favorittressurser fra NDLA og organisere dem slik du ønsker i mapper og med tags.',
|
|
999
1005
|
read: {
|
|
@@ -1016,7 +1022,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1016
1022
|
feide: 'Dette henter vi om deg fra Feide',
|
|
1017
1023
|
storageInfo: {
|
|
1018
1024
|
title: 'Slik lagrer du dine favorittressurser fra NDLA',
|
|
1019
|
-
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på
|
|
1025
|
+
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.'
|
|
1020
1026
|
},
|
|
1021
1027
|
folderInfo: {
|
|
1022
1028
|
title: 'Slik organiserer du dine favorittressurser i mapper',
|
|
@@ -1031,12 +1037,12 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1031
1037
|
add: 'Legg til mappe/tag',
|
|
1032
1038
|
remove: 'Fjern',
|
|
1033
1039
|
removeTitle: 'Fjern ressurs',
|
|
1034
|
-
confirmRemove: 'Er du sikker på at du ønsker å fjerne ressursen
|
|
1040
|
+
confirmRemove: 'Er du sikker på at du ønsker å fjerne ressursen fra denne mappen?',
|
|
1035
1041
|
copyLink: 'Kopier lenke til siden',
|
|
1036
|
-
linkCopied: 'Kopiert til
|
|
1042
|
+
linkCopied: 'Kopiert til utklippstavle',
|
|
1037
1043
|
addToMyNdla: 'Legg i Min NDLA',
|
|
1038
1044
|
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1039
|
-
addedToFolder: 'Ressurs er lagt i
|
|
1045
|
+
addedToFolder: 'Ressurs er lagt i ',
|
|
1040
1046
|
removedFromFolder: 'Fjernet fra "{{folderName}}"',
|
|
1041
1047
|
titleUpdated: 'Tittel oppdatert',
|
|
1042
1048
|
tagsUpdated: 'Tags oppdatert',
|
|
@@ -1049,12 +1055,12 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1049
1055
|
labels: {
|
|
1050
1056
|
category: 'Kategori',
|
|
1051
1057
|
subject: 'Fag',
|
|
1052
|
-
other: '
|
|
1058
|
+
other: 'Annet'
|
|
1053
1059
|
},
|
|
1054
1060
|
listingPage: {
|
|
1055
1061
|
or: 'eller',
|
|
1056
|
-
noFilters: 'Har
|
|
1057
|
-
loadMore: 'Last
|
|
1062
|
+
noFilters: 'Har ingenting å filtrere',
|
|
1063
|
+
loadMore: 'Last mer'
|
|
1058
1064
|
},
|
|
1059
1065
|
siteNav: {
|
|
1060
1066
|
search: 'Søk',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.1.1",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ndla/article-scripts": "^3.0.1",
|
|
35
|
-
"@ndla/button": "^3.3.
|
|
35
|
+
"@ndla/button": "^3.3.2",
|
|
36
36
|
"@ndla/carousel": "^1.2.16",
|
|
37
37
|
"@ndla/core": "^2.3.4",
|
|
38
|
-
"@ndla/forms": "^3.1.
|
|
38
|
+
"@ndla/forms": "^3.1.5",
|
|
39
39
|
"@ndla/hooks": "^1.1.5",
|
|
40
40
|
"@ndla/icons": "^1.11.4",
|
|
41
|
-
"@ndla/licenses": "^5.0.
|
|
42
|
-
"@ndla/modal": "^1.
|
|
43
|
-
"@ndla/notion": "^3.1.
|
|
44
|
-
"@ndla/safelink": "^2.2.
|
|
41
|
+
"@ndla/licenses": "^5.0.9",
|
|
42
|
+
"@ndla/modal": "^1.3.0",
|
|
43
|
+
"@ndla/notion": "^3.1.33",
|
|
44
|
+
"@ndla/safelink": "^2.2.8",
|
|
45
45
|
"@ndla/switch": "^0.1.11",
|
|
46
46
|
"@ndla/tabs": "^1.1.15",
|
|
47
|
-
"@ndla/tooltip": "^2.
|
|
48
|
-
"@ndla/types-learningpath-api": "^0.0.
|
|
47
|
+
"@ndla/tooltip": "^2.2.0",
|
|
48
|
+
"@ndla/types-learningpath-api": "^0.0.13",
|
|
49
49
|
"@ndla/util": "^3.0.1",
|
|
50
50
|
"@reach/menu-button": "^0.16.2",
|
|
51
51
|
"@reach/slider": "^0.16.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "da8118a5337c64c6eb9109f6300369ae537d0cb2"
|
|
89
89
|
}
|
|
@@ -78,7 +78,7 @@ const ArticleAuthorContent = ({ showAuthor, authors, onSelectAuthor }: Props) =>
|
|
|
78
78
|
return (
|
|
79
79
|
<div {...classes()}>
|
|
80
80
|
<div {...classes('author-info')}>
|
|
81
|
-
{image && <Portrait src={image} alt={name}
|
|
81
|
+
{image && <Portrait src={image} alt={name} />}
|
|
82
82
|
<section>
|
|
83
83
|
<h1>{name}</h1>
|
|
84
84
|
<hr />
|
|
@@ -25,8 +25,8 @@ export const ArticleFavoritesButton = ({ isFavorite, onToggleAddToFavorites, art
|
|
|
25
25
|
return (
|
|
26
26
|
<Tooltip tooltip={isFavorite ? addToFavoritesLabel : removeFromFavoritesLabel}>
|
|
27
27
|
<IconButtonDualStates
|
|
28
|
-
ariaLabelActive={t('myNdla.
|
|
29
|
-
ariaLabelInActive={t('myNdla.
|
|
28
|
+
ariaLabelActive={t('myNdla.alreadyFavourited')}
|
|
29
|
+
ariaLabelInActive={t('myNdla.addToFavourites')}
|
|
30
30
|
activeIcon={<Heart />}
|
|
31
31
|
inactiveIcon={<HeartOutline />}
|
|
32
32
|
active={isFavorite}
|
|
@@ -7,16 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import
|
|
11
|
-
import BEMHelper from 'react-bem-helper';
|
|
10
|
+
import styled from '@emotion/styled';
|
|
12
11
|
import SafeLink from '@ndla/safelink';
|
|
12
|
+
import { breakpoints, fonts, mq, spacing } from '@ndla/core';
|
|
13
13
|
import Portrait from '../Portrait';
|
|
14
14
|
|
|
15
|
-
const classes = new BEMHelper({
|
|
16
|
-
name: 'author-info',
|
|
17
|
-
prefix: 'c-',
|
|
18
|
-
});
|
|
19
|
-
|
|
20
15
|
interface Props {
|
|
21
16
|
authorName: string;
|
|
22
17
|
authorRole: string;
|
|
@@ -25,24 +20,63 @@ interface Props {
|
|
|
25
20
|
image?: string;
|
|
26
21
|
}
|
|
27
22
|
|
|
23
|
+
const AuthorInfoSection = styled.section`
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: flex-start;
|
|
26
|
+
padding-bottom: ${spacing.large};
|
|
27
|
+
font-family: ${fonts.sans};
|
|
28
|
+
p,
|
|
29
|
+
a {
|
|
30
|
+
margin: 0;
|
|
31
|
+
${mq.range({ until: breakpoints.tablet })} {
|
|
32
|
+
${fonts.sizes('14px', '22px')};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const StyledPortrait = styled(Portrait)`
|
|
38
|
+
margin-right: ${spacing.large};
|
|
39
|
+
${mq.range({ until: breakpoints.desktop })} {
|
|
40
|
+
margin-right: ${spacing.medium};
|
|
41
|
+
width: 7rem;
|
|
42
|
+
height: 7rem;
|
|
43
|
+
span {
|
|
44
|
+
width: 7rem;
|
|
45
|
+
height: 7rem;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
${mq.range({ until: breakpoints.desktop })} {
|
|
49
|
+
margin-right: ${spacing.small};
|
|
50
|
+
width: 4rem;
|
|
51
|
+
height: 4rem;
|
|
52
|
+
span {
|
|
53
|
+
width: 4rem;
|
|
54
|
+
height: 4rem;
|
|
55
|
+
}
|
|
56
|
+
} ;
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
const StyledHeading = styled.h1`
|
|
60
|
+
margin: 0 0 ${spacing.small};
|
|
61
|
+
${mq.range({ until: breakpoints.desktop })} {
|
|
62
|
+
${fonts.sizes('22px', '22px')};
|
|
63
|
+
}
|
|
64
|
+
${mq.range({ until: breakpoints.tablet })} {
|
|
65
|
+
${fonts.sizes('18px', '18px')};
|
|
66
|
+
margin-bottom: ${spacing.xsmall};
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
|
|
28
70
|
const AuthorInfo = ({ authorName, authorRole, email, image, phone }: Props) => (
|
|
29
|
-
<
|
|
30
|
-
{image && <
|
|
71
|
+
<AuthorInfoSection>
|
|
72
|
+
{image && <StyledPortrait src={image} alt={authorName} modifier="large" />}
|
|
31
73
|
<div>
|
|
32
|
-
<
|
|
74
|
+
<StyledHeading>{authorName}</StyledHeading>
|
|
33
75
|
<p>{authorRole}</p>
|
|
34
76
|
{phone && <p>{phone}</p>}
|
|
35
77
|
{email && <SafeLink to={`mailto:${email}`}>{email}</SafeLink>}
|
|
36
78
|
</div>
|
|
37
|
-
</
|
|
79
|
+
</AuthorInfoSection>
|
|
38
80
|
);
|
|
39
81
|
|
|
40
|
-
AuthorInfo.propTypes = {
|
|
41
|
-
authorName: PropTypes.string.isRequired,
|
|
42
|
-
authorRole: PropTypes.string.isRequired,
|
|
43
|
-
phone: PropTypes.string,
|
|
44
|
-
email: PropTypes.string,
|
|
45
|
-
image: PropTypes.string,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
82
|
export default AuthorInfo;
|
|
@@ -1,11 +1,123 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
2
|
+
import styled from '@emotion/styled';
|
|
4
3
|
import { Play } from '@ndla/icons/common';
|
|
5
4
|
import SafeLink from '@ndla/safelink';
|
|
6
5
|
import type { SafeLinkProps } from '@ndla/safelink';
|
|
6
|
+
import { breakpoints, colors, fonts, mq, spacing, spacingUnit } from '@ndla/core';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface ContentCardContainerProps {
|
|
9
|
+
columnWidth: number;
|
|
10
|
+
}
|
|
11
|
+
const ContentCardContainer = styled.article<ContentCardContainerProps>`
|
|
12
|
+
position: relative;
|
|
13
|
+
display: block;
|
|
14
|
+
width: ${(p) => `${p.columnWidth}px`};
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
const StyledHeading = styled.h1`
|
|
18
|
+
font-weight: ${fonts.weight.semibold};
|
|
19
|
+
${fonts.sizes('14px', '16px')};
|
|
20
|
+
margin: ${spacing.xsmall} 0;
|
|
21
|
+
color: ${colors.brand.primary};
|
|
22
|
+
|
|
23
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
24
|
+
margin: ${spacing.small} 0 ${spacing.xsmall};
|
|
25
|
+
${fonts.sizes('20px', '22px')};
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
const ContentCardLink = styled(SafeLink)`
|
|
30
|
+
color: ${colors.text.primary};
|
|
31
|
+
&:hover,
|
|
32
|
+
&:focus {
|
|
33
|
+
${StyledHeading} {
|
|
34
|
+
text-decoration: underline;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
const ImageWrapper = styled.div`
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 72px;
|
|
42
|
+
border-radius: 5px;
|
|
43
|
+
position: relative;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
background: ${colors.background.grayDark};
|
|
46
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
47
|
+
height: ${spacingUnit * 4.5}px;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
interface BackgroundImageProps {
|
|
52
|
+
image: string;
|
|
53
|
+
}
|
|
54
|
+
const BackgroundImage = styled.div<BackgroundImageProps>`
|
|
55
|
+
display: flex;
|
|
56
|
+
height: 100%;
|
|
57
|
+
width: 100%;
|
|
58
|
+
background-position: center center;
|
|
59
|
+
background-size: cover;
|
|
60
|
+
background-image: url(${(p) => p.image});
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
const PlayBackground = styled.div`
|
|
64
|
+
position: absolute;
|
|
65
|
+
left: 50%;
|
|
66
|
+
top: 50%;
|
|
67
|
+
transform: translate3d(-50%, -50%, 0);
|
|
68
|
+
height: 35px;
|
|
69
|
+
width: 35px;
|
|
70
|
+
background-color: rgba(0, 0, 0, 0.48);
|
|
71
|
+
border-radius: 100%;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
76
|
+
height: 42px;
|
|
77
|
+
width: 42px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.c-icon {
|
|
81
|
+
color: ${colors.white};
|
|
82
|
+
height: 20px;
|
|
83
|
+
width: 20px;
|
|
84
|
+
margin-right: -1px;
|
|
85
|
+
|
|
86
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
87
|
+
height: 25px;
|
|
88
|
+
width: 25px;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
const StyledContentType = styled.p`
|
|
94
|
+
${fonts.sizes('12px', '20px')};
|
|
95
|
+
position: absolute;
|
|
96
|
+
left: ${spacing.small};
|
|
97
|
+
bottom: ${spacing.small};
|
|
98
|
+
display: inline-block;
|
|
99
|
+
background: ${colors.brand.greyLightest};
|
|
100
|
+
border-radius: 2px;
|
|
101
|
+
font-weight: 600;
|
|
102
|
+
margin: 0;
|
|
103
|
+
padding: 0 ${spacing.xxsmall};
|
|
104
|
+
|
|
105
|
+
display: none;
|
|
106
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
107
|
+
display: inline-block;
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
const StyledDescription = styled.p`
|
|
112
|
+
${fonts.sizes('16px')};
|
|
113
|
+
line-height: 1.25rem;
|
|
114
|
+
margin: 0;
|
|
115
|
+
display: none;
|
|
116
|
+
|
|
117
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
118
|
+
display: block;
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
9
121
|
|
|
10
122
|
interface Props {
|
|
11
123
|
title: string;
|
|
@@ -18,43 +130,23 @@ interface Props {
|
|
|
18
130
|
}
|
|
19
131
|
|
|
20
132
|
const ContentCard = ({ title, text, image, type, isFilm = false, toLinkProps, columnWidth }: Props) => (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
133
|
+
<ContentCardContainer columnWidth={columnWidth}>
|
|
134
|
+
<ContentCardLink {...toLinkProps()} title={title}>
|
|
23
135
|
<header>
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
{...classes('background-image')}
|
|
27
|
-
role="img"
|
|
28
|
-
aria-label={title}
|
|
29
|
-
style={{
|
|
30
|
-
backgroundImage: `url(${image})`,
|
|
31
|
-
}}
|
|
32
|
-
/>
|
|
136
|
+
<ImageWrapper>
|
|
137
|
+
<BackgroundImage image={image} role="img" aria-label={title} />
|
|
33
138
|
{isFilm && (
|
|
34
|
-
<
|
|
139
|
+
<PlayBackground>
|
|
35
140
|
<Play />
|
|
36
|
-
</
|
|
141
|
+
</PlayBackground>
|
|
37
142
|
)}
|
|
38
|
-
<
|
|
39
|
-
</
|
|
40
|
-
<
|
|
143
|
+
<StyledContentType>{type}</StyledContentType>
|
|
144
|
+
</ImageWrapper>
|
|
145
|
+
<StyledHeading>{title}</StyledHeading>
|
|
41
146
|
</header>
|
|
42
|
-
<
|
|
43
|
-
</
|
|
44
|
-
</
|
|
147
|
+
<StyledDescription>{text}</StyledDescription>
|
|
148
|
+
</ContentCardLink>
|
|
149
|
+
</ContentCardContainer>
|
|
45
150
|
);
|
|
46
151
|
|
|
47
|
-
ContentCard.propTypes = {
|
|
48
|
-
title: PropTypes.string.isRequired,
|
|
49
|
-
text: PropTypes.string.isRequired,
|
|
50
|
-
type: PropTypes.string.isRequired,
|
|
51
|
-
image: PropTypes.string.isRequired,
|
|
52
|
-
isFilm: PropTypes.bool,
|
|
53
|
-
toLinkProps: PropTypes.func.isRequired,
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
ContentCard.defaultProps = {
|
|
57
|
-
isFilm: false,
|
|
58
|
-
};
|
|
59
|
-
|
|
60
152
|
export default ContentCard;
|
package/src/FileList/File.tsx
CHANGED
|
@@ -1,11 +1,36 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
1
3
|
import { Download } from '@ndla/icons/common';
|
|
2
4
|
import SafeLink from '@ndla/safelink';
|
|
3
5
|
import Tooltip from '@ndla/tooltip';
|
|
4
6
|
import React from 'react';
|
|
5
|
-
import BEMHelper from 'react-bem-helper';
|
|
6
7
|
import { FileFormat, FileType } from './FileList';
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
+
const LinkText = styled.span`
|
|
10
|
+
& > span {
|
|
11
|
+
box-shadow: inset 0 -1px;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
const FileLink = styled(SafeLink)`
|
|
15
|
+
box-shadow: none;
|
|
16
|
+
position: relative;
|
|
17
|
+
color: ${colors.brand.primary};
|
|
18
|
+
margin-right: ${spacing.normal};
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
|
|
22
|
+
&:last-child {
|
|
23
|
+
margin-right: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:hover,
|
|
27
|
+
&:focus,
|
|
28
|
+
&:active {
|
|
29
|
+
${LinkText} {
|
|
30
|
+
box-shadow: none;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
9
34
|
|
|
10
35
|
const renderFormat = (format: FileFormat, title: string, isPrimary: boolean, id: string, isDeadLink: boolean) => {
|
|
11
36
|
const titleWithFormat = `${title} (${format.fileType.toUpperCase()})`;
|
|
@@ -22,20 +47,14 @@ const renderFormat = (format: FileFormat, title: string, isPrimary: boolean, id:
|
|
|
22
47
|
}
|
|
23
48
|
|
|
24
49
|
return (
|
|
25
|
-
<
|
|
26
|
-
{...classes('link')}
|
|
27
|
-
key={format.url}
|
|
28
|
-
to={format.url}
|
|
29
|
-
target="_blank"
|
|
30
|
-
aria-label={titleWithFormat}
|
|
31
|
-
aria-describedby={formatId}>
|
|
50
|
+
<FileLink key={format.url} to={format.url} target="_blank" aria-label={titleWithFormat} aria-describedby={formatId}>
|
|
32
51
|
<Download />
|
|
33
52
|
<Tooltip tooltip={format.tooltip}>
|
|
34
|
-
<
|
|
53
|
+
<LinkText>
|
|
35
54
|
<span>{isPrimary ? titleWithFormat : `(${format.fileType.toUpperCase()})`}</span>
|
|
36
|
-
</
|
|
55
|
+
</LinkText>
|
|
37
56
|
</Tooltip>
|
|
38
|
-
</
|
|
57
|
+
</FileLink>
|
|
39
58
|
);
|
|
40
59
|
};
|
|
41
60
|
|
|
@@ -44,16 +63,27 @@ interface Props {
|
|
|
44
63
|
file: FileType;
|
|
45
64
|
}
|
|
46
65
|
|
|
66
|
+
const FileListItem = styled.li`
|
|
67
|
+
${fonts.sizes('18px', '26px')};
|
|
68
|
+
font-weight: ${fonts.weight.semibold};
|
|
69
|
+
min-height: 60px;
|
|
70
|
+
background: ${colors.brand.greyLighter};
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
flex-wrap: wrap;
|
|
74
|
+
margin-bottom: ${spacing.xsmall};
|
|
75
|
+
padding: ${spacing.small};
|
|
76
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
77
|
+
padding: ${spacing.small} ${spacing.normal};
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
|
|
47
81
|
const File = ({ file, id }: Props) => {
|
|
48
82
|
const formatLinks = file.formats.map((format, index) =>
|
|
49
83
|
renderFormat(format, file.title, index === 0, id, !file.fileExists),
|
|
50
84
|
);
|
|
51
85
|
|
|
52
|
-
return
|
|
53
|
-
<li {...classes('item')} key={file.title}>
|
|
54
|
-
{formatLinks}
|
|
55
|
-
</li>
|
|
56
|
-
);
|
|
86
|
+
return <FileListItem key={file.title}>{formatLinks}</FileListItem>;
|
|
57
87
|
};
|
|
58
88
|
|
|
59
89
|
export default File;
|