@ndla/ui 33.3.3 → 33.4.1

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 (36) hide show
  1. package/es/Article/ArticleByline.js +17 -17
  2. package/es/Article/ArticleSideBar.js +8 -10
  3. package/es/Footer/Footer.js +18 -16
  4. package/es/Footer/FooterLinks.js +23 -22
  5. package/es/LearningPaths/LearningPathMenuAside.js +6 -14
  6. package/es/locale/messages-en.js +7 -0
  7. package/es/locale/messages-nb.js +7 -0
  8. package/es/locale/messages-nn.js +7 -0
  9. package/es/locale/messages-se.js +7 -0
  10. package/es/locale/messages-sma.js +7 -0
  11. package/lib/Article/ArticleByline.js +17 -17
  12. package/lib/Article/ArticleSideBar.js +8 -10
  13. package/lib/Footer/Footer.js +18 -16
  14. package/lib/Footer/FooterLinks.js +23 -22
  15. package/lib/LearningPaths/LearningPathMenuAside.js +6 -14
  16. package/lib/locale/messages-en.d.ts +7 -0
  17. package/lib/locale/messages-en.js +7 -0
  18. package/lib/locale/messages-nb.d.ts +7 -0
  19. package/lib/locale/messages-nb.js +7 -0
  20. package/lib/locale/messages-nn.d.ts +7 -0
  21. package/lib/locale/messages-nn.js +7 -0
  22. package/lib/locale/messages-se.d.ts +7 -0
  23. package/lib/locale/messages-se.js +7 -0
  24. package/lib/locale/messages-sma.d.ts +7 -0
  25. package/lib/locale/messages-sma.js +7 -0
  26. package/package.json +8 -8
  27. package/src/Article/ArticleByline.tsx +11 -11
  28. package/src/Article/ArticleSideBar.tsx +4 -5
  29. package/src/Footer/Footer.tsx +8 -6
  30. package/src/Footer/FooterLinks.tsx +20 -21
  31. package/src/LearningPaths/LearningPathMenuAside.tsx +2 -17
  32. package/src/locale/messages-en.ts +7 -0
  33. package/src/locale/messages-nb.ts +7 -0
  34. package/src/locale/messages-nn.ts +7 -0
  35. package/src/locale/messages-se.ts +7 -0
  36. package/src/locale/messages-sma.ts +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "33.3.3",
3
+ "version": "33.4.1",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -32,19 +32,19 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@ndla/article-scripts": "^3.0.14",
35
- "@ndla/button": "^7.0.5",
35
+ "@ndla/button": "^8.0.0",
36
36
  "@ndla/carousel": "^2.1.1",
37
37
  "@ndla/core": "^3.0.3",
38
- "@ndla/forms": "^4.1.9",
38
+ "@ndla/forms": "^4.1.10",
39
39
  "@ndla/hooks": "^1.2.0",
40
40
  "@ndla/icons": "^2.1.1",
41
- "@ndla/licenses": "^6.1.5",
41
+ "@ndla/licenses": "^6.1.6",
42
42
  "@ndla/modal": "^2.2.2",
43
- "@ndla/notion": "^4.1.11",
44
- "@ndla/safelink": "^4.0.0",
43
+ "@ndla/notion": "^4.1.12",
44
+ "@ndla/safelink": "^4.0.1",
45
45
  "@ndla/switch": "^1.0.3",
46
46
  "@ndla/tabs": "^2.1.1",
47
- "@ndla/tooltip": "^4.0.3",
47
+ "@ndla/tooltip": "^4.0.4",
48
48
  "@ndla/types-learningpath-api": "^0.0.17",
49
49
  "@ndla/util": "^3.1.9",
50
50
  "@reach/menu-button": "^0.16.2",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "312f7ebe89fd733409c3d62723cd7209bef67ad6"
85
+ "gitHead": "670051f760a2eee942642943fca7c4a494ba5b7b"
86
86
  }
