@ndla/ui 50.4.1 → 50.5.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/Footer/Footer.js +9 -9
- package/es/Footer/FooterLinks.js +8 -8
- package/es/FrontpageArticle/FrontpageArticle.js +2 -2
- package/es/LearningPaths/LearningPathInformation.js +4 -4
- package/es/LearningPaths/LearningPathLastStepNavigation.js +5 -5
- package/es/LearningPaths/LearningPathMenuAside.js +5 -5
- package/es/LearningPaths/LearningPathMenuContent.js +7 -7
- package/es/MediaList/MediaList.js +94 -70
- package/es/NDLAFilm/MovieGrid.js +3 -3
- package/es/NDLAFilm/filmStyles.js +4 -4
- package/es/Resource/BlockResource.js +23 -10
- package/es/Resource/ListResource.js +16 -10
- package/es/Resource/resourceComponents.js +19 -11
- package/es/Subject/SubjectHeader.js +5 -5
- package/es/all.css +1 -1
- package/es/locale/messages-en.js +6 -3
- package/es/locale/messages-nb.js +5 -2
- package/es/locale/messages-nn.js +5 -2
- package/es/locale/messages-se.js +5 -2
- package/es/locale/messages-sma.js +5 -2
- package/lib/Footer/Footer.js +9 -9
- package/lib/Footer/FooterLinks.js +7 -7
- package/lib/FrontpageArticle/FrontpageArticle.js +1 -1
- package/lib/LearningPaths/LearningPathInformation.js +4 -4
- package/lib/LearningPaths/LearningPathLastStepNavigation.js +4 -4
- package/lib/LearningPaths/LearningPathMenuAside.js +5 -5
- package/lib/LearningPaths/LearningPathMenuContent.js +7 -7
- package/lib/MediaList/MediaList.d.ts +4 -18
- package/lib/MediaList/MediaList.js +94 -73
- package/lib/NDLAFilm/MovieGrid.js +2 -2
- package/lib/NDLAFilm/filmStyles.js +3 -3
- package/lib/Resource/BlockResource.d.ts +1 -2
- package/lib/Resource/BlockResource.js +22 -9
- package/lib/Resource/ListResource.js +15 -9
- package/lib/Resource/resourceComponents.js +19 -11
- package/lib/Subject/SubjectHeader.js +4 -4
- package/lib/all.css +1 -1
- package/lib/locale/messages-en.d.ts +3 -0
- package/lib/locale/messages-en.js +6 -3
- package/lib/locale/messages-nb.d.ts +3 -0
- package/lib/locale/messages-nb.js +5 -2
- package/lib/locale/messages-nn.d.ts +3 -0
- package/lib/locale/messages-nn.js +5 -2
- package/lib/locale/messages-se.d.ts +3 -0
- package/lib/locale/messages-se.js +5 -2
- package/lib/locale/messages-sma.d.ts +3 -0
- package/lib/locale/messages-sma.js +5 -2
- package/package.json +17 -17
- package/src/Footer/Footer.tsx +7 -9
- package/src/Footer/FooterLinks.tsx +1 -1
- package/src/FrontpageArticle/FrontpageArticle.tsx +3 -3
- package/src/LearningPaths/LearningPathInformation.tsx +1 -1
- package/src/LearningPaths/LearningPathLastStepNavigation.tsx +2 -2
- package/src/LearningPaths/LearningPathMenuAside.tsx +1 -1
- package/src/LearningPaths/LearningPathMenuContent.tsx +2 -2
- package/src/Logo/component.logo.scss +3 -0
- package/src/MediaList/MediaList.tsx +93 -50
- package/src/NDLAFilm/MovieGrid.tsx +3 -3
- package/src/NDLAFilm/filmStyles.ts +3 -3
- package/src/Resource/BlockResource.stories.tsx +0 -3
- package/src/Resource/BlockResource.tsx +9 -8
- package/src/Resource/ListResource.stories.tsx +0 -3
- package/src/Resource/ListResource.tsx +11 -8
- package/src/Resource/resourceComponents.tsx +0 -2
- package/src/Subject/SubjectHeader.tsx +3 -3
- package/src/locale/messages-en.ts +4 -1
- package/src/locale/messages-nb.ts +3 -0
- package/src/locale/messages-nn.ts +3 -0
- package/src/locale/messages-se.ts +3 -0
- package/src/locale/messages-sma.ts +3 -0
- package/src/main.scss +0 -2
- package/src/MediaList/component.medialist.scss +0 -93
- package/src/global/components/component.logo.scss +0 -5
|
@@ -973,8 +973,10 @@ declare const messages: {
|
|
|
973
973
|
};
|
|
974
974
|
publish: string;
|
|
975
975
|
topic: {
|
|
976
|
+
isDeleted: string;
|
|
976
977
|
responses: string;
|
|
977
978
|
topicContent: string;
|
|
979
|
+
fetchMore: string;
|
|
978
980
|
};
|
|
979
981
|
posts: {
|
|
980
982
|
notify: string;
|
|
@@ -983,6 +985,7 @@ declare const messages: {
|
|
|
983
985
|
edit: string;
|
|
984
986
|
delete: string;
|
|
985
987
|
};
|
|
988
|
+
fetchMore: string;
|
|
986
989
|
};
|
|
987
990
|
flag: {
|
|
988
991
|
title: string;
|
|
@@ -992,8 +992,10 @@ const messages = {
|
|
|
992
992
|
},
|
|
993
993
|
publish: 'Publish',
|
|
994
994
|
topic: {
|
|
995
|
+
isDeleted: 'The topic has been deleted and can not be displayed.',
|
|
995
996
|
responses: 'Responses',
|
|
996
|
-
topicContent: 'Write your topic here'
|
|
997
|
+
topicContent: 'Write your topic here',
|
|
998
|
+
fetchMore: 'Fetch more topics'
|
|
997
999
|
},
|
|
998
1000
|
posts: {
|
|
999
1001
|
notify: 'Get notified of new answers',
|
|
@@ -1001,7 +1003,8 @@ const messages = {
|
|
|
1001
1003
|
report: 'Report post to moderator',
|
|
1002
1004
|
edit: 'Edit post',
|
|
1003
1005
|
delete: 'Delete post'
|
|
1004
|
-
}
|
|
1006
|
+
},
|
|
1007
|
+
fetchMore: 'Fetch more answers'
|
|
1005
1008
|
},
|
|
1006
1009
|
flag: {
|
|
1007
1010
|
title: 'Report post / comment',
|
|
@@ -1031,7 +1034,7 @@ const messages = {
|
|
|
1031
1034
|
iconMenu: {
|
|
1032
1035
|
folders: 'Folders',
|
|
1033
1036
|
tags: 'Tags',
|
|
1034
|
-
subjects: '
|
|
1037
|
+
subjects: 'Subjects',
|
|
1035
1038
|
profile: 'Profile',
|
|
1036
1039
|
more: 'More'
|
|
1037
1040
|
},
|
|
@@ -973,8 +973,10 @@ declare const messages: {
|
|
|
973
973
|
topic: string;
|
|
974
974
|
};
|
|
975
975
|
topic: {
|
|
976
|
+
isDeleted: string;
|
|
976
977
|
responses: string;
|
|
977
978
|
topicContent: string;
|
|
979
|
+
fetchMore: string;
|
|
978
980
|
};
|
|
979
981
|
posts: {
|
|
980
982
|
notify: string;
|
|
@@ -983,6 +985,7 @@ declare const messages: {
|
|
|
983
985
|
edit: string;
|
|
984
986
|
delete: string;
|
|
985
987
|
};
|
|
988
|
+
fetchMore: string;
|
|
986
989
|
};
|
|
987
990
|
flag: {
|
|
988
991
|
title: string;
|
|
@@ -992,8 +992,10 @@ const messages = {
|
|
|
992
992
|
topic: 'Innlegget har blitt oppdatert.'
|
|
993
993
|
},
|
|
994
994
|
topic: {
|
|
995
|
+
isDeleted: 'Innlegget har blitt slettet og kan ikke vises.',
|
|
995
996
|
responses: 'Svar',
|
|
996
|
-
topicContent: 'Skriv innlegget ditt her'
|
|
997
|
+
topicContent: 'Skriv innlegget ditt her',
|
|
998
|
+
fetchMore: 'Hent flere innlegg'
|
|
997
999
|
},
|
|
998
1000
|
posts: {
|
|
999
1001
|
notify: 'Få varsel om nye svar',
|
|
@@ -1001,7 +1003,8 @@ const messages = {
|
|
|
1001
1003
|
report: 'Rapporter innlegg til moderator',
|
|
1002
1004
|
edit: 'Rediger innlegg',
|
|
1003
1005
|
delete: 'Slett innlegget'
|
|
1004
|
-
}
|
|
1006
|
+
},
|
|
1007
|
+
fetchMore: 'Hent flere svar'
|
|
1005
1008
|
},
|
|
1006
1009
|
flag: {
|
|
1007
1010
|
title: 'Rapporter innlegg / kommentar',
|
|
@@ -965,8 +965,10 @@ declare const messages: {
|
|
|
965
965
|
topic: string;
|
|
966
966
|
};
|
|
967
967
|
topic: {
|
|
968
|
+
isDeleted: string;
|
|
968
969
|
responses: string;
|
|
969
970
|
topicContent: string;
|
|
971
|
+
fetchMore: string;
|
|
970
972
|
};
|
|
971
973
|
deleted: {
|
|
972
974
|
post: string;
|
|
@@ -983,6 +985,7 @@ declare const messages: {
|
|
|
983
985
|
edit: string;
|
|
984
986
|
delete: string;
|
|
985
987
|
};
|
|
988
|
+
fetchMore: string;
|
|
986
989
|
};
|
|
987
990
|
flag: {
|
|
988
991
|
title: string;
|
|
@@ -984,8 +984,10 @@ const messages = {
|
|
|
984
984
|
topic: 'Slett innlegg'
|
|
985
985
|
},
|
|
986
986
|
topic: {
|
|
987
|
+
isDeleted: 'Innlegget har vorte sletta og kan ikkje visast.',
|
|
987
988
|
responses: 'Svar',
|
|
988
|
-
topicContent: 'Skriv innlegget ditt her'
|
|
989
|
+
topicContent: 'Skriv innlegget ditt her',
|
|
990
|
+
fetchMore: 'Hent fleire innlegg'
|
|
989
991
|
},
|
|
990
992
|
deleted: {
|
|
991
993
|
post: 'Kommentaren din har blitt sletta.',
|
|
@@ -1001,7 +1003,8 @@ const messages = {
|
|
|
1001
1003
|
report: 'Rapporter innlegg til moderator',
|
|
1002
1004
|
edit: 'Rediger innlegg',
|
|
1003
1005
|
delete: 'Slett innlegget'
|
|
1004
|
-
}
|
|
1006
|
+
},
|
|
1007
|
+
fetchMore: 'Hent fleire svar'
|
|
1005
1008
|
},
|
|
1006
1009
|
flag: {
|
|
1007
1010
|
title: 'Rapporter innlegg / kommentar',
|
|
@@ -973,8 +973,10 @@ declare const messages: {
|
|
|
973
973
|
topic: string;
|
|
974
974
|
};
|
|
975
975
|
topic: {
|
|
976
|
+
isDeleted: string;
|
|
976
977
|
responses: string;
|
|
977
978
|
topicContent: string;
|
|
979
|
+
fetchMore: string;
|
|
978
980
|
};
|
|
979
981
|
posts: {
|
|
980
982
|
notify: string;
|
|
@@ -983,6 +985,7 @@ declare const messages: {
|
|
|
983
985
|
edit: string;
|
|
984
986
|
delete: string;
|
|
985
987
|
};
|
|
988
|
+
fetchMore: string;
|
|
986
989
|
};
|
|
987
990
|
flag: {
|
|
988
991
|
title: string;
|
|
@@ -992,8 +992,10 @@ const messages = {
|
|
|
992
992
|
topic: 'Sáhkavuorru lea ođasmahttojuvvon.'
|
|
993
993
|
},
|
|
994
994
|
topic: {
|
|
995
|
+
isDeleted: 'Čálus lea sihkojuvvon iige sáhte čájehuvvot.',
|
|
995
996
|
responses: 'Vástidan',
|
|
996
|
-
topicContent: 'Čále sáhkavuoru dása'
|
|
997
|
+
topicContent: 'Čále sáhkavuoru dása',
|
|
998
|
+
fetchMore: 'Viečča eanet čállosiid'
|
|
997
999
|
},
|
|
998
1000
|
posts: {
|
|
999
1001
|
notify: 'Oaččo dieđu ođđa vástádusaid birra',
|
|
@@ -1001,7 +1003,8 @@ const messages = {
|
|
|
1001
1003
|
report: 'Raportere čállosa moderatorii',
|
|
1002
1004
|
edit: 'Doaimmat čállosa',
|
|
1003
1005
|
delete: 'Sihko čállosa'
|
|
1004
|
-
}
|
|
1006
|
+
},
|
|
1007
|
+
fetchMore: 'Viečča eanet vástádusaid'
|
|
1005
1008
|
},
|
|
1006
1009
|
flag: {
|
|
1007
1010
|
title: 'Rapportere čállosa / kommentára',
|
|
@@ -973,8 +973,10 @@ declare const messages: {
|
|
|
973
973
|
topic: string;
|
|
974
974
|
};
|
|
975
975
|
topic: {
|
|
976
|
+
isDeleted: string;
|
|
976
977
|
responses: string;
|
|
977
978
|
topicContent: string;
|
|
979
|
+
fetchMore: string;
|
|
978
980
|
};
|
|
979
981
|
posts: {
|
|
980
982
|
notify: string;
|
|
@@ -983,6 +985,7 @@ declare const messages: {
|
|
|
983
985
|
edit: string;
|
|
984
986
|
delete: string;
|
|
985
987
|
};
|
|
988
|
+
fetchMore: string;
|
|
986
989
|
};
|
|
987
990
|
flag: {
|
|
988
991
|
title: string;
|
|
@@ -992,8 +992,10 @@ const messages = {
|
|
|
992
992
|
topic: 'Håaleme lea orrestahteme.'
|
|
993
993
|
},
|
|
994
994
|
topic: {
|
|
995
|
+
isDeleted: 'Tjaalege lea sliejhteme jïh ij maehtieh dam vuesiehtidh.',
|
|
995
996
|
responses: 'Vaestiedasse',
|
|
996
|
-
topicContent: 'Tjaelieh dov håalemem daesnie'
|
|
997
|
+
topicContent: 'Tjaelieh dov håalemem daesnie',
|
|
998
|
+
fetchMore: 'Veedtjh jienebh saadtegh'
|
|
997
999
|
},
|
|
998
1000
|
posts: {
|
|
999
1001
|
notify: 'Bïeljelh mejtie orre vaestiedassh',
|
|
@@ -1001,7 +1003,8 @@ const messages = {
|
|
|
1001
1003
|
report: 'Reekth håalemem moderatovrese',
|
|
1002
1004
|
edit: 'Jarkelimmie håalemistie',
|
|
1003
1005
|
delete: 'Slett innlegget'
|
|
1004
|
-
}
|
|
1006
|
+
},
|
|
1007
|
+
fetchMore: 'Jienebh vaestiedassh veedtjedh'
|
|
1005
1008
|
},
|
|
1006
1009
|
flag: {
|
|
1007
1010
|
title: 'Påastem reektehtidh / kommentaarem',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "50.
|
|
3
|
+
"version": "50.5.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
"types"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/accordion": "^3.0.
|
|
35
|
-
"@ndla/button": "^12.0.
|
|
36
|
-
"@ndla/carousel": "^4.0.
|
|
37
|
-
"@ndla/core": "^4.
|
|
38
|
-
"@ndla/dropdown-menu": "^1.0.
|
|
39
|
-
"@ndla/forms": "^5.2.
|
|
34
|
+
"@ndla/accordion": "^3.0.13",
|
|
35
|
+
"@ndla/button": "^12.0.18",
|
|
36
|
+
"@ndla/carousel": "^4.0.19",
|
|
37
|
+
"@ndla/core": "^4.3.0",
|
|
38
|
+
"@ndla/dropdown-menu": "^1.0.20",
|
|
39
|
+
"@ndla/forms": "^5.2.8",
|
|
40
40
|
"@ndla/hooks": "^2.1.4",
|
|
41
|
-
"@ndla/icons": "^4.2.
|
|
41
|
+
"@ndla/icons": "^4.2.5",
|
|
42
42
|
"@ndla/licenses": "^7.2.4",
|
|
43
|
-
"@ndla/modal": "^5.0.
|
|
44
|
-
"@ndla/notion": "^6.0.
|
|
45
|
-
"@ndla/safelink": "^4.1.
|
|
46
|
-
"@ndla/select": "^3.2.
|
|
47
|
-
"@ndla/switch": "^1.1.
|
|
48
|
-
"@ndla/tabs": "^3.2.
|
|
49
|
-
"@ndla/tooltip": "^6.0.
|
|
50
|
-
"@ndla/typography": "^0.4.
|
|
43
|
+
"@ndla/modal": "^5.0.18",
|
|
44
|
+
"@ndla/notion": "^6.0.19",
|
|
45
|
+
"@ndla/safelink": "^4.1.43",
|
|
46
|
+
"@ndla/select": "^3.2.5",
|
|
47
|
+
"@ndla/switch": "^1.1.26",
|
|
48
|
+
"@ndla/tabs": "^3.2.6",
|
|
49
|
+
"@ndla/tooltip": "^6.0.8",
|
|
50
|
+
"@ndla/typography": "^0.4.3",
|
|
51
51
|
"@ndla/util": "^4.0.3",
|
|
52
52
|
"@radix-ui/react-popover": "^1.0.7",
|
|
53
53
|
"@radix-ui/react-slider": "^1.1.2",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "33f14792431d5c46241455f1f5e05ac9a81ab7d6"
|
|
85
85
|
}
|
package/src/Footer/Footer.tsx
CHANGED
|
@@ -26,17 +26,15 @@ const StyledBackground = styled.div`
|
|
|
26
26
|
background: linear-gradient(96deg, rgba(0, 117, 160, 1) 0%, rgba(32, 88, 143, 0) 100%);
|
|
27
27
|
`;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
addMargin?: boolean;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const StyledDiv = styled.div<StyledFooterProps>`
|
|
29
|
+
const StyledDiv = styled.div`
|
|
34
30
|
color: #fff;
|
|
35
31
|
position: relative;
|
|
36
32
|
background: ${colors.brand.dark};
|
|
37
33
|
overflow: hidden;
|
|
38
34
|
z-index: 0;
|
|
39
|
-
|
|
35
|
+
&[data-margin='true'] {
|
|
36
|
+
margin-top: ${spacing.xxlarge};
|
|
37
|
+
}
|
|
40
38
|
`;
|
|
41
39
|
|
|
42
40
|
const StyledOneColumn = styled(OneColumn)`
|
|
@@ -61,8 +59,8 @@ const StyledFooterHeaderIcon = styled(FooterHeaderIcon)`
|
|
|
61
59
|
width: ${spacing.large};
|
|
62
60
|
height: ${spacing.large};
|
|
63
61
|
${mq.range({ from: breakpoints.tabletWide })} {
|
|
64
|
-
width: ${
|
|
65
|
-
height: ${
|
|
62
|
+
width: ${spacing.xlarge};
|
|
63
|
+
height: ${spacing.xlarge};
|
|
66
64
|
}
|
|
67
65
|
`;
|
|
68
66
|
|
|
@@ -163,7 +161,7 @@ const Footer = ({ children, commonLinks, links, languageSelector, auth, privacyL
|
|
|
163
161
|
return (
|
|
164
162
|
<>
|
|
165
163
|
<footer>
|
|
166
|
-
<StyledDiv
|
|
164
|
+
<StyledDiv data-margin={!languageSelector}>
|
|
167
165
|
{languageSelector && <StyledLanguageWrapper>{languageSelector}</StyledLanguageWrapper>}
|
|
168
166
|
<StyledOneColumn cssModifier="large">{footerContent}</StyledOneColumn>
|
|
169
167
|
<StyledBackground />
|
|
@@ -43,16 +43,16 @@ const StyledArticle = styled.article`
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
div[data-type='grid'] + div[data-type='grid'] {
|
|
46
|
-
margin-top: ${
|
|
46
|
+
margin-top: ${spacing.xxlarge};
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
&[data-wide='true'] {
|
|
50
50
|
max-width: 1100px;
|
|
51
51
|
h2[id] {
|
|
52
|
-
margin-top: ${
|
|
52
|
+
margin-top: ${spacing.xxlarge};
|
|
53
53
|
}
|
|
54
54
|
div[data-type='campaign-block'] {
|
|
55
|
-
margin: ${
|
|
55
|
+
margin: ${spacing.xxlarge} 0px;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
`;
|
|
@@ -22,7 +22,7 @@ const StyledWrapper = styled.div<StyledWrapperProps>`
|
|
|
22
22
|
margin: ${spacingUnit * 0.75}px ${spacing.normal} ${spacing.xsmall} 0 !important;
|
|
23
23
|
${mq.range({ from: breakpoints.desktop })} {
|
|
24
24
|
margin: ${spacingUnit * 0.75}px ${spacing.normal} ${spacing.xsmall} 0 !important;
|
|
25
|
-
padding: ${spacing.normal} ${spacing.large} ${spacing.large} ${
|
|
25
|
+
padding: ${spacing.normal} ${spacing.large} ${spacing.large} ${spacing.xxlarge};
|
|
26
26
|
ul {
|
|
27
27
|
margin-left: ${spacing.normal};
|
|
28
28
|
}
|
|
@@ -10,7 +10,7 @@ import { ReactNode } from 'react';
|
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
11
|
import { css } from '@emotion/react';
|
|
12
12
|
import styled from '@emotion/styled';
|
|
13
|
-
import { fonts, spacing
|
|
13
|
+
import { fonts, spacing } from '@ndla/core';
|
|
14
14
|
import SafeLink from '@ndla/safelink';
|
|
15
15
|
import { OneColumn, LayoutItem } from '../index';
|
|
16
16
|
|
|
@@ -38,7 +38,7 @@ const StyledLinkWrapper = styled.div`
|
|
|
38
38
|
|
|
39
39
|
const OneColumnCss = css`
|
|
40
40
|
background: #fff;
|
|
41
|
-
padding-top: ${
|
|
41
|
+
padding-top: ${spacing.xlarge};
|
|
42
42
|
margin-top: -${spacing.normal};
|
|
43
43
|
`;
|
|
44
44
|
|
|
@@ -99,7 +99,7 @@ const StyledMenuItem = styled.li<StyledMenuItemProps>`
|
|
|
99
99
|
width: 2px;
|
|
100
100
|
background: ${colors.brand.greyLight};
|
|
101
101
|
position: absolute;
|
|
102
|
-
transform: translate(29px, -${
|
|
102
|
+
transform: translate(29px, -${spacing.xlarge});
|
|
103
103
|
}
|
|
104
104
|
${(props) =>
|
|
105
105
|
!props.afterCurrent &&
|
|
@@ -115,7 +115,7 @@ const StyledMenuItem = styled.li<StyledMenuItemProps>`
|
|
|
115
115
|
&:after {
|
|
116
116
|
width: 4px;
|
|
117
117
|
background: ${colors.text.light};
|
|
118
|
-
transform: translate(28px, -${
|
|
118
|
+
transform: translate(28px, -${spacing.xlarge});
|
|
119
119
|
}
|
|
120
120
|
`}
|
|
121
121
|
${(props) =>
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ReactNode } from 'react';
|
|
10
|
-
import BEMHelper from 'react-bem-helper';
|
|
9
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
11
10
|
import styled from '@emotion/styled';
|
|
12
|
-
import { breakpoints, colors, mq, spacing } from '@ndla/core';
|
|
11
|
+
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
13
12
|
import { Launch } from '@ndla/icons/common';
|
|
14
13
|
import {
|
|
15
14
|
getLicenseByAbbreviation,
|
|
@@ -19,29 +18,40 @@ import {
|
|
|
19
18
|
} from '@ndla/licenses';
|
|
20
19
|
import type { MetaType } from '@ndla/licenses';
|
|
21
20
|
import { LicenseDescription } from '@ndla/notion';
|
|
21
|
+
import SafeLink from '@ndla/safelink';
|
|
22
|
+
import { Heading, Text } from '@ndla/typography';
|
|
22
23
|
import { uuid } from '@ndla/util';
|
|
23
24
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const StyledMediaList = styled.ul`
|
|
26
|
+
padding-left: 0;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
margin: ${spacing.normal} 0;
|
|
30
|
+
`;
|
|
28
31
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
32
|
+
export const MediaList = ({ children, ...rest }: ComponentProps<'ul'>) => (
|
|
33
|
+
<StyledMediaList {...rest}>{children}</StyledMediaList>
|
|
34
|
+
);
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
36
|
+
const StyledMediaListItem = styled.li`
|
|
37
|
+
margin-bottom: ${spacing.small};
|
|
38
|
+
padding: ${spacing.small} 0;
|
|
39
|
+
border-bottom: 1px solid ${colors.brand.tertiary};
|
|
40
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
}
|
|
37
44
|
|
|
38
|
-
|
|
45
|
+
&:last-of-type {
|
|
46
|
+
border-bottom: none;
|
|
47
|
+
}
|
|
48
|
+
img {
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
39
52
|
|
|
40
|
-
|
|
41
|
-
children
|
|
42
|
-
}
|
|
43
|
-
export const MediaListItem = ({ children }: MediaListItemProps) => (
|
|
44
|
-
<li {...oClasses(undefined, undefined, cClasses('item').className)}>{children}</li>
|
|
53
|
+
export const MediaListItem = ({ children, ...rest }: ComponentProps<'li'>) => (
|
|
54
|
+
<StyledMediaListItem {...rest}>{children}</StyledMediaListItem>
|
|
45
55
|
);
|
|
46
56
|
|
|
47
57
|
interface MediaListItemImageProps {
|
|
@@ -99,16 +109,6 @@ export const MediaListItemImage = ({ children, canOpen }: MediaListItemImageProp
|
|
|
99
109
|
</ImageWrapper>
|
|
100
110
|
);
|
|
101
111
|
|
|
102
|
-
interface MediaListCCLinkProps {
|
|
103
|
-
children: ReactNode;
|
|
104
|
-
url: string;
|
|
105
|
-
}
|
|
106
|
-
export const MediaListCCLink = ({ children, url }: MediaListCCLinkProps) => (
|
|
107
|
-
<a rel="noopener noreferrer license" href={url}>
|
|
108
|
-
{children}
|
|
109
|
-
</a>
|
|
110
|
-
);
|
|
111
|
-
|
|
112
112
|
interface MediaListItemBodyProps {
|
|
113
113
|
children: ReactNode;
|
|
114
114
|
license: string;
|
|
@@ -121,6 +121,25 @@ interface MediaListItemBodyProps {
|
|
|
121
121
|
title?: string;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
const StyledMediaListItemBody = styled.div`
|
|
125
|
+
${fonts.size.text.metaText.small};
|
|
126
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
127
|
+
max-width: 70%;
|
|
128
|
+
}
|
|
129
|
+
${mq.range({ from: breakpoints.desktop })} {
|
|
130
|
+
max-width: 75%;
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
133
|
+
|
|
134
|
+
const BodyTitle = styled(Text)`
|
|
135
|
+
color: ${colors.brand.primary};
|
|
136
|
+
font-weight: ${fonts.weight.bold};
|
|
137
|
+
margin-bottom: ${spacing.xsmall};
|
|
138
|
+
+ p {
|
|
139
|
+
margin-top: ${spacing.small};
|
|
140
|
+
}
|
|
141
|
+
`;
|
|
142
|
+
|
|
124
143
|
export const MediaListItemBody = ({
|
|
125
144
|
children,
|
|
126
145
|
license: licenseAbbreviation,
|
|
@@ -133,34 +152,44 @@ export const MediaListItemBody = ({
|
|
|
133
152
|
const license = getLicenseByAbbreviation(licenseAbbreviation, locale);
|
|
134
153
|
const containerProps = isCreativeCommonsLicense(license.rights)
|
|
135
154
|
? {
|
|
136
|
-
...oClasses('body', undefined, cClasses('body').className),
|
|
137
155
|
'xmlns:cc': 'https://creativecommons.org/ns#',
|
|
138
156
|
'xmlns:dct': 'http://purl.org/dc/terms/',
|
|
139
157
|
about: resourceUrl,
|
|
140
158
|
}
|
|
141
|
-
: {
|
|
142
|
-
...oClasses('body', undefined, cClasses('body').className),
|
|
143
|
-
};
|
|
159
|
+
: {};
|
|
144
160
|
|
|
145
161
|
const metaResourceType = getResourceTypeNamespace(resourceType);
|
|
146
162
|
|
|
147
163
|
return (
|
|
148
|
-
<
|
|
164
|
+
<StyledMediaListItemBody {...containerProps}>
|
|
149
165
|
{/* @ts-ignore */}
|
|
150
166
|
{metaResourceType && <span rel="dct:type" href={metaResourceType} style={{ display: 'none' }} />}
|
|
151
|
-
{title ?
|
|
167
|
+
{title ? (
|
|
168
|
+
<BodyTitle element="h3" margin="none" textStyle="meta-text-medium">
|
|
169
|
+
{title}
|
|
170
|
+
</BodyTitle>
|
|
171
|
+
) : null}
|
|
152
172
|
<LicenseDescription locale={locale} messages={messages} licenseRights={license.rights} highlightCC />
|
|
153
|
-
<
|
|
173
|
+
<SafeLink rel="noopener noreferrer license" target="_blank" to={license.url}>
|
|
174
|
+
{license.linkText}
|
|
175
|
+
</SafeLink>
|
|
154
176
|
{children}
|
|
155
|
-
</
|
|
177
|
+
</StyledMediaListItemBody>
|
|
156
178
|
);
|
|
157
179
|
};
|
|
158
180
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
181
|
+
const StyledMediaListItemActions = styled.div`
|
|
182
|
+
margin: ${spacing.small} 0;
|
|
183
|
+
list-style: none;
|
|
184
|
+
width: 100%;
|
|
185
|
+
button,
|
|
186
|
+
a {
|
|
187
|
+
margin: 0 ${spacing.small} ${spacing.small} 0;
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
190
|
+
|
|
191
|
+
export const MediaListItemActions = ({ children, ...rest }: ComponentProps<'div'>) => (
|
|
192
|
+
<StyledMediaListItemActions {...rest}>{children}</StyledMediaListItemActions>
|
|
164
193
|
);
|
|
165
194
|
|
|
166
195
|
const isLink = (text: string) => text.startsWith('http') || text.startsWith('https');
|
|
@@ -173,9 +202,9 @@ interface HandleLinkProps {
|
|
|
173
202
|
export const HandleLink = ({ text, children }: HandleLinkProps) => {
|
|
174
203
|
if (isLink(text)) {
|
|
175
204
|
return (
|
|
176
|
-
<
|
|
205
|
+
<SafeLink to={text} target="_blank" rel="noopener noreferrer">
|
|
177
206
|
{children}
|
|
178
|
-
</
|
|
207
|
+
</SafeLink>
|
|
179
208
|
);
|
|
180
209
|
}
|
|
181
210
|
return <span>{children}</span>;
|
|
@@ -221,18 +250,32 @@ function isAttributionItem(item: ItemType): item is ItemTypeWithDescription {
|
|
|
221
250
|
return attributionTypes.some((type) => type === item.metaType);
|
|
222
251
|
}
|
|
223
252
|
|
|
253
|
+
const StyledMediaListItemMeta = styled.ul`
|
|
254
|
+
margin: ${spacing.small} 0;
|
|
255
|
+
list-style: none;
|
|
256
|
+
width: 100%;
|
|
257
|
+
button,
|
|
258
|
+
a {
|
|
259
|
+
margin: 0 ${spacing.small} ${spacing.small} 0;
|
|
260
|
+
}
|
|
261
|
+
`;
|
|
262
|
+
|
|
263
|
+
const StyledMediaListMetaItem = styled.li`
|
|
264
|
+
margin: 0;
|
|
265
|
+
padding: 0;
|
|
266
|
+
`;
|
|
267
|
+
|
|
224
268
|
export const MediaListItemMeta = ({ items = [] }: MediaListItemMetaProps) => {
|
|
225
269
|
const attributionItems = items.filter(isAttributionItem);
|
|
226
270
|
const attributionMeta = attributionItems.map((item) => `${item.label}: ${item.description}`).join(', ');
|
|
227
271
|
|
|
228
272
|
return (
|
|
229
|
-
|
|
230
|
-
<ul {...cClasses('actions')} property="cc:attributionName" content={attributionMeta}>
|
|
273
|
+
<StyledMediaListItemMeta property="cc:attributionName" content={attributionMeta}>
|
|
231
274
|
{items.map((item) => (
|
|
232
|
-
<
|
|
275
|
+
<StyledMediaListMetaItem key={uuid()}>
|
|
233
276
|
<ItemText item={item} />
|
|
234
|
-
</
|
|
277
|
+
</StyledMediaListMetaItem>
|
|
235
278
|
))}
|
|
236
|
-
</
|
|
279
|
+
</StyledMediaListItemMeta>
|
|
237
280
|
);
|
|
238
281
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
import { breakpoints, mq, spacing
|
|
11
|
+
import { breakpoints, mq, spacing } from '@ndla/core';
|
|
12
12
|
import FilmContentCard from './FilmContentCard';
|
|
13
13
|
import { setAnimations, StyledHeadingH1 } from './filmStyles';
|
|
14
14
|
import { MovieResourceType, MovieType } from './types';
|
|
@@ -27,8 +27,8 @@ const MovieListing = styled.div<MovieListingProps>`
|
|
|
27
27
|
margin-left: ${spacing.normal};
|
|
28
28
|
margin-right: ${spacing.normal};
|
|
29
29
|
${mq.range({ from: breakpoints.desktop })} {
|
|
30
|
-
margin-left: ${
|
|
31
|
-
margin-right: ${
|
|
30
|
+
margin-left: ${spacing.xlarge};
|
|
31
|
+
margin-right: ${spacing.xlarge};
|
|
32
32
|
}
|
|
33
33
|
> div {
|
|
34
34
|
opacity: 0;
|