@ndla/ui 44.0.23 → 45.0.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/AudioPlayer/Controls.js +21 -21
- package/es/CampaignBlock/CampaignBlock.js +13 -16
- package/es/CompetenceGoalTab/CompetenceItem.js +9 -9
- package/es/Embed/ImageEmbed.js +17 -9
- package/es/ErrorMessage/ErrorMessage.js +7 -7
- package/es/Layout/PageContainer.js +7 -3
- package/es/LicenseByline/EmbedByline.js +6 -6
- package/es/List/OrderedList.js +1 -1
- package/es/List/UnOrderedList.js +1 -1
- package/es/NDLAFilm/AllMoviesAlphabetically.js +11 -9
- package/es/NDLAFilm/FilmContentCard.js +45 -29
- package/es/NDLAFilm/FilmContentCardTags.js +13 -9
- package/es/NDLAFilm/FilmMovieList.js +7 -16
- package/es/NDLAFilm/FilmMovieSearch.js +4 -4
- package/es/NDLAFilm/FilmSlideshow.js +55 -106
- package/es/NDLAFilm/MovieGrid.js +9 -12
- package/es/NDLAFilm/filmStyles.js +4 -4
- package/es/Table/Table.js +8 -6
- package/es/TreeStructure/FolderItem.js +11 -12
- package/es/all.css +1 -1
- package/es/locale/messages-en.js +3 -2
- package/es/locale/messages-nb.js +3 -2
- package/es/locale/messages-nn.js +3 -2
- package/es/locale/messages-se.js +2 -1
- package/es/locale/messages-sma.js +3 -2
- package/lib/AudioPlayer/Controls.js +21 -21
- package/lib/CampaignBlock/CampaignBlock.d.ts +3 -3
- package/lib/CampaignBlock/CampaignBlock.js +13 -16
- package/lib/CompetenceGoalTab/CompetenceItem.js +9 -9
- package/lib/Embed/ImageEmbed.d.ts +6 -6
- package/lib/Embed/ImageEmbed.js +17 -9
- package/lib/ErrorMessage/ErrorMessage.js +7 -7
- package/lib/Layout/PageContainer.d.ts +3 -3
- package/lib/Layout/PageContainer.js +16 -11
- package/lib/LicenseByline/EmbedByline.js +6 -6
- package/lib/List/OrderedList.js +1 -1
- package/lib/List/UnOrderedList.js +1 -1
- package/lib/NDLAFilm/AllMoviesAlphabetically.js +11 -9
- package/lib/NDLAFilm/FilmContentCard.d.ts +3 -4
- package/lib/NDLAFilm/FilmContentCard.js +50 -35
- package/lib/NDLAFilm/FilmContentCardTags.js +13 -9
- package/lib/NDLAFilm/FilmMovieList.d.ts +1 -4
- package/lib/NDLAFilm/FilmMovieList.js +14 -21
- package/lib/NDLAFilm/FilmMovieSearch.js +4 -4
- package/lib/NDLAFilm/FilmSlideshow.d.ts +0 -9
- package/lib/NDLAFilm/FilmSlideshow.js +54 -106
- package/lib/NDLAFilm/MovieGrid.d.ts +1 -4
- package/lib/NDLAFilm/MovieGrid.js +8 -11
- package/lib/NDLAFilm/filmStyles.d.ts +2 -6
- package/lib/NDLAFilm/filmStyles.js +3 -3
- package/lib/Table/Table.js +8 -6
- package/lib/TreeStructure/FolderItem.js +11 -12
- package/lib/all.css +1 -1
- package/lib/locale/messages-en.d.ts +1 -0
- package/lib/locale/messages-en.js +3 -2
- package/lib/locale/messages-nb.d.ts +1 -0
- package/lib/locale/messages-nb.js +3 -2
- package/lib/locale/messages-nn.d.ts +1 -0
- package/lib/locale/messages-nn.js +3 -2
- package/lib/locale/messages-se.d.ts +1 -0
- package/lib/locale/messages-se.js +2 -1
- package/lib/locale/messages-sma.d.ts +1 -0
- package/lib/locale/messages-sma.js +3 -2
- package/package.json +20 -20
- package/src/Aside/component.aside.scss +1 -2
- package/src/AudioPlayer/Controls.tsx +1 -0
- package/src/CampaignBlock/CampaignBlock.stories.tsx +5 -8
- package/src/CampaignBlock/CampaignBlock.tsx +15 -17
- package/src/CompetenceGoalTab/CompetenceItem.tsx +0 -1
- package/src/Embed/ImageEmbed.tsx +13 -12
- package/src/ErrorMessage/ErrorMessage.tsx +1 -1
- package/src/FactBox/component.factbox.scss +1 -2
- package/src/Layout/PageContainer.tsx +8 -3
- package/src/LicenseByline/EmbedByline.tsx +3 -3
- package/src/List/OrderedList.tsx +1 -0
- package/src/List/UnOrderedList.tsx +0 -3
- package/src/NDLAFilm/AllMoviesAlphabetically.tsx +2 -0
- package/src/NDLAFilm/FilmContentCard.tsx +48 -51
- package/src/NDLAFilm/FilmContentCardTags.tsx +5 -2
- package/src/NDLAFilm/FilmMovieList.tsx +4 -21
- package/src/NDLAFilm/FilmMovieSearch.tsx +0 -1
- package/src/NDLAFilm/FilmSlideshow.tsx +47 -100
- package/src/NDLAFilm/MovieGrid.tsx +11 -17
- package/src/NDLAFilm/filmStyles.ts +8 -7
- package/src/Table/Table.tsx +8 -1
- package/src/TreeStructure/FolderItem.tsx +0 -1
- package/src/locale/messages-en.ts +3 -2
- package/src/locale/messages-nb.ts +3 -2
- package/src/locale/messages-nn.ts +3 -2
- package/src/locale/messages-se.ts +2 -1
- package/src/locale/messages-sma.ts +3 -2
- package/es/NDLAFilm/NavigationArrow.js +0 -54
- package/es/NDLAFilm/SlideshowIndicator.js +0 -47
- package/lib/NDLAFilm/NavigationArrow.d.ts +0 -23
- package/lib/NDLAFilm/NavigationArrow.js +0 -63
- package/lib/NDLAFilm/SlideshowIndicator.d.ts +0 -15
- package/lib/NDLAFilm/SlideshowIndicator.js +0 -55
- package/src/NDLAFilm/NavigationArrow.tsx +0 -108
- package/src/NDLAFilm/SlideshowIndicator.tsx +0 -82
|
@@ -307,7 +307,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
307
307
|
},
|
|
308
308
|
socialMedia: {
|
|
309
309
|
heading: 'Follow us',
|
|
310
|
-
description: 'NDLA has several
|
|
310
|
+
description: 'NDLA has several Facebook- and X-accounts. Find the one that suits you, and follow us!',
|
|
311
311
|
mainLink: {
|
|
312
312
|
name: 'Follow us'
|
|
313
313
|
}
|
|
@@ -1017,6 +1017,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1017
1017
|
showLess: 'Show less'
|
|
1018
1018
|
},
|
|
1019
1019
|
files: 'Files',
|
|
1020
|
+
fileTypesNotSupported: 'Filetype(s) not supported: {{fileTypes}}',
|
|
1020
1021
|
download: 'Download file: ',
|
|
1021
1022
|
expandButton: 'Show large version'
|
|
1022
1023
|
}, _licenses.contributorTypes.en), {}, {
|
|
@@ -1175,7 +1176,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1175
1176
|
loginTextLink: 'privacy policy here',
|
|
1176
1177
|
loginTerms: 'Log in with Feide to receive access. By logging on your accept your terms of service',
|
|
1177
1178
|
loginResourcePitch: 'Do you want to favorite this resource?',
|
|
1178
|
-
loginWelcome: 'Welcome to My NDLA! This page allows you to organize your articles in your
|
|
1179
|
+
loginWelcome: 'Welcome to My NDLA! This page allows you to organize your articles in your own way!',
|
|
1179
1180
|
deleteAccount: 'Delete My NDLA',
|
|
1180
1181
|
welcome: 'Welcome to my NDLA! You can now save your favourite resources from NDLA and organise them in folders with tags',
|
|
1181
1182
|
read: {
|
|
@@ -305,7 +305,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
305
305
|
},
|
|
306
306
|
socialMedia: {
|
|
307
307
|
heading: 'Følg oss',
|
|
308
|
-
description: 'NDLA har mange Facebook- og
|
|
308
|
+
description: 'NDLA har mange Facebook- og X-kontoer. Finn den som passer for deg, og følg oss!!',
|
|
309
309
|
mainLink: {
|
|
310
310
|
name: 'Følg oss'
|
|
311
311
|
}
|
|
@@ -1015,6 +1015,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1015
1015
|
showLess: 'Vis mindre'
|
|
1016
1016
|
},
|
|
1017
1017
|
files: 'Filer',
|
|
1018
|
+
fileTypesNotSupported: 'Filtypen(e) støttes ikke: {{fileTypes}}',
|
|
1018
1019
|
download: 'Last ned fil: ',
|
|
1019
1020
|
expandButton: 'Vis stor versjon'
|
|
1020
1021
|
}, _licenses.contributorTypes.nb), {}, {
|
|
@@ -1174,7 +1175,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1174
1175
|
loginTextLink: 'personvernerklæring her',
|
|
1175
1176
|
loginTerms: 'Logg på med Feide for å få tilgang. Ved å logge på godkjenner du våre vilkår for bruk',
|
|
1176
1177
|
loginResourcePitch: 'Ønsker du å favorittmerke denne ressursen?',
|
|
1177
|
-
loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på
|
|
1178
|
+
loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på din måte!',
|
|
1178
1179
|
welcome: 'Velkommen til Min NDLA! Nå kan du lagre favorittressursene dine fra NDLA og organisere dem i mapper og med emneknagger.',
|
|
1179
1180
|
read: {
|
|
1180
1181
|
read: 'Les',
|
|
@@ -305,7 +305,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
305
305
|
},
|
|
306
306
|
socialMedia: {
|
|
307
307
|
heading: 'Følg oss',
|
|
308
|
-
description: 'NDLA har mange Facebook- og
|
|
308
|
+
description: 'NDLA har mange Facebook- og X-kontoar. Finn den som passar for deg, og følg oss',
|
|
309
309
|
mainLink: {
|
|
310
310
|
name: 'Følg oss'
|
|
311
311
|
}
|
|
@@ -1015,6 +1015,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1015
1015
|
},
|
|
1016
1016
|
source: 'Kjelde',
|
|
1017
1017
|
files: 'Filer',
|
|
1018
|
+
fileTypesNotSupported: 'Filtypen(e) støttast ikkje: {{fileTypes}}',
|
|
1018
1019
|
download: 'Last ned fil: ',
|
|
1019
1020
|
expandButton: 'Vis stor versjon'
|
|
1020
1021
|
}, _licenses.contributorTypes.nn), {}, {
|
|
@@ -1174,7 +1175,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1174
1175
|
loginTextLink: 'personvernerklæring her',
|
|
1175
1176
|
loginTerms: 'Logg på med Feide for å få tilgang. Ved å logge på godkjennar du våre vilkår for bruk',
|
|
1176
1177
|
loginResourcePitch: 'Ønsker du å favorittmerke denne resursen?',
|
|
1177
|
-
loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på
|
|
1178
|
+
loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på din måte!',
|
|
1178
1179
|
welcome: 'Velkommen til Min NDLA! No kan du lagre favorittressursane dine frå NDLA og organisere dei i mapper og med emneknaggar.',
|
|
1179
1180
|
read: {
|
|
1180
1181
|
read: 'Les',
|
|
@@ -305,7 +305,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
305
305
|
},
|
|
306
306
|
socialMedia: {
|
|
307
307
|
heading: 'Čuovo min',
|
|
308
|
-
description: 'NDLAs leat máŋga Facebook- ja
|
|
308
|
+
description: 'NDLAs leat máŋga Facebook- ja X-konttu. Gávnna dan mii dutnje heive ja čuovo min!',
|
|
309
309
|
mainLink: {
|
|
310
310
|
name: 'Čuovo min'
|
|
311
311
|
}
|
|
@@ -1015,6 +1015,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1015
1015
|
showLess: 'Čájet unnit'
|
|
1016
1016
|
},
|
|
1017
1017
|
files: 'Fiillat',
|
|
1018
|
+
fileTypesNotSupported: 'Filtypen(e) støttast ikkje: {{fileTypes}}',
|
|
1018
1019
|
download: 'Viečča fiilla: ',
|
|
1019
1020
|
expandButton: 'Čájet stuora veršuvnna'
|
|
1020
1021
|
}, _licenses.contributorTypes.se), {}, {
|
|
@@ -305,7 +305,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
305
305
|
},
|
|
306
306
|
socialMedia: {
|
|
307
307
|
heading: 'Fulkh mijjem',
|
|
308
|
-
description: 'NDLA gellie Facebook- jïh
|
|
308
|
+
description: 'NDLA gellie Facebook- jïh X-kontoeh åtna. Gaavnh dam mij dutnjien sjeahta jïh fulkh mijjem!',
|
|
309
309
|
mainLink: {
|
|
310
310
|
name: 'Fulkh mijjem'
|
|
311
311
|
}
|
|
@@ -1015,6 +1015,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1015
1015
|
showLess: 'Vis mindre'
|
|
1016
1016
|
},
|
|
1017
1017
|
files: 'Filer',
|
|
1018
|
+
fileTypesNotSupported: 'Filtypen(e) støttast ikkje: {{fileTypes}}',
|
|
1018
1019
|
download: 'Veedtjh fijlem: ',
|
|
1019
1020
|
expandButton: 'Vuesehth stoerre versjovnem'
|
|
1020
1021
|
}, _licenses.contributorTypes.nb), {}, {
|
|
@@ -1174,7 +1175,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1174
1175
|
loginTextLink: 'personvernerklæring her',
|
|
1175
1176
|
loginTerms: 'Logg på med Feide for å få tilgang. Ved å logge på godkjenner du våre vilkår for bruk',
|
|
1176
1177
|
loginResourcePitch: 'Ønsker du å favorittmerke denne ressursen?',
|
|
1177
|
-
loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på
|
|
1178
|
+
loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på din måte!',
|
|
1178
1179
|
welcome: 'Velkommen til Min NDLA! Nå kan du lagre favorittressursene dine fra NDLA og organisere dem i mapper og med emneknagger.',
|
|
1179
1180
|
read: {
|
|
1180
1181
|
read: 'Les',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "45.0.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,24 +31,24 @@
|
|
|
31
31
|
"types"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/accordion": "^2.2.
|
|
35
|
-
"@ndla/article-scripts": "^3.0.
|
|
36
|
-
"@ndla/button": "^11.0.
|
|
37
|
-
"@ndla/carousel": "^
|
|
38
|
-
"@ndla/core": "^4.1.
|
|
39
|
-
"@ndla/dropdown-menu": "^1.0.
|
|
40
|
-
"@ndla/forms": "^4.3.
|
|
41
|
-
"@ndla/hooks": "^2.0
|
|
42
|
-
"@ndla/icons": "^4.0.
|
|
34
|
+
"@ndla/accordion": "^2.2.22",
|
|
35
|
+
"@ndla/article-scripts": "^3.0.21",
|
|
36
|
+
"@ndla/button": "^11.0.7",
|
|
37
|
+
"@ndla/carousel": "^4.0.0",
|
|
38
|
+
"@ndla/core": "^4.1.7",
|
|
39
|
+
"@ndla/dropdown-menu": "^1.0.5",
|
|
40
|
+
"@ndla/forms": "^4.3.22",
|
|
41
|
+
"@ndla/hooks": "^2.1.0",
|
|
42
|
+
"@ndla/icons": "^4.0.6",
|
|
43
43
|
"@ndla/licenses": "^7.1.3",
|
|
44
|
-
"@ndla/modal": "^4.0.
|
|
45
|
-
"@ndla/notion": "^5.0.
|
|
46
|
-
"@ndla/safelink": "^4.1.
|
|
47
|
-
"@ndla/select": "^2.4.
|
|
48
|
-
"@ndla/switch": "^1.1.
|
|
49
|
-
"@ndla/tabs": "^3.0.
|
|
50
|
-
"@ndla/tooltip": "^4.1.
|
|
51
|
-
"@ndla/util": "^3.
|
|
44
|
+
"@ndla/modal": "^4.0.6",
|
|
45
|
+
"@ndla/notion": "^5.0.22",
|
|
46
|
+
"@ndla/safelink": "^4.1.21",
|
|
47
|
+
"@ndla/select": "^2.4.12",
|
|
48
|
+
"@ndla/switch": "^1.1.12",
|
|
49
|
+
"@ndla/tabs": "^3.0.8",
|
|
50
|
+
"@ndla/tooltip": "^4.1.18",
|
|
51
|
+
"@ndla/util": "^3.2.0",
|
|
52
52
|
"@radix-ui/react-popover": "^1.0.6",
|
|
53
53
|
"@radix-ui/react-slider": "^1.1.2",
|
|
54
54
|
"date-fns": "^2.30.0",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
|
|
75
75
|
"@ndla/types-backend": "^0.2.5",
|
|
76
|
-
"@ndla/types-embed": "^
|
|
76
|
+
"@ndla/types-embed": "^4.0.0",
|
|
77
77
|
"css-loader": "^6.7.3",
|
|
78
78
|
"mini-css-extract-plugin": "^2.7.5",
|
|
79
79
|
"sass-loader": "^13.2.2",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "5acc97933b03a599d9ad83a4e3a6d305b573f83c"
|
|
87
87
|
}
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
args: {},
|
|
21
21
|
} as Meta<typeof CampaignBlock>;
|
|
22
22
|
|
|
23
|
-
export const
|
|
23
|
+
export const ImageLeft: StoryObj<typeof CampaignBlock> = {
|
|
24
24
|
args: {
|
|
25
25
|
title: { title: 'NDLA film', language: 'nb-no' },
|
|
26
26
|
description: {
|
|
@@ -32,18 +32,14 @@ export const BothImages: StoryObj<typeof CampaignBlock> = {
|
|
|
32
32
|
url: '#',
|
|
33
33
|
text: 'Gå til NDLA film',
|
|
34
34
|
},
|
|
35
|
-
|
|
35
|
+
image: {
|
|
36
36
|
alt: '',
|
|
37
37
|
src: 'https://api.test.ndla.no/image-api/raw/n2UYRxEG.png',
|
|
38
38
|
},
|
|
39
|
-
imageAfter: {
|
|
40
|
-
alt: '',
|
|
41
|
-
src: 'https://api.test.ndla.no/image-api/raw/8GOxOhjr.png',
|
|
42
|
-
},
|
|
43
39
|
},
|
|
44
40
|
};
|
|
45
41
|
|
|
46
|
-
export const
|
|
42
|
+
export const ImageRight: StoryObj<typeof CampaignBlock> = {
|
|
47
43
|
args: {
|
|
48
44
|
title: { title: 'FN-dagen 24. oktober!', language: 'nb-no' },
|
|
49
45
|
description: {
|
|
@@ -54,9 +50,10 @@ export const SingleImage: StoryObj<typeof CampaignBlock> = {
|
|
|
54
50
|
url: '#',
|
|
55
51
|
text: 'Les mer om FN-dagen',
|
|
56
52
|
},
|
|
57
|
-
|
|
53
|
+
image: {
|
|
58
54
|
alt: 'FN-symbol',
|
|
59
55
|
src: 'https://api.test.ndla.no/image-api/raw/LkmDGtip.png',
|
|
60
56
|
},
|
|
57
|
+
imageSide: 'right',
|
|
61
58
|
},
|
|
62
59
|
};
|
|
@@ -33,8 +33,8 @@ interface Props {
|
|
|
33
33
|
url: string;
|
|
34
34
|
text: string;
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
image?: Image;
|
|
37
|
+
imageSide?: 'left' | 'right';
|
|
38
38
|
className?: string;
|
|
39
39
|
path?: string;
|
|
40
40
|
}
|
|
@@ -43,14 +43,20 @@ const Container = styled.div`
|
|
|
43
43
|
max-width: 390px;
|
|
44
44
|
display: flex;
|
|
45
45
|
flex-direction: column;
|
|
46
|
-
gap: ${spacing.
|
|
46
|
+
gap: ${spacing.normal};
|
|
47
47
|
border: 1px ${colors.brand.lighter} solid;
|
|
48
48
|
border-radius: ${misc.borderRadius};
|
|
49
|
-
padding: ${spacing.normal}
|
|
49
|
+
padding: ${spacing.normal};
|
|
50
50
|
background-color: ${colors.white};
|
|
51
|
+
&[data-image-side='right'] {
|
|
52
|
+
flex-direction: column-reverse;
|
|
53
|
+
}
|
|
51
54
|
${mq.range({ from: breakpoints.tabletWide })} {
|
|
52
55
|
max-width: 1100px;
|
|
53
56
|
flex-direction: row;
|
|
57
|
+
&[data-image-side='right'] {
|
|
58
|
+
flex-direction: row-reverse;
|
|
59
|
+
}
|
|
54
60
|
}
|
|
55
61
|
`;
|
|
56
62
|
|
|
@@ -69,17 +75,10 @@ const StyledImg = styled.img`
|
|
|
69
75
|
`;
|
|
70
76
|
|
|
71
77
|
const StyledLink = styled(SafeLink)`
|
|
72
|
-
display: flex;
|
|
78
|
+
display: inline-flex;
|
|
73
79
|
align-items: center;
|
|
74
80
|
gap: ${spacing.xxsmall};
|
|
75
|
-
box-shadow: none;
|
|
76
|
-
text-decoration: underline;
|
|
77
|
-
font-weight: ${fonts.weight.semibold};
|
|
78
81
|
color: ${colors.brand.primary};
|
|
79
|
-
&:hover,
|
|
80
|
-
&:focus-visible {
|
|
81
|
-
text-decoration: none;
|
|
82
|
-
}
|
|
83
82
|
`;
|
|
84
83
|
|
|
85
84
|
const TextWrapper = styled.div`
|
|
@@ -88,18 +87,18 @@ const TextWrapper = styled.div`
|
|
|
88
87
|
|
|
89
88
|
const CampaignBlock = ({
|
|
90
89
|
title,
|
|
91
|
-
|
|
90
|
+
image,
|
|
91
|
+
imageSide = 'left',
|
|
92
92
|
description,
|
|
93
93
|
headingLevel: Heading = 'h2',
|
|
94
|
-
imageAfter,
|
|
95
94
|
url,
|
|
96
95
|
path,
|
|
97
96
|
className,
|
|
98
97
|
}: Props) => {
|
|
99
98
|
const href = usePossiblyRelativeUrl(url.url, path);
|
|
100
99
|
return (
|
|
101
|
-
<Container className={className} data-type="campaign-block">
|
|
102
|
-
{
|
|
100
|
+
<Container className={className} data-type="campaign-block" data-image-side={imageSide}>
|
|
101
|
+
{image && <StyledImg src={image.src} height={200} width={240} alt="" />}
|
|
103
102
|
<TextWrapper>
|
|
104
103
|
<Heading css={headingStyle}>{title.title}</Heading>
|
|
105
104
|
<StyledDescription>{description.text}</StyledDescription>
|
|
@@ -108,7 +107,6 @@ const CampaignBlock = ({
|
|
|
108
107
|
<Forward />
|
|
109
108
|
</StyledLink>
|
|
110
109
|
</TextWrapper>
|
|
111
|
-
{imageAfter && <StyledImg src={imageAfter.src} height={200} width={240} alt="" />}
|
|
112
110
|
</Container>
|
|
113
111
|
);
|
|
114
112
|
};
|
package/src/Embed/ImageEmbed.tsx
CHANGED
|
@@ -77,24 +77,25 @@ const getSizes = (size?: string, align?: string) => {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
export const getFocalPoint = (data: ImageEmbedData) => {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
const focalX = parseFloat(data.focalX ?? '');
|
|
81
|
+
const focalY = parseFloat(data.focalY ?? '');
|
|
82
|
+
if (!!focalX && !!focalY) {
|
|
83
|
+
return { x: focalX, y: focalY };
|
|
82
84
|
}
|
|
83
85
|
return undefined;
|
|
84
86
|
};
|
|
85
87
|
|
|
86
88
|
export const getCrop = (data: ImageEmbedData) => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
) {
|
|
89
|
+
const lowerRightX = parseFloat(data.lowerRightX ?? '');
|
|
90
|
+
const lowerRightY = parseFloat(data.lowerRightY ?? '');
|
|
91
|
+
const upperLeftX = parseFloat(data.upperLeftX ?? '');
|
|
92
|
+
const upperLeftY = parseFloat(data.upperLeftY ?? '');
|
|
93
|
+
if (!!lowerRightX && !!lowerRightY && !!upperLeftX && !!upperLeftY) {
|
|
93
94
|
return {
|
|
94
|
-
startX:
|
|
95
|
-
startY:
|
|
96
|
-
endX:
|
|
97
|
-
endY:
|
|
95
|
+
startX: lowerRightX,
|
|
96
|
+
startY: lowerRightY,
|
|
97
|
+
endX: upperLeftX,
|
|
98
|
+
endY: upperLeftY,
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
101
|
return undefined;
|
|
@@ -69,7 +69,7 @@ export const ErrorMessage = ({ children, messages, illustration, illustrationEle
|
|
|
69
69
|
{messages.description && <Description>{messages.description}</Description>}
|
|
70
70
|
{customElement && <CustomElementWrapper>{customElement}</CustomElementWrapper>}
|
|
71
71
|
{messages.linksTitle && <h2>{messages.linksTitle}</h2>}
|
|
72
|
-
{messages.back &&
|
|
72
|
+
{messages.back && (
|
|
73
73
|
<SafeLink to={`/#${encodeURI(messages.back)}`} onClick={() => window.history.back()}>
|
|
74
74
|
{messages.back}
|
|
75
75
|
</SafeLink>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ReactNode } from 'react';
|
|
9
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
10
10
|
import BEMHelper from 'react-bem-helper';
|
|
11
11
|
|
|
12
12
|
const classes = new BEMHelper({
|
|
@@ -14,7 +14,7 @@ const classes = new BEMHelper({
|
|
|
14
14
|
prefix: 'o-',
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
interface Props {
|
|
17
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
18
18
|
children?: ReactNode;
|
|
19
19
|
background?: boolean;
|
|
20
20
|
backgroundWide?: boolean;
|
|
@@ -28,6 +28,11 @@ export const PageContainer = ({
|
|
|
28
28
|
backgroundWide = false,
|
|
29
29
|
ndlaFilm = false,
|
|
30
30
|
learningPath = false,
|
|
31
|
-
|
|
31
|
+
...rest
|
|
32
|
+
}: Props) => (
|
|
33
|
+
<div {...classes('', { background, backgroundWide, ndlaFilm, learningPath })} {...rest}>
|
|
34
|
+
{children}
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
32
37
|
|
|
33
38
|
export default PageContainer;
|
|
@@ -76,7 +76,7 @@ const BylineWrapper = styled.div`
|
|
|
76
76
|
${fonts.sizes('18px', '24px')};
|
|
77
77
|
background-color: ${colors.brand.lightest};
|
|
78
78
|
padding: ${spacing.nsmall} ${spacing.normal};
|
|
79
|
-
border: 1px solid ${colors.brand.
|
|
79
|
+
border: 1px solid ${colors.brand.light};
|
|
80
80
|
border-top: none;
|
|
81
81
|
|
|
82
82
|
&[data-top-rounded='true'] {
|
|
@@ -94,7 +94,7 @@ const BylineWrapper = styled.div`
|
|
|
94
94
|
background-color: ${colors.support.redLightest};
|
|
95
95
|
}
|
|
96
96
|
&[data-first='true'] {
|
|
97
|
-
border-top: 1px solid ${colors.brand.
|
|
97
|
+
border-top: 1px solid ${colors.brand.light};
|
|
98
98
|
}
|
|
99
99
|
`;
|
|
100
100
|
|
|
@@ -113,7 +113,7 @@ const RightsWrapper = styled.div`
|
|
|
113
113
|
${mobileStyling}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
${mq.range({ until: breakpoints.
|
|
116
|
+
${mq.range({ until: breakpoints.tabletWide })} {
|
|
117
117
|
${mobileStyling}
|
|
118
118
|
}
|
|
119
119
|
`;
|
package/src/List/OrderedList.tsx
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import styled from '@emotion/styled';
|
|
10
10
|
import { colors, fonts, spacing } from '@ndla/core';
|
|
11
11
|
import { forwardRef, HTMLAttributes } from 'react';
|
|
12
|
-
import { generateListResets } from './OrderedList';
|
|
13
12
|
|
|
14
13
|
const StyledUl = styled.ul`
|
|
15
14
|
padding-left: ${spacing.nsmall} !important;
|
|
@@ -18,9 +17,7 @@ const StyledUl = styled.ul`
|
|
|
18
17
|
${fonts.sizes('18px', '29px')};
|
|
19
18
|
|
|
20
19
|
ul {
|
|
21
|
-
list-style-image: none;
|
|
22
20
|
padding-left: ${spacing.nsmall};
|
|
23
|
-
|
|
24
21
|
margin-left: 0 !important;
|
|
25
22
|
}
|
|
26
23
|
|
|
@@ -130,6 +130,8 @@ const AllMoviesAlphabetically = ({ movies }: Props) => {
|
|
|
130
130
|
<MovieItem key={movie.id}>
|
|
131
131
|
<StyledSafeLink to={movie.path}>
|
|
132
132
|
<MovieImage
|
|
133
|
+
alt=""
|
|
134
|
+
loading="lazy"
|
|
133
135
|
src={
|
|
134
136
|
movie?.metaImage?.url ? `${movie.metaImage?.url}?${makeSrcQueryString(IMAGE_WIDTH * 2)}` : undefined
|
|
135
137
|
}
|