@ndla/ui 35.0.9 → 35.0.11

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 (223) hide show
  1. package/es/Article/ArticleByline.js +4 -4
  2. package/es/Article/ArticleHeaderWrapper.js +1 -1
  3. package/es/Article/ArticleNotions.js +5 -5
  4. package/es/Article/ArticleSideBar.js +2 -2
  5. package/es/AudioPlayer/AudioPlayer.js +14 -14
  6. package/es/AudioPlayer/Controls.js +26 -26
  7. package/es/AuthorInfo/AuthorInfo.js +3 -3
  8. package/es/Breadcrumblist/Breadcrumblist.js +6 -6
  9. package/es/CompetenceGoalTab/CompetenceGoalTab.js +2 -2
  10. package/es/CompetenceGoals/CompetenceGoalsDialog.js +3 -3
  11. package/es/Embed/BrightcoveEmbed.js +2 -2
  12. package/es/Embed/ConceptEmbed.js +8 -8
  13. package/es/Embed/ImageEmbed.js +1 -1
  14. package/es/Embed/conceptComponents.js +11 -11
  15. package/es/Filter/FilterButtons.js +9 -9
  16. package/es/Footer/FooterLinks.js +6 -6
  17. package/es/Frontpage/FrontpageAllSubjects.js +7 -7
  18. package/es/Frontpage/FrontpageProgramMenu.js +3 -3
  19. package/es/Image/ImageLink.js +1 -1
  20. package/es/LanguageSelector/LanguageSelector.js +5 -5
  21. package/es/LearningPaths/LearningPathMenu.js +3 -3
  22. package/es/LearningPaths/LearningPathMenuAside.js +4 -4
  23. package/es/LearningPaths/LearningPathMenuContent.js +6 -6
  24. package/es/LearningPaths/LearningPathMenuModalWrapper.js +1 -1
  25. package/es/LetterFilter/LetterFilter.js +2 -2
  26. package/es/Masthead/Masthead.js +6 -6
  27. package/es/Masthead/MastheadAuthModal.js +1 -1
  28. package/es/Masthead/MastheadSearchModal.js +3 -3
  29. package/es/MyNdla/Resource/Folder.js +30 -25
  30. package/es/MyNdla/Resource/FolderInput.js +2 -2
  31. package/es/NDLAFilm/CategorySelect.js +3 -3
  32. package/es/NDLAFilm/FilmContentCard.js +3 -3
  33. package/es/NDLAFilm/FilmSlideshow.js +9 -9
  34. package/es/NDLAFilm/NavigationArrow.js +4 -4
  35. package/es/NDLAFilm/SlideshowIndicator.js +2 -2
  36. package/es/Navigation/NavigationBox.js +20 -20
  37. package/es/Navigation/NavigationTopicAbout.js +14 -14
  38. package/es/Notion/ConceptNotion.js +1 -1
  39. package/es/Notion/FigureNotion.js +1 -1
  40. package/es/Notion/NotionVisualElement.js +2 -2
  41. package/es/Programme/ProgrammeSubjects.js +1 -1
  42. package/es/ResourceGroup/ResourceItem.js +11 -11
  43. package/es/ResourcesWrapper/ResourcesTopicTitle.js +12 -12
  44. package/es/Search/ActiveFilterContent.js +2 -2
  45. package/es/Search/ActiveFilters.js +6 -6
  46. package/es/Search/ContentTypeResult.js +1 -1
  47. package/es/Search/SearchField.js +2 -2
  48. package/es/Search/SearchResult.js +10 -10
  49. package/es/Search/SearchResultSleeve.js +8 -8
  50. package/es/Search/ToggleSearchButton.js +2 -2
  51. package/es/SearchTypeResult/ActiveFilterContent.js +2 -2
  52. package/es/SearchTypeResult/ActiveFilters.js +6 -6
  53. package/es/SearchTypeResult/PopupFilter.js +7 -7
  54. package/es/SearchTypeResult/SearchFieldHeader.js +4 -4
  55. package/es/SearchTypeResult/SearchNotionItem.js +12 -12
  56. package/es/SearchTypeResult/SearchTypeHeader.js +9 -9
  57. package/es/SearchTypeResult/SearchViewType.js +4 -4
  58. package/es/SearchTypeResult/components/ItemContexts.js +7 -7
  59. package/es/SnackBar/DefaultSnackbar.js +2 -2
  60. package/es/TagSelector/DropdownIndicator.js +1 -1
  61. package/es/TagSelector/Option.js +2 -2
  62. package/es/TagSelector/ValueButton.js +1 -1
  63. package/es/Topic/Topic.js +17 -17
  64. package/es/TreeStructure/AddFolderButton.js +2 -2
  65. package/es/TreeStructure/ComboboxButton.js +2 -2
  66. package/es/TreeStructure/FolderItem.js +5 -5
  67. package/es/TreeStructure/FolderItems.js +2 -2
  68. package/es/TreeStructure/TreeStructure.js +7 -7
  69. package/es/User/AuthModal.js +7 -7
  70. package/lib/Article/ArticleByline.js +4 -4
  71. package/lib/Article/ArticleHeaderWrapper.js +1 -1
  72. package/lib/Article/ArticleNotions.js +5 -5
  73. package/lib/Article/ArticleSideBar.js +2 -2
  74. package/lib/AudioPlayer/AudioPlayer.js +14 -14
  75. package/lib/AudioPlayer/Controls.js +26 -26
  76. package/lib/AuthorInfo/AuthorInfo.js +3 -3
  77. package/lib/Breadcrumblist/Breadcrumblist.js +6 -6
  78. package/lib/CompetenceGoalTab/CompetenceGoalTab.js +2 -2
  79. package/lib/CompetenceGoals/CompetenceGoalsDialog.js +3 -3
  80. package/lib/Embed/BrightcoveEmbed.js +2 -2
  81. package/lib/Embed/ConceptEmbed.js +8 -8
  82. package/lib/Embed/ImageEmbed.js +1 -1
  83. package/lib/Embed/conceptComponents.js +11 -11
  84. package/lib/Filter/FilterButtons.js +9 -9
  85. package/lib/Footer/FooterLinks.js +6 -6
  86. package/lib/Frontpage/FrontpageAllSubjects.js +7 -7
  87. package/lib/Frontpage/FrontpageProgramMenu.js +3 -3
  88. package/lib/Image/ImageLink.js +1 -1
  89. package/lib/LanguageSelector/LanguageSelector.js +5 -5
  90. package/lib/LearningPaths/LearningPathMenu.js +3 -3
  91. package/lib/LearningPaths/LearningPathMenuAside.js +4 -4
  92. package/lib/LearningPaths/LearningPathMenuContent.js +6 -6
  93. package/lib/LearningPaths/LearningPathMenuModalWrapper.js +1 -1
  94. package/lib/LetterFilter/LetterFilter.js +2 -2
  95. package/lib/Masthead/Masthead.js +6 -6
  96. package/lib/Masthead/MastheadAuthModal.js +1 -1
  97. package/lib/Masthead/MastheadSearchModal.js +3 -3
  98. package/lib/MyNdla/Resource/Folder.d.ts +2 -1
  99. package/lib/MyNdla/Resource/Folder.js +28 -23
  100. package/lib/MyNdla/Resource/FolderInput.js +2 -2
  101. package/lib/NDLAFilm/CategorySelect.js +3 -3
  102. package/lib/NDLAFilm/FilmContentCard.js +3 -3
  103. package/lib/NDLAFilm/FilmSlideshow.js +9 -9
  104. package/lib/NDLAFilm/NavigationArrow.js +4 -4
  105. package/lib/NDLAFilm/SlideshowIndicator.js +2 -2
  106. package/lib/Navigation/NavigationBox.js +20 -20
  107. package/lib/Navigation/NavigationTopicAbout.js +14 -14
  108. package/lib/Notion/ConceptNotion.js +1 -1
  109. package/lib/Notion/FigureNotion.js +1 -1
  110. package/lib/Notion/NotionVisualElement.js +2 -2
  111. package/lib/Programme/ProgrammeSubjects.js +1 -1
  112. package/lib/ResourceGroup/ResourceItem.js +11 -11
  113. package/lib/ResourcesWrapper/ResourcesTopicTitle.js +12 -12
  114. package/lib/Search/ActiveFilterContent.js +2 -2
  115. package/lib/Search/ActiveFilters.js +6 -6
  116. package/lib/Search/ContentTypeResult.js +1 -1
  117. package/lib/Search/SearchField.js +2 -2
  118. package/lib/Search/SearchResult.js +10 -10
  119. package/lib/Search/SearchResultSleeve.js +8 -8
  120. package/lib/Search/ToggleSearchButton.js +2 -2
  121. package/lib/SearchTypeResult/ActiveFilterContent.js +2 -2
  122. package/lib/SearchTypeResult/ActiveFilters.js +6 -6
  123. package/lib/SearchTypeResult/PopupFilter.js +7 -7
  124. package/lib/SearchTypeResult/SearchFieldHeader.js +4 -4
  125. package/lib/SearchTypeResult/SearchNotionItem.js +12 -12
  126. package/lib/SearchTypeResult/SearchTypeHeader.js +9 -9
  127. package/lib/SearchTypeResult/SearchViewType.js +4 -4
  128. package/lib/SearchTypeResult/components/ItemContexts.js +7 -7
  129. package/lib/SnackBar/DefaultSnackbar.js +2 -2
  130. package/lib/TagSelector/DropdownIndicator.js +1 -1
  131. package/lib/TagSelector/Option.js +2 -2
  132. package/lib/TagSelector/ValueButton.js +1 -1
  133. package/lib/Topic/Topic.js +17 -17
  134. package/lib/TreeStructure/AddFolderButton.js +2 -2
  135. package/lib/TreeStructure/ComboboxButton.js +2 -2
  136. package/lib/TreeStructure/FolderItem.js +5 -5
  137. package/lib/TreeStructure/FolderItems.js +2 -2
  138. package/lib/TreeStructure/TreeStructure.js +7 -7
  139. package/lib/User/AuthModal.js +7 -7
  140. package/lib/types.d.ts +1 -1
  141. package/package.json +12 -12
  142. package/src/Article/ArticleByline.tsx +8 -4
  143. package/src/Article/ArticleHeaderWrapper.tsx +2 -1
  144. package/src/Article/ArticleNotions.tsx +2 -1
  145. package/src/Article/ArticleSideBar.tsx +4 -2
  146. package/src/AudioPlayer/AudioPlayer.tsx +4 -2
  147. package/src/AudioPlayer/Controls.tsx +12 -6
  148. package/src/AuthorInfo/AuthorInfo.tsx +1 -1
  149. package/src/Breadcrumblist/Breadcrumblist.tsx +4 -2
  150. package/src/CompetenceGoalTab/CompetenceGoalTab.tsx +4 -2
  151. package/src/CompetenceGoals/CompetenceGoalsDialog.tsx +2 -1
  152. package/src/ContentLoader/index.tsx +2 -1
  153. package/src/Dialog/Dialog.tsx +4 -2
  154. package/src/Embed/AudioEmbed.tsx +12 -6
  155. package/src/Embed/BrightcoveEmbed.tsx +6 -3
  156. package/src/Embed/ConceptEmbed.tsx +6 -3
  157. package/src/Embed/ImageEmbed.tsx +12 -6
  158. package/src/Embed/conceptComponents.tsx +4 -2
  159. package/src/Figure/Figure.tsx +6 -3
  160. package/src/Figure/FigureBylineExpandButton.tsx +2 -1
  161. package/src/Figure/FigureExpandButton.tsx +2 -1
  162. package/src/Figure/FigureOpenDialogButton.tsx +2 -1
  163. package/src/Filter/FilterButtons.tsx +6 -3
  164. package/src/Filter/FilterList.tsx +4 -2
  165. package/src/Filter/FilterListPhone.tsx +6 -3
  166. package/src/Footer/FooterLinks.tsx +2 -1
  167. package/src/Frontpage/FrontpageAllSubjects.tsx +2 -1
  168. package/src/Frontpage/FrontpageProgramMenu.tsx +4 -2
  169. package/src/Image/ImageLink.tsx +2 -1
  170. package/src/LanguageSelector/LanguageSelector.tsx +2 -1
  171. package/src/LearningPaths/LearningPathMenu.tsx +2 -1
  172. package/src/LearningPaths/LearningPathMenuAside.tsx +2 -1
  173. package/src/LearningPaths/LearningPathMenuContent.tsx +4 -2
  174. package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +2 -1
  175. package/src/LetterFilter/LetterFilter.tsx +2 -1
  176. package/src/Logo/SvgLogo.tsx +2 -1
  177. package/src/Masthead/Masthead.tsx +2 -1
  178. package/src/Masthead/MastheadAuthModal.tsx +2 -1
  179. package/src/Masthead/MastheadSearchModal.tsx +4 -2
  180. package/src/MyNdla/Resource/Folder.stories.mdx +1 -0
  181. package/src/MyNdla/Resource/Folder.tsx +17 -9
  182. package/src/MyNdla/Resource/FolderInput.tsx +2 -1
  183. package/src/NDLAFilm/CategorySelect.tsx +6 -3
  184. package/src/NDLAFilm/FilmContentCard.tsx +4 -2
  185. package/src/NDLAFilm/FilmSlideshow.tsx +2 -1
  186. package/src/NDLAFilm/NavigationArrow.tsx +2 -1
  187. package/src/NDLAFilm/SlideshowIndicator.tsx +2 -1
  188. package/src/Navigation/NavigationBox.tsx +6 -3
  189. package/src/Navigation/NavigationTopicAbout.tsx +2 -1
  190. package/src/Notion/ConceptNotion.tsx +8 -4
  191. package/src/Notion/FigureNotion.tsx +4 -2
  192. package/src/Notion/NotionVisualElement.tsx +2 -1
  193. package/src/Programme/ProgrammeSubjects.tsx +2 -1
  194. package/src/RelatedArticleList/RelatedArticleList.tsx +2 -1
  195. package/src/ResourceGroup/ResourceItem.tsx +2 -1
  196. package/src/ResourcesWrapper/ResourcesTopicTitle.tsx +2 -1
  197. package/src/Search/ActiveFilterContent.tsx +2 -1
  198. package/src/Search/ActiveFilters.tsx +2 -1
  199. package/src/Search/ContentTypeResult.tsx +4 -2
  200. package/src/Search/SearchField.tsx +4 -2
  201. package/src/Search/SearchResult.tsx +2 -1
  202. package/src/Search/SearchResultSleeve.tsx +4 -2
  203. package/src/Search/ToggleSearchButton.tsx +2 -1
  204. package/src/SearchTypeResult/ActiveFilterContent.tsx +2 -1
  205. package/src/SearchTypeResult/ActiveFilters.tsx +4 -2
  206. package/src/SearchTypeResult/PopupFilter.tsx +6 -3
  207. package/src/SearchTypeResult/SearchFieldHeader.tsx +2 -1
  208. package/src/SearchTypeResult/SearchNotionItem.tsx +2 -1
  209. package/src/SearchTypeResult/SearchTypeHeader.tsx +2 -1
  210. package/src/SearchTypeResult/SearchViewType.tsx +4 -2
  211. package/src/SearchTypeResult/components/ItemContexts.tsx +2 -1
  212. package/src/SnackBar/DefaultSnackbar.tsx +2 -1
  213. package/src/TagSelector/DropdownIndicator.tsx +2 -1
  214. package/src/TagSelector/Option.tsx +2 -1
  215. package/src/TagSelector/ValueButton.tsx +2 -1
  216. package/src/Topic/Topic.tsx +6 -3
  217. package/src/TreeStructure/AddFolderButton.tsx +2 -1
  218. package/src/TreeStructure/ComboboxButton.tsx +6 -3
  219. package/src/TreeStructure/FolderItem.tsx +8 -4
  220. package/src/TreeStructure/FolderItems.tsx +4 -2
  221. package/src/TreeStructure/TreeStructure.tsx +2 -1
  222. package/src/User/AuthModal.tsx +2 -1
  223. package/src/types.ts +1 -1
