@ndla/ui 37.1.4 → 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.
Files changed (106) hide show
  1. package/es/Article/Article.js +2 -2
  2. package/es/Article/ArticleHeaderWrapper.js +4 -7
  3. package/es/Article/ArticleNotions.js +16 -17
  4. package/es/Article/ArticleSideBar.js +4 -5
  5. package/es/AudioPlayer/Controls.js +173 -235
  6. package/es/CompetenceGoals/CompetenceGoalsDialog.js +12 -25
  7. package/es/Filter/FilterButtons.js +12 -14
  8. package/es/Filter/FilterListPhone.js +2 -4
  9. package/es/Footer/index.js +1 -2
  10. package/es/LearningPaths/LearningPathMenuModalWrapper.js +10 -6
  11. package/es/Masthead/MastheadSearchModal.js +56 -47
  12. package/es/MyNdla/SettingsMenu.js +6 -6
  13. package/es/NDLAFilm/AboutNdlaFilm.js +3 -3
  14. package/es/ResourcesWrapper/ResourcesTopicTitle.js +19 -23
  15. package/es/SearchTypeResult/PopupFilter.js +14 -20
  16. package/es/SearchTypeResult/components/ItemContexts.js +10 -21
  17. package/es/Topic/Topic.js +23 -23
  18. package/es/User/index.js +1 -3
  19. package/es/index.js +1 -3
  20. package/es/locale/messages-en.js +1 -0
  21. package/es/locale/messages-nb.js +1 -0
  22. package/es/locale/messages-nn.js +1 -0
  23. package/es/locale/messages-se.js +1 -0
  24. package/es/locale/messages-sma.js +1 -0
  25. package/lib/Article/Article.d.ts +2 -2
  26. package/lib/Article/Article.js +2 -2
  27. package/lib/Article/ArticleHeaderWrapper.d.ts +3 -2
  28. package/lib/Article/ArticleHeaderWrapper.js +4 -7
  29. package/lib/Article/ArticleNotions.js +17 -21
  30. package/lib/Article/ArticleSideBar.js +5 -9
  31. package/lib/AudioPlayer/Controls.d.ts +2 -2
  32. package/lib/AudioPlayer/Controls.js +173 -235
  33. package/lib/CompetenceGoals/CompetenceGoalsDialog.d.ts +3 -14
  34. package/lib/CompetenceGoals/CompetenceGoalsDialog.js +11 -26
  35. package/lib/Filter/FilterButtons.js +13 -15
  36. package/lib/Filter/FilterListPhone.js +3 -5
  37. package/lib/Footer/index.d.ts +1 -2
  38. package/lib/Footer/index.js +0 -7
  39. package/lib/LearningPaths/LearningPathMenuModalWrapper.js +9 -8
  40. package/lib/Masthead/MastheadSearchModal.d.ts +1 -1
  41. package/lib/Masthead/MastheadSearchModal.js +58 -46
  42. package/lib/MyNdla/SettingsMenu.js +5 -5
  43. package/lib/NDLAFilm/AboutNdlaFilm.js +2 -2
  44. package/lib/ResourcesWrapper/ResourcesTopicTitle.js +20 -27
  45. package/lib/SearchTypeResult/PopupFilter.js +14 -20
  46. package/lib/SearchTypeResult/components/ItemContexts.js +10 -21
  47. package/lib/Topic/Topic.js +22 -22
  48. package/lib/User/index.d.ts +0 -2
  49. package/lib/User/index.js +1 -13
  50. package/lib/index.d.ts +1 -3
  51. package/lib/index.js +1 -20
  52. package/lib/locale/messages-en.d.ts +1 -0
  53. package/lib/locale/messages-en.js +1 -0
  54. package/lib/locale/messages-nb.d.ts +1 -0
  55. package/lib/locale/messages-nb.js +1 -0
  56. package/lib/locale/messages-nn.d.ts +1 -0
  57. package/lib/locale/messages-nn.js +1 -0
  58. package/lib/locale/messages-se.d.ts +1 -0
  59. package/lib/locale/messages-se.js +1 -0
  60. package/lib/locale/messages-sma.d.ts +1 -0
  61. package/lib/locale/messages-sma.js +1 -0
  62. package/package.json +16 -18
  63. package/src/Article/Article.tsx +4 -4
  64. package/src/Article/ArticleHeaderWrapper.tsx +12 -18
  65. package/src/Article/ArticleNotions.tsx +7 -8
  66. package/src/Article/ArticleSideBar.tsx +3 -3
  67. package/src/AudioPlayer/Controls.tsx +145 -287
  68. package/src/CompetenceGoals/CompetenceGoalsDialog.tsx +13 -38
  69. package/src/Filter/FilterButtons.tsx +4 -5
  70. package/src/Filter/FilterListPhone.tsx +3 -4
  71. package/src/Footer/index.ts +1 -2
  72. package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +10 -6
  73. package/src/Masthead/MastheadSearchModal.tsx +48 -74
  74. package/src/MyNdla/SettingsMenu.tsx +3 -3
  75. package/src/NDLAFilm/AboutNdlaFilm.tsx +3 -3
  76. package/src/ResourcesWrapper/ResourcesTopicTitle.tsx +4 -8
  77. package/src/SearchTypeResult/PopupFilter.tsx +6 -11
  78. package/src/SearchTypeResult/components/ItemContexts.tsx +4 -21
  79. package/src/Topic/Topic.tsx +7 -7
  80. package/src/User/index.ts +0 -2
  81. package/src/index.ts +1 -3
  82. package/src/locale/messages-en.ts +1 -0
  83. package/src/locale/messages-nb.ts +1 -0
  84. package/src/locale/messages-nn.ts +1 -0
  85. package/src/locale/messages-se.ts +1 -0
  86. package/src/locale/messages-sma.ts +1 -0
  87. package/es/Figure/FigureLicenseDialogContent.js +0 -75
  88. package/es/Footer/FooterAuth.js +0 -110
  89. package/es/Masthead/MastheadAuthModal.js +0 -50
  90. package/es/SearchTypeResult/SearchNotionItem.js +0 -208
  91. package/es/User/AuthModal.js +0 -116
  92. package/lib/Figure/FigureLicenseDialogContent.d.ts +0 -22
  93. package/lib/Figure/FigureLicenseDialogContent.js +0 -80
  94. package/lib/Footer/FooterAuth.d.ts +0 -10
  95. package/lib/Footer/FooterAuth.js +0 -114
  96. package/lib/Masthead/MastheadAuthModal.d.ts +0 -13
  97. package/lib/Masthead/MastheadAuthModal.js +0 -56
  98. package/lib/SearchTypeResult/SearchNotionItem.d.ts +0 -29
  99. package/lib/SearchTypeResult/SearchNotionItem.js +0 -215
  100. package/lib/User/AuthModal.d.ts +0 -22
  101. package/lib/User/AuthModal.js +0 -124
  102. package/src/Figure/FigureLicenseDialogContent.tsx +0 -80
  103. package/src/Footer/FooterAuth.tsx +0 -104
  104. package/src/Masthead/MastheadAuthModal.tsx +0 -62
  105. package/src/SearchTypeResult/SearchNotionItem.tsx +0 -228
  106. package/src/User/AuthModal.tsx +0 -123
