@ndla/ui 37.1.3 → 38.0.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/Article.js +2 -2
- package/es/Article/ArticleHeaderWrapper.js +4 -7
- package/es/Article/ArticleNotions.js +16 -17
- package/es/Article/ArticleSideBar.js +4 -5
- package/es/AudioPlayer/Controls.js +173 -255
- package/es/CompetenceGoals/CompetenceGoalsDialog.js +12 -25
- package/es/Filter/FilterButtons.js +12 -14
- package/es/Filter/FilterListPhone.js +2 -4
- package/es/Footer/index.js +1 -2
- package/es/LearningPaths/LearningPathMenuModalWrapper.js +10 -6
- package/es/Masthead/MastheadSearchModal.js +56 -47
- package/es/MyNdla/SettingsMenu.js +6 -6
- package/es/NDLAFilm/AboutNdlaFilm.js +3 -3
- package/es/ResourcesWrapper/ResourcesTopicTitle.js +19 -23
- package/es/SearchTypeResult/PopupFilter.js +14 -20
- package/es/SearchTypeResult/components/ItemContexts.js +10 -21
- package/es/Topic/Topic.js +23 -23
- package/es/User/index.js +1 -3
- package/es/index.js +1 -3
- package/es/locale/messages-en.js +1 -0
- package/es/locale/messages-nb.js +1 -0
- package/es/locale/messages-nn.js +1 -0
- package/es/locale/messages-se.js +1 -0
- package/es/locale/messages-sma.js +1 -0
- package/lib/Article/Article.d.ts +2 -2
- package/lib/Article/Article.js +2 -2
- package/lib/Article/ArticleHeaderWrapper.d.ts +3 -2
- package/lib/Article/ArticleHeaderWrapper.js +4 -7
- package/lib/Article/ArticleNotions.js +17 -21
- package/lib/Article/ArticleSideBar.js +5 -9
- package/lib/AudioPlayer/Controls.d.ts +2 -2
- package/lib/AudioPlayer/Controls.js +173 -255
- package/lib/CompetenceGoals/CompetenceGoalsDialog.d.ts +3 -14
- package/lib/CompetenceGoals/CompetenceGoalsDialog.js +11 -26
- package/lib/Filter/FilterButtons.js +13 -15
- package/lib/Filter/FilterListPhone.js +3 -5
- package/lib/Footer/index.d.ts +1 -2
- package/lib/Footer/index.js +0 -7
- package/lib/LearningPaths/LearningPathMenuModalWrapper.js +9 -8
- package/lib/Masthead/MastheadSearchModal.d.ts +1 -1
- package/lib/Masthead/MastheadSearchModal.js +58 -46
- package/lib/MyNdla/SettingsMenu.js +5 -5
- package/lib/NDLAFilm/AboutNdlaFilm.js +2 -2
- package/lib/ResourcesWrapper/ResourcesTopicTitle.js +20 -27
- package/lib/SearchTypeResult/PopupFilter.js +14 -20
- package/lib/SearchTypeResult/components/ItemContexts.js +10 -21
- package/lib/Topic/Topic.js +22 -22
- package/lib/User/index.d.ts +0 -2
- package/lib/User/index.js +1 -13
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -20
- package/lib/locale/messages-en.d.ts +1 -0
- package/lib/locale/messages-en.js +1 -0
- package/lib/locale/messages-nb.d.ts +1 -0
- package/lib/locale/messages-nb.js +1 -0
- package/lib/locale/messages-nn.d.ts +1 -0
- package/lib/locale/messages-nn.js +1 -0
- package/lib/locale/messages-se.d.ts +1 -0
- package/lib/locale/messages-se.js +1 -0
- package/lib/locale/messages-sma.d.ts +1 -0
- package/lib/locale/messages-sma.js +1 -0
- package/package.json +16 -17
- package/src/Article/Article.tsx +4 -4
- package/src/Article/ArticleHeaderWrapper.tsx +12 -18
- package/src/Article/ArticleNotions.tsx +7 -8
- package/src/Article/ArticleSideBar.tsx +3 -3
- package/src/AudioPlayer/Controls.tsx +146 -300
- package/src/CompetenceGoals/CompetenceGoalsDialog.tsx +13 -38
- package/src/Filter/FilterButtons.tsx +4 -5
- package/src/Filter/FilterListPhone.tsx +3 -4
- package/src/Footer/index.ts +1 -2
- package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +10 -6
- package/src/Masthead/MastheadSearchModal.tsx +48 -74
- package/src/MyNdla/SettingsMenu.tsx +3 -3
- package/src/NDLAFilm/AboutNdlaFilm.tsx +3 -3
- package/src/ResourcesWrapper/ResourcesTopicTitle.tsx +4 -8
- package/src/SearchTypeResult/PopupFilter.tsx +6 -11
- package/src/SearchTypeResult/components/ItemContexts.tsx +4 -21
- package/src/Topic/Topic.tsx +7 -7
- package/src/User/index.ts +0 -2
- package/src/index.ts +1 -3
- package/src/locale/messages-en.ts +1 -0
- package/src/locale/messages-nb.ts +1 -0
- package/src/locale/messages-nn.ts +1 -0
- package/src/locale/messages-se.ts +1 -0
- package/src/locale/messages-sma.ts +1 -0
- package/es/Figure/FigureLicenseDialogContent.js +0 -75
- package/es/Footer/FooterAuth.js +0 -110
- package/es/Masthead/MastheadAuthModal.js +0 -50
- package/es/SearchTypeResult/SearchNotionItem.js +0 -208
- package/es/User/AuthModal.js +0 -116
- package/lib/Figure/FigureLicenseDialogContent.d.ts +0 -22
- package/lib/Figure/FigureLicenseDialogContent.js +0 -80
- package/lib/Footer/FooterAuth.d.ts +0 -10
- package/lib/Footer/FooterAuth.js +0 -114
- package/lib/Masthead/MastheadAuthModal.d.ts +0 -13
- package/lib/Masthead/MastheadAuthModal.js +0 -56
- package/lib/SearchTypeResult/SearchNotionItem.d.ts +0 -29
- package/lib/SearchTypeResult/SearchNotionItem.js +0 -215
- package/lib/User/AuthModal.d.ts +0 -22
- package/lib/User/AuthModal.js +0 -124
- package/src/Figure/FigureLicenseDialogContent.tsx +0 -80
- package/src/Footer/FooterAuth.tsx +0 -104
- package/src/Masthead/MastheadAuthModal.tsx +0 -62
- package/src/SearchTypeResult/SearchNotionItem.tsx +0 -228
- package/src/User/AuthModal.tsx +0 -123
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React, {
|
|
9
|
+
import React, { ReactNode } from 'react';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
|
-
import { breakpoints,
|
|
12
|
-
import
|
|
11
|
+
import { breakpoints, mq } from '@ndla/core';
|
|
12
|
+
import { ModalHeader, ModalBody, ModalCloseButton, Modal, ModalTitle, ModalProps } from '@ndla/modal';
|
|
13
13
|
import { FooterHeaderIcon } from '@ndla/icons/common';
|
|
14
14
|
import styled from '@emotion/styled';
|
|
15
15
|
|
|
@@ -21,28 +21,9 @@ const HeaderWrapper = styled.div`
|
|
|
21
21
|
width: 100%;
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
|
-
const HeadingWrapper = styled.h1`
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
${fonts.sizes('18px', '32px')};
|
|
28
|
-
margin: 0;
|
|
29
|
-
font-weight: ${fonts.weight.semibold};
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
24
|
interface Props {
|
|
33
25
|
children?: ReactNode;
|
|
34
|
-
modalProps?: ComponentProps<typeof Modal>;
|
|
35
|
-
isOpen?: boolean;
|
|
36
|
-
onClose?: () => void;
|
|
37
26
|
subjectName?: string;
|
|
38
|
-
curriculums?: {
|
|
39
|
-
id: string;
|
|
40
|
-
name: string;
|
|
41
|
-
goals?: {
|
|
42
|
-
id: string;
|
|
43
|
-
name: string;
|
|
44
|
-
}[];
|
|
45
|
-
}[];
|
|
46
27
|
}
|
|
47
28
|
|
|
48
29
|
const CompetenceGoalsWrapper = styled.div`
|
|
@@ -57,29 +38,23 @@ const CompetenceGoalsWrapper = styled.div`
|
|
|
57
38
|
}
|
|
58
39
|
`;
|
|
59
40
|
|
|
60
|
-
export const CompetenceGoalsDialog = ({
|
|
41
|
+
export const CompetenceGoalsDialog = ({
|
|
42
|
+
children,
|
|
43
|
+
subjectName,
|
|
44
|
+
...modalProps
|
|
45
|
+
}: Props & Omit<ModalProps, 'children'>) => {
|
|
61
46
|
const { t } = useTranslation();
|
|
62
|
-
const iconId = 'popupCompetenceGoals';
|
|
63
47
|
|
|
64
48
|
return (
|
|
65
|
-
<Modal
|
|
66
|
-
labelledBy={iconId}
|
|
67
|
-
{...modalProps}
|
|
68
|
-
controllable
|
|
69
|
-
isOpen={isOpen}
|
|
70
|
-
onClose={onClose}
|
|
71
|
-
size="fullscreen"
|
|
72
|
-
backgroundColor="light-gradient"
|
|
73
|
-
narrow
|
|
74
|
-
>
|
|
49
|
+
<Modal {...(modalProps as ModalProps)} size="full">
|
|
75
50
|
{(close) => (
|
|
76
51
|
<>
|
|
77
|
-
<ModalHeader
|
|
52
|
+
<ModalHeader>
|
|
78
53
|
<HeaderWrapper>
|
|
79
|
-
<
|
|
80
|
-
<FooterHeaderIcon
|
|
54
|
+
<ModalTitle>
|
|
55
|
+
<FooterHeaderIcon size="24px" style={{ marginRight: '20px' }} />
|
|
81
56
|
{t('competenceGoals.modalText')} {subjectName && ` \u2022 ${subjectName}`}
|
|
82
|
-
</
|
|
57
|
+
</ModalTitle>
|
|
83
58
|
<ModalCloseButton onClick={close} title={t('competenceGoals.competenceGoalClose')} />
|
|
84
59
|
</HeaderWrapper>
|
|
85
60
|
</ModalHeader>
|
|
@@ -11,7 +11,7 @@ import { ButtonV2 } from '@ndla/button';
|
|
|
11
11
|
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
12
12
|
import { useTranslation } from 'react-i18next';
|
|
13
13
|
import { Cross as CrossIcon, Plus as PlusIcon } from '@ndla/icons/action';
|
|
14
|
-
import
|
|
14
|
+
import { ModalHeader, ModalBody, ModalCloseButton, Modal } from '@ndla/modal';
|
|
15
15
|
import ToggleItem from './ToggleItem';
|
|
16
16
|
import FilterCarousel from './FilterCarousel';
|
|
17
17
|
|
|
@@ -127,10 +127,9 @@ export const FilterButtons = ({ heading, items, onFilterToggle, onRemoveAllFilte
|
|
|
127
127
|
</StyledButtonElementWrapper>
|
|
128
128
|
))}
|
|
129
129
|
<Modal
|
|
130
|
-
label={t('searchPage.searchFilterMessages.resourceTypeFilter.button')}
|
|
131
|
-
size="
|
|
130
|
+
aria-label={t('searchPage.searchFilterMessages.resourceTypeFilter.button')}
|
|
131
|
+
size="full"
|
|
132
132
|
animation="subtle"
|
|
133
|
-
backgroundColor="white"
|
|
134
133
|
activateButton={
|
|
135
134
|
<StyledButtonElementWrapper>
|
|
136
135
|
<ButtonV2 colorTheme="light" size="normal" shape="pill">
|
|
@@ -144,7 +143,7 @@ export const FilterButtons = ({ heading, items, onFilterToggle, onRemoveAllFilte
|
|
|
144
143
|
>
|
|
145
144
|
{(onClose: () => void) => (
|
|
146
145
|
<>
|
|
147
|
-
<ModalHeader
|
|
146
|
+
<ModalHeader>
|
|
148
147
|
<h1>{heading}</h1>
|
|
149
148
|
<ModalCloseButton title={t('modal.closeModal')} onClick={onClose} />
|
|
150
149
|
</ModalHeader>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import React, { ChangeEvent, useEffect, useState } from 'react';
|
|
10
10
|
import { ChevronDown, ChevronUp } from '@ndla/icons/common';
|
|
11
|
-
import
|
|
11
|
+
import { ModalHeader, ModalBody, ModalCloseButton, Modal } from '@ndla/modal';
|
|
12
12
|
import { ButtonV2 } from '@ndla/button';
|
|
13
13
|
import debounce from 'lodash/debounce';
|
|
14
14
|
import { classes } from './filterClasses';
|
|
@@ -138,8 +138,7 @@ const FilterListPhone = ({
|
|
|
138
138
|
/>
|
|
139
139
|
)}
|
|
140
140
|
<Modal
|
|
141
|
-
size="
|
|
142
|
-
backgroundColor="grey"
|
|
141
|
+
size="full"
|
|
143
142
|
activateButton={
|
|
144
143
|
<ButtonV2 variant="outline" {...classes('modal-button')}>
|
|
145
144
|
{messages.openFilter}
|
|
@@ -148,7 +147,7 @@ const FilterListPhone = ({
|
|
|
148
147
|
>
|
|
149
148
|
{(onClose) => (
|
|
150
149
|
<>
|
|
151
|
-
<ModalHeader
|
|
150
|
+
<ModalHeader>
|
|
152
151
|
<div {...classes('modal-header')}>
|
|
153
152
|
<div {...classes('modal-heading')}>
|
|
154
153
|
{!isNarrowScreen && label && <h1 {...classes('label')}>{label}</h1>}
|
package/src/Footer/index.ts
CHANGED
|
@@ -9,6 +9,5 @@
|
|
|
9
9
|
import Footer from './Footer';
|
|
10
10
|
import { FooterText } from './FooterText';
|
|
11
11
|
import { EditorName } from './EditorName';
|
|
12
|
-
import FooterAuth from './FooterAuth';
|
|
13
12
|
|
|
14
|
-
export { Footer, FooterText, EditorName
|
|
13
|
+
export { Footer, FooterText, EditorName };
|
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React, { ReactChild, ReactChildren, ReactNode } from 'react';
|
|
10
|
-
import { spacing, mq, breakpoints } from '@ndla/core';
|
|
11
|
-
import
|
|
10
|
+
import { spacing, mq, breakpoints, colors } from '@ndla/core';
|
|
11
|
+
import { ModalHeader, ModalBody, ModalCloseButton, Modal } from '@ndla/modal';
|
|
12
12
|
import { css } from '@emotion/react';
|
|
13
13
|
import { ButtonV2 } from '@ndla/button';
|
|
14
14
|
import { LearningPath } from '@ndla/icons/contentType';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import styled from '@emotion/styled';
|
|
16
17
|
|
|
17
18
|
const buttonToggleCss = css`
|
|
18
19
|
${mq.range({ from: breakpoints.tablet })} {
|
|
@@ -29,6 +30,10 @@ const buttonToggleCss = css`
|
|
|
29
30
|
}
|
|
30
31
|
`;
|
|
31
32
|
|
|
33
|
+
const StyledModal = styled(Modal)`
|
|
34
|
+
background-color: ${colors.brand.greyLightest};
|
|
35
|
+
`;
|
|
36
|
+
|
|
32
37
|
type ModalWrapperProps = {
|
|
33
38
|
innerWidth: number;
|
|
34
39
|
children: (arg: VoidFunction) => ReactChild | ReactChildren | ReactNode;
|
|
@@ -38,10 +43,9 @@ const ModalWrapperComponent = ({ innerWidth, children }: ModalWrapperProps) => {
|
|
|
38
43
|
const { t } = useTranslation();
|
|
39
44
|
if (innerWidth < 601) {
|
|
40
45
|
return (
|
|
41
|
-
<
|
|
42
|
-
backgroundColor="grey"
|
|
46
|
+
<StyledModal
|
|
43
47
|
animationDuration={200}
|
|
44
|
-
size="
|
|
48
|
+
size="full"
|
|
45
49
|
activateButton={
|
|
46
50
|
<ButtonV2 css={buttonToggleCss}>
|
|
47
51
|
<LearningPath />
|
|
@@ -57,7 +61,7 @@ const ModalWrapperComponent = ({ innerWidth, children }: ModalWrapperProps) => {
|
|
|
57
61
|
<ModalBody>{children(closeModal)}</ModalBody>
|
|
58
62
|
</>
|
|
59
63
|
)}
|
|
60
|
-
</
|
|
64
|
+
</StyledModal>
|
|
61
65
|
);
|
|
62
66
|
}
|
|
63
67
|
return <>{children(() => {})}</>;
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import React, { ReactChild, ReactChildren, ReactNode } from 'react';
|
|
2
|
-
import
|
|
1
|
+
import React, { ReactChild, ReactChildren, ReactNode, useState } from 'react';
|
|
2
|
+
import { Drawer } from '@ndla/modal';
|
|
3
3
|
import { IconButtonV2 as IconButton } from '@ndla/button';
|
|
4
4
|
import { Cross } from '@ndla/icons/action';
|
|
5
|
-
import { isFunction } from '@ndla/util';
|
|
6
5
|
import styled from '@emotion/styled';
|
|
7
|
-
import {
|
|
8
|
-
import { spacing, mq, breakpoints, colors, shadows } from '@ndla/core';
|
|
6
|
+
import { spacing, mq, breakpoints, colors } from '@ndla/core';
|
|
9
7
|
import { useTranslation } from 'react-i18next';
|
|
10
8
|
import ToggleSearchButton from '../Search/ToggleSearchButton';
|
|
11
9
|
|
|
12
10
|
interface Props {
|
|
13
11
|
onClose: VoidFunction;
|
|
14
|
-
children: (arg:
|
|
12
|
+
children: (arg: () => void) => ReactChild | ReactChildren | ReactNode;
|
|
15
13
|
hideOnNarrowScreen?: boolean;
|
|
16
14
|
ndlaFilm?: boolean;
|
|
17
15
|
}
|
|
18
16
|
|
|
17
|
+
const StyledDrawer = styled(Drawer)`
|
|
18
|
+
background-color: ${colors.brand.greyLightest};
|
|
19
|
+
`;
|
|
20
|
+
|
|
19
21
|
const StyledHeader = styled.div`
|
|
20
22
|
display: flex;
|
|
21
23
|
gap: ${spacing.small};
|
|
22
|
-
align-items:
|
|
24
|
+
align-items: flex-start;
|
|
23
25
|
${mq.range({ from: breakpoints.tablet })} {
|
|
24
26
|
width: 1024px;
|
|
25
27
|
max-width: calc(100vw - 100px);
|
|
@@ -33,11 +35,14 @@ const StyledHeader = styled.div`
|
|
|
33
35
|
|
|
34
36
|
display: flex;
|
|
35
37
|
padding-top: ${spacing.small};
|
|
38
|
+
padding-bottom: ${spacing.small};
|
|
36
39
|
${mq.range({ from: breakpoints.tablet })} {
|
|
37
40
|
padding-top: ${spacing.normal};
|
|
41
|
+
padding-bottom: ${spacing.normal};
|
|
38
42
|
}
|
|
39
43
|
${mq.range({ from: breakpoints.desktop })} {
|
|
40
44
|
padding-top: calc(${spacing.normal} + ${spacing.small});
|
|
45
|
+
padding-bottom: calc(${spacing.normal} + ${spacing.small});
|
|
41
46
|
}
|
|
42
47
|
> input {
|
|
43
48
|
width: 100%;
|
|
@@ -55,76 +60,45 @@ const StyledHeader = styled.div`
|
|
|
55
60
|
}
|
|
56
61
|
`;
|
|
57
62
|
|
|
58
|
-
const modalStyles = css`
|
|
59
|
-
& > [data-reach-dialog-content] {
|
|
60
|
-
position: fixed;
|
|
61
|
-
background: none;
|
|
62
|
-
top: 0;
|
|
63
|
-
right: 0;
|
|
64
|
-
left: 0;
|
|
65
|
-
height: 74px;
|
|
66
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
67
|
-
height: 110px;
|
|
68
|
-
}
|
|
69
|
-
${mq.range({ from: breakpoints.desktop })} {
|
|
70
|
-
height: 136px;
|
|
71
|
-
}
|
|
72
|
-
overflow-y: visible;
|
|
73
|
-
box-shadow: none;
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
|
|
77
|
-
const extraBackdrop = css`
|
|
78
|
-
position: absolute;
|
|
79
|
-
z-index: -1;
|
|
80
|
-
left: 0;
|
|
81
|
-
right: 0;
|
|
82
|
-
top: 0;
|
|
83
|
-
height: 74px;
|
|
84
|
-
background: ${colors.brand.greyLighter};
|
|
85
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
86
|
-
height: 110px;
|
|
87
|
-
}
|
|
88
|
-
${mq.range({ from: breakpoints.desktop })} {
|
|
89
|
-
height: 136px;
|
|
90
|
-
}
|
|
91
|
-
box-shadow: ${shadows.searchHeader};
|
|
92
|
-
`;
|
|
93
|
-
|
|
94
63
|
const MastheadSearchModal = ({ onClose: onSearchClose, children, hideOnNarrowScreen, ndlaFilm }: Props) => {
|
|
95
64
|
const { t } = useTranslation();
|
|
65
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
96
66
|
return (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
67
|
+
<>
|
|
68
|
+
<ToggleSearchButton hideOnNarrowScreen={hideOnNarrowScreen} onClick={() => setIsOpen(true)} ndlaFilm={ndlaFilm}>
|
|
69
|
+
{t('masthead.menu.search')}
|
|
70
|
+
</ToggleSearchButton>
|
|
71
|
+
<StyledDrawer
|
|
72
|
+
controlled
|
|
73
|
+
aria-label={t('searchPage.searchFieldPlaceholder')}
|
|
74
|
+
position="top"
|
|
75
|
+
expands
|
|
76
|
+
size="small"
|
|
77
|
+
animation="slideIn"
|
|
78
|
+
animationDuration={200}
|
|
79
|
+
isOpen={isOpen}
|
|
80
|
+
onClose={() => {
|
|
81
|
+
setIsOpen(false);
|
|
82
|
+
onSearchClose();
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
{(closeModal) => (
|
|
86
|
+
<>
|
|
87
|
+
<StyledHeader>
|
|
88
|
+
{children(closeModal)}
|
|
89
|
+
<IconButton
|
|
90
|
+
aria-label={t('welcomePage.closeSearch')}
|
|
91
|
+
variant="ghost"
|
|
92
|
+
colorTheme="light"
|
|
93
|
+
onClick={closeModal}
|
|
94
|
+
>
|
|
95
|
+
<Cross className="c-icon--medium" />
|
|
96
|
+
</IconButton>
|
|
97
|
+
</StyledHeader>
|
|
98
|
+
</>
|
|
99
|
+
)}
|
|
100
|
+
</StyledDrawer>
|
|
101
|
+
</>
|
|
128
102
|
);
|
|
129
103
|
};
|
|
130
104
|
|
|
@@ -11,7 +11,7 @@ import styled from '@emotion/styled';
|
|
|
11
11
|
import { isMobile, isTablet } from 'react-device-detect';
|
|
12
12
|
import { useTranslation } from 'react-i18next';
|
|
13
13
|
import { IconButtonV2, MenuItemProps, MenuButton, ButtonV2 } from '@ndla/button';
|
|
14
|
-
import { Drawer, ModalBody, ModalCloseButton,
|
|
14
|
+
import { Drawer, ModalBody, ModalCloseButton, ModalHeader } from '@ndla/modal';
|
|
15
15
|
import { HorizontalMenu } from '@ndla/icons/contentType';
|
|
16
16
|
import { breakpoints, colors, misc, mq, spacing } from '@ndla/core';
|
|
17
17
|
|
|
@@ -58,10 +58,10 @@ const SettingsMenu = ({ menuItems, children }: Props) => {
|
|
|
58
58
|
>
|
|
59
59
|
{(close) => (
|
|
60
60
|
<>
|
|
61
|
-
<
|
|
61
|
+
<ModalHeader>
|
|
62
62
|
<h1>{t('myNdla.settings')}</h1>
|
|
63
63
|
<ModalCloseButton onClick={close} />
|
|
64
|
-
</
|
|
64
|
+
</ModalHeader>
|
|
65
65
|
<StyledModalBody>
|
|
66
66
|
{children?.(close)}
|
|
67
67
|
{!!menuItems?.length && (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
|
-
import { ModalHeader, ModalBody, ModalCloseButton,
|
|
4
|
+
import { ModalHeader, ModalBody, ModalCloseButton, Modal } from '@ndla/modal';
|
|
5
5
|
import { colors, spacing, mq, breakpoints } from '@ndla/core';
|
|
6
6
|
import { ButtonV2 as Button } from '@ndla/button';
|
|
7
7
|
import VisualElement from './VisualElement';
|
|
@@ -64,7 +64,7 @@ const AboutNdlaFilm = ({ aboutNDLAVideo, moreAboutNdlaFilm }: Props) => {
|
|
|
64
64
|
<div>
|
|
65
65
|
<h2 id={titleId}>{aboutNDLAVideo.title}</h2>
|
|
66
66
|
<p>{aboutNDLAVideo.description}</p>
|
|
67
|
-
<
|
|
67
|
+
<Modal size="full" activateButton={<Button variant="link">{t('ndlaFilm.about.more')}</Button>}>
|
|
68
68
|
{(onClose) => (
|
|
69
69
|
<>
|
|
70
70
|
<ModalHeader>
|
|
@@ -73,7 +73,7 @@ const AboutNdlaFilm = ({ aboutNDLAVideo, moreAboutNdlaFilm }: Props) => {
|
|
|
73
73
|
<ModalBody>{moreAboutNdlaFilm}</ModalBody>
|
|
74
74
|
</>
|
|
75
75
|
)}
|
|
76
|
-
</
|
|
76
|
+
</Modal>
|
|
77
77
|
</div>
|
|
78
78
|
</StyledAside>
|
|
79
79
|
</div>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
5
|
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
6
|
-
import
|
|
6
|
+
import { ModalBody, ModalHeader, ModalCloseButton, Modal, ModalTitle } from '@ndla/modal';
|
|
7
7
|
import Tooltip from '@ndla/tooltip';
|
|
8
8
|
import { Switch } from '@ndla/switch';
|
|
9
9
|
import { LearningPathQuiz } from '@ndla/icons/contentType';
|
|
@@ -170,8 +170,6 @@ const ResourcesTopicTitle = ({
|
|
|
170
170
|
heading = <TopicTitle css={topicTitleSingleStyle}>{messages.label}</TopicTitle>;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
const tooltipId = 'popupDialogTooltip';
|
|
174
|
-
|
|
175
173
|
return (
|
|
176
174
|
<TopicTitleWrapper css={invertedStyle ? invertedTopicTitleWrapperStyle : undefined}>
|
|
177
175
|
<div>
|
|
@@ -188,15 +186,13 @@ const ResourcesTopicTitle = ({
|
|
|
188
186
|
css={invertedStyle ? invertedSwitchCSS : switchCSS}
|
|
189
187
|
/>
|
|
190
188
|
<Modal
|
|
191
|
-
labelledBy={tooltipId}
|
|
192
|
-
narrow
|
|
193
189
|
wrapperFunctionForButton={(activateButton: ReactNode) => (
|
|
194
190
|
<TooltipWrapper>
|
|
195
191
|
<Tooltip tooltip={t('resource.dialogTooltip')}>{activateButton}</Tooltip>
|
|
196
192
|
</TooltipWrapper>
|
|
197
193
|
)}
|
|
198
194
|
activateButton={
|
|
199
|
-
<TooltipButton
|
|
195
|
+
<TooltipButton aria-label={t('resource.dialogTooltip')}>
|
|
200
196
|
<HelpIcon invertedStyle={invertedStyle} />
|
|
201
197
|
</TooltipButton>
|
|
202
198
|
}
|
|
@@ -204,10 +200,10 @@ const ResourcesTopicTitle = ({
|
|
|
204
200
|
{(onClose: () => void) => (
|
|
205
201
|
<>
|
|
206
202
|
<ModalHeader>
|
|
203
|
+
<ModalTitle>{t('resource.dialogHeading')}</ModalTitle>
|
|
207
204
|
<ModalCloseButton title={t('modal.closeModal')} onClick={onClose} />
|
|
208
205
|
</ModalHeader>
|
|
209
206
|
<ModalBody>
|
|
210
|
-
<h1>{t('resource.dialogHeading')}</h1>
|
|
211
207
|
<hr />
|
|
212
208
|
<p>{t('resource.dialogText1')}</p>
|
|
213
209
|
<p>{t('resource.dialogText2')}</p>
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
import React, { useState } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
import
|
|
12
|
-
import { breakpoints,
|
|
11
|
+
import { ModalCloseButton, ModalBody, Modal, ModalTitle } from '@ndla/modal';
|
|
12
|
+
import { breakpoints, mq, spacing } from '@ndla/core';
|
|
13
13
|
import { ButtonV2 } from '@ndla/button';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { ToggleItem } from '../Filter';
|
|
@@ -27,10 +27,6 @@ const ModalHeaderWrapper = styled.div`
|
|
|
27
27
|
margin-bottom: ${spacing.normal};
|
|
28
28
|
`;
|
|
29
29
|
|
|
30
|
-
const ModalHeading = styled.h1`
|
|
31
|
-
${fonts.sizes('22px', 1.2)};
|
|
32
|
-
margin: 0;
|
|
33
|
-
`;
|
|
34
30
|
const ModalContent = styled.div`
|
|
35
31
|
max-width: 1040px;
|
|
36
32
|
flex-grow: 1;
|
|
@@ -95,21 +91,20 @@ const PopupFilter = ({
|
|
|
95
91
|
|
|
96
92
|
return (
|
|
97
93
|
<Modal
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
backgroundColor="white"
|
|
94
|
+
aria-labelledby={headingId}
|
|
95
|
+
controlled
|
|
101
96
|
animation="subtle"
|
|
102
97
|
animationDuration={50}
|
|
103
98
|
onClose={onClose}
|
|
104
99
|
isOpen={isOpen}
|
|
105
|
-
size="
|
|
100
|
+
size="full"
|
|
106
101
|
>
|
|
107
102
|
{() => (
|
|
108
103
|
<ModalBody>
|
|
109
104
|
<ModalWrapper>
|
|
110
105
|
<ModalContent>
|
|
111
106
|
<ModalHeaderWrapper>
|
|
112
|
-
<
|
|
107
|
+
<ModalTitle>{t('searchPage.searchFilterMessages.filterLabel')}</ModalTitle>
|
|
113
108
|
<ModalCloseButton onClick={() => onClose()} title={t('searchPage.close')} />
|
|
114
109
|
</ModalHeaderWrapper>
|
|
115
110
|
{subjectCategories && programmes && (
|
|
@@ -12,7 +12,7 @@ import { Additional, Core } from '@ndla/icons/common';
|
|
|
12
12
|
import styled from '@emotion/styled';
|
|
13
13
|
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
14
14
|
import { ButtonV2 } from '@ndla/button';
|
|
15
|
-
import {
|
|
15
|
+
import { Modal, ModalCloseButton, ModalHeader, ModalTitle } from '@ndla/modal';
|
|
16
16
|
import { useTranslation } from 'react-i18next';
|
|
17
17
|
|
|
18
18
|
const BreadcrumbPath = styled.div`
|
|
@@ -34,22 +34,6 @@ const ModalButton = styled(ButtonV2)`
|
|
|
34
34
|
}
|
|
35
35
|
`;
|
|
36
36
|
|
|
37
|
-
const ModalHeader = styled.div`
|
|
38
|
-
display: flex;
|
|
39
|
-
justify-content: space-between;
|
|
40
|
-
align-items: center;
|
|
41
|
-
padding: ${spacing.normal} ${spacing.small};
|
|
42
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
43
|
-
padding: ${spacing.normal} ${spacing.large};
|
|
44
|
-
}
|
|
45
|
-
`;
|
|
46
|
-
|
|
47
|
-
const ModalHeading = styled.h2`
|
|
48
|
-
margin: 0;
|
|
49
|
-
${fonts.sizes('16px', '20px')};
|
|
50
|
-
font-weight: 600;
|
|
51
|
-
`;
|
|
52
|
-
|
|
53
37
|
const ModalContent = styled.div`
|
|
54
38
|
padding: 0 ${spacing.small} ${spacing.normal};
|
|
55
39
|
${mq.range({ from: breakpoints.tablet })} {
|
|
@@ -99,8 +83,7 @@ const ItemContexts = ({ contexts, id, title }: ItemContextsType) => {
|
|
|
99
83
|
<Breadcrumb breadcrumb={mainContext.breadcrumb}>
|
|
100
84
|
|
|
101
85
|
{contexts.length > 1 && (
|
|
102
|
-
<
|
|
103
|
-
label={t('searchPage.contextModal.ariaLabel')}
|
|
86
|
+
<Modal
|
|
104
87
|
activateButton={
|
|
105
88
|
<ModalButton variant="link">
|
|
106
89
|
{t('searchPage.contextModal.button', {
|
|
@@ -114,7 +97,7 @@ const ItemContexts = ({ contexts, id, title }: ItemContextsType) => {
|
|
|
114
97
|
{(onClose: () => void) => (
|
|
115
98
|
<>
|
|
116
99
|
<ModalHeader>
|
|
117
|
-
<
|
|
100
|
+
<ModalTitle>{t('searchPage.contextModal.heading')}</ModalTitle>
|
|
118
101
|
<ModalCloseButton onClick={onClose} title={t('searchPage.close')} />
|
|
119
102
|
</ModalHeader>
|
|
120
103
|
<ModalContent>
|
|
@@ -131,7 +114,7 @@ const ItemContexts = ({ contexts, id, title }: ItemContextsType) => {
|
|
|
131
114
|
</ModalContent>
|
|
132
115
|
</>
|
|
133
116
|
)}
|
|
134
|
-
</
|
|
117
|
+
</Modal>
|
|
135
118
|
)}
|
|
136
119
|
</Breadcrumb>
|
|
137
120
|
);
|
package/src/Topic/Topic.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import { animations, breakpoints, colors, fonts, mq, spacing } from '@ndla/core'
|
|
|
12
12
|
|
|
13
13
|
import parse from 'html-react-parser';
|
|
14
14
|
import { ChevronDown, ChevronUp, PlayCircleFilled } from '@ndla/icons/common';
|
|
15
|
-
import { ModalCloseButton,
|
|
15
|
+
import { ModalCloseButton, Modal, ModalHeader } from '@ndla/modal';
|
|
16
16
|
import { ButtonV2 } from '@ndla/button';
|
|
17
17
|
import { CursorClick, ExpandTwoArrows } from '@ndla/icons/action';
|
|
18
18
|
import { css } from '@emotion/react';
|
|
@@ -182,7 +182,7 @@ const StyledContentWrapper = styled.div<InvertItProps>`
|
|
|
182
182
|
background-color: ${colors.white};
|
|
183
183
|
`;
|
|
184
184
|
|
|
185
|
-
const
|
|
185
|
+
const StyledModalHeader = styled(ModalHeader)`
|
|
186
186
|
padding: ${spacing.small} ${spacing.nsmall};
|
|
187
187
|
`;
|
|
188
188
|
|
|
@@ -274,8 +274,8 @@ const Topic = ({
|
|
|
274
274
|
{topic.image && (
|
|
275
275
|
<TopicHeaderVisualElementWrapper>
|
|
276
276
|
{topic.visualElement ? (
|
|
277
|
-
<
|
|
278
|
-
label={t('topicPage.imageModal')}
|
|
277
|
+
<Modal
|
|
278
|
+
aria-label={t('topicPage.imageModal')}
|
|
279
279
|
activateButton={
|
|
280
280
|
<VisualElementButton
|
|
281
281
|
variant="stripped"
|
|
@@ -297,13 +297,13 @@ const Topic = ({
|
|
|
297
297
|
>
|
|
298
298
|
{(onClose: () => void) => (
|
|
299
299
|
<>
|
|
300
|
-
<
|
|
300
|
+
<StyledModalHeader>
|
|
301
301
|
<ModalCloseButton onClick={onClose} title={t('modal.closeModal')} />
|
|
302
|
-
</
|
|
302
|
+
</StyledModalHeader>
|
|
303
303
|
{topic.visualElement && topic.visualElement.element}
|
|
304
304
|
</>
|
|
305
305
|
)}
|
|
306
|
-
</
|
|
306
|
+
</Modal>
|
|
307
307
|
) : (
|
|
308
308
|
<TopicHeaderImage
|
|
309
309
|
src={`${topic.image.url}?${makeSrcQueryString(400, topic.image.crop, topic.image.focalPoint)}`}
|
package/src/User/index.ts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import AuthModal from './AuthModal';
|
|
10
9
|
import { UserInfo } from './UserInfo';
|
|
11
10
|
import type {
|
|
12
11
|
AffiliationType,
|
|
@@ -20,4 +19,3 @@ import type {
|
|
|
20
19
|
|
|
21
20
|
export { UserInfo };
|
|
22
21
|
export type { AffiliationType, FeideGoGroup, FeideGroup, FeideOrg, FeideUserApiType, FeideMembershipType, FeideUser };
|
|
23
|
-
export default AuthModal;
|
package/src/index.ts
CHANGED
|
@@ -98,7 +98,7 @@ export {
|
|
|
98
98
|
|
|
99
99
|
export { FilterList, FilterListPhone, FilterButtons, ToggleItem } from './Filter';
|
|
100
100
|
|
|
101
|
-
export { Footer, EditorName, FooterText
|
|
101
|
+
export { Footer, EditorName, FooterText } from './Footer';
|
|
102
102
|
|
|
103
103
|
export {
|
|
104
104
|
Figure,
|
|
@@ -133,9 +133,7 @@ export { default as ContentTypeResult } from './Search/ContentTypeResult';
|
|
|
133
133
|
export { SearchFieldForm } from './Search/SearchFieldForm';
|
|
134
134
|
|
|
135
135
|
export { default as MastheadSearchModal } from './Masthead/MastheadSearchModal';
|
|
136
|
-
export { default as MastheadAuthModal } from './Masthead/MastheadAuthModal';
|
|
137
136
|
export { UserInfo } from './User';
|
|
138
|
-
export { default as AuthModal } from './User';
|
|
139
137
|
export type {
|
|
140
138
|
AffiliationType,
|
|
141
139
|
FeideGoGroup,
|