@ndla/ui 25.1.0 → 25.3.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/Article/ArticleByline.js +17 -7
- package/es/Article/ArticleFavoritesButton.js +2 -1
- package/es/Article/ArticleSideBar.js +5 -4
- package/es/Breadcrumb/BreadcrumbItem.js +8 -7
- package/es/ErrorMessage/ErrorMessage.js +12 -6
- package/es/Frontpage/FrontpageHeader.js +10 -10
- package/es/Frontpage/FrontpageProgramMenu.js +12 -10
- package/es/Image/Image.js +5 -4
- package/es/LanguageSelector/LanguageSelector.js +31 -26
- package/es/LearningPaths/LearningPathInformation.js +8 -5
- package/es/Masthead/Masthead.js +8 -8
- package/es/Masthead/MastheadAuthModal.js +11 -11
- package/es/Masthead/MastheadSearchModal.js +9 -11
- package/es/NDLAFilm/AboutNdlaFilm.js +3 -3
- package/es/Navigation/NavigationHeading.js +9 -6
- package/es/Navigation/NavigationTopicAbout.js +15 -14
- package/es/Programme/Programme.js +10 -7
- package/es/ResourceGroup/ResourceItem.js +17 -14
- package/es/Search/SearchField.js +4 -3
- package/es/Search/SearchFieldForm.js +4 -3
- package/es/Search/ToggleSearchButton.js +3 -3
- package/es/Subject/SubjectHeader.js +5 -6
- package/es/TagSelector/SuggestionInput.js +8 -8
- package/es/Topic/Topic.js +21 -20
- package/es/TopicMenu/TopicMenu.js +22 -13
- package/es/TopicMenu/TopicMenuButton.js +5 -5
- package/es/all.css +1 -1
- package/es/locale/messages-en.js +6 -23
- package/es/locale/messages-nb.js +9 -26
- package/es/locale/messages-nn.js +8 -25
- package/es/locale/messages-se.js +695 -712
- package/es/locale/messages-sma.js +8 -25
- package/lib/Article/ArticleByline.js +17 -7
- package/lib/Article/ArticleFavoritesButton.js +2 -1
- package/lib/Article/ArticleSideBar.js +5 -4
- package/lib/Breadcrumb/BreadcrumbItem.js +8 -7
- package/lib/ErrorMessage/ErrorMessage.d.ts +1 -0
- package/lib/ErrorMessage/ErrorMessage.js +12 -6
- package/lib/Frontpage/FrontpageHeader.d.ts +5 -6
- package/lib/Frontpage/FrontpageHeader.js +10 -12
- package/lib/Frontpage/FrontpageProgramMenu.js +12 -10
- package/lib/Image/Image.d.ts +1 -1
- package/lib/Image/Image.js +5 -4
- package/lib/LanguageSelector/LanguageSelector.d.ts +1 -1
- package/lib/LanguageSelector/LanguageSelector.js +31 -26
- package/lib/LearningPaths/LearningPathInformation.d.ts +2 -1
- package/lib/LearningPaths/LearningPathInformation.js +8 -5
- package/lib/Masthead/Masthead.js +8 -8
- package/lib/Masthead/MastheadAuthModal.js +11 -11
- package/lib/Masthead/MastheadSearchModal.js +9 -11
- package/lib/NDLAFilm/AboutNdlaFilm.js +4 -4
- package/lib/Navigation/NavigationHeading.d.ts +2 -1
- package/lib/Navigation/NavigationHeading.js +9 -6
- package/lib/Navigation/NavigationTopicAbout.js +15 -14
- package/lib/Programme/Programme.d.ts +2 -1
- package/lib/Programme/Programme.js +10 -7
- package/lib/ResourceGroup/ResourceItem.js +17 -14
- package/lib/Search/SearchField.js +4 -3
- package/lib/Search/SearchFieldForm.js +4 -3
- package/lib/Search/ToggleSearchButton.js +3 -3
- package/lib/Subject/SubjectHeader.js +14 -16
- package/lib/TagSelector/SuggestionInput.js +8 -8
- package/lib/Topic/Topic.js +21 -20
- package/lib/TopicMenu/TopicMenu.js +47 -39
- package/lib/TopicMenu/TopicMenuButton.js +6 -6
- package/lib/all.css +1 -1
- package/lib/locale/messages-en.d.ts +2 -19
- package/lib/locale/messages-en.js +6 -23
- package/lib/locale/messages-nb.d.ts +2 -19
- package/lib/locale/messages-nb.js +9 -26
- package/lib/locale/messages-nn.d.ts +2 -19
- package/lib/locale/messages-nn.js +8 -25
- package/lib/locale/messages-se.d.ts +2 -19
- package/lib/locale/messages-se.js +695 -712
- package/lib/locale/messages-sma.d.ts +2 -19
- package/lib/locale/messages-sma.js +8 -25
- package/package.json +14 -14
- package/src/Article/ArticleByline.tsx +10 -3
- package/src/Article/ArticleFavoritesButton.tsx +2 -1
- package/src/Article/ArticleSideBar.tsx +1 -0
- package/src/Breadcrumb/BreadcrumbItem.tsx +1 -1
- package/src/ErrorMessage/ErrorMessage.tsx +6 -0
- package/src/Frontpage/FrontpageHeader.tsx +6 -7
- package/src/Frontpage/FrontpageProgramMenu.tsx +1 -1
- package/src/Image/Image.tsx +1 -1
- package/src/LanguageSelector/LanguageSelector.tsx +21 -23
- package/src/LearningPaths/LearningPathInformation.tsx +3 -2
- package/src/Masthead/Masthead.tsx +2 -0
- package/src/Masthead/MastheadAuthModal.tsx +16 -16
- package/src/Masthead/MastheadSearchModal.tsx +6 -23
- package/src/NDLAFilm/AboutNdlaFilm.tsx +2 -2
- package/src/Navigation/NavigationHeading.tsx +3 -2
- package/src/Navigation/NavigationTopicAbout.tsx +1 -0
- package/src/Programme/Programme.tsx +11 -2
- package/src/ResourceGroup/ResourceItem.tsx +12 -3
- package/src/Search/SearchField.tsx +6 -1
- package/src/Search/SearchFieldForm.tsx +1 -1
- package/src/Search/ToggleSearchButton.tsx +2 -2
- package/src/Subject/SubjectHeader.tsx +1 -2
- package/src/TagSelector/SuggestionInput.tsx +1 -1
- package/src/Topic/Topic.tsx +1 -0
- package/src/TopicMenu/TopicMenu.jsx +23 -17
- package/src/TopicMenu/TopicMenuButton.jsx +6 -7
- package/src/locale/messages-en.ts +8 -24
- package/src/locale/messages-nb.ts +10 -26
- package/src/locale/messages-nn.ts +9 -25
- package/src/locale/messages-se.ts +722 -738
- package/src/locale/messages-sma.ts +9 -24
- package/src/main.scss +0 -1
- package/es/Article/ArticleAuthorContent.js +0 -71
- package/lib/Article/ArticleAuthorContent.d.ts +0 -28
- package/lib/Article/ArticleAuthorContent.js +0 -88
- package/src/Article/ArticleAuthorContent.tsx +0 -107
- package/src/Article/component.article-author-popup.scss +0 -90
|
@@ -92,6 +92,8 @@ declare const messages: {
|
|
|
92
92
|
myPage: string;
|
|
93
93
|
deleteAccount: string;
|
|
94
94
|
logout: string;
|
|
95
|
+
loginText: string;
|
|
96
|
+
loginTextLink: string;
|
|
95
97
|
loginTerms: string;
|
|
96
98
|
loginResourcePitch: string;
|
|
97
99
|
loginWelcome: string;
|
|
@@ -392,13 +394,6 @@ declare const messages: {
|
|
|
392
394
|
name: string;
|
|
393
395
|
};
|
|
394
396
|
};
|
|
395
|
-
category: {
|
|
396
|
-
fellesfag: string;
|
|
397
|
-
yrkesfag: string;
|
|
398
|
-
studiespesialiserende: string;
|
|
399
|
-
imported: string;
|
|
400
|
-
heading: string;
|
|
401
|
-
};
|
|
402
397
|
errorDescription: string;
|
|
403
398
|
film: {
|
|
404
399
|
header: string;
|
|
@@ -955,18 +950,6 @@ declare const messages: {
|
|
|
955
950
|
text: string;
|
|
956
951
|
};
|
|
957
952
|
};
|
|
958
|
-
fagfornyelse: {
|
|
959
|
-
frontpage: {
|
|
960
|
-
heading: string;
|
|
961
|
-
text: string;
|
|
962
|
-
blogHeading: string;
|
|
963
|
-
};
|
|
964
|
-
badge: {
|
|
965
|
-
heading: string;
|
|
966
|
-
text: string;
|
|
967
|
-
linkText: string;
|
|
968
|
-
};
|
|
969
|
-
};
|
|
970
953
|
frontPageToolbox: {
|
|
971
954
|
heading: string;
|
|
972
955
|
text: string;
|
|
@@ -248,13 +248,6 @@ var messages = _objectSpread(_objectSpread({
|
|
|
248
248
|
name: 'Følg oss'
|
|
249
249
|
}
|
|
250
250
|
},
|
|
251
|
-
category: {
|
|
252
|
-
fellesfag: 'Fellesfag',
|
|
253
|
-
yrkesfag: 'Yrkesfag',
|
|
254
|
-
studiespesialiserende: 'Studieforberedende',
|
|
255
|
-
imported: 'Spolte fag',
|
|
256
|
-
heading: 'Hva lærer du?'
|
|
257
|
-
},
|
|
258
251
|
errorDescription: 'Beklager, en feil oppstod under lasting av fagene.',
|
|
259
252
|
film: {
|
|
260
253
|
header: 'NDLA film',
|
|
@@ -787,18 +780,6 @@ var messages = _objectSpread(_objectSpread({
|
|
|
787
780
|
text: 'er utarbeidet av'
|
|
788
781
|
}
|
|
789
782
|
},
|
|
790
|
-
fagfornyelse: {
|
|
791
|
-
frontpage: {
|
|
792
|
-
heading: 'Velkommen til sniktitt på Fagfornyelsen i NDLA',
|
|
793
|
-
text: 'Høsten 2020 og 2021 vil de nye læreplanene tre i kraft. I NDLA har vi startet med dette arbeidet allerede. Våre innholdsansvarlige lager hver dag nye supre læringsressurser som er tilrettelagt for de nye planene. På denne siden kan du se dem allerede nå.',
|
|
794
|
-
blogHeading: 'Vil du vite mer?'
|
|
795
|
-
},
|
|
796
|
-
badge: {
|
|
797
|
-
heading: 'Denne siden er tilrettelagt for fagfornyelsen 2020/2021',
|
|
798
|
-
text: 'Innholdet er under arbeid. Ikke på jakt etter dette?',
|
|
799
|
-
linkText: 'Gå til ndla.no for dagens innhold'
|
|
800
|
-
}
|
|
801
|
-
},
|
|
802
783
|
frontPageToolbox: {
|
|
803
784
|
heading: 'Verktøykassa',
|
|
804
785
|
text: 'Har du lyst til å bli god til å presentere, eller vil du lære å studere smartere ved hjelp av riktig studieteknikk? Trenger du råd om hvordan du leser mest mulig effektivt til eksamen? I verktøykassa til NDLA finner du masse gode tips og råd!',
|
|
@@ -970,14 +951,14 @@ var messages = _objectSpread(_objectSpread({
|
|
|
970
951
|
folders_plural: '{{count}} mapper',
|
|
971
952
|
folder: {
|
|
972
953
|
folder: 'Mappe',
|
|
973
|
-
"delete": 'Slett',
|
|
974
|
-
edit: 'Rediger',
|
|
954
|
+
"delete": 'Slett mappe',
|
|
955
|
+
edit: 'Rediger mappe',
|
|
975
956
|
missingName: 'Skriv navn på mappe',
|
|
976
957
|
folderDeleted: '"{{folderName}}" er slettet'
|
|
977
958
|
},
|
|
978
959
|
tags: '{{count}} emneknagg',
|
|
979
960
|
tags_plural: '{{count}} emneknagger',
|
|
980
|
-
confirmDeleteFolder: 'Er du sikker på at du vil slette
|
|
961
|
+
confirmDeleteFolder: 'Er du sikker på at du vil slette mappa? Dersom mappa har undermappar vil disse også slettes. Denne handlinga kan ikkje endrast.',
|
|
981
962
|
confirmDeleteTag: 'Er du sikker på at du vil slette emneknagg? Denne handlingen kan ikke endres.',
|
|
982
963
|
myFolders: 'Mine mapper',
|
|
983
964
|
myTags: 'Mine emneknagger',
|
|
@@ -999,13 +980,15 @@ var messages = _objectSpread(_objectSpread({
|
|
|
999
980
|
myPage: 'Min side',
|
|
1000
981
|
deleteAccount: 'Slett Min NDLA',
|
|
1001
982
|
logout: 'Logg ut av Min NDLA',
|
|
983
|
+
loginText: 'Logg på med Feide for å få tilgang til Min NDLA. Vi ber om at du ikkje skriver noko støtende, personsensitiv informasjon eller andre persondata i tekstfelt. Les vår ',
|
|
984
|
+
loginTextLink: 'personvernerklæring her',
|
|
1002
985
|
loginTerms: 'Logg på med Feide for å få tilgang. Ved å logge på godkjenner du våre vilkår for bruk',
|
|
1003
986
|
loginResourcePitch: 'Ønsker du å favorittmerke denne siden?',
|
|
1004
987
|
loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på <i>din</i> måte!',
|
|
1005
988
|
welcome: 'Velkommen til Min NDLA! Nå kan du lagre dine favorittressurser fra NDLA og organisere dem slik du ønsker i mapper og med emneknagger.',
|
|
1006
989
|
read: {
|
|
1007
|
-
our: 'Les
|
|
1008
|
-
ours: 'Les
|
|
990
|
+
our: 'Les vår',
|
|
991
|
+
ours: 'Les våre'
|
|
1009
992
|
},
|
|
1010
993
|
privacy: 'personvernerklæring her',
|
|
1011
994
|
questions: {
|
|
@@ -1043,7 +1026,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1043
1026
|
linkCopied: 'Kopiert til utklippstavle',
|
|
1044
1027
|
addToMyNdla: 'Legg i Min NDLA',
|
|
1045
1028
|
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1046
|
-
addedToFolder: 'Ressurs er lagt i
|
|
1029
|
+
addedToFolder: 'Ressurs er lagt i ',
|
|
1047
1030
|
removedFromFolder: 'Fjernet fra "{{folderName}}"',
|
|
1048
1031
|
titleUpdated: 'Tittel oppdatert',
|
|
1049
1032
|
tagsUpdated: 'Emneknagger oppdatert',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.3.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
"types"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/article-scripts": "^3.0.
|
|
35
|
-
"@ndla/button": "^3.
|
|
36
|
-
"@ndla/carousel": "^1.2.
|
|
34
|
+
"@ndla/article-scripts": "^3.0.2",
|
|
35
|
+
"@ndla/button": "^3.4.1",
|
|
36
|
+
"@ndla/carousel": "^1.2.21",
|
|
37
37
|
"@ndla/core": "^2.3.5",
|
|
38
|
-
"@ndla/forms": "^3.
|
|
39
|
-
"@ndla/hooks": "^1.1.
|
|
40
|
-
"@ndla/icons": "^1.
|
|
41
|
-
"@ndla/licenses": "^5.0.
|
|
42
|
-
"@ndla/modal": "^1.3.
|
|
43
|
-
"@ndla/notion": "^3.1.
|
|
44
|
-
"@ndla/safelink": "^2.2.
|
|
38
|
+
"@ndla/forms": "^3.2.0",
|
|
39
|
+
"@ndla/hooks": "^1.1.6",
|
|
40
|
+
"@ndla/icons": "^1.12.0",
|
|
41
|
+
"@ndla/licenses": "^5.0.15",
|
|
42
|
+
"@ndla/modal": "^1.3.5",
|
|
43
|
+
"@ndla/notion": "^3.1.39",
|
|
44
|
+
"@ndla/safelink": "^2.2.13",
|
|
45
45
|
"@ndla/switch": "^0.1.13",
|
|
46
|
-
"@ndla/tabs": "^1.1.
|
|
46
|
+
"@ndla/tabs": "^1.1.20",
|
|
47
47
|
"@ndla/tooltip": "^2.2.1",
|
|
48
48
|
"@ndla/types-learningpath-api": "^0.0.13",
|
|
49
|
-
"@ndla/util": "^3.0
|
|
49
|
+
"@ndla/util": "^3.1.0",
|
|
50
50
|
"@reach/menu-button": "^0.16.2",
|
|
51
51
|
"@reach/slider": "^0.16.0",
|
|
52
52
|
"focus-trap-react": "^8.9.2",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "b00cf1eb600a2fa9b3113b51abd0c7b2f02d0860"
|
|
89
89
|
}
|
|
@@ -75,8 +75,11 @@ const getSuppliersText = (suppliers: SupplierProps[], t: TFunction) => {
|
|
|
75
75
|
return '';
|
|
76
76
|
}
|
|
77
77
|
return suppliers.length > 1
|
|
78
|
-
? t('article.multipleSuppliersLabel', {
|
|
79
|
-
|
|
78
|
+
? t('article.multipleSuppliersLabel', {
|
|
79
|
+
names: renderContributors(suppliers, t),
|
|
80
|
+
interpolation: { escapeValue: false },
|
|
81
|
+
})
|
|
82
|
+
: t('article.supplierLabel', { name: renderContributors(suppliers, t), interpolation: { escapeValue: false } });
|
|
80
83
|
};
|
|
81
84
|
|
|
82
85
|
const ArticleByline = ({
|
|
@@ -114,7 +117,10 @@ const ArticleByline = ({
|
|
|
114
117
|
{showPrimaryContributors && (
|
|
115
118
|
<PrimaryContributorsWrapper>
|
|
116
119
|
{authors.length > 0
|
|
117
|
-
? t('article.authorsLabel', {
|
|
120
|
+
? t('article.authorsLabel', {
|
|
121
|
+
names: renderContributors(authors, t),
|
|
122
|
+
interpolation: { escapeValue: false },
|
|
123
|
+
})
|
|
118
124
|
: getSuppliersText(suppliers, t)}
|
|
119
125
|
</PrimaryContributorsWrapper>
|
|
120
126
|
)}
|
|
@@ -150,6 +156,7 @@ const ArticleByline = ({
|
|
|
150
156
|
size="small"
|
|
151
157
|
borderShape="rounded"
|
|
152
158
|
outline
|
|
159
|
+
aria-live="assertive"
|
|
153
160
|
data-copy-string={copyPageUrlLink}
|
|
154
161
|
copyNode={t('article.copyPageLinkCopied')}>
|
|
155
162
|
{t('article.copyPageLink')}
|
|
@@ -31,7 +31,8 @@ export const ArticleFavoritesButton = ({ isFavorite, onToggleAddToFavorites, art
|
|
|
31
31
|
inactiveIcon={<HeartOutline />}
|
|
32
32
|
active={isFavorite}
|
|
33
33
|
size="small"
|
|
34
|
-
|
|
34
|
+
colorTheme="light"
|
|
35
|
+
variant="ghost"
|
|
35
36
|
onClick={() => onToggleAddToFavorites(articleId, !isFavorite)}
|
|
36
37
|
/>
|
|
37
38
|
</Tooltip>
|
|
@@ -92,7 +92,7 @@ const BreadcrumbItem = forwardRef<any, Props>(
|
|
|
92
92
|
const { to, name, index } = item;
|
|
93
93
|
const isLast = index === totalCount - 1;
|
|
94
94
|
return (
|
|
95
|
-
<StyledListItem ref={liRef} autoCollapse={autoCollapse}>
|
|
95
|
+
<StyledListItem ref={liRef} autoCollapse={autoCollapse} aria-current={isLast ? 'page' : undefined}>
|
|
96
96
|
<CollapseContainer autoCollapse={autoCollapse}>
|
|
97
97
|
{renderItem ? (
|
|
98
98
|
renderItem(item, totalCount)
|
|
@@ -47,6 +47,7 @@ interface Props {
|
|
|
47
47
|
linksTitle?: string;
|
|
48
48
|
back?: string;
|
|
49
49
|
goToFrontPage?: string;
|
|
50
|
+
logInFailed?: string;
|
|
50
51
|
};
|
|
51
52
|
illustration?: {
|
|
52
53
|
url: string;
|
|
@@ -78,6 +79,11 @@ export const ErrorMessage = ({ children, messages, illustration, illustrationEle
|
|
|
78
79
|
<SafeLink to="/">{messages.goToFrontPage}</SafeLink>
|
|
79
80
|
</div>
|
|
80
81
|
)}
|
|
82
|
+
{messages.logInFailed && (
|
|
83
|
+
<div css={{ marginTop: spacing.xsmall }}>
|
|
84
|
+
<SafeLink to="/minndla">{messages.logInFailed}</SafeLink>
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
81
87
|
{children}
|
|
82
88
|
</StyledErrorMessage>
|
|
83
89
|
);
|
|
@@ -2,7 +2,6 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import { colors, spacing, spacingUnit, mq, breakpoints } from '@ndla/core';
|
|
4
4
|
import SafeLink from '@ndla/safelink';
|
|
5
|
-
import { WithTranslation, withTranslation } from 'react-i18next';
|
|
6
5
|
import FrontpageHeaderIllustration from './illustrations/FrontpageHeaderIllustration';
|
|
7
6
|
import SvgLogo from '../Logo/SvgLogo';
|
|
8
7
|
|
|
@@ -48,20 +47,20 @@ const HeaderIllustrationWrapper = styled.div`
|
|
|
48
47
|
}
|
|
49
48
|
`;
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
interface FrontPageHeaderProps {
|
|
52
51
|
locale: string;
|
|
53
52
|
showHeader: boolean;
|
|
54
53
|
children?: ReactNode;
|
|
55
|
-
}
|
|
54
|
+
}
|
|
56
55
|
|
|
57
|
-
const FrontpageHeader = ({ locale, showHeader = true, children
|
|
56
|
+
const FrontpageHeader = ({ locale, showHeader = true, children }: FrontPageHeaderProps) => (
|
|
58
57
|
<StyledHeaderWrapper>
|
|
59
58
|
<StyledHeader>
|
|
60
|
-
<StyledLogo to="/" aria-
|
|
59
|
+
<StyledLogo to="/" aria-hidden="true">
|
|
61
60
|
<SvgLogo locale={locale} />
|
|
62
61
|
</StyledLogo>
|
|
63
62
|
{showHeader && (
|
|
64
|
-
<HeaderIllustrationWrapper>
|
|
63
|
+
<HeaderIllustrationWrapper aria-hidden="true">
|
|
65
64
|
<FrontpageHeaderIllustration />
|
|
66
65
|
</HeaderIllustrationWrapper>
|
|
67
66
|
)}
|
|
@@ -70,4 +69,4 @@ const FrontpageHeader = ({ locale, showHeader = true, children, t }: FrontPageHe
|
|
|
70
69
|
</StyledHeaderWrapper>
|
|
71
70
|
);
|
|
72
71
|
|
|
73
|
-
export default
|
|
72
|
+
export default FrontpageHeader;
|
|
@@ -119,7 +119,7 @@ const FrontpageProgramMenu = ({ programItems, subjectCategories, showBetaCursor
|
|
|
119
119
|
<StyledMenuItem>{t('frontpageMenu.allsubjects')}</StyledMenuItem>
|
|
120
120
|
</Button>
|
|
121
121
|
{showBetaCursor && (
|
|
122
|
-
<CursorPlaceholder>
|
|
122
|
+
<CursorPlaceholder aria-hidden="true">
|
|
123
123
|
<CursorWrapper>
|
|
124
124
|
<LeftCursor hide={showSubjects} />
|
|
125
125
|
<CursorTextWrapper>
|
package/src/Image/Image.tsx
CHANGED
|
@@ -64,10 +64,10 @@ const Image = ({
|
|
|
64
64
|
contentType,
|
|
65
65
|
sizes = '(min-width: 1024px) 1024px, 100vw',
|
|
66
66
|
expandButton,
|
|
67
|
+
fallbackWidth = 1024,
|
|
67
68
|
...rest
|
|
68
69
|
}: Props) => {
|
|
69
70
|
const srcSet = rest.srcSet ?? getSrcSet(src, crop, focalPoint);
|
|
70
|
-
const fallbackWidth = rest.fallbackWidth ?? 1024;
|
|
71
71
|
const queryString = makeSrcQueryString(fallbackWidth, crop, focalPoint);
|
|
72
72
|
|
|
73
73
|
if (contentType && contentType === 'image/gif') {
|
|
@@ -10,7 +10,7 @@ import React, { useState } from 'react';
|
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { css } from '@emotion/core';
|
|
12
12
|
import FocusTrapReact from 'focus-trap-react';
|
|
13
|
-
import
|
|
13
|
+
import { ButtonV2 as Button } from '@ndla/button';
|
|
14
14
|
import { spacing, misc, colors, mq, breakpoints, animations, fonts, spacingUnit } from '@ndla/core';
|
|
15
15
|
import { ChevronDown } from '@ndla/icons/common';
|
|
16
16
|
import { useTranslation } from 'react-i18next';
|
|
@@ -95,12 +95,6 @@ const StyledSpan = styled.span`
|
|
|
95
95
|
font-weight: ${fonts.weight.semibold};
|
|
96
96
|
`;
|
|
97
97
|
|
|
98
|
-
const styledInvertedOutlineLargeScreensOnly = css`
|
|
99
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
100
|
-
${appearances.ghostPillOutlineInverted}
|
|
101
|
-
}
|
|
102
|
-
`;
|
|
103
|
-
|
|
104
98
|
type Props = {
|
|
105
99
|
options: {
|
|
106
100
|
[key: string]: {
|
|
@@ -116,31 +110,35 @@ type Props = {
|
|
|
116
110
|
alwaysVisible?: boolean;
|
|
117
111
|
};
|
|
118
112
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
113
|
+
interface StyledButtonProps {
|
|
114
|
+
outline?: boolean;
|
|
115
|
+
inverted?: boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const StyledButton = styled(Button)<StyledButtonProps>`
|
|
119
|
+
border-color: ${({ inverted, outline }) =>
|
|
120
|
+
outline ? (inverted ? colors.white : colors.brand.primary) : 'transparent'};
|
|
121
|
+
`;
|
|
122
|
+
|
|
123
|
+
const LanguageSelector = ({ currentLanguage, outline, center, inverted, alwaysVisible }: Props) => {
|
|
127
124
|
const { t, i18n } = useTranslation();
|
|
128
125
|
const [infoLocale, setInfoLocale] = useState(i18n.language);
|
|
129
126
|
const [isOpen, setIsOpen] = useState(false);
|
|
130
127
|
return (
|
|
131
128
|
<StyledWrapper alwaysVisible={alwaysVisible}>
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
129
|
+
<StyledButton
|
|
130
|
+
outline={outline}
|
|
131
|
+
inverted={inverted}
|
|
132
|
+
shape="pill"
|
|
133
|
+
size="medium"
|
|
134
|
+
colorTheme="lighter"
|
|
135
|
+
variant="ghost"
|
|
138
136
|
onClick={() => setIsOpen(true)}>
|
|
139
137
|
<StyledSpan>
|
|
140
138
|
{t(`languages.prefixChangeLanguage`)}: {t(`languages.${infoLocale}`)}
|
|
141
139
|
</StyledSpan>
|
|
142
140
|
<ChevronDown />
|
|
143
|
-
</
|
|
141
|
+
</StyledButton>
|
|
144
142
|
{isOpen && (
|
|
145
143
|
<FocusTrapReact
|
|
146
144
|
active
|
|
@@ -153,7 +151,7 @@ const LanguageSelector = ({
|
|
|
153
151
|
}}>
|
|
154
152
|
<StyledModal animateIn={isOpen} centered={center}>
|
|
155
153
|
<Button
|
|
156
|
-
link
|
|
154
|
+
variant="link"
|
|
157
155
|
onClick={() => {
|
|
158
156
|
setIsOpen(false);
|
|
159
157
|
}}>
|
|
@@ -66,18 +66,19 @@ interface Props {
|
|
|
66
66
|
description?: string;
|
|
67
67
|
title: string;
|
|
68
68
|
invertedStyle?: boolean;
|
|
69
|
+
id?: string;
|
|
69
70
|
license?: {
|
|
70
71
|
license: string;
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
export const LearningPathInformation = ({ description, title, license, invertedStyle }: Props) => {
|
|
75
|
+
export const LearningPathInformation = ({ description, title, license, invertedStyle, id }: Props) => {
|
|
75
76
|
const { rights } = getLicenseByAbbreviation(license?.license || '', 'nb');
|
|
76
77
|
return (
|
|
77
78
|
<section className="o-wrapper">
|
|
78
79
|
<StyledWrapper invertedStyle={invertedStyle} className="c-article">
|
|
79
80
|
<LicenseWrapper>
|
|
80
|
-
<StyledHeader>{title}</StyledHeader>
|
|
81
|
+
<StyledHeader id={id}>{title}</StyledHeader>
|
|
81
82
|
<LicenseByline licenseRights={rights} color={colors.brand.tertiary} />
|
|
82
83
|
</LicenseWrapper>
|
|
83
84
|
{description && <div dangerouslySetInnerHTML={{ __html: description }} />}
|
|
@@ -21,6 +21,7 @@ interface MastheadItemProps {
|
|
|
21
21
|
|
|
22
22
|
const LeftMastheadItem = styled.div`
|
|
23
23
|
display: flex;
|
|
24
|
+
align-items: center;
|
|
24
25
|
button {
|
|
25
26
|
white-space: nowrap;
|
|
26
27
|
}
|
|
@@ -35,6 +36,7 @@ const LeftMastheadItem = styled.div`
|
|
|
35
36
|
|
|
36
37
|
const RightMastheadItem = styled.div`
|
|
37
38
|
display: flex;
|
|
39
|
+
gap: ${spacing.small};
|
|
38
40
|
align-items: center;
|
|
39
41
|
justify-content: flex-end;
|
|
40
42
|
${mq.range({ from: breakpoints.tablet })} {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
import Button from '@ndla/button';
|
|
11
|
+
import { ButtonV2 as Button } from '@ndla/button';
|
|
12
12
|
import { Feide } from '@ndla/icons/common';
|
|
13
|
-
import { colors,
|
|
13
|
+
import { colors, spacing } from '@ndla/core';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
|
|
16
16
|
import AuthModal, { AuthModalProps } from '../User/AuthModal';
|
|
@@ -20,20 +20,15 @@ type FeideWrapperProps = {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const StyledButton = styled(Button)<FeideWrapperProps>`
|
|
23
|
-
|
|
24
|
-
display: flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
.feide-icon svg {
|
|
23
|
+
svg {
|
|
27
24
|
margin-left: ${spacing.xsmall};
|
|
28
|
-
|
|
29
|
-
color: ${(props) => (props.inverted ? `#ffffff` : `#000000`)};
|
|
25
|
+
color: ${(props) => (props.inverted ? colors.white : colors.brand.primary)};
|
|
30
26
|
width: 22px;
|
|
31
27
|
height: 22px;
|
|
32
28
|
}
|
|
33
|
-
&:hover
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
29
|
+
&:hover svg,
|
|
30
|
+
&:focus svg {
|
|
31
|
+
color: ${colors.brand.primary};
|
|
37
32
|
}
|
|
38
33
|
`;
|
|
39
34
|
|
|
@@ -43,15 +38,20 @@ interface Props extends AuthModalProps {
|
|
|
43
38
|
|
|
44
39
|
const MastheadAuthModal = ({ inverted, ...rest }: Props) => {
|
|
45
40
|
const { t } = useTranslation();
|
|
41
|
+
|
|
46
42
|
return (
|
|
47
43
|
<AuthModal
|
|
48
44
|
{...rest}
|
|
49
45
|
activateButton={
|
|
50
|
-
<StyledButton
|
|
46
|
+
<StyledButton
|
|
47
|
+
inverted={inverted}
|
|
48
|
+
shape="pill"
|
|
49
|
+
size="medium"
|
|
50
|
+
colorTheme="lighter"
|
|
51
|
+
variant="ghost"
|
|
52
|
+
aria-label={t('user.buttonLogIn')}>
|
|
51
53
|
{t('myNdla.myNDLA')}
|
|
52
|
-
<
|
|
53
|
-
<Feide />
|
|
54
|
-
</span>
|
|
54
|
+
<Feide />
|
|
55
55
|
</StyledButton>
|
|
56
56
|
}
|
|
57
57
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactChild, ReactChildren, ReactNode } from 'react';
|
|
2
2
|
import Modal from '@ndla/modal';
|
|
3
|
-
import
|
|
3
|
+
import { IconButtonV2 as IconButton } from '@ndla/button';
|
|
4
4
|
import { Cross } from '@ndla/icons/action';
|
|
5
5
|
import { isFunction } from '@ndla/util';
|
|
6
6
|
import styled from '@emotion/styled';
|
|
@@ -17,6 +17,9 @@ interface Props {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const StyledHeader = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
gap: ${spacing.small};
|
|
22
|
+
align-items: center;
|
|
20
23
|
${mq.range({ from: breakpoints.tablet })} {
|
|
21
24
|
width: 1024px;
|
|
22
25
|
max-width: calc(100vw - 100px);
|
|
@@ -50,26 +53,6 @@ const StyledHeader = styled.div`
|
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
|
-
> button {
|
|
54
|
-
width: ${spacing.large};
|
|
55
|
-
height: 48px;
|
|
56
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
57
|
-
transform: translate(${spacing.large}, 0);
|
|
58
|
-
width: ${spacing.large};
|
|
59
|
-
height: 56px;
|
|
60
|
-
&:hover,
|
|
61
|
-
&:focus {
|
|
62
|
-
transform: translate(calc(${spacing.large} + 1px), 1px);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
${mq.range({ from: breakpoints.wide })} {
|
|
66
|
-
transform: translate(${spacing.large}, 0);
|
|
67
|
-
&:hover,
|
|
68
|
-
&:focus {
|
|
69
|
-
transform: translate(calc(${spacing.large} + 1px), 1px);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
56
|
`;
|
|
74
57
|
|
|
75
58
|
const modalStyles = css`
|
|
@@ -133,9 +116,9 @@ const MastheadSearchModal = ({
|
|
|
133
116
|
<div css={extraBackdrop} />
|
|
134
117
|
<StyledHeader>
|
|
135
118
|
{isFunction(children) ? children(closeModal) : children}
|
|
136
|
-
<
|
|
119
|
+
<IconButton aria-label={t('welcomePage.closeSearch')} variant="ghost" colorTheme="light" onClick={closeModal}>
|
|
137
120
|
<Cross className="c-icon--medium" />
|
|
138
|
-
</
|
|
121
|
+
</IconButton>
|
|
139
122
|
</StyledHeader>
|
|
140
123
|
</>
|
|
141
124
|
)}
|
|
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
|
|
5
5
|
import { colors, spacing, fonts, mq, breakpoints } from '@ndla/core';
|
|
6
|
-
import Button from '@ndla/button';
|
|
6
|
+
import { ButtonV2 as Button } from '@ndla/button';
|
|
7
7
|
import { OneColumn } from '..';
|
|
8
8
|
import VisualElement from './VisualElement';
|
|
9
9
|
|
|
@@ -67,7 +67,7 @@ const AboutNdlaFilm = ({ aboutNDLAVideo, moreAboutNdlaFilm }: Props) => {
|
|
|
67
67
|
<div>
|
|
68
68
|
<h1>{aboutNDLAVideo.title}</h1>
|
|
69
69
|
<p>{aboutNDLAVideo.description}</p>
|
|
70
|
-
<Modal size="fullscreen" activateButton={<Button link>{t('ndlaFilm.about.more')}</Button>}>
|
|
70
|
+
<Modal size="fullscreen" activateButton={<Button variant="link">{t('ndlaFilm.about.more')}</Button>}>
|
|
71
71
|
{(onClose) => (
|
|
72
72
|
<OneColumn cssModifier="medium">
|
|
73
73
|
<ModalHeader>
|
|
@@ -45,10 +45,11 @@ type Props = {
|
|
|
45
45
|
subHeading?: string;
|
|
46
46
|
children: ReactNode;
|
|
47
47
|
invertedStyle?: boolean;
|
|
48
|
+
headingId?: string;
|
|
48
49
|
};
|
|
49
50
|
|
|
50
|
-
export const NavigationHeading = ({ subHeading, children, invertedStyle }: Props) => (
|
|
51
|
-
<StyledH1 invertedStyle={invertedStyle}>
|
|
51
|
+
export const NavigationHeading = ({ subHeading, children, invertedStyle, headingId }: Props) => (
|
|
52
|
+
<StyledH1 invertedStyle={invertedStyle} id={headingId} tabIndex={-1}>
|
|
52
53
|
{subHeading && <StyledSubText>{subHeading}</StyledSubText>}
|
|
53
54
|
<StyledMainText>{children}</StyledMainText>
|
|
54
55
|
</StyledH1>
|
|
@@ -65,9 +65,18 @@ type Props = GradesProps & {
|
|
|
65
65
|
heading?: string;
|
|
66
66
|
image?: string;
|
|
67
67
|
messageBoxText?: string;
|
|
68
|
+
headingId?: string;
|
|
68
69
|
};
|
|
69
70
|
|
|
70
|
-
export const Programme = ({
|
|
71
|
+
export const Programme = ({
|
|
72
|
+
heading,
|
|
73
|
+
image,
|
|
74
|
+
grades,
|
|
75
|
+
selectedGrade,
|
|
76
|
+
onChangeGrade,
|
|
77
|
+
messageBoxText,
|
|
78
|
+
headingId,
|
|
79
|
+
}: Props) => {
|
|
71
80
|
const { t } = useTranslation();
|
|
72
81
|
return (
|
|
73
82
|
<StyledWrapper>
|
|
@@ -76,7 +85,7 @@ export const Programme = ({ heading, image, grades, selectedGrade, onChangeGrade
|
|
|
76
85
|
<StyledLayoutWrapper>
|
|
77
86
|
<LayoutItem layout="extend">
|
|
78
87
|
<StyledContentWrapper>
|
|
79
|
-
<NavigationHeading>{heading}</NavigationHeading>
|
|
88
|
+
<NavigationHeading headingId={headingId}>{heading}</NavigationHeading>
|
|
80
89
|
{messageBoxText && <MessageBox>{t(messageBoxText)}</MessageBox>}
|
|
81
90
|
<SubjectsWrapper>
|
|
82
91
|
<ProgrammeSubjects grades={grades} selectedGrade={selectedGrade} onChangeGrade={onChangeGrade} />
|
|
@@ -284,19 +284,28 @@ const ResourceItem = ({
|
|
|
284
284
|
{contentTypeName && <ContentTypeName>{contentTypeName}</ContentTypeName>}
|
|
285
285
|
{access && access === 'teacher' && (
|
|
286
286
|
<Tooltip tooltip={t('article.access.onlyTeacher')}>
|
|
287
|
-
<HumanMaleBoard
|
|
287
|
+
<HumanMaleBoard
|
|
288
|
+
className="c-icon--20 u-margin-left-tiny c-topic-resource__list__additional-icons"
|
|
289
|
+
aria-label={t('article.access.onlyTeacher')}
|
|
290
|
+
/>
|
|
288
291
|
</Tooltip>
|
|
289
292
|
)}
|
|
290
293
|
{showAdditionalResources && contentTypeDescription && (
|
|
291
294
|
<>
|
|
292
295
|
{additional && (
|
|
293
296
|
<Tooltip tooltip={contentTypeDescription}>
|
|
294
|
-
<Additional
|
|
297
|
+
<Additional
|
|
298
|
+
className="c-icon--20 u-margin-left-tiny c-topic-resource__list__additional-icons"
|
|
299
|
+
aria-label={contentTypeDescription}
|
|
300
|
+
/>
|
|
295
301
|
</Tooltip>
|
|
296
302
|
)}
|
|
297
303
|
{!additional && (
|
|
298
304
|
<Tooltip tooltip={contentTypeDescription}>
|
|
299
|
-
<Core
|
|
305
|
+
<Core
|
|
306
|
+
className="c-icon--20 u-margin-left-tiny c-topic-resource__list__additional-icons"
|
|
307
|
+
aria-label={contentTypeDescription}
|
|
308
|
+
/>
|
|
300
309
|
</Tooltip>
|
|
301
310
|
)}
|
|
302
311
|
</>
|