@ndla/ui 25.0.1 → 25.2.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/ArticleFavoritesButton.js +2 -1
- package/es/Frontpage/FrontpageHeader.js +7 -5
- package/es/Frontpage/FrontpageProgramMenu.js +12 -10
- package/es/Frontpage/FrontpageSearch.js +5 -3
- package/es/Image/Image.js +5 -4
- package/es/LanguageSelector/LanguageSelector.js +31 -26
- 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/NDLAFilm/FilmSlideshow.js +7 -7
- package/es/NDLAFilm/NavigationArrow.js +4 -4
- package/es/Navigation/NavigationHeading.js +9 -6
- package/es/Navigation/NavigationTopicAbout.js +15 -14
- package/es/Notion/FigureNotion.js +4 -3
- package/es/Notion/NotionVisualElement.js +3 -2
- package/es/Programme/Programme.js +10 -7
- package/es/Search/SearchField.js +4 -3
- package/es/Search/SearchFieldForm.js +4 -3
- package/es/Search/ToggleSearchButton.js +3 -3
- package/es/SectionHeading/SectionHeading.js +4 -3
- package/es/Subject/Subject.js +109 -64
- package/es/Subject/SubjectAbout.js +61 -23
- package/es/Subject/SubjectArchive.js +109 -67
- package/es/Subject/SubjectCarousel.js +39 -62
- package/es/Subject/SubjectHeader.js +55 -25
- package/es/Subject/SubjectLinks.js +30 -16
- package/es/Subject/SubjectNewContent.js +76 -21
- package/es/Subject/SubjectShortcuts.js +39 -24
- package/es/Subject/SubjectSocial.js +20 -18
- 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/index.js +1 -0
- package/es/locale/messages-nb.js +23 -23
- package/es/locale/messages-nn.js +29 -29
- package/es/locale/messages-se.js +24 -24
- package/es/locale/messages-sma.js +24 -24
- package/lib/Article/ArticleFavoritesButton.js +2 -1
- package/lib/Frontpage/FrontpageHeader.js +7 -5
- package/lib/Frontpage/FrontpageMultidisciplinarySubject.d.ts +5 -5
- package/lib/Frontpage/FrontpageProgramMenu.js +12 -10
- package/lib/Frontpage/FrontpageSearch.js +6 -3
- package/lib/Frontpage/illustrations/FrontpageIllustrations.d.ts +2 -2
- 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/Masthead/Masthead.js +8 -8
- package/lib/Masthead/MastheadAuthModal.js +11 -11
- package/lib/Masthead/MastheadSearchModal.js +9 -11
- package/lib/MultidisciplinarySubject/Illustrations.d.ts +7 -7
- package/lib/NDLAFilm/AboutNdlaFilm.js +4 -4
- package/lib/NDLAFilm/FilmSlideshow.js +7 -7
- package/lib/NDLAFilm/NavigationArrow.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/Notion/FigureNotion.d.ts +2 -1
- package/lib/Notion/FigureNotion.js +4 -3
- package/lib/Notion/NotionVisualElement.d.ts +1 -0
- package/lib/Notion/NotionVisualElement.js +3 -2
- package/lib/Programme/Programme.d.ts +2 -1
- package/lib/Programme/Programme.js +10 -7
- package/lib/Resource/resourceComponents.d.ts +2 -2
- package/lib/Search/ActiveFilterContent.d.ts +1 -1
- package/lib/Search/ContentTypeResultStyles.d.ts +3 -3
- package/lib/Search/SearchField.js +4 -3
- package/lib/Search/SearchFieldForm.js +4 -3
- package/lib/Search/ToggleSearchButton.js +3 -3
- package/lib/SearchTypeResult/ActiveFilterContent.d.ts +1 -1
- package/lib/SectionHeading/SectionHeading.js +4 -3
- package/lib/Subject/Subject.d.ts +30 -82
- package/lib/Subject/Subject.js +90 -62
- package/lib/Subject/SubjectAbout.d.ts +1 -15
- package/lib/Subject/SubjectAbout.js +56 -25
- package/lib/Subject/SubjectArchive.d.ts +0 -21
- package/lib/Subject/SubjectArchive.js +103 -73
- package/lib/Subject/SubjectCarousel.d.ts +1 -31
- package/lib/Subject/SubjectCarousel.js +47 -76
- package/lib/Subject/SubjectHeader.d.ts +1 -14
- package/lib/Subject/SubjectHeader.js +53 -28
- package/lib/Subject/SubjectLinks.d.ts +1 -11
- package/lib/Subject/SubjectLinks.js +29 -19
- package/lib/Subject/SubjectNewContent.d.ts +1 -13
- package/lib/Subject/SubjectNewContent.js +70 -24
- package/lib/Subject/SubjectShortcuts.d.ts +0 -13
- package/lib/Subject/SubjectShortcuts.js +38 -29
- package/lib/Subject/SubjectSocial.d.ts +7 -22
- package/lib/Subject/SubjectSocial.js +19 -21
- 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/index.d.ts +1 -0
- package/lib/index.js +12 -3
- package/lib/locale/messages-nb.js +23 -23
- package/lib/locale/messages-nn.js +29 -29
- package/lib/locale/messages-se.js +24 -24
- package/lib/locale/messages-sma.js +24 -24
- package/package.json +14 -14
- package/src/Article/ArticleFavoritesButton.tsx +2 -1
- package/src/Frontpage/FrontpageHeader.tsx +1 -1
- package/src/Frontpage/FrontpageProgramMenu.tsx +1 -1
- package/src/Frontpage/FrontpageSearch.tsx +3 -1
- package/src/Image/Image.tsx +1 -1
- package/src/LanguageSelector/LanguageSelector.tsx +21 -23
- 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/NDLAFilm/FilmSlideshow.tsx +2 -0
- package/src/NDLAFilm/NavigationArrow.tsx +4 -4
- package/src/Navigation/NavigationHeading.tsx +3 -2
- package/src/Navigation/NavigationTopicAbout.tsx +1 -0
- package/src/Notion/FigureNotion.tsx +5 -2
- package/src/Notion/NotionVisualElement.tsx +2 -0
- package/src/Programme/Programme.tsx +11 -2
- package/src/Search/SearchField.tsx +6 -1
- package/src/Search/SearchFieldForm.tsx +1 -1
- package/src/Search/ToggleSearchButton.tsx +2 -2
- package/src/SectionHeading/SectionHeading.tsx +6 -2
- package/src/Subject/Subject.tsx +151 -72
- package/src/Subject/SubjectAbout.tsx +97 -27
- package/src/Subject/SubjectArchive.tsx +129 -58
- package/src/Subject/SubjectCarousel.tsx +42 -36
- package/src/Subject/SubjectHeader.tsx +75 -34
- package/src/Subject/SubjectLinks.tsx +21 -19
- package/src/Subject/SubjectNewContent.tsx +87 -32
- package/src/Subject/SubjectShortcuts.tsx +67 -27
- package/src/Subject/SubjectSocial.tsx +19 -20
- 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/index.ts +2 -0
- package/src/locale/messages-nb.ts +22 -23
- package/src/locale/messages-nn.ts +28 -28
- package/src/locale/messages-se.ts +23 -24
- package/src/locale/messages-sma.ts +23 -24
- package/src/main.scss +0 -2
- package/es/Article/ArticleAuthorContent.js +0 -71
- package/lib/Article/ArticleAuthorContent.d.ts +0 -28
- package/lib/Article/ArticleAuthorContent.js +0 -88
- package/src/.DS_Store +0 -0
- package/src/Article/ArticleAuthorContent.tsx +0 -107
- package/src/Article/component.article-author-popup.scss +0 -90
- package/src/Subject/component.subject-about.scss +0 -73
- package/src/Subject/component.subject-archive.scss +0 -92
- package/src/Subject/component.subject-carousel.scss +0 -32
- package/src/Subject/component.subject-concepts.scss +0 -37
- package/src/Subject/component.subject-header.scss +0 -87
- package/src/Subject/component.subject-links.scss +0 -14
- package/src/Subject/component.subject-new-content.scss +0 -82
- package/src/Subject/component.subject-shortcut.scss +0 -57
- package/src/Subject/component.subject.scss +0 -213
|
@@ -8,6 +8,7 @@ import { SearchField } from '../Search';
|
|
|
8
8
|
import { SearchFieldForm } from '../Search/SearchFieldForm';
|
|
9
9
|
import SearchResultSleeve from '../Search/SearchResultSleeve';
|
|
10
10
|
import { ContentTypeResultType, Resource } from '../types';
|
|
11
|
+
import { getMastheadHeight } from '../Masthead';
|
|
11
12
|
|
|
12
13
|
const StyledWrapper = styled.section`
|
|
13
14
|
border-radius: 2px;
|
|
@@ -94,11 +95,12 @@ const FrontpageSearch = ({
|
|
|
94
95
|
|
|
95
96
|
useEffect(() => {
|
|
96
97
|
let yCoordinate = 0;
|
|
98
|
+
const mastheadHeight = getMastheadHeight() || 84;
|
|
97
99
|
const resetScroll = () => {
|
|
98
100
|
window.scrollTo({ top: yCoordinate });
|
|
99
101
|
};
|
|
100
102
|
if (inputHasFocus && searchFieldRef && searchFieldRef.current) {
|
|
101
|
-
yCoordinate = searchFieldRef.current.getBoundingClientRect().top + window.pageYOffset;
|
|
103
|
+
yCoordinate = searchFieldRef.current.getBoundingClientRect().top + window.pageYOffset - mastheadHeight;
|
|
102
104
|
const isIE11 = isIE && parseInt(browserVersion) < 12;
|
|
103
105
|
if (isIE11) {
|
|
104
106
|
// insta move on IE
|
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
|
}}>
|
|
@@ -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>
|
|
@@ -48,10 +48,10 @@ export const StyledNavigationArrow = styled.div<StyledNavigationArrowProps>`
|
|
|
48
48
|
transform: translate(${spacing.xsmall}, 0);
|
|
49
49
|
${(props) =>
|
|
50
50
|
props.right &&
|
|
51
|
-
`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
css`
|
|
52
|
+
right: 0;
|
|
53
|
+
transform: translate(-${spacing.xsmall}, 0);
|
|
54
|
+
`}
|
|
55
55
|
`;
|
|
56
56
|
|
|
57
57
|
const NavigationArrowButton = styled.button`
|
|
@@ -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>
|
|
@@ -30,6 +30,7 @@ interface Props {
|
|
|
30
30
|
hideFigCaption?: boolean;
|
|
31
31
|
hideIconsAndAuthors?: boolean;
|
|
32
32
|
figureType?: FigureType;
|
|
33
|
+
licenseButtons?: ReactNode;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
const FigureNotion = ({
|
|
@@ -44,6 +45,7 @@ const FigureNotion = ({
|
|
|
44
45
|
hideFigCaption,
|
|
45
46
|
hideIconsAndAuthors,
|
|
46
47
|
figureType,
|
|
48
|
+
licenseButtons,
|
|
47
49
|
}: Props) => {
|
|
48
50
|
const { t, i18n } = useTranslation();
|
|
49
51
|
const license = getLicenseByAbbreviation(licenseString, i18n.language);
|
|
@@ -84,8 +86,9 @@ const FigureNotion = ({
|
|
|
84
86
|
source: t('source'),
|
|
85
87
|
learnAboutLicenses: t('license.learnMore'),
|
|
86
88
|
title: t('title'),
|
|
87
|
-
}}
|
|
88
|
-
|
|
89
|
+
}}>
|
|
90
|
+
{licenseButtons}
|
|
91
|
+
</FigureLicenseDialog>
|
|
89
92
|
</FigureCaption>
|
|
90
93
|
) : (
|
|
91
94
|
<BottomBorder />
|
|
@@ -30,6 +30,7 @@ export type NotionVisualElementType = {
|
|
|
30
30
|
src: string;
|
|
31
31
|
alt?: string;
|
|
32
32
|
};
|
|
33
|
+
licenseButtons?: ReactNode;
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
interface Props {
|
|
@@ -64,6 +65,7 @@ const NotionVisualElement = ({ visualElement, id, figureId }: Props) => {
|
|
|
64
65
|
title={visualElement.title ?? ''}
|
|
65
66
|
copyright={visualElement.copyright}
|
|
66
67
|
licenseString={visualElement.copyright?.license?.license ?? ''}
|
|
68
|
+
licenseButtons={visualElement.licenseButtons}
|
|
67
69
|
type={type}>
|
|
68
70
|
{visualElement.image?.src ? (
|
|
69
71
|
<img src={visualElement.image?.src} alt={visualElement.image.alt} />
|
|
@@ -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} />
|
|
@@ -139,7 +139,12 @@ const SearchField = ({
|
|
|
139
139
|
{t('welcomePage.resetSearch')}
|
|
140
140
|
</button>
|
|
141
141
|
)}
|
|
142
|
-
<button
|
|
142
|
+
<button
|
|
143
|
+
tabIndex={-1}
|
|
144
|
+
{...classes('button', 'searchIcon')}
|
|
145
|
+
type="submit"
|
|
146
|
+
value="Search"
|
|
147
|
+
aria-label={t('siteNav.search')}>
|
|
143
148
|
<SearchIcon />
|
|
144
149
|
</button>
|
|
145
150
|
</div>
|
|
@@ -58,7 +58,7 @@ const StyledForm = styled.form<StyledProps>`
|
|
|
58
58
|
|
|
59
59
|
export const SearchFieldForm = ({ children, inputHasFocus, onSubmit }: Props) => {
|
|
60
60
|
return (
|
|
61
|
-
<StyledForm action="/search/" inputHasFocus={inputHasFocus} onSubmit={onSubmit}>
|
|
61
|
+
<StyledForm role="search" action="/search/" inputHasFocus={inputHasFocus} onSubmit={onSubmit}>
|
|
62
62
|
{children}
|
|
63
63
|
</StyledForm>
|
|
64
64
|
);
|
|
@@ -32,7 +32,7 @@ const StyledButton = styled(Button)<StyledButtonProps>`
|
|
|
32
32
|
color: ${(p) => (p.ndlaFilm ? '#fff' : colors.brand.primary)};
|
|
33
33
|
padding: ${spacing.small} ${spacingUnit * 0.75}px ${spacing.small} ${spacing.normal};
|
|
34
34
|
align-items: center;
|
|
35
|
-
margin-left: ${spacing.
|
|
35
|
+
margin-left: ${spacing.medium};
|
|
36
36
|
|
|
37
37
|
.c-icon {
|
|
38
38
|
height: 24px;
|
|
@@ -43,7 +43,7 @@ const StyledButton = styled(Button)<StyledButtonProps>`
|
|
|
43
43
|
|
|
44
44
|
${mq.range({ from: breakpoints.desktop })} {
|
|
45
45
|
display: ${(p) => (p.hideOnWideScreen ? 'none' : 'flex')};
|
|
46
|
-
margin-right: ${spacing.
|
|
46
|
+
margin-right: ${spacing.nsmall};
|
|
47
47
|
padding: ${spacing.small} ${spacing.normal};
|
|
48
48
|
}
|
|
49
49
|
&:hover,
|
|
@@ -26,7 +26,7 @@ const StyledWrapper = styled.h2<StyledWrapperProps>`
|
|
|
26
26
|
`};
|
|
27
27
|
`;
|
|
28
28
|
|
|
29
|
-
const LargeStyledWrapper = StyledWrapper.withComponent('
|
|
29
|
+
const LargeStyledWrapper = StyledWrapper.withComponent('h1');
|
|
30
30
|
|
|
31
31
|
interface Props {
|
|
32
32
|
children: ReactNode;
|
|
@@ -36,7 +36,11 @@ interface Props {
|
|
|
36
36
|
|
|
37
37
|
const SectionHeading = ({ children, large = false, className }: Props) => {
|
|
38
38
|
const Wrapper: ElementType = large ? LargeStyledWrapper : StyledWrapper;
|
|
39
|
-
return
|
|
39
|
+
return (
|
|
40
|
+
<Wrapper large={large} className={className}>
|
|
41
|
+
{children}
|
|
42
|
+
</Wrapper>
|
|
43
|
+
);
|
|
40
44
|
};
|
|
41
45
|
|
|
42
46
|
export default SectionHeading;
|