@@ -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 Button, { CopyButton } from '@ndla/button';
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
- borderShape="rounded"
151
- outline
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
- <Button id={buttonId} size="small" borderShape="rounded" outline>
163
+ <ButtonV2 id={buttonId} size="small" shape="pill" variant="outline">
164
164
  {t('article.useContent')}
165
- </Button>
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
- borderShape="rounded"
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
- borderShape="rounded"
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
- <Button size="small" borderShape="rounded" outline onClick={() => printPage(printUrl)}>
205
+ <ButtonV2 size="small" shape="pill" variant="outline" onClick={() => printPage(printUrl)}>
206
206
  {t('article.printPage')}
207
- </Button>
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 Button, { CopyButton } from '@ndla/button';
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
- width="full"
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
- <Button size="small" width="full" outline>
101
+ <ButtonV2 size="small" variant="outline">
103
102
  {t('article.useContent')}
104
- </Button>
103
+ </ButtonV2>
105
104
  }
106
105
  size="medium">
107
106
  {(onClose: () => void) => (
@@ -30,7 +30,7 @@ type StyledFooterProps = {
30
30
  addMargin?: boolean;
31
31
  };
32
32
 
33
- const StyledFooter = styled.footer<StyledFooterProps>`
33
+ const StyledDiv = styled.div<StyledFooterProps>`
34
34
  color: #fff;
35
35
  position: relative;
36
36
  background: ${colors.brand.dark};
@@ -159,11 +159,13 @@ const Footer = ({ children, links, languageSelector, auth, privacyLinks }: Props
159
159
  return (
160
160
  <>
161
161
  {languageSelector && <StyledLanguageWrapper>{languageSelector}</StyledLanguageWrapper>}
162
- <StyledFooter addMargin={!languageSelector}>
163
- <OneColumn cssModifier="large">{footerContent}</OneColumn>
164
- <StyledBackground />
165
- </StyledFooter>
166
- {auth}
162
+ <footer>
163
+ <StyledDiv addMargin={!languageSelector}>
164
+ <OneColumn cssModifier="large">{footerContent}</OneColumn>
165
+ <StyledBackground />
166
+ </StyledDiv>
167
+ {auth}
168
+ </footer>
167
169
  </>
168
170
  );
169
171
  };
@@ -8,17 +8,18 @@ import { useTranslation } from 'react-i18next';
8
8
  const StyledLinksWrapper = styled.div`
9
9
  display: flex;
10
10
  align-items: flex-start;
11
- section:first-of-type {
11
+ gap: ${spacing.normal};
12
+ div:first-of-type {
12
13
  margin-right: ${spacing.large};
13
14
  }
14
15
  ${mq.range({ from: breakpoints.desktop })} {
15
- section:first-of-type {
16
+ div:first-of-type {
16
17
  margin-right: ${spacingUnit * 4}px;
17
18
  }
18
19
  }
19
20
  ${mq.range({ until: breakpoints.tabletWide })} {
20
21
  flex-direction: column;
21
- > section {
22
+ > div {
22
23
  margin-top: ${spacing.large};
23
24
  }
24
25
  }
@@ -86,7 +87,7 @@ const StyledSocialMediaLinkWrapper = styled.div`
86
87
  align-items: center;
87
88
  `;
88
89
 
89
- const StyledHeaderLinks = styled.h1`
90
+ const StyledHeaderLinks = styled.h3`
90
91
  ${fonts.sizes(16, 1.5)};
91
92
  font-weight: ${fonts.weight.semibold};
92
93
  margin: ${spacing.xsmall} 0;
@@ -97,11 +98,11 @@ const FooterLinks = ({ links }: FooterLinksProps) => {
97
98
  return (
98
99
  <>
99
100
  <StyledLinksWrapper>
100
- <section>
101
- <StyledHeaderLinks>
101
+ <div>
102
+ <StyledHeaderLinks id="otherLinks">
102
103
  {t('footer.linksHeader')} <Launch />
103
104
  </StyledHeaderLinks>
104
- <StyledNav>
105
+ <StyledNav aria-labelledby="otherLinks">
105
106
  {commonLinks.map((link) => (
106
107
  <div key={link.url}>
107
108
  <StyledSafeLink
@@ -115,20 +116,18 @@ const FooterLinks = ({ links }: FooterLinksProps) => {
115
116
  </div>
116
117
  ))}
117
118
  </StyledNav>
118
- </section>
119
- <section>
120
- <StyledNav>
121
- {links.map((link) => (
122
- <StyledSocialMediaLinkWrapper key={link.to}>
123
- <StyledSocialMediaIcon>{link.icon}</StyledSocialMediaIcon>
124
- <StyledSafeLink to={link.to}>
125
- {link.text}
126
- <Forward />
127
- </StyledSafeLink>
128
- </StyledSocialMediaLinkWrapper>
129
- ))}
130
- </StyledNav>
131
- </section>
119
+ </div>
120
+ <StyledNav aria-label={t('footer.socialMedia')}>
121
+ {links.map((link) => (
122
+ <StyledSocialMediaLinkWrapper key={link.to}>
123
+ <StyledSocialMediaIcon>{link.icon}</StyledSocialMediaIcon>
124
+ <StyledSafeLink to={link.to}>
125
+ {link.text}
126
+ <Forward />
127
+ </StyledSafeLink>
128
+ </StyledSocialMediaLinkWrapper>
129
+ ))}
130
+ </StyledNav>
132
131
  </StyledLinksWrapper>
133
132
  </>
134
133
  );
@@ -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
- <StyledSafeLinkButton
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
- </StyledSafeLinkButton>
114
+ </SafeLinkButton>
130
115
  </StyledAside>
131
116
  );
132
117
  };
@@ -253,7 +253,13 @@ const messages = {
253
253
  archived: 'This is an expired and unmaintained subject.',
254
254
  },
255
255
  subjectsPage: {
256
+ filterSubjects: 'Filter subjects',
257
+ scrollToGroup: 'Scroll to group',
258
+ goToTop: 'Scroll to top',
259
+ alphabeticSort: 'Subjects grouped alphabetically',
260
+ subjectGroup: 'Group "{{ category }}"',
256
261
  allSubjects: 'All subjects',
262
+ myFavoriteSubjects: 'My favorite subjects',
257
263
  chooseSubject: 'Choose subject',
258
264
  errorDescription: 'Sorry, an error occurred while loading the subjects.',
259
265
  confirmRemove: 'Are you sure you want to remove {{subject}} from your favorite subjects?',
@@ -624,6 +630,7 @@ const messages = {
624
630
  },
625
631
  footer: {
626
632
  aboutNDLA: 'About NDLA',
633
+ socialMedia: 'Social media',
627
634
  selectLanguage: 'Choose language (språk): ',
628
635
  info: 'This webapplication is developed by NDLA as Open Source code.',
629
636
  editorInChief: 'Editor in chief: ',
@@ -252,7 +252,13 @@ const messages = {
252
252
  archived: 'Dette er et utgått fag som ikke vedlikeholdes.',
253
253
  },
254
254
  subjectsPage: {
255
+ filterSubjects: 'Filtrer fag',
256
+ scrollToGroup: 'Hopp til gruppe',
257
+ goToTop: 'Gå til toppen',
258
+ alphabeticSort: 'Fag gruppert alfabetisk',
259
+ subjectGroup: 'Gruppe "{{ category }}"',
255
260
  allSubjects: 'Alle fag',
261
+ myFavoriteSubjects: 'Mine favorittfag',
256
262
  errorDescription: 'Beklager, en feil oppstod under lasting av fagene.',
257
263
  chooseSubject: 'Velg fag',
258
264
  confirmRemove: 'Er du sikker på at du vil fjerne {{subject}} fra favorittfag?',
@@ -623,6 +629,7 @@ const messages = {
623
629
  },
624
630
  footer: {
625
631
  aboutNDLA: 'Om NDLA',
632
+ socialMedia: 'Sosiale medier',
626
633
  selectLanguage: 'Velg språk (language): ',
627
634
  vision: 'Sammen skaper vi framtidas læring',
628
635
  linksHeader: 'Andre NDLA-nettsteder',
@@ -252,7 +252,13 @@ const messages = {
252
252
  archived: 'Dette er eit utgått fag som ikkje blir halde ved like.',
253
253
  },
254
254
  subjectsPage: {
255
+ filterSubjects: 'Filtrer fag',
256
+ scrollToGroup: 'Hopp til gruppe',
257
+ goToTop: 'Gå til toppen',
258
+ alphabeticSort: 'Fag gruppert alfabetisk',
259
+ subjectGroup: 'Gruppe "{{ category }}"',
255
260
  allSubjects: 'Alle fag',
261
+ myFavoriteSubjects: 'Favorittfaga mine',
256
262
  errorDescription: 'Orsak, ein feil oppstod under lasting av faga.',
257
263
  chooseSubject: 'Vel fag',
258
264
  confirmRemove: 'Er du sikker på at du vil fjerne {{subject}} fra favorittfag?',
@@ -624,6 +630,7 @@ const messages = {
624
630
  },
625
631
  footer: {
626
632
  aboutNDLA: 'Om NDLA',
633
+ socialMedia: 'Sosiale media',
627
634
  selectLanguage: 'Vel språk (language): ',
628
635
  vision: 'Saman skapar vi framtidas læring',
629
636
  linksHeader: 'Andre NDLA-nettstader',
@@ -252,7 +252,13 @@ const messages = {
252
252
  archived: 'Dát leat heaittihuvvon fága mii ii ođasmahttojuvvo.',
253
253
  },
254
254
  subjectsPage: {
255
+ filterSubjects: 'Filtrer fag',
256
+ scrollToGroup: 'Hopp til gruppe',
257
+ goToTop: 'Gå til toppen',
258
+ alphabeticSort: 'Fag gruppert alfabetisk',
259
+ subjectGroup: 'Gruppe "{{ category }}"',
255
260
  allSubjects: 'Buot fágat',
261
+ myFavoriteSubjects: 'Mine favorittfag',
256
262
  errorDescription: 'Šállošat, boasttuvuohta čuožžilii fágaid viežžamis.',
257
263
  chooseSubject: 'Vállje fága',
258
264
  confirmRemove: 'Er du sikker på at du vil fjerne {{subject}} fra favorittfag?',
@@ -624,6 +630,7 @@ const messages = {
624
630
  },
625
631
  footer: {
626
632
  aboutNDLA: 'NDLA birra',
633
+ socialMedia: 'Sosiale medier',
627
634
  selectLanguage: 'Vállje giela (language): ',
628
635
  vision: 'Ovttas hábmet boahtteáiggi oahppama',
629
636
  linksHeader: 'Eará NDLA neahttabáikkit',
@@ -252,7 +252,13 @@ const messages = {
252
252
  archived: 'Dette er et utgått fag som ikke vedlikeholdes.',
253
253
  },
254
254
  subjectsPage: {
255
+ filterSubjects: 'Filtrer fag',
256
+ scrollToGroup: 'Hopp til gruppe',
257
+ goToTop: 'Gå til toppen',
258
+ alphabeticSort: 'Fag gruppert alfabetisk',
259
+ subjectGroup: 'Gruppe "{{ category }}"',
255
260
  allSubjects: 'Alle fag',
261
+ myFavoriteSubjects: 'Mine favorittfag',
256
262
  errorDescription: 'Beklager, en feil oppstod under lasting av fagene.',
257
263
  chooseSubject: 'Velg fag',
258
264
  confirmRemove: 'Er du sikker på at du vil fjerne {{subject}} fra favorittfag?',
@@ -624,6 +630,7 @@ const messages = {
624
630
  },
625
631
  footer: {
626
632
  aboutNDLA: 'Om NDLA',
633
+ socialMedia: 'Sosiale medier',
627
634
  selectLanguage: 'Velg språk (language): ',
628
635
  vision: 'Sammen skaper vi framtidas læring',
629
636
  linksHeader: 'Andre NDLA-nettsteder',