@ndla/ui 33.4.0 → 33.4.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/ArticleByline.js +17 -17
- package/es/Article/ArticleSideBar.js +8 -10
- package/es/LearningPaths/LearningPathMenuAside.js +6 -14
- package/es/locale/messages-en.js +2 -0
- package/es/locale/messages-nb.js +2 -0
- package/es/locale/messages-nn.js +2 -0
- package/es/locale/messages-se.js +2 -0
- package/es/locale/messages-sma.js +2 -0
- package/lib/Article/ArticleByline.js +17 -17
- package/lib/Article/ArticleSideBar.js +8 -10
- package/lib/LearningPaths/LearningPathMenuAside.js +6 -14
- package/lib/locale/messages-en.d.ts +2 -0
- package/lib/locale/messages-en.js +2 -0
- package/lib/locale/messages-nb.d.ts +2 -0
- package/lib/locale/messages-nb.js +2 -0
- package/lib/locale/messages-nn.d.ts +2 -0
- package/lib/locale/messages-nn.js +2 -0
- package/lib/locale/messages-se.d.ts +2 -0
- package/lib/locale/messages-se.js +2 -0
- package/lib/locale/messages-sma.d.ts +2 -0
- package/lib/locale/messages-sma.js +2 -0
- package/package.json +8 -8
- package/src/Article/ArticleByline.tsx +11 -11
- package/src/Article/ArticleSideBar.tsx +4 -5
- package/src/LearningPaths/LearningPathMenuAside.tsx +2 -17
- package/src/locale/messages-en.ts +2 -0
- package/src/locale/messages-nb.ts +2 -0
- package/src/locale/messages-nn.ts +2 -0
- package/src/locale/messages-se.ts +2 -0
- package/src/locale/messages-sma.ts +2 -0
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import React, { ReactNode } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
|
|
12
|
-
import
|
|
12
|
+
import { CopyButton, ButtonV2 } from '@ndla/button';
|
|
13
13
|
import { colors, fonts, spacing } from '@ndla/core';
|
|
14
14
|
import { copyTextToClipboard, printPage } from '@ndla/util';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
@@ -147,8 +147,8 @@ const ArticleByline = ({
|
|
|
147
147
|
{copySourceReference && (
|
|
148
148
|
<CopyButton
|
|
149
149
|
size="small"
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
variant="outline"
|
|
151
|
+
shape="pill"
|
|
152
152
|
aria-live="assertive"
|
|
153
153
|
copyNode={t('license.hasCopiedTitle')}
|
|
154
154
|
data-copy-string={copySourceReference}
|
|
@@ -160,9 +160,9 @@ const ArticleByline = ({
|
|
|
160
160
|
<Modal
|
|
161
161
|
labelledBy={buttonId}
|
|
162
162
|
activateButton={
|
|
163
|
-
<
|
|
163
|
+
<ButtonV2 id={buttonId} size="small" shape="pill" variant="outline">
|
|
164
164
|
{t('article.useContent')}
|
|
165
|
-
</
|
|
165
|
+
</ButtonV2>
|
|
166
166
|
}
|
|
167
167
|
backgroundColor="white"
|
|
168
168
|
position="top"
|
|
@@ -181,8 +181,8 @@ const ArticleByline = ({
|
|
|
181
181
|
<CopyButton
|
|
182
182
|
onClick={copyLinkHandler}
|
|
183
183
|
size="small"
|
|
184
|
-
|
|
185
|
-
outline
|
|
184
|
+
shape="pill"
|
|
185
|
+
variant="outline"
|
|
186
186
|
aria-live="assertive"
|
|
187
187
|
data-copy-string={copyPageUrlLink}
|
|
188
188
|
copyNode={t('article.copyPageLinkCopied')}>
|
|
@@ -192,8 +192,8 @@ const ArticleByline = ({
|
|
|
192
192
|
{copyEmbedLink && (
|
|
193
193
|
<CopyButton
|
|
194
194
|
size="small"
|
|
195
|
-
|
|
196
|
-
outline
|
|
195
|
+
shape="pill"
|
|
196
|
+
variant="outline"
|
|
197
197
|
aria-live="assertive"
|
|
198
198
|
copyNode={t('license.hasCopiedTitle')}
|
|
199
199
|
data-copy-string={copyEmbedLink}
|
|
@@ -202,9 +202,9 @@ const ArticleByline = ({
|
|
|
202
202
|
</CopyButton>
|
|
203
203
|
)}
|
|
204
204
|
{printUrl && (
|
|
205
|
-
<
|
|
205
|
+
<ButtonV2 size="small" shape="pill" variant="outline" onClick={() => printPage(printUrl)}>
|
|
206
206
|
{t('article.printPage')}
|
|
207
|
-
</
|
|
207
|
+
</ButtonV2>
|
|
208
208
|
)}
|
|
209
209
|
</ButtonWrapper>
|
|
210
210
|
</Wrapper>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { MouseEvent, ReactNode, RefObject, useEffect, useState } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { CopyButton, ButtonV2 } from '@ndla/button';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import SafeLink from '@ndla/safelink';
|
|
5
5
|
import { fonts } from '@ndla/core';
|
|
@@ -87,8 +87,7 @@ const ArticleSideBar = ({
|
|
|
87
87
|
<CopyButton
|
|
88
88
|
onClick={copyLinkHandler}
|
|
89
89
|
size="small"
|
|
90
|
-
|
|
91
|
-
outline
|
|
90
|
+
variant="outline"
|
|
92
91
|
aria-live="assertive"
|
|
93
92
|
copyNode={t('article.copyPageLinkCopied')}
|
|
94
93
|
data-copy-string={copyPageUrlLink}>
|
|
@@ -99,9 +98,9 @@ const ArticleSideBar = ({
|
|
|
99
98
|
{licenseBox && (
|
|
100
99
|
<Modal
|
|
101
100
|
activateButton={
|
|
102
|
-
<
|
|
101
|
+
<ButtonV2 size="small" variant="outline">
|
|
103
102
|
{t('article.useContent')}
|
|
104
|
-
</
|
|
103
|
+
</ButtonV2>
|
|
105
104
|
}
|
|
106
105
|
size="medium">
|
|
107
106
|
{(onClose: () => void) => (
|
|
@@ -76,21 +76,6 @@ const StyledAside = styled.aside<StyledAsideProps>`
|
|
|
76
76
|
}
|
|
77
77
|
`;
|
|
78
78
|
|
|
79
|
-
type StyledSafeLinkButtonProps = {
|
|
80
|
-
invertedStyle?: boolean;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const StyledSafeLinkButton = styled(SafeLinkButton)<StyledSafeLinkButtonProps>`
|
|
84
|
-
${(props) =>
|
|
85
|
-
props.invertedStyle &&
|
|
86
|
-
css`
|
|
87
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
88
|
-
border-color: #fff;
|
|
89
|
-
color: #fff;
|
|
90
|
-
}
|
|
91
|
-
`}
|
|
92
|
-
`;
|
|
93
|
-
|
|
94
79
|
type Props = {
|
|
95
80
|
isOpen: boolean;
|
|
96
81
|
lastUpdated: string;
|
|
@@ -119,14 +104,14 @@ const LearningPathMenuAside = ({ lastUpdated, learningPathURL, copyright, isOpen
|
|
|
119
104
|
</div>
|
|
120
105
|
{copyright.contributors && <LearningPathMenuAsideCopyright copyright={copyright} />}
|
|
121
106
|
<p css={infoTextCSS}>{t('learningPath.createLearningPathText')}</p>
|
|
122
|
-
<
|
|
107
|
+
<SafeLinkButton
|
|
123
108
|
to={learningPathURL}
|
|
124
109
|
target="_blank"
|
|
125
110
|
rel="noopener noreferrer"
|
|
126
111
|
variant="outline"
|
|
127
112
|
inverted={invertedStyle}>
|
|
128
113
|
{t('learningPath.createLearningPathButtonText')}
|
|
129
|
-
</
|
|
114
|
+
</SafeLinkButton>
|
|
130
115
|
</StyledAside>
|
|
131
116
|
);
|
|
132
117
|
};
|
|
@@ -259,6 +259,7 @@ const messages = {
|
|
|
259
259
|
alphabeticSort: 'Subjects grouped alphabetically',
|
|
260
260
|
subjectGroup: 'Group "{{ category }}"',
|
|
261
261
|
allSubjects: 'All subjects',
|
|
262
|
+
myFavoriteSubjects: 'My favorite subjects',
|
|
262
263
|
chooseSubject: 'Choose subject',
|
|
263
264
|
errorDescription: 'Sorry, an error occurred while loading the subjects.',
|
|
264
265
|
confirmRemove: 'Are you sure you want to remove {{subject}} from your favorite subjects?',
|
|
@@ -340,6 +341,7 @@ const messages = {
|
|
|
340
341
|
},
|
|
341
342
|
},
|
|
342
343
|
menu: {
|
|
344
|
+
button: 'Menu',
|
|
343
345
|
goToMainMenu: 'Go to main menu',
|
|
344
346
|
close: 'Close',
|
|
345
347
|
goTo: 'Go to',
|
|
@@ -258,6 +258,7 @@ const messages = {
|
|
|
258
258
|
alphabeticSort: 'Fag gruppert alfabetisk',
|
|
259
259
|
subjectGroup: 'Gruppe "{{ category }}"',
|
|
260
260
|
allSubjects: 'Alle fag',
|
|
261
|
+
myFavoriteSubjects: 'Mine favorittfag',
|
|
261
262
|
errorDescription: 'Beklager, en feil oppstod under lasting av fagene.',
|
|
262
263
|
chooseSubject: 'Velg fag',
|
|
263
264
|
confirmRemove: 'Er du sikker på at du vil fjerne {{subject}} fra favorittfag?',
|
|
@@ -339,6 +340,7 @@ const messages = {
|
|
|
339
340
|
},
|
|
340
341
|
},
|
|
341
342
|
menu: {
|
|
343
|
+
button: 'Meny',
|
|
342
344
|
goToMainMenu: 'Gå til hovedmeny',
|
|
343
345
|
close: 'Lukk',
|
|
344
346
|
goTo: 'Gå til',
|
|
@@ -258,6 +258,7 @@ const messages = {
|
|
|
258
258
|
alphabeticSort: 'Fag gruppert alfabetisk',
|
|
259
259
|
subjectGroup: 'Gruppe "{{ category }}"',
|
|
260
260
|
allSubjects: 'Alle fag',
|
|
261
|
+
myFavoriteSubjects: 'Favorittfaga mine',
|
|
261
262
|
errorDescription: 'Orsak, ein feil oppstod under lasting av faga.',
|
|
262
263
|
chooseSubject: 'Vel fag',
|
|
263
264
|
confirmRemove: 'Er du sikker på at du vil fjerne {{subject}} fra favorittfag?',
|
|
@@ -339,6 +340,7 @@ const messages = {
|
|
|
339
340
|
},
|
|
340
341
|
},
|
|
341
342
|
menu: {
|
|
343
|
+
button: 'Meny',
|
|
342
344
|
goToMainMenu: 'Gå til hovedmeny',
|
|
343
345
|
close: 'Lukk',
|
|
344
346
|
goTo: 'Gå til',
|
|
@@ -258,6 +258,7 @@ const messages = {
|
|
|
258
258
|
alphabeticSort: 'Fag gruppert alfabetisk',
|
|
259
259
|
subjectGroup: 'Gruppe "{{ category }}"',
|
|
260
260
|
allSubjects: 'Buot fágat',
|
|
261
|
+
myFavoriteSubjects: 'Mine favorittfag',
|
|
261
262
|
errorDescription: 'Šállošat, boasttuvuohta čuožžilii fágaid viežžamis.',
|
|
262
263
|
chooseSubject: 'Vállje fága',
|
|
263
264
|
confirmRemove: 'Er du sikker på at du vil fjerne {{subject}} fra favorittfag?',
|
|
@@ -340,6 +341,7 @@ const messages = {
|
|
|
340
341
|
},
|
|
341
342
|
},
|
|
342
343
|
menu: {
|
|
344
|
+
menu: 'Meny',
|
|
343
345
|
goToMainMenu: 'Gå til hovedmeny',
|
|
344
346
|
close: 'Govčča',
|
|
345
347
|
goTo: 'Mana deike',
|
|
@@ -258,6 +258,7 @@ const messages = {
|
|
|
258
258
|
alphabeticSort: 'Fag gruppert alfabetisk',
|
|
259
259
|
subjectGroup: 'Gruppe "{{ category }}"',
|
|
260
260
|
allSubjects: 'Alle fag',
|
|
261
|
+
myFavoriteSubjects: 'Mine favorittfag',
|
|
261
262
|
errorDescription: 'Beklager, en feil oppstod under lasting av fagene.',
|
|
262
263
|
chooseSubject: 'Velg fag',
|
|
263
264
|
confirmRemove: 'Er du sikker på at du vil fjerne {{subject}} fra favorittfag?',
|
|
@@ -339,6 +340,7 @@ const messages = {
|
|
|
339
340
|
},
|
|
340
341
|
},
|
|
341
342
|
menu: {
|
|
343
|
+
menu: 'Meny',
|
|
342
344
|
goToMainMenu: 'Gå til hovedmeny',
|
|
343
345
|
close: 'Lukk',
|
|
344
346
|
goTo: 'Gå til',
|