@@ -6,10 +6,10 @@
6
6
  *
7
7
  */
8
8
 
9
- import React, { ComponentProps, ReactNode } from 'react';
9
+ import React, { ReactNode } from 'react';
10
10
  import { useTranslation } from 'react-i18next';
11
- import { breakpoints, fonts, mq } from '@ndla/core';
12
- import Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
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 = ({ children, isOpen, onClose, subjectName, modalProps }: Props) => {
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 modifier="menu">
52
+ <ModalHeader>
78
53
  <HeaderWrapper>
79
- <HeadingWrapper>
80
- <FooterHeaderIcon id={iconId} size="24px" style={{ marginRight: '20px' }} />
54
+ <ModalTitle>
55
+ <FooterHeaderIcon size="24px" style={{ marginRight: '20px' }} />
81
56
  {t('competenceGoals.modalText')} {subjectName && ` \u2022 ${subjectName}`}
82
- </HeadingWrapper>
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 Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
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="fullscreen"
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 modifier={['left-align']}>
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 Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
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="fullscreen"
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 modifier={['left-align']}>
150
+ <ModalHeader>
152
151
  <div {...classes('modal-header')}>
153
152
  <div {...classes('modal-heading')}>
154
153
  {!isNarrowScreen && label && <h1 {...classes('label')}>{label}</h1>}
@@ -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, FooterAuth };
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 Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
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
- <Modal
42
- backgroundColor="grey"
46
+ <StyledModal
43
47
  animationDuration={200}
44
- size="fullscreen"
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
- </Modal>
64
+ </StyledModal>
61
65
  );