@@ -110,7 +110,8 @@ const FooterLinks = ({ links }: FooterLinksProps) => {
110
110
  aria-label={t(`footer.ndlaLinks.${link.key}`)}
111
111
  to={link.url}
112
112
  target="_blank"
113
- rel="noopener noreferrer">
113
+ rel="noopener noreferrer"
114
+ >
114
115
  {t(`footer.ndlaLinks.${link.key}`)}
115
116
  </StyledSafeLink>
116
117
  </div>
@@ -163,7 +163,8 @@ const renderList = (
163
163
  onNavigate();
164
164
  }
165
165
  }}
166
- to={subject.path || ''}>
166
+ to={subject.path || ''}
167
+ >
167
168
  {subject.name}
168
169
  </SafeLink>
169
170
  <StyledSpacingElement />
@@ -61,14 +61,16 @@ const FrontpageProgramMenu = ({ programItems, subjectCategories }: Props) => {
61
61
  onClick={() => toggleSubjects(false)}
62
62
  colorTheme={showSubjects ? 'lighter' : undefined}
63
63
  size="medium"
64
- shape="pill">
64
+ shape="pill"
65
+ >
65
66
  <StyledMenuItem>{t('frontpageMenu.program')}</StyledMenuItem>
66
67
  </ButtonV2>
67
68
  <ButtonV2
68
69
  onClick={() => toggleSubjects(true)}
69
70
  colorTheme={!showSubjects ? 'lighter' : undefined}
70
71
  size="medium"
71
- shape="pill">
72
+ shape="pill"
73
+ >
72
74
  <StyledMenuItem>{t('frontpageMenu.allsubjects')}</StyledMenuItem>
73
75
  </ButtonV2>
74
76
  </StyledMenu>
@@ -29,7 +29,8 @@ export function ImageLink({ src, crop, children, ...rest }: Props) {
29
29
  target="_blank"
30
30
  href={`${src}?${makeSrcQueryString(undefined, crop)}`}
31
31
  rel="noopener noreferrer"
32
- {...rest}>
32
+ {...rest}
33
+ >
33
34
  {children}
34
35
  </StyledLink>
35
36
  );
@@ -84,7 +84,8 @@ const LanguageSelector = <T extends string>({ locales, onSelect, inverted }: Pro
84
84
  variant="ghost"
85
85
  shape="sharp"
86
86
  aria-label={t(`changeLanguage.${locale}`)}
87
- onClick={() => onSelect(locale)}>
87
+ onClick={() => onSelect(locale)}
88
+ >
88
89
  <ActivityIndicator>{i18n.language === locale && <ActiveIndicator />}</ActivityIndicator>
89
90
  <Text>{t(`languages.${locale}`)}</Text>
90
91
  </LanguageChoice>
@@ -124,7 +124,8 @@ const LearningPathMenu = ({
124
124
  <div
125
125
  css={css`
126
126
  padding-left: ${spacing.small};
127
- `}>
127
+ `}
128
+ >
128
129
  <Tooltip tooltip={t('learningPath.openMenuTooltip')}>
129
130
  <StyledToggleMenubutton type="button" onClick={() => toggleOpenState(!isOpen)}>
130
131
  {!isOpen ? <ArrowExpandRight /> : <ArrowExpandLeft />}
@@ -109,7 +109,8 @@ const LearningPathMenuAside = ({ lastUpdated, learningPathURL, copyright, isOpen
109
109
  target="_blank"
110
110
  rel="noopener noreferrer"
111
111
  variant="outline"
112
- inverted={invertedStyle}>
112
+ inverted={invertedStyle}
113
+ >
113
114
  {t('learningPath.createLearningPathButtonText')}
114
115
  </SafeLinkButton>
115
116
  </StyledAside>
@@ -249,11 +249,13 @@ const LearningPathMenuContent = ({
249
249
  afterCurrent={index > currentIndex}
250
250
  isOpen={isOpen}
251
251
  invertedStyle={invertedStyle}
252
- indexNumber={index}>
252
+ indexNumber={index}
253
+ >
253
254
  <SafeLink
254
255
  onClick={onStepNavigate}
255
256
  to={toLearningPathUrl(learningPathId, id)}
256
- aria-describedby={`read-${id}`}>
257
+ aria-describedby={`read-${id}`}
258
+ >
257
259
  <StyledContentType>
258
260
  <ContentTypeBadge type={type ?? constants.contentTypes.LEARNING_PATH} background size="small" />
259
261
  {hasRead(id, cookies) && (
@@ -47,7 +47,8 @@ const ModalWrapperComponent = ({ innerWidth, children }: ModalWrapperProps) => {
47
47
  <LearningPath />
48
48
  <span>{t('learningPath.openMenuTooltip')}</span>
49
49
  </ButtonV2>
50
- }>
50
+ }
51
+ >
51
52
  {(closeModal: VoidFunction) => (
52
53
  <>
53
54
  <ModalHeader>
@@ -62,7 +62,8 @@ const LetterFilter = ({ value, onChange, enabledLetters }: Props) => {
62
62
  variant={!selected ? 'ghost' : undefined}
63
63
  colorTheme={!selected ? 'lighter' : 'primary'}
64
64
  disabled={disabled}
65
- size="xsmall">
65
+ size="xsmall"
66
+ >
66
67
  {letter}
67
68
  </StyledButton>
68
69
  </li>
@@ -37,7 +37,8 @@ export const SvgLogo = ({ name = true, color = '#000000', locale }: Props) => (
37
37
  xmlns="http://www.w3.org/2000/svg"
38
38
  viewBox="0 0 376 152"
39
39
  fill={color}
40
- fillRule="evenodd">
40
+ fillRule="evenodd"
41
+ >
41
42
  <path d="M355 67h-84v51h102V51h-18v16zm0 14h-66v19h66V81zm-84-48v18h84V33h-84z" />
42
43
  <rect width="18" height="118" x="236" transform="matrix(-1 0 0 1 490 0)" />
43
44
  <path d="M201 100V51h-65v49h65zm18 18V0h-18v33h-83v85h101z" />
@@ -118,7 +118,8 @@ export const Masthead = ({ children, fixed, ndlaFilm, skipToMainContentId, messa
118
118
  <MessageBanner
119
119
  key={message.number}
120
120
  showCloseButton={message.closable}
121
- onClose={() => onCloseAlert?.(message.number)}>
121
+ onClose={() => onCloseAlert?.(message.number)}
122
+ >
122
123
  {message.content}
123
124
  </MessageBanner>
124
125
  ))}
@@ -49,7 +49,8 @@ const MastheadAuthModal = ({ inverted, ...rest }: Props) => {
49
49
  size="medium"
50
50
  colorTheme="lighter"
51
51
  variant="ghost"
52
- aria-label={t('user.buttonLogIn')}>
52
+ aria-label={t('user.buttonLogIn')}
53
+ >
53
54
  {t('myNdla.myNDLA')}
54
55
  <Feide />
55
56
  </StyledButton>
@@ -106,7 +106,8 @@ const MastheadSearchModal = ({ onClose: onSearchClose, children, hideOnNarrowScr
106
106
  <ToggleSearchButton hideOnNarrowScreen={hideOnNarrowScreen} ndlaFilm={ndlaFilm}>
107
107
  {t('masthead.menu.search')}
108
108
  </ToggleSearchButton>
109
- }>
109
+ }
110
+ >
110
111
  {(closeModal: VoidFunction) => (
111
112
  <>
112
113
  <div css={extraBackdrop} />
@@ -116,7 +117,8 @@ const MastheadSearchModal = ({ onClose: onSearchClose, children, hideOnNarrowScr
116
117
  aria-label={t('welcomePage.closeSearch')}
117
118
  variant="ghost"
118
119
  colorTheme="light"
119
- onClick={closeModal}>
120
+ onClick={closeModal}
121
+ >
120
122
  <Cross className="c-icon--medium" />
121
123
  </IconButton>
122
124
  </StyledHeader>
@@ -42,6 +42,7 @@ export const Template = (args) => <Folder {...args} />;
42
42
  { icon: <Pencil />, text: 'Rediger', onClick: () => {} },
43
43
  { icon: <DeleteForever />, text: 'Slett', onClick: () => {}, type: 'danger' },
44
44
  ],
45
+ isShared: 'true',
45
46
  }}>
46
47
  {Template.bind({})}
47
48
  </Story>
@@ -7,9 +7,9 @@
7
7
  */
8
8
 
9
9
  import styled from '@emotion/styled';
10
- import React, { useRef } from 'react';
11
- import { FolderOutlined } from '@ndla/icons/contentType';
12
- import { FileDocumentOutline } from '@ndla/icons/common';
10
+ import React from 'react';
11
+ import { FolderOutlined, FolderShared } from '@ndla/icons/contentType';
12
+ import { FileDocumentOutline, Share } from '@ndla/icons/common';
13
13
  import { fonts, spacing, colors, mq, breakpoints } from '@ndla/core';
14
14
  import { css } from '@emotion/react';
15
15
  import { useTranslation } from 'react-i18next';
@@ -112,7 +112,7 @@ const CountContainer = styled.div`
112
112
  margin: 0 ${spacing.small} 0 ${spacing.nsmall};
113
113
  `;
114
114
 
115
- const IconCountWrapper = styled.div<LayoutProps>`
115
+ const IconTextWrapper = styled.div<LayoutProps>`
116
116
  display: flex;
117
117
  align-items: center;
118
118
  gap: ${spacing.xxsmall};
@@ -144,10 +144,10 @@ const Count = ({ type, count, layoutType }: IconCountProps) => {
144
144
  if (!count) return null;
145
145
 
146
146
  return (
147
- <IconCountWrapper type={layoutType}>
148
- <Icon aria-label={t(`myNdla.${type}s`)} />
147
+ <IconTextWrapper type={layoutType}>
148
+ <Icon />
149
149
  <span>{t(`myNdla.${type}s`, { count })}</span>
150
- </IconCountWrapper>
150
+ </IconTextWrapper>
151
151
  );
152
152
  };
153
153
 
@@ -160,22 +160,30 @@ interface Props {
160
160
  link: string;
161
161
  type: LayoutType;
162
162
  menuItems?: MenuItemProps[];
163
+ isShared?: boolean;
163
164
  }
164
165
 
165
- const Folder = ({ id, link, title, subFolders, subResources, type = 'list', menuItems }: Props) => {
166
+ const Folder = ({ id, link, title, subFolders, subResources, type = 'list', menuItems, isShared }: Props) => {
166
167
  const { t } = useTranslation();
168
+ const Icon = isShared ? FolderShared : FolderOutlined;
167
169
 
168
170
  return (
169
171
  <FolderWrapper type={type} id={id}>
170
172
  <TitleWrapper type={type}>
171
173
  <IconWrapper>
172
- <FolderOutlined aria-label={t('myNdla.folder.folder')} />
174
+ <Icon aria-label={t('myNdla.folder.folder')} />
173
175
  </IconWrapper>
174
176
  <ResourceTitleLink to={link}>
175
177
  <FolderTitle title={title}>{title}</FolderTitle>
176
178
  </ResourceTitleLink>
177
179
  </TitleWrapper>
178
180
  <MenuWrapper>
181
+ {isShared && (
182
+ <IconTextWrapper type={type}>
183
+ <Share />
184
+ <span>{t('myNdla.folder.sharing.shared')}</span>
185
+ </IconTextWrapper>
186
+ )}
179
187
  <CountContainer>
180
188
  <Count layoutType={type} type={'folder'} count={subFolders} />
181
189
  <Count layoutType={type} type={'resource'} count={subResources} />
@@ -91,7 +91,8 @@ const FolderInput = forwardRef<HTMLInputElement, Props>(({ loading, error, onClo
91
91
  aria-label={t('save')}
92
92
  title={t('save')}
93
93
  size="small"
94
- onClick={onSave}>
94
+ onClick={onSave}
95
+ >
95
96
  <Done />
96
97
  </IconButtonV2>
97
98
  )}
@@ -152,7 +152,8 @@ const CategorySelect = ({ resourceTypes, resourceTypeSelected, ariaControlId, on
152
152
  aria-controls="selectCategory"
153
153
  type="button"
154
154
  tabIndex={resourceTypesIsOpen ? -1 : 0}
155
- onClick={() => setResourceTypesIsOpen(true)}>
155
+ onClick={() => setResourceTypesIsOpen(true)}
156
+ >
156
157
  <div>
157
158
  <span>{t('ndlaFilm.search.chooseCategory')}</span>
158
159
  <small>{(resourceTypeSelected && resourceTypeSelected.name) || t('ndlaFilm.search.categoryFromNdla')}</small>
@@ -168,7 +169,8 @@ const CategorySelect = ({ resourceTypes, resourceTypeSelected, ariaControlId, on
168
169
  onDeactivate: () => setResourceTypesIsOpen(false),
169
170
  clickOutsideDeactivates: true,
170
171
  escapeDeactivates: true,
171
- }}>
172
+ }}
173
+ >
172
174
  <DropdownWrapper id="selectCategory" offsetDropdown={offsetDropDown}>
173
175
  <DropdownButton aria-controls={ariaControlId} type="button" onClick={() => onSelect()}>
174
176
  <span>{t('ndlaFilm.search.categoryFromNdla')}</span>
@@ -180,7 +182,8 @@ const CategorySelect = ({ resourceTypes, resourceTypeSelected, ariaControlId, on
180
182
  ref={(el) => updateRef(el, resourceType.id)}
181
183
  onClick={() => onSelect(resourceType.id)}
182
184
  data-id={resourceType.id}
183
- key={resourceType.id}>
185
+ key={resourceType.id}
186
+ >
184
187
  <span>{resourceType.name}</span>
185
188
  </DropdownButton>
186
189
  ))}
@@ -43,13 +43,15 @@ const FilmContentCard = ({
43
43
  to={path}
44
44
  aria-describedby={contentTypeId}
45
45
  columnWidth={columnWidth}
46
- style={{ marginRight: `${distanceBetweenItems}px` }}>
46
+ style={{ marginRight: `${distanceBetweenItems}px` }}
47
+ >
47
48
  <StyledImage
48
49
  role="img"
49
50
  columnWidth={columnWidth}
50
51
  style={{
51
52
  backgroundImage: `url(${backgroundImage}?${makeSrcQueryString(600)})`,
52
- }}>
53
+ }}
54
+ >
53
55
  {movieResourceTypes && !hideTags && (
54
56
  <FilmContentCardTags
55
57
  id={contentTypeId}
@@ -422,7 +422,8 @@ const FilmSlideshow = ({ autoSlide = false, slideshow = [], slideInterval = 5000
422
422
  style={{
423
423
  width: slideshowWidth,
424
424
  transform: getSlidePosition(slideIndex),
425
- }}>
425
+ }}
426
+ >
426
427
  {renderSlideItem(slideshow[slideshow.length - 1])}
427
428
  {slideshow.map(renderSlideItem)}
428
429
  {renderSlideItem(slideshow[0])}
@@ -98,7 +98,8 @@ const NavigationArrow = ({ slideIndexTarget, gotoSlide, rightArrow }: Props) =>
98
98
  tabIndex={-1}
99
99
  onClick={() => {
100
100
  gotoSlide(slideIndexTarget, true);
101
- }}>
101
+ }}
102
+ >
102
103
  <Chevron css={chevronCss} />
103
104
  </NavigationArrowButton>
104
105
  </StyledNavigationArrow>
@@ -71,7 +71,8 @@ const SlideshowIndicator = ({ slideshow, activeSlide, gotoSlide }: Props) => {
71
71
  active={index === activeSlide}
72
72
  key={`indicator_${index}`}
73
73
  type="button"
74
- onClick={() => gotoSlide(index, true)}>
74
+ onClick={() => gotoSlide(index, true)}
75
+ >
75
76
  <span />
76
77
  </SlideshowIndicatorDot>
77
78
  ))}
@@ -233,7 +233,8 @@ export const NavigationBox = ({
233
233
  <StyledListElementWrapper
234
234
  isAdditionalResource={item.isAdditionalResource}
235
235
  lighter={colorMode === 'light'}
236
- selected={item.selected}>
236
+ selected={item.selected}
237
+ >
237
238
  <ListElementType
238
239
  to={item.url ?? ''}
239
240
  colorTheme={item.selected ? 'darker' : colorMode}
@@ -244,12 +245,14 @@ export const NavigationBox = ({
244
245
  if (onClick) {
245
246
  onClick(e, item.id);
246
247
  }
247
- }}>
248
+ }}
249
+ >
248
250
  <StyledButtonContent>
249
251
  <StyledButtonContentText
250
252
  isAdditionalResource={item.isAdditionalResource}
251
253
  isRestrictedResource={item.isRestrictedResource}
252
- lighter={colorMode === 'light'}>
254
+ lighter={colorMode === 'light'}
255
+ >
253
256
  <StyledMarksWrapper>
254
257
  {item.isAdditionalResource && (
255
258
  <StyledAdditionalResourceMark lighter={colorMode === 'light'} selected={item.selected}>
@@ -150,7 +150,8 @@ export const NavigationTopicAbout = ({
150
150
  variant="link"
151
151
  onClick={() => {
152
152
  onToggleShowContent();
153
- }}>
153
+ }}
154
+ >
154
155
  {showContent ? (
155
156
  <>
156
157
  {t('navigation.showShorterDescription')} <ChevronUp />
@@ -81,7 +81,8 @@ const ConceptNotion = ({ concept, disableScripts, type, hideIconsAndAuthors, fig
81
81
  licenseString={concept.copyright?.license?.license ?? ''}
82
82
  type="concept"
83
83
  hideIconsAndAuthors={hideIconsAndAuthors}
84
- figureType={figureType}>
84
+ figureType={figureType}
85
+ >
85
86
  <UINotion
86
87
  id={notionId}
87
88
  title={concept.title}
@@ -108,7 +109,8 @@ const ConceptNotion = ({ concept, disableScripts, type, hideIconsAndAuthors, fig
108
109
  source={concept.source}
109
110
  />
110
111
  </>
111
- }>
112
+ }
113
+ >
112
114
  {concept.visualElement.image && (
113
115
  <NotionImage
114
116
  type={type}
@@ -146,7 +148,8 @@ const ConceptNotion = ({ concept, disableScripts, type, hideIconsAndAuthors, fig
146
148
  source={concept.source}
147
149
  />
148
150
  </>
149
- }>
151
+ }
152
+ >
150
153
  {concept.image && (
151
154
  <NotionImage
152
155
  type={type}
@@ -158,7 +161,8 @@ const ConceptNotion = ({ concept, disableScripts, type, hideIconsAndAuthors, fig
158
161
  </Notion>
159
162
  </ImageWrapper>
160
163
  ) : undefined
161
- }></UINotion>
164
+ }
165
+ ></UINotion>
162
166
  </FigureNotion>
163
167
  );
164
168
  };
@@ -72,7 +72,8 @@ const FigureNotion = ({
72
72
  reuseLabel={t(`${type}.reuse`)}
73
73
  authors={authors}
74
74
  licenseRights={license.rights}
75
- hideIconsAndAuthors={hideIconsAndAuthors}>
75
+ hideIconsAndAuthors={hideIconsAndAuthors}
76
+ >
76
77
  <FigureLicenseDialog
77
78
  id={id}
78
79
  authors={groupedAuthors}
@@ -86,7 +87,8 @@ const FigureNotion = ({
86
87
  source: t('source'),
87
88
  learnAboutLicenses: t('license.learnMore'),
88
89
  title: t('title'),
89
- }}>
90
+ }}
91
+ >
90
92
  {licenseButtons}
91
93
  </FigureLicenseDialog>
92
94
  </FigureCaption>
@@ -66,7 +66,8 @@ const NotionVisualElement = ({ visualElement, id, figureId }: Props) => {
66
66
  copyright={visualElement.copyright}
67
67
  licenseString={visualElement.copyright?.license?.license ?? ''}
68
68
  licenseButtons={visualElement.licenseButtons}
69
- type={type}>
69
+ type={type}
70
+ >
70
71
  {visualElement.image?.src ? (
71
72
  <img src={visualElement.image?.src} alt={visualElement.image.alt} />
72
73
  ) : (
@@ -61,7 +61,8 @@ const ProgrammeSubjects = ({ grades, onNavigate, selectedGrade = 'vg1' }: Props)
61
61
  colorTheme={item !== grade ? 'lighter' : undefined}
62
62
  shape="pill"
63
63
  size="normal"
64
- aria-current={current}>
64
+ aria-current={current}
65
+ >
65
66
  {item.name}
66
67
  </SafeLinkButton>
67
68
  </li>
@@ -83,7 +83,8 @@ const RelatedArticleList = ({ messages, children, articleCount, dangerouslySetIn
83
83
  data-type="related-article-button"
84
84
  data-showmore={messages.showMore}
85
85
  data-showless={messages.showLess}
86
- variant="outline">
86
+ variant="outline"
87
+ >
87
88
  {messages.showMore}
88
89
  </ButtonV2>
89
90
  )}
@@ -241,7 +241,8 @@ const ResourceItem = ({
241
241
  hidden={hidden && !active}
242
242
  active={active}
243
243
  additional={additional}
244
- extraBottomMargin={extraBottomMargin}>
244
+ extraBottomMargin={extraBottomMargin}
245
+ >
245
246
  <ResourceWrapper>
246
247
  <ContentBadgeWrapper>
247
248
  <ContentTypeBadge type={contentType ?? ''} background border={false} />
@@ -199,7 +199,8 @@ const ResourcesTopicTitle = ({
199
199
  <TooltipButton id={tooltipId} aria-label={t('resource.dialogTooltip')}>
200
200
  <HelpIcon invertedStyle={invertedStyle} />
201
201
  </TooltipButton>
202
- }>
202
+ }
203
+ >
203
204
  {(onClose: () => void) => (
204
205
  <>
205
206
  <ModalHeader>
@@ -46,7 +46,8 @@ const ActiveFilterContent = forwardRef<HTMLButtonElement, Props>(({ filter, onFi
46
46
  aria-label={ariaLabel}
47
47
  type="button"
48
48
  ref={ref}
49
- onClick={() => onFilterRemove(filter.value, filter.filterName)}>
49
+ onClick={() => onFilterRemove(filter.value, filter.filterName)}
50
+ >
50
51
  <StyledActiveFilterTitle>{filter.title}</StyledActiveFilterTitle>
51
52
  <Cross />
52
53
  </StyledActiveFilter>
@@ -103,7 +103,8 @@ const ActiveFilters = ({ filters, onFilterRemove, showOnSmallScreen }: Props) =>
103
103
  <Tooltip
104
104
  tooltip={t('searchPage.searchFilterMessages.removeFilter', {
105
105
  filterName: filter.title,
106
- })}>
106
+ })}
107
+ >
107
108
  <ActiveFilterContent
108
109
  filter={filter}
109
110
  ariaLabel={t('searchPage.searchFilterMessages.removeFilter', {
@@ -138,7 +138,8 @@ const ContentTypeResult = ({
138
138
  if (onNavigate) {
139
139
  onNavigate();
140
140
  }
141
- }}>
141
+ }}
142
+ >
142
143
  {unGrouped && !ignoreContentTypeBadge && (
143
144
  <ContentTypeBadge type={resource.contentType ?? ''} size="x-small" background border />
144
145
  )}
@@ -156,7 +157,8 @@ const ContentTypeResult = ({
156
157
  css={[showAllButtonStyle, shouldHighlightShowAllButton && noWidthhighlightStyle]}
157
158
  data-highlighted={shouldHighlightShowAllButton}
158
159
  onClick={() => toggleShowAll(!showAll)}
159
- tabIndex={-1}>
160
+ tabIndex={-1}
161
+ >
160
162
  {showAll ? messages.showLessResultLabel : messages.allResultLabel}
161
163
  {showAll ? <ChevronUp /> : <ChevronDown />}
162
164
  </ButtonV2>
@@ -134,7 +134,8 @@ const SearchField = ({
134
134
  onChange('');
135
135
  onFocus?.();
136
136
  inputRef?.current?.focus();
137
- }}>
137
+ }}
138
+ >
138
139
  {t('welcomePage.resetSearch')}
139
140
  </button>
140
141
  )}
@@ -143,7 +144,8 @@ const SearchField = ({
143
144
  {...classes('button', 'searchIcon')}
144
145
  type="submit"
145
146
  value="Search"
146
- aria-label={t('siteNav.search')}>
147
+ aria-label={t('siteNav.search')}
148
+ >
147
149
  <SearchIcon />
148
150
  </button>
149
151
  </div>
@@ -351,7 +351,8 @@ export const SearchResultList = ({ results, loading }: SearchResultListProps) =>
351
351
  key={`search_result_item_${typeof item.url === 'object' ? item.url.href : item.url}`}
352
352
  item={item}
353
353
  additionalContentTooltip={t('resource.tooltipAdditionalTopic')}
354
- subjectsLabel={t('searchPage.searchResultListMessages.subjectsLabel')}>
354
+ subjectsLabel={t('searchPage.searchResultListMessages.subjectsLabel')}
355
+ >
355
356
  {item.children}
356
357
  </SearchResultItem>
357
358
  ))}
@@ -318,7 +318,8 @@ const SearchResultSleeve = ({
318
318
  <StyledSearchLink
319
319
  css={keyboardPathNavigation === GO_TO_SEARCHPAGE && highlightStyle}
320
320
  to={allResultUrl}
321
- tabIndex={-1}>
321
+ tabIndex={-1}
322
+ >
322
323
  <SearchIcon className="c-icon--22" />
323
324
  <strong ref={searchAllRef}>{searchString}</strong>
324
325
  <small>{t('welcomePage.searchAllInfo')}</small>
@@ -327,7 +328,8 @@ const SearchResultSleeve = ({
327
328
  <StyledSearchLink
328
329
  css={keyboardPathNavigation === GO_TO_SUGGESTION && highlightStyle}
329
330
  to={suggestionUrl}
330
- tabIndex={-1}>
331
+ tabIndex={-1}
332
+ >
331
333
  <SearchIcon className="c-icon--22" />
332
334
  <small>{t('searchPage.resultType.searchPhraseSuggestion')}</small>
333
335
  <strong ref={searchSuggestionRef}>{suggestion}</strong>
@@ -64,7 +64,8 @@ const ToggleSearchButton = ({ children, ndlaFilm, hideOnNarrowScreen, hideOnWide
64
64
  hideOnNarrowScreen={hideOnNarrowScreen}
65
65
  hideOnWideScreen={hideOnWideScreen}
66
66
  type="button"
67
- {...rest}>
67
+ {...rest}
68
+ >
68
69
  <StyledSpan>{children}</StyledSpan>
69
70
  <Search />
70
71
  </StyledButton>
@@ -44,7 +44,8 @@ const ActiveFilterContent = forwardRef<HTMLButtonElement, Props>(({ filter, onFi
44
44
  })}
45
45
  ref={ref}
46
46
  shape="pill"
47
- onClick={() => onFilterRemove(filter.value, filter.name)}>
47
+ onClick={() => onFilterRemove(filter.value, filter.name)}
48
+ >
48
49
  <StyledActiveFilterTitle>{filter.title}</StyledActiveFilterTitle>
49
50
  <Cross />
50
51
  </StyledButton>