@ndla/ui 34.6.4 → 34.6.6
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/AudioPlayer/AudioPlayer.js +19 -19
- package/es/ErrorMessage/ErrorResourceAccessDenied.js +3 -3
- package/es/FactBox/FactBox.js +3 -3
- package/es/Figure/Figure.js +8 -10
- package/es/Filter/FilterButtons.js +20 -23
- package/es/Filter/FilterListPhone.js +7 -7
- package/es/Footer/FooterAuth.js +12 -11
- package/es/Frontpage/FrontpageProgramMenu.js +16 -16
- package/es/LearningPaths/LearningPathMenuModalWrapper.js +3 -3
- package/es/Navigation/NavigationTopicAbout.js +17 -17
- package/es/NoContentBox/NoContentBox.js +3 -3
- package/es/RelatedArticleList/RelatedArticleList.js +3 -3
- package/es/Search/ContentTypeResult.js +5 -4
- package/es/Search/ToggleSearchButton.js +4 -4
- package/es/SearchTypeResult/ActiveFilters.js +9 -10
- package/es/SearchTypeResult/PopupFilter.js +14 -14
- package/es/SearchTypeResult/ResultNavigation.js +9 -9
- package/es/SearchTypeResult/SearchHeader.js +11 -11
- package/es/SearchTypeResult/SearchNotionItem.js +18 -18
- package/es/SearchTypeResult/SearchTypeHeader.js +13 -13
- package/es/SearchTypeResult/SearchViewType.js +9 -8
- package/es/SearchTypeResult/components/SubjectFilters.js +5 -5
- package/es/User/AuthModal.js +9 -9
- package/es/locale/messages-en.js +3 -2
- package/es/locale/messages-nb.js +2 -1
- package/es/locale/messages-nn.js +2 -1
- package/es/locale/messages-se.js +2 -1
- package/es/locale/messages-sma.js +3 -2
- package/lib/AudioPlayer/AudioPlayer.js +19 -19
- package/lib/ErrorMessage/ErrorResourceAccessDenied.js +3 -3
- package/lib/FactBox/FactBox.js +3 -3
- package/lib/Figure/Figure.js +8 -10
- package/lib/Filter/FilterButtons.js +20 -23
- package/lib/Filter/FilterListPhone.js +7 -7
- package/lib/Footer/FooterAuth.js +12 -11
- package/lib/Frontpage/FrontpageProgramMenu.js +16 -16
- package/lib/LearningPaths/LearningPathMenuModalWrapper.js +3 -3
- package/lib/Navigation/NavigationTopicAbout.js +17 -17
- package/lib/NoContentBox/NoContentBox.js +3 -3
- package/lib/RelatedArticleList/RelatedArticleList.js +3 -3
- package/lib/Search/ContentTypeResult.js +5 -4
- package/lib/Search/ToggleSearchButton.js +4 -4
- package/lib/SearchTypeResult/ActiveFilters.js +9 -10
- package/lib/SearchTypeResult/PopupFilter.js +14 -14
- package/lib/SearchTypeResult/ResultNavigation.js +9 -9
- package/lib/SearchTypeResult/SearchHeader.js +11 -11
- package/lib/SearchTypeResult/SearchNotionItem.js +18 -18
- package/lib/SearchTypeResult/SearchTypeHeader.js +13 -13
- package/lib/SearchTypeResult/SearchViewType.js +9 -8
- package/lib/SearchTypeResult/components/SubjectFilters.js +5 -5
- package/lib/User/AuthModal.js +9 -9
- package/lib/locale/messages-en.d.ts +1 -0
- package/lib/locale/messages-en.js +3 -2
- package/lib/locale/messages-nb.d.ts +1 -0
- package/lib/locale/messages-nb.js +2 -1
- package/lib/locale/messages-nn.d.ts +1 -0
- package/lib/locale/messages-nn.js +2 -1
- package/lib/locale/messages-se.d.ts +1 -0
- package/lib/locale/messages-se.js +2 -1
- package/lib/locale/messages-sma.d.ts +1 -0
- package/lib/locale/messages-sma.js +3 -2
- package/package.json +2 -2
- package/src/AudioPlayer/AudioPlayer.tsx +9 -9
- package/src/ErrorMessage/ErrorResourceAccessDenied.tsx +3 -3
- package/src/FactBox/FactBox.tsx +3 -3
- package/src/Figure/Figure.tsx +7 -13
- package/src/Filter/FilterButtons.tsx +12 -14
- package/src/Filter/FilterListPhone.tsx +7 -7
- package/src/Footer/FooterAuth.tsx +4 -4
- package/src/Frontpage/FrontpageProgramMenu.tsx +13 -5
- package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +3 -3
- package/src/Navigation/NavigationTopicAbout.tsx +4 -4
- package/src/NoContentBox/NoContentBox.tsx +3 -3
- package/src/RelatedArticleList/RelatedArticleList.tsx +4 -4
- package/src/Search/ContentTypeResult.tsx +5 -4
- package/src/Search/ToggleSearchButton.tsx +2 -2
- package/src/SearchTypeResult/ActiveFilters.tsx +4 -5
- package/src/SearchTypeResult/PopupFilter.tsx +9 -9
- package/src/SearchTypeResult/ResultNavigation.tsx +5 -5
- package/src/SearchTypeResult/SearchHeader.tsx +3 -3
- package/src/SearchTypeResult/SearchNotionItem.tsx +5 -5
- package/src/SearchTypeResult/SearchTypeHeader.tsx +5 -5
- package/src/SearchTypeResult/SearchViewType.tsx +5 -4
- package/src/SearchTypeResult/components/SubjectFilters.tsx +3 -3
- package/src/User/AuthModal.tsx +3 -3
- package/src/locale/messages-en.ts +3 -2
- package/src/locale/messages-nb.ts +2 -1
- package/src/locale/messages-nn.ts +2 -1
- package/src/locale/messages-se.ts +2 -1
- package/src/locale/messages-sma.ts +3 -2
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import styled from '@emotion/styled';
|
|
10
|
-
import
|
|
10
|
+
import { ButtonV2 } from '@ndla/button';
|
|
11
11
|
import { animations, colors, fonts, spacing } from '@ndla/core';
|
|
12
12
|
import { ChevronDown, FeideText, LogIn, LogOut } from '@ndla/icons/common';
|
|
13
13
|
import React from 'react';
|
|
@@ -44,7 +44,7 @@ const StyledButtonWrapper = styled.div`
|
|
|
44
44
|
margin-top: ${spacing.normal};
|
|
45
45
|
`;
|
|
46
46
|
|
|
47
|
-
const LoginButton = styled(
|
|
47
|
+
const LoginButton = styled(ButtonV2)`
|
|
48
48
|
background: #222222;
|
|
49
49
|
border-color: ${colors.text.light};
|
|
50
50
|
`;
|
|
@@ -53,7 +53,7 @@ const StyledLogInIconWrapper = styled.span`
|
|
|
53
53
|
margin-left: ${spacing.xsmall};
|
|
54
54
|
`;
|
|
55
55
|
|
|
56
|
-
const AuthedButton = styled(
|
|
56
|
+
const AuthedButton = styled(ButtonV2)`
|
|
57
57
|
color: #ffffff;
|
|
58
58
|
transition: all ${animations.durations.fast} ease-in-out;
|
|
59
59
|
&:hover,
|
|
@@ -79,7 +79,7 @@ const FooterAuth = ({ isAuthenticated, user, onAuthenticateClick, ...rest }: Aut
|
|
|
79
79
|
user={user}
|
|
80
80
|
onAuthenticateClick={onAuthenticateClick}
|
|
81
81
|
activateButton={
|
|
82
|
-
<AuthedButton
|
|
82
|
+
<AuthedButton variant="ghost" shape="pill" size="medium">
|
|
83
83
|
{t('user.loggedInAsButton', { role: user?.eduPersonPrimaryAffiliation })}
|
|
84
84
|
<ChevronDown />
|
|
85
85
|
</AuthedButton>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
|
-
import
|
|
3
|
+
import { ButtonV2 } from '@ndla/button';
|
|
4
4
|
import { fonts, breakpoints, mq } from '@ndla/core';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import NavigationBox, { ItemProps } from '../Navigation/NavigationBox';
|
|
@@ -112,12 +112,20 @@ const FrontpageProgramMenu = ({ programItems, subjectCategories, showBetaCursor
|
|
|
112
112
|
return (
|
|
113
113
|
<StyledWrapper>
|
|
114
114
|
<StyledMenu>
|
|
115
|
-
<
|
|
115
|
+
<ButtonV2
|
|
116
|
+
onClick={() => toggleSubjects(false)}
|
|
117
|
+
colorTheme={showSubjects ? 'lighter' : undefined}
|
|
118
|
+
size="medium"
|
|
119
|
+
shape="pill">
|
|
116
120
|
<StyledMenuItem>{t('frontpageMenu.program')}</StyledMenuItem>
|
|
117
|
-
</
|
|
118
|
-
<
|
|
121
|
+
</ButtonV2>
|
|
122
|
+
<ButtonV2
|
|
123
|
+
onClick={() => toggleSubjects(true)}
|
|
124
|
+
colorTheme={!showSubjects ? 'lighter' : undefined}
|
|
125
|
+
size="medium"
|
|
126
|
+
shape="pill">
|
|
119
127
|
<StyledMenuItem>{t('frontpageMenu.allsubjects')}</StyledMenuItem>
|
|
120
|
-
</
|
|
128
|
+
</ButtonV2>
|
|
121
129
|
{showBetaCursor && (
|
|
122
130
|
<CursorPlaceholder aria-hidden="true">
|
|
123
131
|
<CursorWrapper>
|
|
@@ -10,7 +10,7 @@ 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/react';
|
|
13
|
-
import
|
|
13
|
+
import { ButtonV2 } from '@ndla/button';
|
|
14
14
|
import { LearningPath } from '@ndla/icons/contentType';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
|
|
@@ -43,10 +43,10 @@ const ModalWrapperComponent = ({ innerWidth, children }: ModalWrapperProps) => {
|
|
|
43
43
|
animationDuration={200}
|
|
44
44
|
size="fullscreen"
|
|
45
45
|
activateButton={
|
|
46
|
-
<
|
|
46
|
+
<ButtonV2 css={buttonToggleCss}>
|
|
47
47
|
<LearningPath />
|
|
48
48
|
<span>{t('learningPath.openMenuTooltip')}</span>
|
|
49
|
-
</
|
|
49
|
+
</ButtonV2>
|
|
50
50
|
}>
|
|
51
51
|
{(closeModal: VoidFunction) => (
|
|
52
52
|
<>
|
|
@@ -3,7 +3,7 @@ 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/react';
|
|
6
|
-
import
|
|
6
|
+
import { ButtonV2 } from '@ndla/button';
|
|
7
7
|
import { ChevronDown, ChevronUp } from '@ndla/icons/common';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
|
|
@@ -145,9 +145,9 @@ export const NavigationTopicAbout = ({
|
|
|
145
145
|
<StyledIngress invertedStyle={invertedStyle}>
|
|
146
146
|
{parse(renderMarkdown(introduction))}
|
|
147
147
|
<StyledButtonWrapper invertedStyle={invertedStyle}>
|
|
148
|
-
<
|
|
148
|
+
<ButtonV2
|
|
149
149
|
aria-expanded={!!showContent}
|
|
150
|
-
link
|
|
150
|
+
variant="link"
|
|
151
151
|
onClick={() => {
|
|
152
152
|
onToggleShowContent();
|
|
153
153
|
}}>
|
|
@@ -160,7 +160,7 @@ export const NavigationTopicAbout = ({
|
|
|
160
160
|
{t('navigation.showLongerDescription')} <ChevronDown />
|
|
161
161
|
</>
|
|
162
162
|
)}
|
|
163
|
-
</
|
|
163
|
+
</ButtonV2>
|
|
164
164
|
</StyledButtonWrapper>
|
|
165
165
|
</StyledIngress>
|
|
166
166
|
{showContent && <StyledContentWrapper invertedStyle={invertedStyle}>{children}</StyledContentWrapper>}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import
|
|
10
|
+
import { ButtonV2 } from '@ndla/button';
|
|
11
11
|
|
|
12
12
|
interface Props {
|
|
13
13
|
onClick?: () => void;
|
|
@@ -21,9 +21,9 @@ export const NoContentBox = ({ buttonText, text, onClick }: Props) => (
|
|
|
21
21
|
<div>
|
|
22
22
|
<p>{text}</p>
|
|
23
23
|
{onClick && (
|
|
24
|
-
<
|
|
24
|
+
<ButtonV2 variant="outline" onClick={onClick}>
|
|
25
25
|
{buttonText}
|
|
26
|
-
</
|
|
26
|
+
</ButtonV2>
|
|
27
27
|
)}
|
|
28
28
|
</div>
|
|
29
29
|
</span>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Children, cloneElement, ReactElement } from 'react';
|
|
2
2
|
import BEMHelper from 'react-bem-helper';
|
|
3
|
-
import
|
|
3
|
+
import { ButtonV2 } from '@ndla/button';
|
|
4
4
|
import SafeLink from '@ndla/safelink';
|
|
5
5
|
import SectionHeading from '../SectionHeading';
|
|
6
6
|
import { HeadingLevel } from '../types';
|
|
@@ -79,13 +79,13 @@ const RelatedArticleList = ({ messages, children, articleCount, dangerouslySetIn
|
|
|
79
79
|
{clonedChildren}
|
|
80
80
|
</div>
|
|
81
81
|
{childrenCount > 2 && (
|
|
82
|
-
<
|
|
82
|
+
<ButtonV2
|
|
83
83
|
data-type="related-article-button"
|
|
84
84
|
data-showmore={messages.showMore}
|
|
85
85
|
data-showless={messages.showLess}
|
|
86
|
-
outline>
|
|
86
|
+
variant="outline">
|
|
87
87
|
{messages.showMore}
|
|
88
|
-
</
|
|
88
|
+
</ButtonV2>
|
|
89
89
|
)}
|
|
90
90
|
</section>
|
|
91
91
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ButtonV2 } from '@ndla/button';
|
|
2
2
|
import { Additional, ChevronDown, ChevronUp } from '@ndla/icons/common';
|
|
3
3
|
import SafeLink from '@ndla/safelink';
|
|
4
4
|
import Tooltip from '@ndla/tooltip';
|
|
@@ -150,15 +150,16 @@ const ContentTypeResult = ({
|
|
|
150
150
|
})}
|
|
151
151
|
{displayShowAllButton && (
|
|
152
152
|
<StyledListItem ref={showAllRef}>
|
|
153
|
-
<
|
|
154
|
-
|
|
153
|
+
<ButtonV2
|
|
154
|
+
variant="ghost"
|
|
155
|
+
shape="pill"
|
|
155
156
|
css={[showAllButtonStyle, shouldHighlightShowAllButton && noWidthhighlightStyle]}
|
|
156
157
|
data-highlighted={shouldHighlightShowAllButton}
|
|
157
158
|
onClick={() => toggleShowAll(!showAll)}
|
|
158
159
|
tabIndex={-1}>
|
|
159
160
|
{showAll ? messages.showLessResultLabel : messages.allResultLabel}
|
|
160
161
|
{showAll ? <ChevronUp /> : <ChevronDown />}
|
|
161
|
-
</
|
|
162
|
+
</ButtonV2>
|
|
162
163
|
</StyledListItem>
|
|
163
164
|
)}
|
|
164
165
|
</StyledList>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { spacing, spacingUnit, breakpoints, mq, misc, fonts, colors } from '@ndla/core';
|
|
11
11
|
import { Search } from '@ndla/icons/common';
|
|
12
|
-
import
|
|
12
|
+
import { ButtonProps, ButtonV2 } from '@ndla/button';
|
|
13
13
|
import styled from '@emotion/styled';
|
|
14
14
|
|
|
15
15
|
interface Props extends ButtonProps {
|
|
@@ -24,7 +24,7 @@ interface StyledButtonProps {
|
|
|
24
24
|
ndlaFilm?: boolean;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const StyledButton = styled(
|
|
27
|
+
const StyledButton = styled(ButtonV2)<StyledButtonProps>`
|
|
28
28
|
background: ${(p) => (p.ndlaFilm ? colors.ndlaFilm.filmColorBright : colors.brand.greyLighter)};
|
|
29
29
|
border-radius: ${misc.borderRadius};
|
|
30
30
|
border: 0;
|
|
@@ -12,7 +12,7 @@ import styled from '@emotion/styled';
|
|
|
12
12
|
import { css } from '@emotion/react';
|
|
13
13
|
import { spacing, mq, breakpoints } from '@ndla/core';
|
|
14
14
|
import Tooltip from '@ndla/tooltip';
|
|
15
|
-
import
|
|
15
|
+
import { ButtonV2 } from '@ndla/button';
|
|
16
16
|
import ActiveFilterContent, { FilterProps, StyledActiveFilterTitle } from './ActiveFilterContent';
|
|
17
17
|
|
|
18
18
|
type StyledActiveFiltersProps = {
|
|
@@ -138,20 +138,19 @@ const ActiveFilters = ({
|
|
|
138
138
|
{filterLength > showFilterCount && (
|
|
139
139
|
<StyledActiveFilterWrapper>
|
|
140
140
|
<Tooltip tooltip={t('searchPage.searchFilterMessages.noValuesButtonText')}>
|
|
141
|
-
<
|
|
141
|
+
<ButtonV2
|
|
142
142
|
aria-label={t('searchPage.searchFilterMessages.additionalSubjectFilters', {
|
|
143
143
|
count: filterLength - showFilterCount + 1,
|
|
144
144
|
})}
|
|
145
|
-
type="button"
|
|
146
145
|
size="normal"
|
|
147
|
-
|
|
146
|
+
shape="pill"
|
|
148
147
|
onClick={onClickShowHiddenSubjects}>
|
|
149
148
|
<StyledActiveFilterTitle>
|
|
150
149
|
{t('searchPage.searchFilterMessages.additionalSubjectFilters', {
|
|
151
150
|
count: filterLength - showFilterCount + 1,
|
|
152
151
|
})}
|
|
153
152
|
</StyledActiveFilterTitle>
|
|
154
|
-
</
|
|
153
|
+
</ButtonV2>
|
|
155
154
|
</Tooltip>
|
|
156
155
|
</StyledActiveFilterWrapper>
|
|
157
156
|
)}
|
|
@@ -10,7 +10,7 @@ import React, { 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
|
-
import
|
|
13
|
+
import { ButtonV2 } from '@ndla/button';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { ToggleItem } from '../Filter';
|
|
16
16
|
|
|
@@ -113,23 +113,23 @@ const PopupFilter = ({
|
|
|
113
113
|
</ModalHeaderWrapper>
|
|
114
114
|
{subjectCategories && programmes && (
|
|
115
115
|
<MainFilterButtonWrapper>
|
|
116
|
-
<
|
|
116
|
+
<ButtonV2
|
|
117
117
|
onClick={() => setSelectedMenu(MENU_ALL_SUBJECTS)}
|
|
118
|
-
|
|
118
|
+
colorTheme={selectedMenu !== MENU_ALL_SUBJECTS ? 'lighter' : undefined}
|
|
119
119
|
size="normal"
|
|
120
|
-
|
|
120
|
+
shape="pill">
|
|
121
121
|
{t('frontpageMenu.allsubjects')}
|
|
122
|
-
</
|
|
122
|
+
</ButtonV2>
|
|
123
123
|
</MainFilterButtonWrapper>
|
|
124
124
|
)}
|
|
125
125
|
{programmes && (
|
|
126
|
-
<
|
|
126
|
+
<ButtonV2
|
|
127
127
|
onClick={() => setSelectedMenu(MENU_PROGRAMMES)}
|
|
128
|
-
|
|
128
|
+
colorTheme={selectedMenu !== MENU_PROGRAMMES ? 'lighter' : undefined}
|
|
129
129
|
size="normal"
|
|
130
|
-
|
|
130
|
+
shape="pill">
|
|
131
131
|
{t('frontpageMenu.program')}
|
|
132
|
-
</
|
|
132
|
+
</ButtonV2>
|
|
133
133
|
)}
|
|
134
134
|
{selectedMenu === MENU_ALL_SUBJECTS && subjectCategories && (
|
|
135
135
|
<FrontpageAllSubjects
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
import
|
|
11
|
+
import { ButtonV2 } from '@ndla/button';
|
|
12
12
|
import { fonts, spacing, colors } from '@ndla/core';
|
|
13
13
|
import { useTranslation } from 'react-i18next';
|
|
14
14
|
|
|
@@ -91,13 +91,13 @@ const ResultNavigation = ({ onShowMore, totalCount, toCount, contentType = '', t
|
|
|
91
91
|
<Progress width={progress} />
|
|
92
92
|
</ProgressBar>
|
|
93
93
|
{isMore ? (
|
|
94
|
-
<
|
|
94
|
+
<ButtonV2 className="nav" variant="outline" onClick={onShowMore} aria-describedby={`searchitem-header-${type}`}>
|
|
95
95
|
{t('searchPage.resultType.showMore')}
|
|
96
|
-
</
|
|
96
|
+
</ButtonV2>
|
|
97
97
|
) : (
|
|
98
|
-
<
|
|
98
|
+
<ButtonV2 className="nav" variant="outline" onClick={onToTopHandler}>
|
|
99
99
|
{t('searchPage.resultType.toTopOfPage')}
|
|
100
|
-
</
|
|
100
|
+
</ButtonV2>
|
|
101
101
|
)}
|
|
102
102
|
</ResultNav>
|
|
103
103
|
);
|
|
@@ -9,7 +9,7 @@ import React, { FormEvent, useEffect, useState } from 'react';
|
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { breakpoints, fonts, mq, spacing } from '@ndla/core';
|
|
12
|
-
import
|
|
12
|
+
import { ButtonV2 } from '@ndla/button';
|
|
13
13
|
|
|
14
14
|
import SearchFieldHeader from './SearchFieldHeader';
|
|
15
15
|
import { CompetenceGoalsItemType } from '../types';
|
|
@@ -131,9 +131,9 @@ const SearchHeader = ({
|
|
|
131
131
|
{searchPhraseSuggestion && (
|
|
132
132
|
<PhraseSuggestionText>
|
|
133
133
|
{t('searchPage.resultType.searchPhraseSuggestion')}{' '}
|
|
134
|
-
<
|
|
134
|
+
<ButtonV2 variant="link" onClick={searchPhraseSuggestionOnClick}>
|
|
135
135
|
[{searchPhraseSuggestion}]
|
|
136
|
-
</
|
|
136
|
+
</ButtonV2>
|
|
137
137
|
</PhraseSuggestionText>
|
|
138
138
|
)}
|
|
139
139
|
{!!competenceGoals?.length && (
|
|
@@ -12,7 +12,7 @@ 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
|
-
import
|
|
15
|
+
import { ButtonV2 } from '@ndla/button';
|
|
16
16
|
import { Play } from '@ndla/icons/common';
|
|
17
17
|
import { ArrowExpand } from '@ndla/icons/editor';
|
|
18
18
|
import Modal, { ModalCloseButton, ModalHeader, ModalBody } from '@ndla/modal';
|
|
@@ -147,13 +147,13 @@ const SearchNotionItem = ({
|
|
|
147
147
|
<ShowMediaButtonWrapper>
|
|
148
148
|
<Modal
|
|
149
149
|
activateButton={
|
|
150
|
-
<
|
|
150
|
+
<ButtonV2 colorTheme="lighter" size="xsmall" shape="pill">
|
|
151
151
|
<>
|
|
152
152
|
{type === 'video' && <Play />}
|
|
153
153
|
{type === 'other' && <ArrowExpand />}
|
|
154
154
|
<ShowMediaButtonText>{t('searchPage.resultType.showVideo')}</ShowMediaButtonText>
|
|
155
155
|
</>
|
|
156
|
-
</
|
|
156
|
+
</ButtonV2>
|
|
157
157
|
}
|
|
158
158
|
animation="subtle"
|
|
159
159
|
animationDuration={50}
|
|
@@ -193,9 +193,9 @@ const SearchNotionItem = ({
|
|
|
193
193
|
{authors.length > 0 && license && ' '}
|
|
194
194
|
{license && `(${getLicenseByAbbreviation(license, locale).abbreviation})`}
|
|
195
195
|
{onReferenceClick && (
|
|
196
|
-
<
|
|
196
|
+
<ButtonV2 variant="link" onClick={onReferenceClick}>
|
|
197
197
|
{t('article.cite')}
|
|
198
|
-
</
|
|
198
|
+
</ButtonV2>
|
|
199
199
|
)}
|
|
200
200
|
</p>
|
|
201
201
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import React, { MouseEvent, memo } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
import
|
|
11
|
+
import { ButtonV2 } from '@ndla/button';
|
|
12
12
|
import { breakpoints, fonts, mq, spacing } from '@ndla/core';
|
|
13
13
|
import { useTranslation } from 'react-i18next';
|
|
14
14
|
import { Cross } from '@ndla/icons/action';
|
|
@@ -111,11 +111,11 @@ const SearchTypeHeader = ({ filters = [], onFilterClick, totalCount, type }: Pro
|
|
|
111
111
|
<CategoryItems>
|
|
112
112
|
{filters.map((option: FilterOptionsType) => (
|
|
113
113
|
<CategoryTypeButtonWrapper key={option.id}>
|
|
114
|
-
<
|
|
114
|
+
<ButtonV2
|
|
115
115
|
aria-current={option.active}
|
|
116
116
|
size="xsmall"
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
shape="pill"
|
|
118
|
+
colorTheme={!option.active ? 'greyLighter' : undefined}
|
|
119
119
|
onClick={(e: MouseEvent<HTMLButtonElement>) => {
|
|
120
120
|
if (e.currentTarget && option.active) {
|
|
121
121
|
e.currentTarget.blur();
|
|
@@ -128,7 +128,7 @@ const SearchTypeHeader = ({ filters = [], onFilterClick, totalCount, type }: Pro
|
|
|
128
128
|
<Cross />
|
|
129
129
|
</CategoryTypeCrossWrapper>
|
|
130
130
|
)}
|
|
131
|
-
</
|
|
131
|
+
</ButtonV2>
|
|
132
132
|
</CategoryTypeButtonWrapper>
|
|
133
133
|
))}
|
|
134
134
|
</CategoryItems>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
|
-
import
|
|
11
|
+
import { ButtonV2 } from '@ndla/button';
|
|
12
12
|
import { Grid } from '@ndla/icons/common';
|
|
13
13
|
import { ListCircle } from '@ndla/icons/editor';
|
|
14
14
|
import { animations, breakpoints, colors, mq } from '@ndla/core';
|
|
@@ -32,7 +32,7 @@ const ButtonContainer = styled.div`
|
|
|
32
32
|
width: 44px;
|
|
33
33
|
height: 44px;
|
|
34
34
|
`;
|
|
35
|
-
const ButtonElement = styled(
|
|
35
|
+
const ButtonElement = styled(ButtonV2)`
|
|
36
36
|
border-radius: 50%;
|
|
37
37
|
padding: 2px;
|
|
38
38
|
width: 100%;
|
|
@@ -81,7 +81,8 @@ const SearchViewType = ({ viewType, onChangeViewType }: SearchViewTypeProps) =>
|
|
|
81
81
|
<Wrapper>
|
|
82
82
|
<ButtonContainer>
|
|
83
83
|
<ButtonElement
|
|
84
|
-
stripped
|
|
84
|
+
variant="stripped"
|
|
85
|
+
colorTheme="greyLighter"
|
|
85
86
|
type="button"
|
|
86
87
|
size="normal"
|
|
87
88
|
title={t('searchPage.resultType.gridView')}
|
|
@@ -93,7 +94,7 @@ const SearchViewType = ({ viewType, onChangeViewType }: SearchViewTypeProps) =>
|
|
|
93
94
|
</ButtonContainer>
|
|
94
95
|
<ButtonContainer>
|
|
95
96
|
<ButtonElement
|
|
96
|
-
stripped
|
|
97
|
+
variant="stripped"
|
|
97
98
|
size="normal"
|
|
98
99
|
title={t('searchPage.resultType.listView')}
|
|
99
100
|
onClick={() => onClickHandler('list')}>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import React, { useEffect, useRef, useState } from 'react';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
11
|
import styled from '@emotion/styled';
|
|
12
|
-
import
|
|
12
|
+
import { ButtonV2 } from '@ndla/button';
|
|
13
13
|
import { Plus as PlusIcon } from '@ndla/icons/action';
|
|
14
14
|
|
|
15
15
|
import PopupFilter, { PopupFilterProps } from '../PopupFilter';
|
|
@@ -106,10 +106,10 @@ const SubjectFilters = ({ filters, activeFilters, isNarrowScreen }: SubjectFilte
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
const OpenModalButton = () => (
|
|
109
|
-
<
|
|
109
|
+
<ButtonV2 type="button" size="normal" colorTheme="greyLighter" shape="pill" onClick={handlePopupOpen}>
|
|
110
110
|
<FilterButtonText>{t('searchPage.searchFilterMessages.noValuesButtonText')}</FilterButtonText>
|
|
111
111
|
<PlusIcon />
|
|
112
|
-
</
|
|
112
|
+
</ButtonV2>
|
|
113
113
|
);
|
|
114
114
|
|
|
115
115
|
const ActiveFiltersElement = ({ showModalButton }: { showModalButton?: boolean }) => {
|
package/src/User/AuthModal.tsx
CHANGED
|
@@ -10,7 +10,7 @@ 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
|
-
import
|
|
13
|
+
import { ButtonV2 } from '@ndla/button';
|
|
14
14
|
import { FeideText, LogIn, LogOut, HumanMaleBoard } from '@ndla/icons/common';
|
|
15
15
|
import { fonts, spacing } from '@ndla/core';
|
|
16
16
|
import { UserInfo } from './UserInfo';
|
|
@@ -105,12 +105,12 @@ const AuthModal = ({
|
|
|
105
105
|
</p>
|
|
106
106
|
)}
|
|
107
107
|
<StyledButtonWrapper>
|
|
108
|
-
<
|
|
108
|
+
<ButtonV2 size="medium" onClick={onAuthenticateClick}>
|
|
109
109
|
{isAuthenticated ? t('user.buttonLogOut') : t('user.buttonLogIn')}
|
|
110
110
|
<StyledLogInIconWrapper aria-hidden>
|
|
111
111
|
{isAuthenticated ? <LogOut className="c-icon--medium" /> : <LogIn className="c-icon--medium" />}
|
|
112
112
|
</StyledLogInIconWrapper>
|
|
113
|
-
</
|
|
113
|
+
</ButtonV2>
|
|
114
114
|
</StyledButtonWrapper>
|
|
115
115
|
</StyledModalContent>
|
|
116
116
|
</StyledModalBody>
|
|
@@ -1053,8 +1053,9 @@ const messages = {
|
|
|
1053
1053
|
loggedInAs: 'You are logged in as {{role}}.',
|
|
1054
1054
|
loggedInAsButton: 'You are logged in as {{role}}',
|
|
1055
1055
|
role: {
|
|
1056
|
-
employee: '
|
|
1057
|
-
|
|
1056
|
+
employee: 'Employee',
|
|
1057
|
+
faculty: 'Employee',
|
|
1058
|
+
staff: 'Employee',
|
|
1058
1059
|
student: 'Student',
|
|
1059
1060
|
},
|
|
1060
1061
|
buttonLogIn: 'Log in with Feide',
|
|
@@ -1052,7 +1052,8 @@ const messages = {
|
|
|
1052
1052
|
loggedInAs: 'Du er pålogget som {{role}}.',
|
|
1053
1053
|
loggedInAsButton: 'Du er pålogget som {{role}}',
|
|
1054
1054
|
role: {
|
|
1055
|
-
employee: '
|
|
1055
|
+
employee: 'ansatt',
|
|
1056
|
+
faculty: 'ansatt',
|
|
1056
1057
|
staff: 'ansatt',
|
|
1057
1058
|
student: 'elev',
|
|
1058
1059
|
},
|
|
@@ -1052,7 +1052,8 @@ const messages = {
|
|
|
1052
1052
|
loggedInAs: 'Du er pålogga som {{role}}.',
|
|
1053
1053
|
loggedInAsButton: 'Du er pålogga som {{role}}',
|
|
1054
1054
|
role: {
|
|
1055
|
-
employee: '
|
|
1055
|
+
employee: 'tilsett',
|
|
1056
|
+
faculty: 'tilsett',
|
|
1056
1057
|
staff: 'tilsett',
|
|
1057
1058
|
student: 'elev',
|
|
1058
1059
|
},
|
|
@@ -1053,7 +1053,8 @@ const messages = {
|
|
|
1053
1053
|
loggedInAs: 'Don leat sisaloggejuvvon {{role}}.',
|
|
1054
1054
|
loggedInAsButton: 'Don leat sisaloggejuvvon {{role}}',
|
|
1055
1055
|
role: {
|
|
1056
|
-
employee: '
|
|
1056
|
+
employee: 'bargi',
|
|
1057
|
+
faculty: 'bargi',
|
|
1057
1058
|
staff: 'bargi',
|
|
1058
1059
|
student: 'oahppi',
|
|
1059
1060
|
},
|
|
@@ -1056,8 +1056,9 @@ const messages = {
|
|
|
1056
1056
|
loggedInAs: 'Datne tjaangeme goh {{role}}.',
|
|
1057
1057
|
loggedInAsButton: 'Datne tjaangeme goh {{role}}',
|
|
1058
1058
|
role: {
|
|
1059
|
-
employee: '
|
|
1060
|
-
|
|
1059
|
+
employee: 'barkije',
|
|
1060
|
+
faculty: 'barkije',
|
|
1061
|
+
staff: 'barkije',
|
|
1061
1062
|
student: 'learohke',
|
|
1062
1063
|
},
|
|
1063
1064
|
buttonLogIn: 'Tjaangh Feidine',
|