62
66
  }
63
67
  return <>{children(() => {})}</>;
@@ -1,25 +1,27 @@
1
- import React, { ReactChild, ReactChildren, ReactNode } from 'react';
2
- import Modal from '@ndla/modal';
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 { css } from '@emotion/react';
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: Function) => ReactChild | ReactChildren | ReactNode;
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: center;
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
- <Modal
98
- label={t('searchPage.searchFieldPlaceholder')}
99
- backgroundColor="grey"
100
- animation="slide-down"
101
- animationDuration={200}
102
- size="full-width"
103
- onClose={onSearchClose}
104
- css={modalStyles}
105
- activateButton={
106
- <ToggleSearchButton hideOnNarrowScreen={hideOnNarrowScreen} ndlaFilm={ndlaFilm}>
107
- {t('masthead.menu.search')}
108
- </ToggleSearchButton>
109
- }
110
- >
111
- {(closeModal: VoidFunction) => (
112
- <>
113
- <div css={extraBackdrop} />
114
- <StyledHeader>
115
- {isFunction(children) ? children(closeModal) : children}
116
- <IconButton
117
- aria-label={t('welcomePage.closeSearch')}
118
- variant="ghost"
119
- colorTheme="light"
120
- onClick={closeModal}
121
- >
122
- <Cross className="c-icon--medium" />
123
- </IconButton>
124
- </StyledHeader>
125
- </>
126
- )}
127
- </Modal>
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, ModalHeaderV2 } from '@ndla/modal';
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
- <ModalHeaderV2>
61
+ <ModalHeader>
62
62
  <h1>{t('myNdla.settings')}</h1>
63
63
  <ModalCloseButton onClick={close} />
64
- </ModalHeaderV2>
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, ModalV2 } from '@ndla/modal';
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
- <ModalV2 size="full" activateButton={<Button variant="link">{t('ndlaFilm.about.more')}</Button>}>
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
- </ModalV2>
76
+ </Modal>
77
77
  </div>
78
78
  </StyledAside>
79
79
  </div>
@@ -1,9 +1,9 @@
1
- import React, { Fragment, ReactNode } from '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 Modal, { ModalBody, ModalHeader, ModalCloseButton } from '@ndla/modal';
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 id={tooltipId} aria-label={t('resource.dialogTooltip')}>
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 Modal, { ModalCloseButton, ModalBody } from '@ndla/modal';
12
- import { breakpoints, fonts, mq, spacing } from '@ndla/core';
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
- labelledBy={headingId}
99
- controllable
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="fullscreen"
100
+ size="full"
106
101
  >
107
102
  {() => (
108
103
  <ModalBody>
109
104
  <ModalWrapper>
110
105
  <ModalContent>
111
106
  <ModalHeaderWrapper>
112
- <ModalHeading id={headingId}>{t('searchPage.searchFilterMessages.filterLabel')}</ModalHeading>
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 { ModalV2, ModalCloseButton } from '@ndla/modal';
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
  &nbsp;
101
85
  {contexts.length > 1 && (
102
- <ModalV2
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
- <ModalHeading>{t('searchPage.contextModal.heading')}</ModalHeading>
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
- </ModalV2>
117
+ </Modal>
135
118
  )}
136
119
  </Breadcrumb>
137
120
  );
@@ -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, ModalV2, ModalHeaderV2 } from '@ndla/modal';
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 ModalHeader = styled(ModalHeaderV2)`
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
- <ModalV2
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
- <ModalHeader>
300
+ <StyledModalHeader>
301
301
  <ModalCloseButton onClick={onClose} title={t('modal.closeModal')} />
302
- </ModalHeader>
302
+ </StyledModalHeader>
303
303
  {topic.visualElement && topic.visualElement.element}
304
304
  </>
305
305
  )}
306
- </ModalV2>
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, FooterAuth } from './Footer';
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,
@@ -998,6 +998,7 @@ const messages = {
998
998
  },
999
999
  audio: {
1000
1000
  play: 'Play',
1001
+ pause: 'Pause',
1001
1002
  download: 'Download audio',
1002
1003
  reuse: 'Use audio',
1003
1004
  error: {
@@ -997,6 +997,7 @@ const messages = {
997
997
  },
998
998
  audio: {
999
999
  play: 'Spill av',
1000
+ pause: 'Pause',
1000
1001
  download: 'Last ned lydfil',
1001
1002
  reuse: 'Bruk lydfil',
1002
1003
  error: {