@ndla/ui 35.0.28 → 35.1.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/ContactBlock/ContactBlock.js +150 -0
- package/es/ContactBlock/index.js +9 -0
- package/es/KeyPerformanceIndicator/KeyPerformanceIndicator.js +57 -0
- package/es/KeyPerformanceIndicator/index.js +9 -0
- package/es/index.js +3 -1
- package/es/locale/messages-en.js +2 -0
- package/es/locale/messages-nb.js +2 -0
- package/es/locale/messages-nn.js +2 -0
- package/es/locale/messages-se.js +2 -0
- package/es/locale/messages-sma.js +2 -0
- package/lib/ContactBlock/ContactBlock.d.ts +20 -0
- package/lib/ContactBlock/ContactBlock.js +154 -0
- package/lib/ContactBlock/index.d.ts +9 -0
- package/lib/ContactBlock/index.js +17 -0
- package/lib/KeyPerformanceIndicator/KeyPerformanceIndicator.d.ts +8 -0
- package/lib/KeyPerformanceIndicator/KeyPerformanceIndicator.js +62 -0
- package/lib/KeyPerformanceIndicator/index.d.ts +1 -0
- package/lib/KeyPerformanceIndicator/index.js +13 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +14 -0
- package/lib/locale/messages-en.d.ts +2 -0
- package/lib/locale/messages-en.js +2 -0
- package/lib/locale/messages-nb.d.ts +2 -0
- package/lib/locale/messages-nb.js +2 -0
- package/lib/locale/messages-nn.d.ts +2 -0
- package/lib/locale/messages-nn.js +2 -0
- package/lib/locale/messages-se.d.ts +2 -0
- package/lib/locale/messages-se.js +2 -0
- package/lib/locale/messages-sma.d.ts +2 -0
- package/lib/locale/messages-sma.js +2 -0
- package/package.json +12 -12
- package/src/ContactBlock/ContactBlock.tsx +144 -0
- package/src/ContactBlock/Contactblock.stories.tsx +88 -0
- package/src/ContactBlock/index.ts +10 -0
- package/src/KeyPerformanceIndicator/KeyPerformanceIndicator.stories.tsx +79 -0
- package/src/KeyPerformanceIndicator/KeyPerformanceIndicator.tsx +66 -0
- package/src/KeyPerformanceIndicator/index.ts +9 -0
- package/src/index.ts +2 -0
- package/src/locale/messages-en.ts +2 -0
- package/src/locale/messages-nb.ts +2 -0
- package/src/locale/messages-nn.ts +2 -0
- package/src/locale/messages-se.ts +2 -0
- package/src/locale/messages-sma.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "35.0
|
|
3
|
+
"version": "35.1.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ndla/article-scripts": "^3.0.17",
|
|
35
|
-
"@ndla/button": "^10.0.
|
|
36
|
-
"@ndla/carousel": "^3.0.
|
|
35
|
+
"@ndla/button": "^10.0.13",
|
|
36
|
+
"@ndla/carousel": "^3.0.13",
|
|
37
37
|
"@ndla/core": "^3.1.3",
|
|
38
|
-
"@ndla/forms": "^4.2.
|
|
38
|
+
"@ndla/forms": "^4.2.22",
|
|
39
39
|
"@ndla/hooks": "^2.0.4",
|
|
40
|
-
"@ndla/icons": "^2.2.
|
|
40
|
+
"@ndla/icons": "^2.2.13",
|
|
41
41
|
"@ndla/licenses": "^7.0.4",
|
|
42
|
-
"@ndla/modal": "^2.2.
|
|
43
|
-
"@ndla/notion": "^4.2.
|
|
44
|
-
"@ndla/safelink": "^4.0.
|
|
42
|
+
"@ndla/modal": "^2.2.17",
|
|
43
|
+
"@ndla/notion": "^4.2.19",
|
|
44
|
+
"@ndla/safelink": "^4.0.23",
|
|
45
45
|
"@ndla/switch": "^1.0.9",
|
|
46
|
-
"@ndla/tabs": "^2.1.
|
|
47
|
-
"@ndla/tooltip": "^4.0.
|
|
46
|
+
"@ndla/tabs": "^2.1.20",
|
|
47
|
+
"@ndla/tooltip": "^4.0.21",
|
|
48
48
|
"@ndla/util": "^3.1.12",
|
|
49
49
|
"@radix-ui/react-accordion": "1.1.0",
|
|
50
50
|
"@radix-ui/react-dropdown-menu": "2.0.2",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
|
|
77
77
|
"@ndla/types-backend": "0.2.1",
|
|
78
|
-
"@ndla/types-embed": "^1.0
|
|
78
|
+
"@ndla/types-embed": "^1.1.0",
|
|
79
79
|
"@types/reach__dialog": "^0.1.0",
|
|
80
80
|
"css-loader": "^6.7.3",
|
|
81
81
|
"mini-css-extract-plugin": "^2.7.5",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "c055a24586a13acac494f7cecda6b301fba80249"
|
|
90
90
|
}
|
|
@@ -0,0 +1,144 @@
|
|
|
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 { css } from '@emotion/react';
|
|
10
|
+
import styled from '@emotion/styled';
|
|
11
|
+
import { IImageMetaInformationV3 } from '@ndla/types-backend/image-api';
|
|
12
|
+
import { spacing, fonts, colors, mq, breakpoints, misc } from '@ndla/core';
|
|
13
|
+
import { BlobPointy, BlobRound } from '@ndla/icons/common';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import concat from 'lodash/concat';
|
|
16
|
+
import { errorSvgSrc } from '../Embed/ImageEmbed';
|
|
17
|
+
|
|
18
|
+
interface Props {
|
|
19
|
+
image?: IImageMetaInformationV3;
|
|
20
|
+
jobTitle: string;
|
|
21
|
+
description: string;
|
|
22
|
+
blobColor?: 'pink' | 'green';
|
|
23
|
+
blob?: 'pointy' | 'round';
|
|
24
|
+
imageWidth?: number;
|
|
25
|
+
name: string;
|
|
26
|
+
email: string;
|
|
27
|
+
}
|
|
28
|
+
const CardWrapper = styled.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
padding: 0 0 ${spacing.medium} ${spacing.medium};
|
|
32
|
+
font-family: ${fonts.sans};
|
|
33
|
+
justify-content: center;
|
|
34
|
+
border-radius: ${misc.borderRadius};
|
|
35
|
+
border: 1px solid ${colors.brand.lighter};
|
|
36
|
+
margin-top: ${spacing.mediumlarge};
|
|
37
|
+
${mq.range({ from: breakpoints.tabletWide })} {
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
padding: 0 0 ${spacing.medium} ${spacing.medium};
|
|
40
|
+
gap: ${spacing.nsmall};
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
const StyledHeader = styled.div`
|
|
45
|
+
${fonts.sizes('22px', '30px')};
|
|
46
|
+
font-weight: ${fonts.weight.bold};
|
|
47
|
+
margin: 0 0 ${spacing.xsmall} 0;
|
|
48
|
+
padding-top: ${spacing.medium};
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const StyledDescriptionInformation = styled.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
overflow-wrap: anywhere;
|
|
54
|
+
color: ${colors.text.light};
|
|
55
|
+
gap: ${spacing.xxsmall};
|
|
56
|
+
`;
|
|
57
|
+
const EmailLink = styled.a`
|
|
58
|
+
color: ${colors.text.light};
|
|
59
|
+
text-decoration-color: ${colors.text.light};
|
|
60
|
+
text-decoration-style: solid;
|
|
61
|
+
text-decoration: underline;
|
|
62
|
+
box-shadow: unset;
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
const SummaryBlock = styled.p`
|
|
66
|
+
font-family: ${fonts.serif};
|
|
67
|
+
padding: 0 ${spacing.medium} 0 0;
|
|
68
|
+
${mq.range({ from: breakpoints.tabletWide })} {
|
|
69
|
+
padding-top: 0;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
const ContentWrapper = styled.div`
|
|
74
|
+
display: flex;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
justify-content: space-between;
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
const BlobWrapper = styled.div`
|
|
80
|
+
height: 180px;
|
|
81
|
+
width: 90px;
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
const ImageWrapper = styled.div`
|
|
85
|
+
aspect-ratio: 16/9;
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: ${spacing.small};
|
|
89
|
+
padding: ${spacing.medium} ${spacing.medium} 0 0;
|
|
90
|
+
|
|
91
|
+
${mq.range({ from: breakpoints.tabletWide })} {
|
|
92
|
+
padding-right: 0;
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
|
|
96
|
+
const blobStyle = css`
|
|
97
|
+
width: 165px;
|
|
98
|
+
height: 180px;
|
|
99
|
+
transform: translate(10%, 0);
|
|
100
|
+
`;
|
|
101
|
+
const Email = styled.div`
|
|
102
|
+
min-width: 60px;
|
|
103
|
+
`;
|
|
104
|
+
const ContactBlock = ({ image, jobTitle, description, name, email, blobColor = 'green', blob = 'pointy' }: Props) => {
|
|
105
|
+
const { t } = useTranslation();
|
|
106
|
+
const isGreenBlob = blobColor === 'green';
|
|
107
|
+
const Blob = blob === 'pointy' ? BlobPointy : BlobRound;
|
|
108
|
+
const authors = concat(image?.copyright.processors, image?.copyright.creators, image?.copyright.rightsholders);
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<CardWrapper>
|
|
112
|
+
<ImageWrapper>
|
|
113
|
+
{image ? (
|
|
114
|
+
<>
|
|
115
|
+
<img alt={image.alttext.alttext} src={`${image.image.imageUrl}?width=286`} />
|
|
116
|
+
{`${t('photo')}: ${authors.reduce((acc, name) => (acc = `${acc} ${name?.name}`), '')} ${
|
|
117
|
+
image.copyright.license.license
|
|
118
|
+
}`}
|
|
119
|
+
</>
|
|
120
|
+
) : (
|
|
121
|
+
<img alt={t('image.error.url')} src={errorSvgSrc} />
|
|
122
|
+
)}
|
|
123
|
+
</ImageWrapper>
|
|
124
|
+
<div>
|
|
125
|
+
<ContentWrapper>
|
|
126
|
+
<div>
|
|
127
|
+
<StyledHeader>{name}</StyledHeader>
|
|
128
|
+
<StyledDescriptionInformation>{jobTitle}</StyledDescriptionInformation>
|
|
129
|
+
<StyledDescriptionInformation>
|
|
130
|
+
<Email>{`${t('email')}:`}</Email>
|
|
131
|
+
<EmailLink href={`mailto:${email}?subject=Contact us`}>{email}</EmailLink>
|
|
132
|
+
</StyledDescriptionInformation>
|
|
133
|
+
</div>
|
|
134
|
+
<BlobWrapper>
|
|
135
|
+
<Blob css={blobStyle} color={isGreenBlob ? colors.support.greenLight : colors.support.redLight} />
|
|
136
|
+
</BlobWrapper>
|
|
137
|
+
</ContentWrapper>
|
|
138
|
+
<SummaryBlock>{description}</SummaryBlock>
|
|
139
|
+
</div>
|
|
140
|
+
</CardWrapper>
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export default ContactBlock;
|
|
@@ -0,0 +1,88 @@
|
|
|
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 ContactBlock from './ContactBlock';
|
|
12
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Enkle komponenter/Kontaktblokk',
|
|
16
|
+
component: ContactBlock,
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
args: {
|
|
19
|
+
image: {
|
|
20
|
+
id: '65750',
|
|
21
|
+
metaUrl: 'https://api.test.ndla.no/image-api/v3/images/65750',
|
|
22
|
+
title: {
|
|
23
|
+
title: 'Sigurd Trageton',
|
|
24
|
+
language: 'nb',
|
|
25
|
+
},
|
|
26
|
+
alttext: {
|
|
27
|
+
alttext: 'Sigurd Trageton',
|
|
28
|
+
language: 'nb',
|
|
29
|
+
},
|
|
30
|
+
copyright: {
|
|
31
|
+
license: {
|
|
32
|
+
license: 'CC-BY-SA-4.0',
|
|
33
|
+
description: 'Creative Commons Attribution-ShareAlike 4.0 International',
|
|
34
|
+
url: 'https://creativecommons.org/licenses/by-sa/4.0/',
|
|
35
|
+
},
|
|
36
|
+
origin: '',
|
|
37
|
+
creators: [
|
|
38
|
+
{
|
|
39
|
+
type: 'photographer',
|
|
40
|
+
name: 'Tom Knudsen',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
processors: [],
|
|
44
|
+
rightsholders: [],
|
|
45
|
+
},
|
|
46
|
+
tags: {
|
|
47
|
+
tags: ['Sigurd', 'Trageton', 'Portrett'],
|
|
48
|
+
language: 'nb',
|
|
49
|
+
},
|
|
50
|
+
caption: {
|
|
51
|
+
caption: 'Sigurd Trageton',
|
|
52
|
+
language: 'nb',
|
|
53
|
+
},
|
|
54
|
+
supportedLanguages: ['nb', 'nn'],
|
|
55
|
+
created: '2023-03-29T07:15:50Z',
|
|
56
|
+
createdBy: 'f-jBTU8O8kYbUW20lMeIuTSv',
|
|
57
|
+
modelRelease: 'not-set',
|
|
58
|
+
image: {
|
|
59
|
+
fileName: 'RVrVQIKh.jpg',
|
|
60
|
+
size: 404340,
|
|
61
|
+
contentType: 'image/jpeg',
|
|
62
|
+
imageUrl: 'https://api.test.ndla.no/image-api/raw/RVrVQIKh.jpg',
|
|
63
|
+
dimensions: {
|
|
64
|
+
width: 1600,
|
|
65
|
+
height: 2000,
|
|
66
|
+
},
|
|
67
|
+
language: 'nb',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
jobTitle: 'Daglig leder og ansvarlig redaktør, Vestland fylkeskommune',
|
|
71
|
+
description:
|
|
72
|
+
'Sigurd har variert ledererfaring fra utdanningssektoren, både fra videregående skole, nasjonalt senter og fra universitets/høgskolesektoren. Ansvarsområdene dekker bl.a. utdanning/opplæring/studiekvalitet, økonomi, HR, stratgi og IT-utvikling/-drift.',
|
|
73
|
+
name: 'Sigurd Trageton',
|
|
74
|
+
email: 'sigurd@ndla.no',
|
|
75
|
+
blobColor: 'green',
|
|
76
|
+
blob: 'pointy',
|
|
77
|
+
},
|
|
78
|
+
parameters: {
|
|
79
|
+
...defaultParameters,
|
|
80
|
+
layout: 'centered',
|
|
81
|
+
},
|
|
82
|
+
} as Meta<typeof ContactBlock>;
|
|
83
|
+
|
|
84
|
+
export const ContactBlockStory: StoryFn<typeof ContactBlock> = ({ ...args }) => {
|
|
85
|
+
return <ContactBlock {...args} />;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
ContactBlockStory.storyName = 'Kontaktblokk';
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
import ContactBlock from './ContactBlock';
|
|
9
|
+
|
|
10
|
+
export default ContactBlock;
|
|
@@ -0,0 +1,79 @@
|
|
|
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 { defaultParameters } from '../../../../stories/defaults';
|
|
12
|
+
import KeyPerformanceIndicator from './KeyPerformanceIndicator';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Enkle komponenter/Nøkkeltall',
|
|
16
|
+
component: KeyPerformanceIndicator,
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
parameters: {
|
|
19
|
+
...defaultParameters,
|
|
20
|
+
layout: 'centered',
|
|
21
|
+
},
|
|
22
|
+
args: {
|
|
23
|
+
title: '500',
|
|
24
|
+
subTitle: 'TVERRFAGLIGE RESSURSER',
|
|
25
|
+
image: {
|
|
26
|
+
id: '65797',
|
|
27
|
+
metaUrl: 'https://api.test.ndla.no/image-api/v3/images/65797',
|
|
28
|
+
title: {
|
|
29
|
+
title: 'Nøkkeltall tverrfaglig',
|
|
30
|
+
language: 'nb',
|
|
31
|
+
},
|
|
32
|
+
alttext: {
|
|
33
|
+
alttext: 'Nøkkeltall tverrfaglig',
|
|
34
|
+
language: 'nb',
|
|
35
|
+
},
|
|
36
|
+
copyright: {
|
|
37
|
+
license: {
|
|
38
|
+
license: 'PD',
|
|
39
|
+
description: 'Public Domain Mark',
|
|
40
|
+
url: 'https://creativecommons.org/about/pdm',
|
|
41
|
+
},
|
|
42
|
+
origin: 'NDLA',
|
|
43
|
+
creators: [
|
|
44
|
+
{
|
|
45
|
+
type: 'artist',
|
|
46
|
+
name: 'Hedvig',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
processors: [],
|
|
50
|
+
rightsholders: [],
|
|
51
|
+
},
|
|
52
|
+
tags: {
|
|
53
|
+
tags: ['Nøkkeltall', 'Tverrfaglig', 'svg'],
|
|
54
|
+
language: 'nb',
|
|
55
|
+
},
|
|
56
|
+
caption: {
|
|
57
|
+
caption: '',
|
|
58
|
+
language: 'nb',
|
|
59
|
+
},
|
|
60
|
+
supportedLanguages: ['nb'],
|
|
61
|
+
created: '2023-04-18T11:20:34Z',
|
|
62
|
+
createdBy: 'f-jBTU8O8kYbUW20lMeIuTSv',
|
|
63
|
+
modelRelease: 'not-set',
|
|
64
|
+
image: {
|
|
65
|
+
fileName: 'wMowCjRg.svg',
|
|
66
|
+
size: 43278,
|
|
67
|
+
contentType: 'image/svg+xml',
|
|
68
|
+
imageUrl: 'https://api.test.ndla.no/image-api/raw/wMowCjRg.svg',
|
|
69
|
+
language: 'nb',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
} as Meta<typeof KeyPerformanceIndicator>;
|
|
74
|
+
|
|
75
|
+
export const KeyPerformanceIndicatorStory: StoryFn<typeof KeyPerformanceIndicator> = ({ ...args }) => {
|
|
76
|
+
return <KeyPerformanceIndicator {...args} />;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
KeyPerformanceIndicatorStory.storyName = 'Nøkkeltall';
|
|
@@ -0,0 +1,66 @@
|
|
|
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 styled from '@emotion/styled';
|
|
10
|
+
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
11
|
+
import { IImageMetaInformationV3 } from '@ndla/types-backend/build/image-api';
|
|
12
|
+
|
|
13
|
+
const ContentWrapper = styled.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
padding: ${spacing.small};
|
|
19
|
+
align-items: center;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const StyledImage = styled.img`
|
|
23
|
+
max-width: 150px;
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
const TitleWrapper = styled.div`
|
|
27
|
+
color: ${colors.text.primary};
|
|
28
|
+
font-family: ${fonts.sans};
|
|
29
|
+
font-weight: ${fonts.weight.bold};
|
|
30
|
+
overflow-wrap: break-word;
|
|
31
|
+
${fonts.sizes('38px', '48px')};
|
|
32
|
+
${mq.range({ until: breakpoints.tabletWide })} {
|
|
33
|
+
${fonts.sizes('30px', '36px')};
|
|
34
|
+
}
|
|
35
|
+
max-width: 240px;
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const SubTitleWrapper = styled.div`
|
|
39
|
+
overflow-wrap: 'break-word';
|
|
40
|
+
${mq.range({ until: breakpoints.tabletWide })} {
|
|
41
|
+
padding-top: ${spacing.xxsmall};
|
|
42
|
+
${fonts.sizes('18px', '29px')};
|
|
43
|
+
color: ${colors.text.primary};
|
|
44
|
+
font-weight: ${fonts.weight.normal};
|
|
45
|
+
font-family: ${fonts.sans};
|
|
46
|
+
}
|
|
47
|
+
max-width: 240px;
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
interface Props {
|
|
51
|
+
image?: IImageMetaInformationV3;
|
|
52
|
+
title: string;
|
|
53
|
+
subTitle: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const KeyPerformanceIndicator = ({ image, title, subTitle }: Props) => {
|
|
57
|
+
return (
|
|
58
|
+
<ContentWrapper>
|
|
59
|
+
<StyledImage src={image?.image.imageUrl} alt={image?.alttext.alttext} />
|
|
60
|
+
<TitleWrapper>{title}</TitleWrapper>
|
|
61
|
+
<SubTitleWrapper>{subTitle}</SubTitleWrapper>
|
|
62
|
+
</ContentWrapper>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default KeyPerformanceIndicator;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
export { default as KeyPerformanceIndicator } from './KeyPerformanceIndicator';
|
package/src/index.ts
CHANGED
|
@@ -271,3 +271,5 @@ export type { TreeStructureProps } from './TreeStructure';
|
|
|
271
271
|
export { SearchField, SearchResultList, SearchResultItem, ActiveFilters, ToggleSearchButton } from './Search';
|
|
272
272
|
export { default as LetterFilter } from './LetterFilter';
|
|
273
273
|
export { BlogPostV2 } from './BlogPost';
|
|
274
|
+
export { KeyPerformanceIndicator } from './KeyPerformanceIndicator';
|
|
275
|
+
export { default as ContactBlock } from './ContactBlock';
|