@ndla/ui 36.0.0 → 36.0.2
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/BlogPost/BlogPost.js +4 -4
- package/es/CampaignBlock/CampaignBlock.js +77 -0
- package/es/CampaignBlock/index.js +9 -0
- package/es/ContactBlock/ContactBlock.js +63 -39
- package/es/Embed/BrightcoveEmbed.js +3 -3
- package/es/LicenseByline/EmbedByline.js +90 -0
- package/es/LicenseByline/LicenseDescription.js +37 -0
- package/es/LicenseByline/LicenseLink.js +36 -0
- package/es/LicenseByline/index.js +1 -0
- package/es/Messages/MessageBox.js +9 -9
- package/es/locale/messages-en.js +8 -1
- package/es/locale/messages-nb.js +8 -1
- package/es/locale/messages-nn.js +8 -1
- package/es/locale/messages-se.js +8 -1
- package/es/locale/messages-sma.js +8 -1
- package/lib/BlogPost/BlogPost.js +4 -4
- package/lib/CampaignBlock/CampaignBlock.d.ts +31 -0
- package/lib/CampaignBlock/CampaignBlock.js +82 -0
- package/lib/CampaignBlock/index.d.ts +8 -0
- package/lib/CampaignBlock/index.js +13 -0
- package/lib/ContactBlock/ContactBlock.js +63 -39
- package/lib/Embed/BrightcoveEmbed.js +3 -3
- package/lib/LicenseByline/EmbedByline.d.ts +43 -0
- package/lib/LicenseByline/EmbedByline.js +95 -0
- package/lib/LicenseByline/LicenseDescription.d.ts +12 -0
- package/lib/LicenseByline/LicenseDescription.js +43 -0
- package/lib/LicenseByline/LicenseLink.d.ts +14 -0
- package/lib/LicenseByline/LicenseLink.js +44 -0
- package/lib/LicenseByline/index.d.ts +1 -0
- package/lib/LicenseByline/index.js +13 -0
- package/lib/Messages/MessageBox.js +9 -9
- package/lib/locale/messages-en.d.ts +7 -0
- package/lib/locale/messages-en.js +8 -1
- package/lib/locale/messages-nb.d.ts +7 -0
- package/lib/locale/messages-nb.js +8 -1
- package/lib/locale/messages-nn.d.ts +7 -0
- package/lib/locale/messages-nn.js +8 -1
- package/lib/locale/messages-se.d.ts +7 -0
- package/lib/locale/messages-se.js +8 -1
- package/lib/locale/messages-sma.d.ts +7 -0
- package/lib/locale/messages-sma.js +8 -1
- package/package.json +2 -2
- package/src/BlogPost/BlogPost.tsx +0 -4
- package/src/CampaignBlock/CampaignBlock.stories.tsx +63 -0
- package/src/CampaignBlock/CampaignBlock.tsx +99 -0
- package/src/CampaignBlock/index.ts +9 -0
- package/src/ContactBlock/ContactBlock.tsx +27 -19
- package/src/ContactBlock/Contactblock.stories.tsx +0 -1
- package/src/Embed/BrightcoveEmbed.tsx +1 -1
- package/src/LicenseByline/EmbedByline.stories.tsx +82 -0
- package/src/LicenseByline/EmbedByline.tsx +117 -0
- package/src/LicenseByline/LicenseDescription.tsx +37 -0
- package/src/LicenseByline/LicenseLink.tsx +42 -0
- package/src/LicenseByline/index.tsx +1 -0
- package/src/Messages/MessageBox.tsx +1 -1
- package/src/locale/messages-en.ts +7 -0
- package/src/locale/messages-nb.ts +7 -0
- package/src/locale/messages-nn.ts +7 -0
- package/src/locale/messages-se.ts +7 -0
- package/src/locale/messages-sma.ts +7 -0
|
@@ -1256,7 +1256,14 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1256
1256
|
embed: {
|
|
1257
1257
|
conceptListError: 'Failed to show concept list',
|
|
1258
1258
|
linkError: 'Failed to show link.',
|
|
1259
|
-
unsupported: "Embed {{type}} not supported."
|
|
1259
|
+
unsupported: "Embed {{type}} not supported.",
|
|
1260
|
+
type: {
|
|
1261
|
+
image: 'Image',
|
|
1262
|
+
video: 'Video',
|
|
1263
|
+
audio: 'Audio',
|
|
1264
|
+
podcast: 'Podcast',
|
|
1265
|
+
concept: 'Concept'
|
|
1266
|
+
}
|
|
1260
1267
|
}
|
|
1261
1268
|
});
|
|
1262
1269
|
var _default = messages;
|
|
@@ -269,6 +269,13 @@ declare const messages: {
|
|
|
269
269
|
conceptListError: string;
|
|
270
270
|
linkError: string;
|
|
271
271
|
unsupported: string;
|
|
272
|
+
type: {
|
|
273
|
+
image: string;
|
|
274
|
+
video: string;
|
|
275
|
+
audio: string;
|
|
276
|
+
podcast: string;
|
|
277
|
+
concept: string;
|
|
278
|
+
};
|
|
272
279
|
};
|
|
273
280
|
common: {
|
|
274
281
|
subject: string;
|
|
@@ -1256,7 +1256,14 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1256
1256
|
embed: {
|
|
1257
1257
|
conceptListError: 'Klarte ikke å vise forklaringsliste',
|
|
1258
1258
|
linkError: 'Klarte ikke å vise lenke.',
|
|
1259
|
-
unsupported: "Embed {{type}} er ikke st\xF8ttet."
|
|
1259
|
+
unsupported: "Embed {{type}} er ikke st\xF8ttet.",
|
|
1260
|
+
type: {
|
|
1261
|
+
image: 'Bilde',
|
|
1262
|
+
video: 'Video',
|
|
1263
|
+
audio: 'Lyd',
|
|
1264
|
+
podcast: 'Podkast',
|
|
1265
|
+
concept: 'Forklaring'
|
|
1266
|
+
}
|
|
1260
1267
|
}
|
|
1261
1268
|
});
|
|
1262
1269
|
var _default = messages;
|
|
@@ -269,6 +269,13 @@ declare const messages: {
|
|
|
269
269
|
conceptListError: string;
|
|
270
270
|
linkError: string;
|
|
271
271
|
unsupported: string;
|
|
272
|
+
type: {
|
|
273
|
+
image: string;
|
|
274
|
+
video: string;
|
|
275
|
+
audio: string;
|
|
276
|
+
podcast: string;
|
|
277
|
+
concept: string;
|
|
278
|
+
};
|
|
272
279
|
};
|
|
273
280
|
common: {
|
|
274
281
|
subject: string;
|
|
@@ -1256,7 +1256,14 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1256
1256
|
embed: {
|
|
1257
1257
|
conceptListError: 'Klarte ikkje å vise forklaringsliste',
|
|
1258
1258
|
linkError: 'Klarte ikkje å vise lenke.',
|
|
1259
|
-
unsupported: "Embed {{type}} er ikkje st\xF8tta."
|
|
1259
|
+
unsupported: "Embed {{type}} er ikkje st\xF8tta.",
|
|
1260
|
+
type: {
|
|
1261
|
+
image: 'Bilde',
|
|
1262
|
+
video: 'Video',
|
|
1263
|
+
audio: 'Lyd',
|
|
1264
|
+
podcast: 'Podkast',
|
|
1265
|
+
concept: 'Forklaring'
|
|
1266
|
+
}
|
|
1260
1267
|
}
|
|
1261
1268
|
});
|
|
1262
1269
|
var _default = messages;
|
|
@@ -269,6 +269,13 @@ declare const messages: {
|
|
|
269
269
|
conceptListError: string;
|
|
270
270
|
linkError: string;
|
|
271
271
|
unsupported: string;
|
|
272
|
+
type: {
|
|
273
|
+
image: string;
|
|
274
|
+
video: string;
|
|
275
|
+
audio: string;
|
|
276
|
+
podcast: string;
|
|
277
|
+
concept: string;
|
|
278
|
+
};
|
|
272
279
|
};
|
|
273
280
|
common: {
|
|
274
281
|
subject: string;
|
|
@@ -1256,7 +1256,14 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1256
1256
|
embed: {
|
|
1257
1257
|
conceptListError: 'Ii sáhttán čájehit čilgehuslisttu',
|
|
1258
1258
|
linkError: 'Ii sáhttán čájehit liŋkka.',
|
|
1259
|
-
unsupported: "Embed {{type}} ii dorjojuvvo."
|
|
1259
|
+
unsupported: "Embed {{type}} ii dorjojuvvo.",
|
|
1260
|
+
type: {
|
|
1261
|
+
image: 'Bilde',
|
|
1262
|
+
video: 'Video',
|
|
1263
|
+
audio: 'Lyd',
|
|
1264
|
+
podcast: 'Podkast',
|
|
1265
|
+
concept: 'Forklaring'
|
|
1266
|
+
}
|
|
1260
1267
|
}
|
|
1261
1268
|
});
|
|
1262
1269
|
var _default = messages;
|
|
@@ -269,6 +269,13 @@ declare const messages: {
|
|
|
269
269
|
conceptListError: string;
|
|
270
270
|
linkError: string;
|
|
271
271
|
unsupported: string;
|
|
272
|
+
type: {
|
|
273
|
+
image: string;
|
|
274
|
+
video: string;
|
|
275
|
+
audio: string;
|
|
276
|
+
podcast: string;
|
|
277
|
+
concept: string;
|
|
278
|
+
};
|
|
272
279
|
};
|
|
273
280
|
common: {
|
|
274
281
|
subject: string;
|
|
@@ -1256,7 +1256,14 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1256
1256
|
embed: {
|
|
1257
1257
|
conceptListError: 'Klarte ikkje å vise forklaringsliste',
|
|
1258
1258
|
linkError: 'Klarte ikkje å vise lenke.',
|
|
1259
|
-
unsupported: "Embed {{type}} er ikkje st\xF8tta."
|
|
1259
|
+
unsupported: "Embed {{type}} er ikkje st\xF8tta.",
|
|
1260
|
+
type: {
|
|
1261
|
+
image: 'Bilde',
|
|
1262
|
+
video: 'Video',
|
|
1263
|
+
audio: 'Lyd',
|
|
1264
|
+
podcast: 'Podkast',
|
|
1265
|
+
concept: 'Forklaring'
|
|
1266
|
+
}
|
|
1260
1267
|
}
|
|
1261
1268
|
});
|
|
1262
1269
|
var _default = messages;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "36.0.
|
|
3
|
+
"version": "36.0.2",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "486edbc7b92bc8fc182669cec1c259438215e3cc"
|
|
90
90
|
}
|
|
@@ -33,18 +33,14 @@ const Container = styled(SafeLink)`
|
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
color: ${colors.text.primary};
|
|
35
35
|
max-width: 350px;
|
|
36
|
-
min-width: 350px;
|
|
37
36
|
max-height: 415px;
|
|
38
|
-
min-height: 415px;
|
|
39
37
|
gap: ${spacing.nsmall};
|
|
40
38
|
box-shadow: none;
|
|
41
39
|
border: 1px solid ${colors.brand.lightest};
|
|
42
40
|
border-radius: ${misc.borderRadius};
|
|
43
41
|
padding: ${spacing.normal} ${spacing.medium};
|
|
44
42
|
&[data-size='large'] {
|
|
45
|
-
min-width: 532px;
|
|
46
43
|
max-width: 532px;
|
|
47
|
-
min-height: 550px;
|
|
48
44
|
max-height: 550px;
|
|
49
45
|
}
|
|
50
46
|
&:hover,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
11
|
+
import CampaignBlock from './CampaignBlock';
|
|
12
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Enkle komponenter/Campaign Block',
|
|
16
|
+
component: CampaignBlock,
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
parameters: {
|
|
19
|
+
...defaultParameters,
|
|
20
|
+
},
|
|
21
|
+
args: {},
|
|
22
|
+
} as Meta<typeof CampaignBlock>;
|
|
23
|
+
|
|
24
|
+
export const BothImages: StoryObj<typeof CampaignBlock> = {
|
|
25
|
+
args: {
|
|
26
|
+
title: { title: 'NDLA film', language: 'nb-no' },
|
|
27
|
+
description: {
|
|
28
|
+
text: 'NDLA film er en tjeneste i samarbeid med Norgesfilm. Denne tjenesten lar deg se en rekke spillefilmer, kortfilmer, dokumentarer og serier. Du kan også se undervisningsfilm og filmklipp. Velkommen inn i filmens verden!',
|
|
29
|
+
language: 'nb-no',
|
|
30
|
+
},
|
|
31
|
+
headingLevel: 'h2',
|
|
32
|
+
url: {
|
|
33
|
+
url: '#',
|
|
34
|
+
text: 'Gå til NDLA film',
|
|
35
|
+
},
|
|
36
|
+
imageBefore: {
|
|
37
|
+
alt: '',
|
|
38
|
+
src: 'https://api.test.ndla.no/image-api/raw/n2UYRxEG.png',
|
|
39
|
+
},
|
|
40
|
+
imageAfter: {
|
|
41
|
+
alt: '',
|
|
42
|
+
src: 'https://api.test.ndla.no/image-api/raw/8GOxOhjr.png',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const SingleImage: StoryObj<typeof CampaignBlock> = {
|
|
48
|
+
args: {
|
|
49
|
+
title: { title: 'FN-dagen 24. oktober!', language: 'nb-no' },
|
|
50
|
+
description: {
|
|
51
|
+
text: ' Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation quis nostrud exercitation ',
|
|
52
|
+
language: 'nb-no',
|
|
53
|
+
},
|
|
54
|
+
url: {
|
|
55
|
+
url: '#',
|
|
56
|
+
text: 'Les mer om FN-dagen',
|
|
57
|
+
},
|
|
58
|
+
imageAfter: {
|
|
59
|
+
alt: 'FN-symbol',
|
|
60
|
+
src: 'https://api.test.ndla.no/image-api/raw/LkmDGtip.png',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import styled from '@emotion/styled';
|
|
11
|
+
import { css } from '@emotion/react';
|
|
12
|
+
import SafeLink from '@ndla/safelink';
|
|
13
|
+
import { Forward } from '@ndla/icons/common';
|
|
14
|
+
import { breakpoints, colors, fonts, spacing, mq, misc } from '@ndla/core';
|
|
15
|
+
import { HeadingLevel } from '../types';
|
|
16
|
+
|
|
17
|
+
interface Image {
|
|
18
|
+
src: string;
|
|
19
|
+
alt: string;
|
|
20
|
+
}
|
|
21
|
+
interface Props {
|
|
22
|
+
title: {
|
|
23
|
+
title: string;
|
|
24
|
+
language: string;
|
|
25
|
+
};
|
|
26
|
+
description: {
|
|
27
|
+
text: string;
|
|
28
|
+
language: string;
|
|
29
|
+
};
|
|
30
|
+
headingLevel?: HeadingLevel;
|
|
31
|
+
url: {
|
|
32
|
+
url: string;
|
|
33
|
+
text: string;
|
|
34
|
+
};
|
|
35
|
+
imageBefore?: Image;
|
|
36
|
+
imageAfter?: Image;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const Container = styled.div`
|
|
40
|
+
max-width: 390px;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: ${spacing.xsmall};
|
|
44
|
+
border: 1px ${colors.brand.lighter} solid;
|
|
45
|
+
border-radius: ${misc.borderRadius};
|
|
46
|
+
padding: ${spacing.normal} ${spacing.small};
|
|
47
|
+
${mq.range({ from: breakpoints.tabletWide })} {
|
|
48
|
+
max-width: 1100px;
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
const headingStyle = css`
|
|
54
|
+
margin: 0;
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const StyledDescription = styled.p`
|
|
58
|
+
font-family: ${fonts.serif};
|
|
59
|
+
margin: ${spacing.normal} 0 ${spacing.medium};
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
const StyledImg = styled.img`
|
|
63
|
+
max-height: 200px;
|
|
64
|
+
${mq.range({ until: breakpoints.tabletWide })} {
|
|
65
|
+
align-self: center;
|
|
66
|
+
}
|
|
67
|
+
${mq.range({ from: breakpoints.tabletWide })} {
|
|
68
|
+
align-self: center;
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
const StyledLink = styled(SafeLink)`
|
|
73
|
+
box-shadow: none;
|
|
74
|
+
text-decoration: underline;
|
|
75
|
+
color: ${colors.brand.primary};
|
|
76
|
+
&:hover,
|
|
77
|
+
&:focus-visible {
|
|
78
|
+
text-decoration: none;
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
|
|
82
|
+
const CampaignBlock = ({ title, imageBefore, description, headingLevel: Heading = 'h2', imageAfter, url }: Props) => {
|
|
83
|
+
return (
|
|
84
|
+
<Container>
|
|
85
|
+
{imageBefore && <StyledImg src={imageBefore.src} data-left={true} />}
|
|
86
|
+
<div>
|
|
87
|
+
<Heading css={headingStyle}>{title.title}</Heading>
|
|
88
|
+
<StyledDescription>{description.text}</StyledDescription>
|
|
89
|
+
<StyledLink to={url.url}>
|
|
90
|
+
{url.text}
|
|
91
|
+
<Forward />
|
|
92
|
+
</StyledLink>
|
|
93
|
+
</div>
|
|
94
|
+
{imageAfter && <StyledImg src={imageAfter.src} data-right={true} />}
|
|
95
|
+
</Container>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default CampaignBlock;
|
|
@@ -25,16 +25,16 @@ interface Props {
|
|
|
25
25
|
name: string;
|
|
26
26
|
email: string;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const BlockWrapper = styled.div`
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
padding: 0 0 ${spacing.medium} ${spacing.medium};
|
|
32
32
|
font-family: ${fonts.sans};
|
|
33
|
-
justify-content: center;
|
|
34
33
|
border-radius: ${misc.borderRadius};
|
|
35
34
|
border: 1px solid ${colors.brand.lighter};
|
|
36
|
-
|
|
35
|
+
max-width: 348px;
|
|
37
36
|
${mq.range({ from: breakpoints.tabletWide })} {
|
|
37
|
+
max-width: 773px;
|
|
38
38
|
flex-direction: row;
|
|
39
39
|
padding: 0 0 ${spacing.medium} ${spacing.medium};
|
|
40
40
|
gap: ${spacing.nsmall};
|
|
@@ -48,12 +48,13 @@ const StyledHeader = styled.div`
|
|
|
48
48
|
padding-top: ${spacing.medium};
|
|
49
49
|
`;
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const StyledText = styled.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
overflow-wrap: anywhere;
|
|
54
54
|
color: ${colors.text.light};
|
|
55
55
|
gap: ${spacing.xxsmall};
|
|
56
56
|
`;
|
|
57
|
+
|
|
57
58
|
const EmailLink = styled.a`
|
|
58
59
|
color: ${colors.text.light};
|
|
59
60
|
text-decoration-color: ${colors.text.light};
|
|
@@ -70,7 +71,7 @@ const SummaryBlock = styled.p`
|
|
|
70
71
|
}
|
|
71
72
|
`;
|
|
72
73
|
|
|
73
|
-
const
|
|
74
|
+
const TextWrapper = styled.div`
|
|
74
75
|
display: flex;
|
|
75
76
|
overflow: hidden;
|
|
76
77
|
justify-content: space-between;
|
|
@@ -82,18 +83,16 @@ const BlobWrapper = styled.div`
|
|
|
82
83
|
`;
|
|
83
84
|
|
|
84
85
|
const ImageWrapper = styled.div`
|
|
85
|
-
aspect-ratio: 16/9;
|
|
86
86
|
display: flex;
|
|
87
87
|
flex-direction: column;
|
|
88
88
|
gap: ${spacing.small};
|
|
89
89
|
padding: ${spacing.medium} ${spacing.medium} 0 0;
|
|
90
|
-
|
|
91
90
|
${mq.range({ from: breakpoints.tabletWide })} {
|
|
92
91
|
padding-right: 0;
|
|
93
92
|
}
|
|
94
93
|
`;
|
|
95
94
|
|
|
96
|
-
const
|
|
95
|
+
const blobStyling = css`
|
|
97
96
|
width: 165px;
|
|
98
97
|
height: 180px;
|
|
99
98
|
transform: translate(10%, 0);
|
|
@@ -101,6 +100,15 @@ const blobStyle = css`
|
|
|
101
100
|
const Email = styled.div`
|
|
102
101
|
min-width: 60px;
|
|
103
102
|
`;
|
|
103
|
+
|
|
104
|
+
const ContentWrapper = styled.div`
|
|
105
|
+
width: 100%;
|
|
106
|
+
`;
|
|
107
|
+
|
|
108
|
+
const StyledImage = styled.img`
|
|
109
|
+
object-fit: cover;
|
|
110
|
+
`;
|
|
111
|
+
|
|
104
112
|
const ContactBlock = ({ image, jobTitle, description, name, email, blobColor = 'green', blob = 'pointy' }: Props) => {
|
|
105
113
|
const { t } = useTranslation();
|
|
106
114
|
const isGreenBlob = blobColor === 'green';
|
|
@@ -108,11 +116,11 @@ const ContactBlock = ({ image, jobTitle, description, name, email, blobColor = '
|
|
|
108
116
|
const authors = concat(image?.copyright.processors, image?.copyright.creators, image?.copyright.rightsholders);
|
|
109
117
|
|
|
110
118
|
return (
|
|
111
|
-
<
|
|
119
|
+
<BlockWrapper>
|
|
112
120
|
<ImageWrapper>
|
|
113
121
|
{image ? (
|
|
114
122
|
<>
|
|
115
|
-
<
|
|
123
|
+
<StyledImage alt={image.alttext.alttext} src={`${image.image.imageUrl}?width=286`} />
|
|
116
124
|
{`${t('photo')}: ${authors.reduce((acc, name) => (acc = `${acc} ${name?.name}`), '')} ${
|
|
117
125
|
image.copyright.license.license
|
|
118
126
|
}`}
|
|
@@ -121,23 +129,23 @@ const ContactBlock = ({ image, jobTitle, description, name, email, blobColor = '
|
|
|
121
129
|
<img alt={t('image.error.url')} src={errorSvgSrc} />
|
|
122
130
|
)}
|
|
123
131
|
</ImageWrapper>
|
|
124
|
-
<
|
|
125
|
-
<
|
|
132
|
+
<ContentWrapper>
|
|
133
|
+
<TextWrapper>
|
|
126
134
|
<div>
|
|
127
135
|
<StyledHeader>{name}</StyledHeader>
|
|
128
|
-
<
|
|
129
|
-
<
|
|
136
|
+
<StyledText>{jobTitle}</StyledText>
|
|
137
|
+
<StyledText>
|
|
130
138
|
<Email>{`${t('email')}:`}</Email>
|
|
131
139
|
<EmailLink href={`mailto:${email}?subject=Contact us`}>{email}</EmailLink>
|
|
132
|
-
</
|
|
140
|
+
</StyledText>
|
|
133
141
|
</div>
|
|
134
142
|
<BlobWrapper>
|
|
135
|
-
<Blob css={
|
|
143
|
+
<Blob css={blobStyling} color={isGreenBlob ? colors.support.greenLight : colors.support.redLight} />
|
|
136
144
|
</BlobWrapper>
|
|
137
|
-
</
|
|
145
|
+
</TextWrapper>
|
|
138
146
|
<SummaryBlock>{description}</SummaryBlock>
|
|
139
|
-
</
|
|
140
|
-
</
|
|
147
|
+
</ContentWrapper>
|
|
148
|
+
</BlockWrapper>
|
|
141
149
|
);
|
|
142
150
|
};
|
|
143
151
|
|
|
@@ -144,7 +144,7 @@ const BrightcoveEmbed = ({ embed, isConcept }: Props) => {
|
|
|
144
144
|
size="small"
|
|
145
145
|
onClick={() => setShowOriginalVideo((p) => !p)}
|
|
146
146
|
>
|
|
147
|
-
{t(`figure.button.${showOriginalVideo ? 'original' : 'alternative'}`)}
|
|
147
|
+
{t(`figure.button.${!showOriginalVideo ? 'original' : 'alternative'}`)}
|
|
148
148
|
</LinkedVideoButton>
|
|
149
149
|
}
|
|
150
150
|
licenseRights={license.rights}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
11
|
+
import styled from '@emotion/styled';
|
|
12
|
+
import { breakpoints, mq, spacing } from '@ndla/core';
|
|
13
|
+
import { IconButtonV2 } from '@ndla/button';
|
|
14
|
+
import { Switch } from '@ndla/switch';
|
|
15
|
+
import { HeartOutline } from '@ndla/icons/action';
|
|
16
|
+
import EmbedByline from './EmbedByline';
|
|
17
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
18
|
+
|
|
19
|
+
const ButtonWrapper = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
gap: ${spacing.small};
|
|
22
|
+
${mq.range({ until: breakpoints.tablet })} {
|
|
23
|
+
flex: 1;
|
|
24
|
+
width: 100%;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
align-items: space-between;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
title: 'Enkle komponenter/EmbedByline',
|
|
32
|
+
component: EmbedByline,
|
|
33
|
+
tags: ['autodocs'],
|
|
34
|
+
parameters: {
|
|
35
|
+
...defaultParameters,
|
|
36
|
+
},
|
|
37
|
+
args: {
|
|
38
|
+
topRounded: true,
|
|
39
|
+
visibleAlt: 'Synlig alt-tekst kan legges her, eller fjernes helt',
|
|
40
|
+
type: 'image',
|
|
41
|
+
children: (
|
|
42
|
+
<ButtonWrapper>
|
|
43
|
+
<Switch checked={false} label="Bytt til synstolket video" onChange={() => {}} id="switch" />
|
|
44
|
+
<IconButtonV2 variant="ghost" aria-label="Legg til i favoritter">
|
|
45
|
+
<HeartOutline />
|
|
46
|
+
</IconButtonV2>
|
|
47
|
+
</ButtonWrapper>
|
|
48
|
+
),
|
|
49
|
+
description:
|
|
50
|
+
'Bildetekst som kan være ganske lang. Denne roboten er laget av DALLE2, en helt vaskeekte AI. Hvis denne teksten blir veldig lang kommer den på flere linjer.',
|
|
51
|
+
copyright: {
|
|
52
|
+
license: {
|
|
53
|
+
license: 'CC-BY-SA-4.0',
|
|
54
|
+
description: 'Creative Commons Attribution-ShareAlike 4.0 International',
|
|
55
|
+
url: 'https://creativecommons.org/licenses/by-sa/4.0/',
|
|
56
|
+
},
|
|
57
|
+
origin: 'http://floradania.dk/forside/',
|
|
58
|
+
creators: [],
|
|
59
|
+
processors: [],
|
|
60
|
+
rightsholders: [
|
|
61
|
+
{
|
|
62
|
+
type: 'Supplier',
|
|
63
|
+
name: 'Floradania',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
argTypes: {
|
|
69
|
+
children: {
|
|
70
|
+
control: {
|
|
71
|
+
type: null,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
} as Meta<typeof EmbedByline>;
|
|
76
|
+
|
|
77
|
+
export const EmbedBylineStory: StoryFn<typeof EmbedByline> = (args) => {
|
|
78
|
+
const { children, ...rest } = args;
|
|
79
|
+
return <EmbedByline {...rest}>{children}</EmbedByline>;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
EmbedBylineStory.storyName = 'EmbedByline';
|