@ndla/ui 44.0.24 → 45.0.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/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/Topic/Topic.js +17 -20
- 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/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/Topic/Topic.js +17 -20
- 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/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/Topic/Topic.tsx +2 -7
- 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
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { HTMLAttributes } from 'react';
|
|
10
|
-
import { spacing, colors, fonts, breakpoints, misc } from '@ndla/core';
|
|
10
|
+
import { spacing, colors, fonts, breakpoints, misc, mq } from '@ndla/core';
|
|
11
11
|
import SafeLink from '@ndla/safelink';
|
|
12
12
|
import styled from '@emotion/styled';
|
|
13
13
|
import { makeSrcQueryString } from '../Image';
|
|
@@ -16,46 +16,36 @@ import { MovieResourceType, MovieType } from './types';
|
|
|
16
16
|
|
|
17
17
|
interface Props extends HTMLAttributes<HTMLElement> {
|
|
18
18
|
movie: MovieType;
|
|
19
|
-
columnWidth: number;
|
|
20
|
-
distanceBetweenItems?: number;
|
|
21
19
|
resourceTypes: MovieResourceType[];
|
|
22
|
-
resizeThumbnailImages?: boolean;
|
|
23
20
|
hideTags?: boolean;
|
|
24
21
|
className?: string;
|
|
22
|
+
lazy?: boolean;
|
|
23
|
+
type?: 'slideshow' | 'list';
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
const FilmContentCard = ({
|
|
28
27
|
movie: { metaImage, resourceTypes: movieResourceTypes, title, id, path },
|
|
29
|
-
columnWidth,
|
|
30
|
-
distanceBetweenItems,
|
|
31
28
|
resourceTypes,
|
|
32
|
-
resizeThumbnailImages,
|
|
33
29
|
hideTags = false,
|
|
34
30
|
className,
|
|
31
|
+
type = 'slideshow',
|
|
32
|
+
lazy,
|
|
35
33
|
...rest
|
|
36
34
|
}: Props) => {
|
|
37
|
-
|
|
38
|
-
const contentTypeId =
|
|
39
|
-
if (resizeThumbnailImages && metaImage) {
|
|
40
|
-
backgroundImage += '?width=480';
|
|
41
|
-
}
|
|
35
|
+
const backgroundImage = metaImage ? `${metaImage.url}?${makeSrcQueryString(600)}` : '';
|
|
36
|
+
const contentTypeId = `${type}-content-type-${id}`;
|
|
42
37
|
|
|
43
38
|
return (
|
|
44
39
|
<StyledSafeLink
|
|
45
40
|
onMouseDown={(e) => e.preventDefault()}
|
|
46
41
|
to={path}
|
|
42
|
+
data-type={type}
|
|
47
43
|
aria-describedby={contentTypeId}
|
|
48
|
-
columnWidth={columnWidth}
|
|
49
44
|
className={className}
|
|
50
|
-
style={{ marginRight: `${distanceBetweenItems}px` }}
|
|
51
45
|
{...rest}
|
|
52
46
|
>
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
style={{
|
|
56
|
-
backgroundImage: `url(${backgroundImage}?${makeSrcQueryString(600)})`,
|
|
57
|
-
}}
|
|
58
|
-
>
|
|
47
|
+
<ImageWrapper>
|
|
48
|
+
<StyledImage src={backgroundImage} loading={lazy ? 'lazy' : 'eager'} alt="" />
|
|
59
49
|
{movieResourceTypes && !hideTags && (
|
|
60
50
|
<FilmContentCardTags
|
|
61
51
|
id={contentTypeId}
|
|
@@ -63,7 +53,7 @@ const FilmContentCard = ({
|
|
|
63
53
|
resourceTypes={resourceTypes}
|
|
64
54
|
/>
|
|
65
55
|
)}
|
|
66
|
-
</
|
|
56
|
+
</ImageWrapper>
|
|
67
57
|
<StyledMovieTitle>{title}</StyledMovieTitle>
|
|
68
58
|
</StyledSafeLink>
|
|
69
59
|
);
|
|
@@ -81,32 +71,21 @@ const StyledMovieTitle = styled.span`
|
|
|
81
71
|
}
|
|
82
72
|
`;
|
|
83
73
|
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
background-size: cover;
|
|
74
|
+
const ImageWrapper = styled.div`
|
|
75
|
+
position: relative;
|
|
87
76
|
background-color: ${colors.ndlaFilm.filmColorLight};
|
|
88
|
-
background-position-x: center;
|
|
89
|
-
background-position-y: center;
|
|
90
77
|
border-radius: ${misc.borderRadius};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
background: ${colors.ndlaFilm.filmColor};
|
|
99
|
-
opacity: 0;
|
|
100
|
-
position: absolute;
|
|
101
|
-
top: 0;
|
|
102
|
-
bottom: 0;
|
|
103
|
-
left: 0;
|
|
104
|
-
right: 0;
|
|
105
|
-
}
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
const StyledImage = styled.img`
|
|
82
|
+
aspect-ratio: 16/9;
|
|
83
|
+
width: 100%;
|
|
84
|
+
object-fit: cover;
|
|
106
85
|
`;
|
|
107
86
|
|
|
108
87
|
interface StyledSlideWrapperProps {
|
|
109
|
-
columnWidth
|
|
88
|
+
columnWidth?: number;
|
|
110
89
|
}
|
|
111
90
|
|
|
112
91
|
const shouldForwardProp = (p: string) => p !== 'columnWidth';
|
|
@@ -115,8 +94,7 @@ const StyledSafeLink = styled(SafeLink, { shouldForwardProp })<StyledSlideWrappe
|
|
|
115
94
|
display: flex;
|
|
116
95
|
flex-direction: column;
|
|
117
96
|
gap: ${spacing.small};
|
|
118
|
-
|
|
119
|
-
color: #fff;
|
|
97
|
+
color: ${colors.white};
|
|
120
98
|
box-shadow: none;
|
|
121
99
|
&:hover,
|
|
122
100
|
&:focus-within,
|
|
@@ -125,13 +103,32 @@ const StyledSafeLink = styled(SafeLink, { shouldForwardProp })<StyledSlideWrappe
|
|
|
125
103
|
${StyledMovieTitle} {
|
|
126
104
|
text-decoration: underline;
|
|
127
105
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
106
|
+
[data-content-cards] {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
}
|
|
109
|
+
img {
|
|
110
|
+
opacity: 0.7;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
&[data-type='slideshow'] {
|
|
114
|
+
width: 30vw;
|
|
115
|
+
${mq.range({ until: breakpoints.tablet })} {
|
|
116
|
+
width: 40vw;
|
|
117
|
+
}
|
|
118
|
+
${mq.range({ from: breakpoints.desktop })} {
|
|
119
|
+
width: 30vw;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
&[data-type='list'] {
|
|
123
|
+
width: 40vw;
|
|
124
|
+
${mq.range({ from: breakpoints.tablet, until: breakpoints.desktop })} {
|
|
125
|
+
width: 28vw;
|
|
126
|
+
}
|
|
127
|
+
${mq.range({ from: breakpoints.desktop })} {
|
|
128
|
+
width: 20vw;
|
|
129
|
+
}
|
|
130
|
+
${mq.range({ from: breakpoints.ultraWide })} {
|
|
131
|
+
width: 14vw;
|
|
135
132
|
}
|
|
136
133
|
}
|
|
137
134
|
`;
|
|
@@ -6,7 +6,9 @@ const StyledWrapperDiv = styled.div`
|
|
|
6
6
|
transition: opacity 200ms ease;
|
|
7
7
|
padding: ${spacing.xsmall} ${spacing.xsmall};
|
|
8
8
|
opacity: 0;
|
|
9
|
-
|
|
9
|
+
position: absolute;
|
|
10
|
+
bottom: 0px;
|
|
11
|
+
left: 0px;
|
|
10
12
|
z-index: 1;
|
|
11
13
|
`;
|
|
12
14
|
|
|
@@ -35,7 +37,8 @@ const FilmContentCardTags = ({ movieResourceTypes, resourceTypes, id }: Props) =
|
|
|
35
37
|
}
|
|
36
38
|
});
|
|
37
39
|
return (
|
|
38
|
-
|
|
40
|
+
// data-content-cards is used to set the opacity of tags on hover/focus
|
|
41
|
+
<StyledWrapperDiv id={id} data-content-cards="">
|
|
39
42
|
{Object.keys(resources).map((resourceName) => (
|
|
40
43
|
<StyledMovieTags key={resourceName}>{resourceName}</StyledMovieTags>
|
|
41
44
|
))}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { Carousel
|
|
8
|
+
import { Carousel } from '@ndla/carousel';
|
|
9
9
|
import styled from '@emotion/styled';
|
|
10
10
|
import { IconButtonV2 } from '@ndla/button';
|
|
11
11
|
import { ChevronLeft, ChevronRight } from '@ndla/icons/common';
|
|
@@ -20,8 +20,6 @@ interface Props {
|
|
|
20
20
|
slideBackwardsLabel: string;
|
|
21
21
|
slideForwardsLabel: string;
|
|
22
22
|
resourceTypes: MovieResourceType[];
|
|
23
|
-
autoSizedProps: CalculatedCarouselProps;
|
|
24
|
-
resizeThumbnailImages?: boolean;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
const StyledSection = styled.section`
|
|
@@ -31,17 +29,9 @@ const StyledSection = styled.section`
|
|
|
31
29
|
}
|
|
32
30
|
`;
|
|
33
31
|
|
|
34
|
-
const FilmMovieList = ({
|
|
35
|
-
name,
|
|
36
|
-
movies = [],
|
|
37
|
-
slideBackwardsLabel,
|
|
38
|
-
slideForwardsLabel,
|
|
39
|
-
resourceTypes = [],
|
|
40
|
-
autoSizedProps,
|
|
41
|
-
resizeThumbnailImages,
|
|
42
|
-
}: Props) => (
|
|
32
|
+
const FilmMovieList = ({ name, movies = [], slideBackwardsLabel, slideForwardsLabel, resourceTypes = [] }: Props) => (
|
|
43
33
|
<StyledSection>
|
|
44
|
-
{!!name && <StyledHeadingH2
|
|
34
|
+
{!!name && <StyledHeadingH2>{name}</StyledHeadingH2>}
|
|
45
35
|
<Carousel
|
|
46
36
|
leftButton={
|
|
47
37
|
<IconButtonV2 aria-label={slideBackwardsLabel}>
|
|
@@ -54,15 +44,8 @@ const FilmMovieList = ({
|
|
|
54
44
|
</IconButtonV2>
|
|
55
45
|
}
|
|
56
46
|
items={movies.map((movie) => (
|
|
57
|
-
<FilmContentCard
|
|
58
|
-
key={movie.id}
|
|
59
|
-
movie={movie}
|
|
60
|
-
columnWidth={autoSizedProps.columnWidth}
|
|
61
|
-
resourceTypes={resourceTypes}
|
|
62
|
-
resizeThumbnailImages={resizeThumbnailImages}
|
|
63
|
-
/>
|
|
47
|
+
<FilmContentCard key={movie.id} movie={movie} type="list" lazy resourceTypes={resourceTypes} />
|
|
64
48
|
))}
|
|
65
|
-
{...autoSizedProps}
|
|
66
49
|
/>
|
|
67
50
|
</StyledSection>
|
|
68
51
|
);
|
|
@@ -8,64 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
import { useCallback, useState } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
import { Carousel
|
|
12
|
-
import { breakpoints, colors, misc, mq, spacing
|
|
11
|
+
import { Carousel } from '@ndla/carousel';
|
|
12
|
+
import { breakpoints, colors, misc, mq, spacing } from '@ndla/core';
|
|
13
13
|
import SafeLink from '@ndla/safelink';
|
|
14
14
|
import { IconButtonV2 } from '@ndla/button';
|
|
15
15
|
import { ChevronLeft, ChevronRight } from '@ndla/icons/common';
|
|
16
16
|
import FilmContentCard from './FilmContentCard';
|
|
17
17
|
import { MovieType } from './types';
|
|
18
|
-
|
|
19
|
-
export const slideshowBreakpoints: {
|
|
20
|
-
until?: keyof typeof breakpoints;
|
|
21
|
-
columnsPrSlide: number;
|
|
22
|
-
distanceBetweenItems: number;
|
|
23
|
-
arrowOffset: number;
|
|
24
|
-
margin?: number;
|
|
25
|
-
maxColumnWidth?: number;
|
|
26
|
-
}[] = [
|
|
27
|
-
{
|
|
28
|
-
until: 'mobileWide',
|
|
29
|
-
columnsPrSlide: 2,
|
|
30
|
-
distanceBetweenItems: spacingUnit / 2,
|
|
31
|
-
margin: spacingUnit,
|
|
32
|
-
arrowOffset: 13,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
until: 'tabletWide',
|
|
36
|
-
columnsPrSlide: 3,
|
|
37
|
-
distanceBetweenItems: spacingUnit / 2,
|
|
38
|
-
margin: spacingUnit,
|
|
39
|
-
arrowOffset: 13,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
until: 'desktop',
|
|
43
|
-
columnsPrSlide: 3,
|
|
44
|
-
distanceBetweenItems: spacingUnit,
|
|
45
|
-
margin: spacingUnit * 2,
|
|
46
|
-
arrowOffset: 0,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
until: 'wide',
|
|
50
|
-
columnsPrSlide: 3,
|
|
51
|
-
distanceBetweenItems: spacingUnit,
|
|
52
|
-
margin: spacingUnit * 2,
|
|
53
|
-
arrowOffset: 0,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
until: 'ultraWide',
|
|
57
|
-
columnsPrSlide: 3,
|
|
58
|
-
distanceBetweenItems: spacingUnit,
|
|
59
|
-
margin: spacingUnit * 3.5,
|
|
60
|
-
arrowOffset: 0,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
columnsPrSlide: 3,
|
|
64
|
-
distanceBetweenItems: spacingUnit,
|
|
65
|
-
margin: spacingUnit * 3.5,
|
|
66
|
-
arrowOffset: 0,
|
|
67
|
-
},
|
|
68
|
-
];
|
|
18
|
+
import Image from '../Image';
|
|
69
19
|
|
|
70
20
|
interface Props {
|
|
71
21
|
slideshow: MovieType[];
|
|
@@ -106,8 +56,9 @@ const InfoWrapper = styled.div`
|
|
|
106
56
|
}
|
|
107
57
|
`;
|
|
108
58
|
|
|
109
|
-
const StyledImg = styled
|
|
59
|
+
const StyledImg = styled(Image)`
|
|
110
60
|
max-height: 600px;
|
|
61
|
+
min-height: 600px;
|
|
111
62
|
object-position: top;
|
|
112
63
|
width: 100%;
|
|
113
64
|
aspect-ratio: 16/9;
|
|
@@ -124,7 +75,7 @@ const CarouselContainer = styled.div`
|
|
|
124
75
|
margin-top: -70px;
|
|
125
76
|
}
|
|
126
77
|
${mq.range({ from: breakpoints.desktop })} {
|
|
127
|
-
margin-top: -
|
|
78
|
+
margin-top: -160px;
|
|
128
79
|
}
|
|
129
80
|
`;
|
|
130
81
|
|
|
@@ -148,62 +99,59 @@ const FilmSlideshow = ({ slideshow }: Props) => {
|
|
|
148
99
|
const [currentSlide, setCurrentSlide] = useState(slideshow[0]);
|
|
149
100
|
|
|
150
101
|
return (
|
|
151
|
-
<
|
|
152
|
-
{
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
</
|
|
162
|
-
</
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
))}
|
|
184
|
-
{...autoSizedProps}
|
|
102
|
+
<section>
|
|
103
|
+
<StyledSafeLink to={currentSlide.path} tabIndex={-1} aria-hidden>
|
|
104
|
+
<StyledImg
|
|
105
|
+
src={currentSlide.metaImage?.url ?? ''}
|
|
106
|
+
sizes="(min-width: 1140px) 1140px, (min-width: 720px) 100vw, 100vw"
|
|
107
|
+
alt=""
|
|
108
|
+
/>
|
|
109
|
+
<SlideInfoWrapper>
|
|
110
|
+
<InfoWrapper>
|
|
111
|
+
<h3>{currentSlide.title}</h3>
|
|
112
|
+
<span id="currentMovieDescription">{currentSlide.metaDescription}</span>
|
|
113
|
+
</InfoWrapper>
|
|
114
|
+
</SlideInfoWrapper>
|
|
115
|
+
</StyledSafeLink>
|
|
116
|
+
<CarouselContainer>
|
|
117
|
+
<Carousel
|
|
118
|
+
leftButton={
|
|
119
|
+
<SlideshowButton aria-label="">
|
|
120
|
+
<ChevronLeft />
|
|
121
|
+
</SlideshowButton>
|
|
122
|
+
}
|
|
123
|
+
rightButton={
|
|
124
|
+
<SlideshowButton aria-label="">
|
|
125
|
+
<ChevronRight />
|
|
126
|
+
</SlideshowButton>
|
|
127
|
+
}
|
|
128
|
+
items={slideshow.map((movie) => (
|
|
129
|
+
<FilmCard
|
|
130
|
+
key={movie.id}
|
|
131
|
+
current={movie.id === currentSlide.id}
|
|
132
|
+
movie={movie}
|
|
133
|
+
setCurrentSlide={setCurrentSlide}
|
|
185
134
|
/>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
</
|
|
135
|
+
))}
|
|
136
|
+
/>
|
|
137
|
+
</CarouselContainer>
|
|
138
|
+
</section>
|
|
190
139
|
);
|
|
191
140
|
};
|
|
192
141
|
|
|
193
142
|
interface FilmCardProps {
|
|
194
|
-
setCurrentSlide: () => void;
|
|
143
|
+
setCurrentSlide: (movie: MovieType) => void;
|
|
195
144
|
movie: MovieType;
|
|
196
145
|
current: boolean;
|
|
197
|
-
columnWidth: number;
|
|
198
146
|
}
|
|
199
147
|
|
|
200
|
-
const FilmCard = ({ setCurrentSlide, movie, current
|
|
148
|
+
const FilmCard = ({ setCurrentSlide, movie, current }: FilmCardProps) => {
|
|
201
149
|
const [hoverCallback, setHoverCallback] = useState<ReturnType<typeof setTimeout> | undefined>(undefined);
|
|
202
150
|
|
|
203
151
|
const onHover = useCallback(() => {
|
|
204
|
-
const timeout = setTimeout(() => setCurrentSlide(), 500);
|
|
152
|
+
const timeout = setTimeout(() => setCurrentSlide(movie), 500);
|
|
205
153
|
setHoverCallback(timeout);
|
|
206
|
-
}, [setCurrentSlide]);
|
|
154
|
+
}, [movie, setCurrentSlide]);
|
|
207
155
|
|
|
208
156
|
return (
|
|
209
157
|
<StyledFilmContentCard
|
|
@@ -214,12 +162,11 @@ const FilmCard = ({ setCurrentSlide, movie, current, columnWidth }: FilmCardProp
|
|
|
214
162
|
setHoverCallback(undefined);
|
|
215
163
|
}
|
|
216
164
|
}}
|
|
217
|
-
onFocus={() => setCurrentSlide()}
|
|
165
|
+
onFocus={() => setCurrentSlide(movie)}
|
|
218
166
|
current={current}
|
|
219
167
|
aria-describedby={'currentMovieDescription'}
|
|
220
168
|
key={movie.id}
|
|
221
169
|
movie={movie}
|
|
222
|
-
columnWidth={columnWidth}
|
|
223
170
|
resourceTypes={[]}
|
|
224
171
|
/>
|
|
225
172
|
);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import { spacing } from '@ndla/core';
|
|
3
|
-
import { CalculatedCarouselProps } from '@ndla/carousel';
|
|
2
|
+
import { breakpoints, mq, spacing, spacingUnit } from '@ndla/core';
|
|
4
3
|
import { useTranslation } from 'react-i18next';
|
|
5
4
|
import FilmContentCard from './FilmContentCard';
|
|
6
5
|
import { MovieResourceType, MovieType } from './types';
|
|
@@ -13,9 +12,16 @@ interface MovieListingProps {
|
|
|
13
12
|
const MovieListing = styled.div<MovieListingProps>`
|
|
14
13
|
display: flex;
|
|
15
14
|
flex-wrap: wrap;
|
|
15
|
+
gap: ${spacing.normal};
|
|
16
16
|
margin: ${spacing.small} 0;
|
|
17
17
|
margin-left: ${(props) => props.marginLeft && `${props.marginLeft}px`};
|
|
18
18
|
${setAnimations()};
|
|
19
|
+
margin-left: ${spacing.normal};
|
|
20
|
+
margin-right: ${spacing.normal};
|
|
21
|
+
${mq.range({ from: breakpoints.desktop })} {
|
|
22
|
+
margin-left: ${spacingUnit * 3}px;
|
|
23
|
+
margin-right: ${spacingUnit * 3}px;
|
|
24
|
+
}
|
|
19
25
|
> div {
|
|
20
26
|
opacity: 0;
|
|
21
27
|
animation-fill-mode: forwards;
|
|
@@ -33,13 +39,11 @@ const LoadingPlaceholder = styled.div<LoadingPlaceholderProps>`
|
|
|
33
39
|
`;
|
|
34
40
|
|
|
35
41
|
interface Props {
|
|
36
|
-
autoSizedProps: CalculatedCarouselProps;
|
|
37
42
|
resourceTypeName?: MovieResourceType;
|
|
38
43
|
fetchingMoviesByType: boolean;
|
|
39
44
|
moviesByType: MovieType[];
|
|
40
45
|
resourceTypes: MovieResourceType[];
|
|
41
46
|
loadingPlaceholderHeight?: string;
|
|
42
|
-
resizeThumbnailImages?: boolean;
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
const MovieGrid = ({
|
|
@@ -48,13 +52,11 @@ const MovieGrid = ({
|
|
|
48
52
|
moviesByType,
|
|
49
53
|
resourceTypes,
|
|
50
54
|
loadingPlaceholderHeight,
|
|
51
|
-
autoSizedProps,
|
|
52
|
-
resizeThumbnailImages,
|
|
53
55
|
}: Props) => {
|
|
54
56
|
const { t } = useTranslation();
|
|
55
57
|
return (
|
|
56
58
|
<section>
|
|
57
|
-
<StyledHeadingH1
|
|
59
|
+
<StyledHeadingH1>
|
|
58
60
|
{resourceTypeName && resourceTypeName.name}
|
|
59
61
|
<small>
|
|
60
62
|
{fetchingMoviesByType
|
|
@@ -62,19 +64,11 @@ const MovieGrid = ({
|
|
|
62
64
|
: `${moviesByType.length} ${t('ndlaFilm.movieMatchInCategory')}`}
|
|
63
65
|
</small>
|
|
64
66
|
</StyledHeadingH1>
|
|
65
|
-
<MovieListing
|
|
67
|
+
<MovieListing>
|
|
66
68
|
{fetchingMoviesByType && <LoadingPlaceholder height={loadingPlaceholderHeight} />}
|
|
67
69
|
{!fetchingMoviesByType &&
|
|
68
70
|
moviesByType.map((movie, index) => (
|
|
69
|
-
<FilmContentCard
|
|
70
|
-
key={index}
|
|
71
|
-
hideTags
|
|
72
|
-
movie={movie}
|
|
73
|
-
columnWidth={autoSizedProps.columnWidth}
|
|
74
|
-
distanceBetweenItems={autoSizedProps.distanceBetweenItems}
|
|
75
|
-
resourceTypes={resourceTypes}
|
|
76
|
-
resizeThumbnailImages={resizeThumbnailImages}
|
|
77
|
-
/>
|
|
71
|
+
<FilmContentCard key={index} hideTags movie={movie} resourceTypes={resourceTypes} lazy type="list" />
|
|
78
72
|
))}
|
|
79
73
|
</MovieListing>
|
|
80
74
|
</section>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import { fonts, spacing, colors } from '@ndla/core';
|
|
2
|
+
import { fonts, spacing, colors, mq, breakpoints, spacingUnit } from '@ndla/core';
|
|
3
3
|
|
|
4
4
|
export const setAnimations = () => {
|
|
5
5
|
const styles: any = {};
|
|
@@ -11,23 +11,24 @@ export const setAnimations = () => {
|
|
|
11
11
|
return styles;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
marginLeft?: number;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const StyledHeadingH1 = styled.h1<StyledHeadingProps>`
|
|
14
|
+
export const StyledHeadingH1 = styled.h1`
|
|
19
15
|
${fonts.sizes('22px', '26px')};
|
|
20
16
|
font-weight: ${fonts.weight.semibold};
|
|
21
17
|
text-transform: uppercase;
|
|
22
18
|
letter-spacing: 0.05em;
|
|
23
19
|
color: ${colors.white};
|
|
24
20
|
margin: ${spacing.xsmall} 0;
|
|
25
|
-
margin-left: ${(props) => props.marginLeft && `${props.marginLeft}px`};
|
|
26
21
|
small {
|
|
27
22
|
font-weight: normal;
|
|
28
23
|
padding-left: ${spacing.small};
|
|
29
24
|
color: ${colors.brand.grey};
|
|
30
25
|
}
|
|
26
|
+
margin-left: ${spacing.normal};
|
|
27
|
+
margin-right: ${spacing.normal};
|
|
28
|
+
${mq.range({ from: breakpoints.desktop })} {
|
|
29
|
+
margin-left: ${spacingUnit * 3}px;
|
|
30
|
+
margin-right: ${spacingUnit * 3}px;
|
|
31
|
+
}
|
|
31
32
|
`;
|
|
32
33
|
|
|
33
34
|
export const StyledHeadingH2 = StyledHeadingH1.withComponent('h2');
|
package/src/Table/Table.tsx
CHANGED
|
@@ -143,7 +143,14 @@ export const TableStyling = css`
|
|
|
143
143
|
|
|
144
144
|
ol,
|
|
145
145
|
ul {
|
|
146
|
-
|
|
146
|
+
li,
|
|
147
|
+
li p {
|
|
148
|
+
${fonts.sizes('14px', '22px')};
|
|
149
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
150
|
+
${fonts.sizes('15px', '30px')};
|
|
151
|
+
}
|
|
152
|
+
margin: ${spacing.xsmall} 0 !important;
|
|
153
|
+
}
|
|
147
154
|
}
|
|
148
155
|
|
|
149
156
|
p {
|
package/src/Topic/Topic.tsx
CHANGED
|
@@ -243,7 +243,6 @@ const Topic = ({
|
|
|
243
243
|
}: TopicProps) => {
|
|
244
244
|
const { t } = useTranslation();
|
|
245
245
|
const contentId = `expanded-description-${id}`;
|
|
246
|
-
const testId = 'nav-topic-about';
|
|
247
246
|
|
|
248
247
|
const VisualElementIcon = useMemo(() => {
|
|
249
248
|
if (!visualElementEmbedMeta || visualElementEmbedMeta.status === 'error') return null;
|
|
@@ -267,15 +266,11 @@ const Topic = ({
|
|
|
267
266
|
|
|
268
267
|
const wrapperStyle = [frame ? frameStyle : undefined, invertedStyle ? _invertedStyle : undefined];
|
|
269
268
|
if (isLoading) {
|
|
270
|
-
return
|
|
271
|
-
<Wrapper css={wrapperStyle} data-testid={testId}>
|
|
272
|
-
{isLoading ? <Loader /> : null}
|
|
273
|
-
</Wrapper>
|
|
274
|
-
);
|
|
269
|
+
return <Wrapper css={wrapperStyle}>{isLoading ? <Loader /> : null}</Wrapper>;
|
|
275
270
|
}
|
|
276
271
|
|
|
277
272
|
return (
|
|
278
|
-
<Wrapper css={wrapperStyle}
|
|
273
|
+
<Wrapper css={wrapperStyle}>
|
|
279
274
|
<TopicIntroductionWrapper>
|
|
280
275
|
<div>
|
|
281
276
|
<HeadingWrapper>
|
|
@@ -305,7 +305,7 @@ const messages = {
|
|
|
305
305
|
},
|
|
306
306
|
socialMedia: {
|
|
307
307
|
heading: 'Follow us',
|
|
308
|
-
description: 'NDLA has several
|
|
308
|
+
description: 'NDLA has several Facebook- and X-accounts. Find the one that suits you, and follow us!',
|
|
309
309
|
mainLink: {
|
|
310
310
|
name: 'Follow us',
|
|
311
311
|
},
|
|
@@ -1052,6 +1052,7 @@ const messages = {
|
|
|
1052
1052
|
showLess: 'Show less',
|
|
1053
1053
|
},
|
|
1054
1054
|
files: 'Files',
|
|
1055
|
+
fileTypesNotSupported: 'Filetype(s) not supported: {{fileTypes}}',
|
|
1055
1056
|
download: 'Download file: ',
|
|
1056
1057
|
expandButton: 'Show large version',
|
|
1057
1058
|
...contributorTypes.en,
|
|
@@ -1222,7 +1223,7 @@ const messages = {
|
|
|
1222
1223
|
loginTextLink: 'privacy policy here',
|
|
1223
1224
|
loginTerms: 'Log in with Feide to receive access. By logging on your accept your terms of service',
|
|
1224
1225
|
loginResourcePitch: 'Do you want to favorite this resource?',
|
|
1225
|
-
loginWelcome: 'Welcome to My NDLA! This page allows you to organize your articles in your
|
|
1226
|
+
loginWelcome: 'Welcome to My NDLA! This page allows you to organize your articles in your own way!',
|
|
1226
1227
|
deleteAccount: 'Delete My NDLA',
|
|
1227
1228
|
welcome:
|
|
1228
1229
|
'Welcome to my NDLA! You can now save your favourite resources from NDLA and organise them in folders with tags',
|
|
@@ -304,7 +304,7 @@ const messages = {
|
|
|
304
304
|
},
|
|
305
305
|
socialMedia: {
|
|
306
306
|
heading: 'Følg oss',
|
|
307
|
-
description: 'NDLA har mange Facebook- og
|
|
307
|
+
description: 'NDLA har mange Facebook- og X-kontoer. Finn den som passer for deg, og følg oss!!',
|
|
308
308
|
mainLink: {
|
|
309
309
|
name: 'Følg oss',
|
|
310
310
|
},
|
|
@@ -1051,6 +1051,7 @@ const messages = {
|
|
|
1051
1051
|
showLess: 'Vis mindre',
|
|
1052
1052
|
},
|
|
1053
1053
|
files: 'Filer',
|
|
1054
|
+
fileTypesNotSupported: 'Filtypen(e) støttes ikke: {{fileTypes}}',
|
|
1054
1055
|
download: 'Last ned fil: ',
|
|
1055
1056
|
expandButton: 'Vis stor versjon',
|
|
1056
1057
|
...contributorTypes.nb,
|
|
@@ -1220,7 +1221,7 @@ const messages = {
|
|
|
1220
1221
|
loginTextLink: 'personvernerklæring her',
|
|
1221
1222
|
loginTerms: 'Logg på med Feide for å få tilgang. Ved å logge på godkjenner du våre vilkår for bruk',
|
|
1222
1223
|
loginResourcePitch: 'Ønsker du å favorittmerke denne ressursen?',
|
|
1223
|
-
loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på
|
|
1224
|
+
loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på din måte!',
|
|
1224
1225
|
welcome:
|
|
1225
1226
|
'Velkommen til Min NDLA! Nå kan du lagre favorittressursene dine fra NDLA og organisere dem i mapper og med emneknagger.',
|
|
1226
1227
|
read: { read: 'Les', our: ' vår.' },
|