@ndla/ui 3.3.17 → 4.0.2
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/ArticleAuthorContent.js +1 -2
- package/es/Article/ArticleByline.js +5 -6
- package/es/Article/ArticleHeaderWrapper.js +5 -6
- package/es/Article/ArticleSideBar.js +5 -6
- package/es/AudioPlayer/AudioPlayer.js +15 -16
- package/es/CloseButton/CloseButton.js +17 -33
- package/es/CloseButton/index.js +2 -1
- package/es/CompetenceGoalTab/CompetenceGoalTab.js +6 -7
- package/es/ErrorMessage/ErrorResourceAccessDenied.js +2 -3
- package/es/FactBox/FactBox.js +1 -2
- package/es/Figure/Figure.js +1 -2
- package/es/Filter/FilterButtons.js +9 -10
- package/es/Footer/FooterAuth.js +8 -9
- package/es/Frontpage/FrontpageProgramMenu.js +10 -11
- package/es/LanguageSelector/LanguageSelector.js +8 -9
- package/es/LearningPaths/LearningPathInformation.js +1 -1
- package/es/LearningPaths/LearningPathMenu.js +3 -3
- package/es/LearningPaths/LearningPathMenuAside.js +6 -6
- package/es/LearningPaths/LearningPathMenuAsideCopyright.js +1 -1
- package/es/LearningPaths/LearningPathMenuModalWrapper.js +2 -3
- package/es/Masthead/MastheadAuthModal.js +1 -2
- package/es/Masthead/MastheadSearchModal.js +4 -5
- package/es/MessageBox/MessageBox.js +26 -12
- package/es/NDLAFilm/AboutNdlaFilm.js +2 -3
- package/es/Navigation/NavigationBox.js +23 -22
- package/es/Navigation/NavigationTopicAbout.js +15 -16
- package/es/NoContentBox/NoContentBox.js +1 -2
- package/es/Notion/Notion.js +5 -6
- package/es/Programme/ProgrammeSubjects.js +1 -2
- package/es/RelatedArticleList/RelatedArticleList.js +1 -2
- package/es/Search/ContentTypeResult.js +2 -3
- package/es/SearchTypeResult/ActiveFilterContent.js +2 -3
- package/es/SearchTypeResult/PopupFilter.js +9 -10
- package/es/SearchTypeResult/ResultNavigation.js +3 -4
- package/es/SearchTypeResult/SearchHeader.js +10 -11
- package/es/SearchTypeResult/SearchItem.js +18 -19
- package/es/SearchTypeResult/SearchNotionItem.js +13 -14
- package/es/SearchTypeResult/SearchTypeHeader.js +6 -7
- package/es/Topic/Topic.js +23 -28
- package/es/User/AuthModal.js +9 -10
- package/es/index.js +1 -1
- package/es/locale/messages-en.js +3 -0
- package/es/locale/messages-nb.js +3 -0
- package/es/locale/messages-nn.js +3 -0
- package/lib/Article/Article.js +2 -2
- package/lib/Article/ArticleByline.js +4 -4
- package/lib/Article/ArticleHeaderWrapper.js +4 -4
- package/lib/Article/ArticleSideBar.js +4 -4
- package/lib/AudioPlayer/AudioPlayer.js +14 -14
- package/lib/CloseButton/CloseButton.d.ts +9 -5
- package/lib/CloseButton/CloseButton.js +19 -34
- package/lib/CloseButton/index.d.ts +1 -0
- package/lib/CloseButton/index.js +12 -1
- package/lib/CompetenceGoalTab/CompetenceGoalTab.js +5 -5
- package/lib/ErrorMessage/ErrorResourceAccessDenied.js +1 -2
- package/lib/Filter/FilterButtons.js +9 -9
- package/lib/Footer/FooterAuth.js +7 -7
- package/lib/Frontpage/FrontpageMultidisciplinarySubject.d.ts +5 -5
- package/lib/Frontpage/FrontpageProgramMenu.js +10 -10
- package/lib/Frontpage/illustrations/FrontpageIllustrations.d.ts +2 -2
- package/lib/LanguageSelector/LanguageSelector.js +7 -7
- package/lib/LearningPaths/LearningPathInformation.d.ts +0 -2
- package/lib/LearningPaths/LearningPathInformation.js +1 -1
- package/lib/LearningPaths/LearningPathMenu.d.ts +0 -6
- package/lib/LearningPaths/LearningPathMenu.js +3 -3
- package/lib/LearningPaths/LearningPathMenuAside.d.ts +0 -2
- package/lib/LearningPaths/LearningPathMenuAside.js +6 -6
- package/lib/LearningPaths/LearningPathMenuAsideCopyright.d.ts +0 -2
- package/lib/LearningPaths/LearningPathMenuAsideCopyright.js +1 -1
- package/lib/LearningPaths/LearningPathMenuModalWrapper.js +1 -2
- package/lib/Masthead/MastheadAuthModal.js +1 -1
- package/lib/Masthead/MastheadSearchModal.js +3 -4
- package/lib/MessageBox/MessageBox.d.ts +3 -3
- package/lib/MessageBox/MessageBox.js +25 -12
- package/lib/MultidisciplinarySubject/Illustrations.d.ts +7 -7
- package/lib/NDLAFilm/AboutNdlaFilm.js +1 -2
- package/lib/Navigation/NavigationBox.js +22 -20
- package/lib/Navigation/NavigationTopicAbout.js +14 -14
- package/lib/NoContentBox/NoContentBox.js +0 -1
- package/lib/Notion/Notion.js +4 -4
- package/lib/Programme/ProgrammeSubjects.js +1 -2
- package/lib/Search/ContentTypeResult.js +1 -1
- package/lib/Search/ContentTypeResultStyles.d.ts +3 -3
- package/lib/SearchTypeResult/ActiveFilterContent.d.ts +1 -1
- package/lib/SearchTypeResult/ActiveFilterContent.js +1 -2
- package/lib/SearchTypeResult/PopupFilter.js +8 -8
- package/lib/SearchTypeResult/ResultNavigation.js +2 -3
- package/lib/SearchTypeResult/SearchHeader.d.ts +1 -1
- package/lib/SearchTypeResult/SearchHeader.js +9 -9
- package/lib/SearchTypeResult/SearchItem.js +17 -17
- package/lib/SearchTypeResult/SearchNotionItem.js +12 -12
- package/lib/SearchTypeResult/SearchTypeHeader.d.ts +1 -1
- package/lib/SearchTypeResult/SearchTypeHeader.js +6 -6
- package/lib/Topic/Topic.js +22 -26
- package/lib/User/AuthModal.js +8 -8
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/locale/messages-en.d.ts +3 -0
- package/lib/locale/messages-en.js +3 -0
- package/lib/locale/messages-nb.d.ts +3 -0
- package/lib/locale/messages-nb.js +3 -0
- package/lib/locale/messages-nn.d.ts +3 -0
- package/lib/locale/messages-nn.js +3 -0
- package/package.json +6 -6
- package/src/Article/Article.tsx +1 -1
- package/src/Article/ArticleAuthorContent.tsx +0 -1
- package/src/Article/ArticleByline.tsx +0 -1
- package/src/Article/ArticleHeaderWrapper.tsx +0 -1
- package/src/Article/ArticleSideBar.tsx +0 -1
- package/src/AudioPlayer/AudioPlayer.tsx +0 -1
- package/src/CloseButton/CloseButton.tsx +13 -17
- package/src/CloseButton/index.ts +2 -0
- package/src/CompetenceGoalTab/CompetenceGoalTab.tsx +0 -1
- package/src/ErrorMessage/ErrorResourceAccessDenied.tsx +0 -1
- package/src/FactBox/FactBox.tsx +0 -1
- package/src/Figure/Figure.tsx +0 -1
- package/src/Filter/FilterButtons.tsx +0 -1
- package/src/Footer/FooterAuth.tsx +0 -1
- package/src/Frontpage/FrontpageProgramMenu.tsx +0 -1
- package/src/LanguageSelector/LanguageSelector.tsx +0 -1
- package/src/LearningPaths/LearningPathInformation.tsx +0 -2
- package/src/LearningPaths/LearningPathMenu.tsx +0 -6
- package/src/LearningPaths/LearningPathMenuAside.tsx +0 -2
- package/src/LearningPaths/LearningPathMenuAsideCopyright.tsx +0 -2
- package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +0 -1
- package/src/Masthead/MastheadAuthModal.tsx +1 -2
- package/src/Masthead/MastheadSearchModal.tsx +0 -1
- package/src/MessageBox/MessageBox.tsx +12 -3
- package/src/NDLAFilm/AboutNdlaFilm.tsx +0 -1
- package/src/Navigation/NavigationBox.tsx +1 -2
- package/src/Navigation/NavigationTopicAbout.tsx +0 -1
- package/src/NoContentBox/NoContentBox.tsx +0 -1
- package/src/Notion/Notion.tsx +0 -2
- package/src/Programme/ProgrammeSubjects.tsx +0 -1
- package/src/RelatedArticleList/RelatedArticleList.tsx +0 -1
- package/src/Search/ContentTypeResult.tsx +0 -1
- package/src/SearchTypeResult/ActiveFilterContent.tsx +0 -1
- package/src/SearchTypeResult/PopupFilter.tsx +0 -1
- package/src/SearchTypeResult/ResultNavigation.tsx +0 -1
- package/src/SearchTypeResult/SearchHeader.tsx +0 -1
- package/src/SearchTypeResult/SearchItem.tsx +0 -1
- package/src/SearchTypeResult/SearchNotionItem.tsx +0 -1
- package/src/SearchTypeResult/SearchTypeHeader.tsx +0 -1
- package/src/Topic/Topic.tsx +0 -5
- package/src/User/AuthModal.tsx +0 -1
- package/src/index.ts +1 -1
- package/src/locale/messages-en.ts +3 -0
- package/src/locale/messages-nb.ts +3 -0
- package/src/locale/messages-nn.ts +3 -0
|
@@ -10,7 +10,6 @@ import React, { ReactChild, ReactChildren, ReactNode } from 'react';
|
|
|
10
10
|
import { spacing, mq, breakpoints } from '@ndla/core';
|
|
11
11
|
import Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
|
|
12
12
|
import { css } from '@emotion/core';
|
|
13
|
-
// @ts-ignore
|
|
14
13
|
import Button from '@ndla/button';
|
|
15
14
|
import { LearningPath } from '@ndla/icons/contentType';
|
|
16
15
|
import { useTranslation } from 'react-i18next';
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
// @ts-ignore
|
|
12
11
|
import Button from '@ndla/button';
|
|
13
12
|
import { Feide } from '@ndla/icons/common';
|
|
14
13
|
|
|
@@ -16,7 +15,7 @@ import AuthModal from '../User';
|
|
|
16
15
|
import { AuthModalProps } from '../User/AuthModal';
|
|
17
16
|
|
|
18
17
|
type FeideWrapperProps = {
|
|
19
|
-
inverted
|
|
18
|
+
inverted?: boolean;
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
const StyledButton = styled(Button)<FeideWrapperProps>`
|
|
@@ -128,6 +128,11 @@ const Link = styled.a`
|
|
|
128
128
|
box-shadow: none;
|
|
129
129
|
}
|
|
130
130
|
`;
|
|
131
|
+
const CloseButtonWrapper = styled.div`
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: 10px;
|
|
134
|
+
right: 1px;
|
|
135
|
+
`;
|
|
131
136
|
|
|
132
137
|
type LinkProps = {
|
|
133
138
|
href?: string;
|
|
@@ -136,12 +141,12 @@ type LinkProps = {
|
|
|
136
141
|
type Props = {
|
|
137
142
|
type?: WrapperProps['boxType'];
|
|
138
143
|
sticky?: boolean;
|
|
139
|
-
onClose?: boolean;
|
|
140
144
|
children?: string;
|
|
141
145
|
links?: LinkProps[];
|
|
146
|
+
showCloseButton?: boolean;
|
|
142
147
|
};
|
|
143
148
|
|
|
144
|
-
export const MessageBox = ({ type, sticky = false,
|
|
149
|
+
export const MessageBox = ({ type, sticky = false, children, links, t, showCloseButton }: Props & WithTranslation) => {
|
|
145
150
|
const [hideMessageBox, setHideMessageBox] = useState(false);
|
|
146
151
|
const onCloseMessageBox = () => {
|
|
147
152
|
setHideMessageBox(true);
|
|
@@ -157,7 +162,11 @@ export const MessageBox = ({ type, sticky = false, onClose, children, links, t }
|
|
|
157
162
|
</IconWrapper>
|
|
158
163
|
<TextWrapper>{children}</TextWrapper>
|
|
159
164
|
</InfoWrapper>
|
|
160
|
-
{
|
|
165
|
+
{showCloseButton && (
|
|
166
|
+
<CloseButtonWrapper>
|
|
167
|
+
<CloseButton onClick={onCloseMessageBox} />
|
|
168
|
+
</CloseButtonWrapper>
|
|
169
|
+
)}
|
|
161
170
|
</Wrapper>
|
|
162
171
|
|
|
163
172
|
{links && (
|
|
@@ -3,7 +3,6 @@ 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
|
-
//@ts-ignore
|
|
7
6
|
import Button from '@ndla/button';
|
|
8
7
|
import { OneColumn } from '..';
|
|
9
8
|
import VisualElement from './VisualElement';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { MouseEvent, ChangeEventHandler } from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import { SafeLinkButton } from '@ndla/safelink';
|
|
4
|
-
// @ts-ignore
|
|
5
4
|
import Button from '@ndla/button';
|
|
6
5
|
import { breakpoints, colors, fonts, misc, mq, spacing } from '@ndla/core';
|
|
7
6
|
import { css } from '@emotion/core';
|
|
@@ -230,7 +229,7 @@ export const NavigationBox = ({
|
|
|
230
229
|
lighter={colorMode === 'light'}
|
|
231
230
|
selected={item.selected}>
|
|
232
231
|
<ListElementType
|
|
233
|
-
to={item.url}
|
|
232
|
+
to={item.url ?? ''}
|
|
234
233
|
lighter={!item.selected && colorMode === 'light'}
|
|
235
234
|
greyLighter={!item.selected && colorMode === 'greyLighter'}
|
|
236
235
|
greyLightest={!item.selected && colorMode === 'greyLightest'}
|
|
@@ -3,7 +3,6 @@ import parse from 'html-react-parser';
|
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
5
5
|
import { css } from '@emotion/core';
|
|
6
|
-
// @ts-ignore
|
|
7
6
|
import Button from '@ndla/button';
|
|
8
7
|
import { ChevronDown, ChevronUp } from '@ndla/icons/common';
|
|
9
8
|
import { useTranslation } from 'react-i18next';
|
package/src/Notion/Notion.tsx
CHANGED
|
@@ -2,8 +2,6 @@ import styled from '@emotion/styled';
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import HTMLReactParser from 'html-react-parser';
|
|
4
4
|
import React, { MouseEventHandler, ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
// @ts-ignore
|
|
7
5
|
import Button from '@ndla/button';
|
|
8
6
|
import { joinArrayWithConjunction } from '@ndla/util';
|
|
9
7
|
import { colors, fonts } from '@ndla/core';
|
|
@@ -10,7 +10,6 @@ import React from 'react';
|
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { Cross } from '@ndla/icons/action';
|
|
12
12
|
import { spacing, fonts } from '@ndla/core';
|
|
13
|
-
// @ts-ignore
|
|
14
13
|
import Button from '@ndla/button';
|
|
15
14
|
import { WithTranslation, withTranslation } from 'react-i18next';
|
|
16
15
|
|
|
@@ -10,7 +10,6 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import Modal, { ModalCloseButton, ModalBody } from '@ndla/modal';
|
|
12
12
|
import { breakpoints, fonts, mq, spacing } from '@ndla/core';
|
|
13
|
-
// @ts-ignore
|
|
14
13
|
import Button from '@ndla/button';
|
|
15
14
|
import { Plus as PlusIcon } from '@ndla/icons/action';
|
|
16
15
|
import { useTranslation } from 'react-i18next';
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { ChevronDown } from '@ndla/icons/common';
|
|
12
|
-
// @ts-ignore
|
|
13
12
|
import Button from '@ndla/button';
|
|
14
13
|
import { spacing } from '@ndla/core';
|
|
15
14
|
import { useTranslation } from 'react-i18next';
|
|
@@ -10,7 +10,6 @@ import React, { FormEvent } from 'react';
|
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { breakpoints, fonts, mq, spacing } from '@ndla/core';
|
|
12
12
|
|
|
13
|
-
// @ts-ignore
|
|
14
13
|
import Button from '@ndla/button';
|
|
15
14
|
import { WithTranslation, withTranslation } from 'react-i18next';
|
|
16
15
|
import { FilterProps } from './ActiveFilterContent';
|
|
@@ -11,7 +11,6 @@ import styled from '@emotion/styled';
|
|
|
11
11
|
import parse from 'html-react-parser';
|
|
12
12
|
import { ChevronRight, Additional, Core } from '@ndla/icons/common';
|
|
13
13
|
import SafeLink from '@ndla/safelink';
|
|
14
|
-
// @ts-ignore
|
|
15
14
|
import Button from '@ndla/button';
|
|
16
15
|
import Modal, { ModalCloseButton } from '@ndla/modal';
|
|
17
16
|
|
|
@@ -12,7 +12,6 @@ import parse from 'html-react-parser';
|
|
|
12
12
|
|
|
13
13
|
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
14
14
|
import { getLicenseByAbbreviation } from '@ndla/licenses';
|
|
15
|
-
// @ts-ignore
|
|
16
15
|
import Button from '@ndla/button';
|
|
17
16
|
import { Play } from '@ndla/icons/common';
|
|
18
17
|
import { ArrowExpand } from '@ndla/icons/editor';
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
import React, { MouseEvent, memo } from 'react'; // useMemo , { Children }
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
// @ts-ignore
|
|
12
11
|
import Button from '@ndla/button';
|
|
13
12
|
import { breakpoints, mq, spacing } from '@ndla/core';
|
|
14
13
|
import { WithTranslation, withTranslation } from 'react-i18next';
|
package/src/Topic/Topic.tsx
CHANGED
|
@@ -13,7 +13,6 @@ import { animations, breakpoints, colors, fonts, mq, spacing } from '@ndla/core'
|
|
|
13
13
|
import parse from 'html-react-parser';
|
|
14
14
|
import { ChevronDown, ChevronUp, PlayCircleFilled } from '@ndla/icons/common';
|
|
15
15
|
import Modal, { ModalCloseButton, ModalHeader, ModalBody } from '@ndla/modal';
|
|
16
|
-
// @ts-ignore
|
|
17
16
|
import Button from '@ndla/button';
|
|
18
17
|
import { CursorClick, ExpandTwoArrows } from '@ndla/icons/action';
|
|
19
18
|
import { css } from '@emotion/core';
|
|
@@ -280,8 +279,6 @@ const Topic = ({
|
|
|
280
279
|
topic.image.focalPoint,
|
|
281
280
|
)}`}
|
|
282
281
|
alt={topic.image.alt}
|
|
283
|
-
crop={topic.image.crop}
|
|
284
|
-
focalPoint={topic.image.focalPoint}
|
|
285
282
|
/>
|
|
286
283
|
<TopicHeaderOverlay />
|
|
287
284
|
</ShowVisualElementWrapper>
|
|
@@ -318,8 +315,6 @@ const Topic = ({
|
|
|
318
315
|
<TopicHeaderImage
|
|
319
316
|
src={`${topic.image.url}?${makeSrcQueryString(400, topic.image.crop, topic.image.focalPoint)}`}
|
|
320
317
|
alt={topic.image.alt}
|
|
321
|
-
crop={topic.image.crop}
|
|
322
|
-
focalPoint={topic.image.focalPoint}
|
|
323
318
|
/>
|
|
324
319
|
)}
|
|
325
320
|
</TopicHeaderVisualElementWrapper>
|
package/src/User/AuthModal.tsx
CHANGED
|
@@ -10,7 +10,6 @@ import React, { ReactElement, ReactNode } from 'react';
|
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { useTranslation } from 'react-i18next';
|
|
12
12
|
import Modal, { ModalCloseButton } from '@ndla/modal';
|
|
13
|
-
// @ts-ignore
|
|
14
13
|
import Button from '@ndla/button';
|
|
15
14
|
import { FeideText, LogIn, LogOut, HumanMaleBoard } from '@ndla/icons/common';
|
|
16
15
|
import { fonts, spacing } from '@ndla/core';
|
package/src/index.ts
CHANGED
|
@@ -117,7 +117,7 @@ export { default as Breadcrumblist } from './Breadcrumblist';
|
|
|
117
117
|
|
|
118
118
|
export { MessageBox, MessageBoxTag, MessageBoxType } from './MessageBox';
|
|
119
119
|
|
|
120
|
-
export { CloseButton } from './CloseButton';
|
|
120
|
+
export { default as CloseButton } from './CloseButton';
|
|
121
121
|
export { default as AudioPlayer, initAudioPlayers } from './AudioPlayer';
|
|
122
122
|
|
|
123
123
|
export { NavigationHeading, NavigationBox, NavigationTopicAbout } from './Navigation';
|
|
@@ -395,6 +395,9 @@ const messages = {
|
|
|
395
395
|
embed: 'Bygg inn',
|
|
396
396
|
embedCopied: 'Kopierte innbyggingskode!',
|
|
397
397
|
copyText: {
|
|
398
|
+
now: 'nå',
|
|
399
|
+
podcast: 'podkast',
|
|
400
|
+
by: 'av',
|
|
398
401
|
internet: '[Internett]. ',
|
|
399
402
|
noTitle: 'Uten tittel',
|
|
400
403
|
downloadedFrom: 'Hentet fra: ',
|
|
@@ -396,6 +396,9 @@ const messages = {
|
|
|
396
396
|
embed: 'Bygg inn',
|
|
397
397
|
embedCopied: 'Kopierte innbyggingskode!',
|
|
398
398
|
copyText: {
|
|
399
|
+
now: 'nå',
|
|
400
|
+
podcast: 'podkast',
|
|
401
|
+
by: 'av',
|
|
399
402
|
internet: '[Internett]. ',
|
|
400
403
|
noTitle: 'Utan tittel',
|
|
401
404
|
downloadedFrom: 'Henta frå: ',
|