@ndla/ui 37.0.1 → 37.0.4

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 (82) hide show
  1. package/es/Article/ArticleByline.js +7 -5
  2. package/es/AudioPlayer/SpeechControl.js +13 -13
  3. package/es/ContentTypeBadge/ContentTypeBadge.js +5 -5
  4. package/es/Embed/AudioEmbed.js +3 -2
  5. package/es/Embed/BrightcoveEmbed.js +5 -4
  6. package/es/Embed/ConceptEmbed.js +11 -10
  7. package/es/Embed/ImageEmbed.js +2 -1
  8. package/es/Embed/conceptComponents.js +9 -7
  9. package/es/List/OrderedList.js +2 -6
  10. package/es/List/UnOrderedList.js +1 -1
  11. package/es/NDLAFilm/FilmMovieSearch.js +10 -8
  12. package/es/Resource/BlockResource.js +9 -9
  13. package/es/Resource/ListResource.js +13 -9
  14. package/es/Resource/resourceComponents.js +12 -12
  15. package/es/Typography/Heading.js +17 -7
  16. package/es/index.js +2 -1
  17. package/es/locale/messages-en.js +10 -2
  18. package/es/locale/messages-nb.js +10 -2
  19. package/es/locale/messages-nn.js +10 -2
  20. package/es/locale/messages-se.js +10 -2
  21. package/es/locale/messages-sma.js +10 -2
  22. package/es/model/ContentType.js +1 -1
  23. package/es/model/index.js +3 -2
  24. package/es/utils/resourceTypeColor.js +6 -0
  25. package/lib/Article/ArticleByline.js +7 -5
  26. package/lib/AudioPlayer/SpeechControl.js +14 -14
  27. package/lib/ContentTypeBadge/ContentTypeBadge.js +5 -5
  28. package/lib/Embed/AudioEmbed.js +3 -2
  29. package/lib/Embed/BrightcoveEmbed.js +5 -4
  30. package/lib/Embed/ConceptEmbed.js +11 -10
  31. package/lib/Embed/ImageEmbed.js +2 -1
  32. package/lib/Embed/conceptComponents.js +9 -7
  33. package/lib/List/OrderedList.js +1 -5
  34. package/lib/List/UnOrderedList.js +1 -1
  35. package/lib/NDLAFilm/FilmMovieSearch.js +10 -8
  36. package/lib/Resource/BlockResource.js +8 -8
  37. package/lib/Resource/ListResource.js +12 -8
  38. package/lib/Resource/resourceComponents.js +11 -11
  39. package/lib/Typography/Heading.d.ts +4 -5
  40. package/lib/Typography/Heading.js +17 -8
  41. package/lib/index.d.ts +2 -0
  42. package/lib/index.js +7 -0
  43. package/lib/locale/messages-en.d.ts +8 -0
  44. package/lib/locale/messages-en.js +10 -2
  45. package/lib/locale/messages-nb.d.ts +8 -0
  46. package/lib/locale/messages-nb.js +10 -2
  47. package/lib/locale/messages-nn.d.ts +8 -0
  48. package/lib/locale/messages-nn.js +10 -2
  49. package/lib/locale/messages-se.d.ts +8 -0
  50. package/lib/locale/messages-se.js +10 -2
  51. package/lib/locale/messages-sma.d.ts +8 -0
  52. package/lib/locale/messages-sma.js +10 -2
  53. package/lib/model/ContentType.d.ts +1 -1
  54. package/lib/model/ContentType.js +3 -3
  55. package/lib/model/index.d.ts +1 -0
  56. package/lib/model/index.js +2 -1
  57. package/lib/utils/resourceTypeColor.js +6 -0
  58. package/package.json +3 -3
  59. package/src/Article/ArticleByline.tsx +2 -2
  60. package/src/AudioPlayer/SpeechControl.tsx +9 -26
  61. package/src/ContentTypeBadge/ContentTypeBadge.tsx +5 -5
  62. package/src/Embed/AudioEmbed.tsx +7 -2
  63. package/src/Embed/BrightcoveEmbed.tsx +2 -1
  64. package/src/Embed/ConceptEmbed.tsx +2 -1
  65. package/src/Embed/ImageEmbed.tsx +2 -1
  66. package/src/Embed/conceptComponents.tsx +2 -1
  67. package/src/List/OrderedList.tsx +15 -16
  68. package/src/List/UnOrderedList.tsx +9 -2
  69. package/src/NDLAFilm/FilmMovieSearch.tsx +24 -25
  70. package/src/Resource/BlockResource.tsx +6 -2
  71. package/src/Resource/ListResource.tsx +7 -8
  72. package/src/Resource/resourceComponents.tsx +4 -2
  73. package/src/Typography/Heading.tsx +8 -8
  74. package/src/index.ts +2 -0
  75. package/src/locale/messages-en.ts +8 -0
  76. package/src/locale/messages-nb.ts +8 -0
  77. package/src/locale/messages-nn.ts +8 -0
  78. package/src/locale/messages-se.ts +8 -0
  79. package/src/locale/messages-sma.ts +8 -0
  80. package/src/model/ContentType.ts +1 -1
  81. package/src/model/index.ts +2 -1
  82. package/src/utils/resourceTypeColor.tsx +6 -0
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import styled from '@emotion/styled';
10
- import { fonts, spacing, spacingUnit } from '@ndla/core';
10
+ import { fonts, spacing } from '@ndla/core';
11
11
  import { forwardRef, HTMLAttributes } from 'react';
12
12
 
13
13
  export const generateListResets = () => {
@@ -21,24 +21,25 @@ export const generateListResets = () => {
21
21
  return styles;
22
22
  };
23
23
 
24
- const listSpacing = {
25
- xlarge: `${spacingUnit * 2.5}px`,
26
- xxlarge: `${spacingUnit * 3}px`,
27
- };
28
-
29
24
  const StyledOl = styled.ol`
30
25
  margin-top: 0;
31
- margin-left: 0;
26
+ margin-left: ${spacing.medium};
32
27
  ${fonts.sizes('18px', '29px')};
33
28
  list-style-type: none;
29
+ padding-left: ${spacing.medium} !important;
34
30
 
35
31
  // Child ordered lists
36
32
  ol {
37
- padding-left: ${spacing.normal};
33
+ padding-left: ${spacing.medium};
34
+ margin-left: 0;
38
35
  }
39
36
  // List item
40
37
  li {
41
38
  margin-top: ${spacing.normal};
39
+
40
+ p {
41
+ margin-bottom: ${spacing.normal} !important;
42
+ }
42
43
  }
43
44
 
44
45
  &[data-type='letters'] {
@@ -49,7 +50,7 @@ const StyledOl = styled.ol`
49
50
  position: absolute;
50
51
  transform: translateX(-100%);
51
52
  content: counter(item, upper-alpha) '.';
52
- padding-right: 0.25em;
53
+ padding-right: ${spacing.nsmall};
53
54
  }
54
55
 
55
56
  > ol[data-type='letters'] {
@@ -57,7 +58,6 @@ const StyledOl = styled.ol`
57
58
  content: counter(item, lower-alpha) '.';
58
59
  }
59
60
  ol[data-type='letters'] {
60
- padding-left: ${spacing.normal};
61
61
  > li:before {
62
62
  content: counter(item, lower-roman) '.';
63
63
  }
@@ -73,20 +73,19 @@ const StyledOl = styled.ol`
73
73
  &:before {
74
74
  position: absolute;
75
75
  transform: translateX(-100%);
76
- padding-right: 0.25em;
77
76
  content: counters(item, '.') '.';
77
+ padding-right: ${spacing.nsmall};
78
78
  }
79
79
 
80
80
  > ol:not([data-type='letters']) {
81
- padding-left: ${spacing.medium};
82
81
  > li {
82
+ padding-left: ${spacing.nsmall};
83
83
  > ol:not([data-type='letters']) {
84
- padding-left: ${spacing.large};
85
84
  > li {
85
+ padding-left: ${spacing.medium};
86
86
  > ol:not([data-type='letters']) {
87
- padding-left: ${listSpacing.xlarge};
88
- ol:not([data-type='letters']) {
89
- padding-left: ${listSpacing.xxlarge};
87
+ > li {
88
+ padding-left: ${spacing.large};
90
89
  }
91
90
  }
92
91
  }
@@ -12,6 +12,8 @@ import { forwardRef, HTMLAttributes } from 'react';
12
12
  import { generateListResets } from './OrderedList';
13
13
 
14
14
  const StyledUl = styled.ul`
15
+ padding-left: ${spacing.small} !important;
16
+ margin-left: ${spacing.medium} !important;
15
17
  > li {
16
18
  ::marker {
17
19
  color: ${colors.brand.secondary};
@@ -19,15 +21,20 @@ const StyledUl = styled.ul`
19
21
  }
20
22
  ul {
21
23
  list-style-image: none;
22
- padding-left: ${spacing.mediumlarge};
24
+ padding-left: ${spacing.small};
25
+
26
+ margin-left: 0 !important;
23
27
  }
24
28
  margin-top: 0;
25
- margin-left: 0;
26
29
  ${fonts.sizes('18px', '29px')};
27
30
 
28
31
  // List item
29
32
  li {
33
+ padding-left: ${spacing.nsmall};
30
34
  margin-top: ${spacing.normal};
35
+ p {
36
+ margin-bottom: ${spacing.normal} !important;
37
+ }
31
38
  }
32
39
 
33
40
  // Child unordered lists
@@ -27,32 +27,31 @@ const TopicNavigation = styled.div`
27
27
  align-items: flex-start;
28
28
  padding: 0 ${spacing.normal};
29
29
  }
30
- ul {
31
- list-style-type: none;
32
- list-style-image: none;
33
- display: flex;
34
- align-items: flex-start;
35
- flex-wrap: wrap;
36
- padding: 0;
37
- margin: ${spacing.small} 0;
38
- ${mq.range({ from: breakpoints.tablet })} {
39
- padding-left: ${spacing.normal};
40
- }
41
- li {
42
- padding: 0;
43
- width: 100%;
44
- ${mq.range({ from: breakpoints.tablet })} {
45
- width: 50%;
46
- }
47
- a {
48
- color: #fff;
49
- &:hover,
50
- &:focus {
51
- color: ${colors.brand.light};
52
- }
30
+ `;
31
+
32
+ const StyledUl = styled.ul`
33
+ display: flex;
34
+ flex-direction: column;
35
+ list-style-type: none;
36
+ list-style-image: none;
37
+ li {
38
+ flex: 1;
39
+ width: 100%;
40
+ a {
41
+ color: ${colors.white};
42
+ &:hover,
43
+ &:focus-within {
44
+ color: ${colors.brand.light};
53
45
  }
54
46
  }
55
47
  }
48
+ ${mq.range({ from: breakpoints.tablet })} {
49
+ display: grid;
50
+ grid-template-rows: auto auto auto auto;
51
+ grid-template-columns: 1fr;
52
+ grid-auto-flow: column;
53
+ column-gap: ${spacing.normal};
54
+ }
56
55
  `;
57
56
 
58
57
  interface Props {
@@ -81,7 +80,7 @@ const FilmMovieSearch = ({
81
80
  {`${t('ndlaFilm.subjectsInMovies')}:`}
82
81
  </StyledHeadingH2>
83
82
  <nav className="u-12/12 u-8/12@tablet" aria-labelledby={skipToContentId}>
84
- <ul>
83
+ <StyledUl>
85
84
  {topics.map((topic) => (
86
85
  <li key={topic.id}>
87
86
  <SafeLink to={topic.path} key={topic.id}>
@@ -89,7 +88,7 @@ const FilmMovieSearch = ({
89
88
  </SafeLink>
90
89
  </li>
91
90
  ))}
92
- </ul>
91
+ </StyledUl>
93
92
  </nav>
94
93
  </TopicNavigation>
95
94
  <CategorySelect
@@ -22,7 +22,7 @@ import {
22
22
  StyledContentIconWrapper,
23
23
  } from './resourceComponents';
24
24
  import ContentLoader from '../ContentLoader';
25
- import { contentTypeMapping } from '../model/ContentType';
25
+ import { contentTypeMapping, resourceEmbedTypeMapping } from '../model/ContentType';
26
26
  import { SettingsMenu } from '../MyNdla';
27
27
 
28
28
  const BlockElementWrapper = styled.div`
@@ -174,7 +174,11 @@ const BlockResource = ({
174
174
  <BlockImage
175
175
  image={resourceImage}
176
176
  loading={isLoading}
177
- contentType={contentTypeMapping[firstResourceType] ?? contentTypeMapping['default']}
177
+ contentType={
178
+ contentTypeMapping[firstResourceType] ??
179
+ resourceEmbedTypeMapping[firstResourceType] ??
180
+ contentTypeMapping['default']
181
+ }
178
182
  />
179
183
  </ImageWrapper>
180
184
  <BlockInfoWrapper>
@@ -22,7 +22,7 @@ import {
22
22
  } from './resourceComponents';
23
23
  import ContentLoader from '../ContentLoader';
24
24
  import ContentTypeBadge from '../ContentTypeBadge';
25
- import { contentTypeMapping, resourceTypeMapping } from '../model/ContentType';
25
+ import { contentTypeMapping, resourceEmbedTypeMapping } from '../model/ContentType';
26
26
  import { SettingsMenu } from '../MyNdla';
27
27
 
28
28
  const ListResourceWrapper = styled.div`
@@ -131,14 +131,15 @@ interface ListResourceImageProps {
131
131
  loading?: boolean;
132
132
  type: 'normal' | 'compact';
133
133
  contentType: string;
134
+ background?: boolean;
134
135
  }
135
136
 
136
- const ListResourceImage = ({ resourceImage, loading, type, contentType }: ListResourceImageProps) => {
137
+ const ListResourceImage = ({ resourceImage, loading, type, contentType, background }: ListResourceImageProps) => {
137
138
  if (!loading) {
138
139
  if (resourceImage.src === '') {
139
140
  return (
140
141
  <StyledContentIconWrapper contentType={contentType}>
141
- <ContentTypeBadge type={contentType} size="x-small" />
142
+ <ContentTypeBadge type={contentType} background={background} size="x-small" />
142
143
  </StyledContentIconWrapper>
143
144
  );
144
145
  } else {
@@ -221,6 +222,7 @@ const ListResource = ({
221
222
  const showDescription = description !== undefined;
222
223
  const imageType = showDescription ? 'normal' : 'compact';
223
224
  const firstContentType = resourceTypes?.[0]?.id ?? '';
225
+ const embedResourceType = resourceEmbedTypeMapping[firstContentType];
224
226
 
225
227
  return (
226
228
  <ListResourceWrapper id={id}>
@@ -229,11 +231,8 @@ const ListResource = ({
229
231
  resourceImage={resourceImage}
230
232
  loading={isLoading}
231
233
  type={imageType}
232
- contentType={
233
- contentTypeMapping[firstContentType] ??
234
- resourceTypeMapping[firstContentType] ??
235
- contentTypeMapping['default']
236
- }
234
+ background={!!embedResourceType}
235
+ contentType={contentTypeMapping[firstContentType] ?? embedResourceType ?? contentTypeMapping['default']}
237
236
  />
238
237
  </ImageWrapper>
239
238
  <TopicAndTitleWrapper>
@@ -15,7 +15,7 @@ import SafeLink from '@ndla/safelink';
15
15
  import { useNavigate } from 'react-router-dom';
16
16
  import { HashTag } from '@ndla/icons/common';
17
17
  import resourceTypeColor from '../utils/resourceTypeColor';
18
- import { resourceTypeMapping } from '../model/ContentType';
18
+ import { resourceEmbedTypeMapping } from '../model/ContentType';
19
19
 
20
20
  export interface ResourceImageProps {
21
21
  alt: string;
@@ -198,7 +198,9 @@ export const ResourceTypeList = ({ resourceTypes }: ResourceTypeListProps) => {
198
198
  <StyledResourceTypeList aria-label={t('navigation.topics')}>
199
199
  {resourceTypes.map((resource, i) => (
200
200
  <StyledResourceListElement key={resource.id}>
201
- {resourceTypeMapping[resource.id] ? t(`embed.type.${resourceTypeMapping[resource.id]}`) : resource.name}
201
+ {resourceEmbedTypeMapping[resource.id]
202
+ ? t(`embed.type.${resourceEmbedTypeMapping[resource.id]}`)
203
+ : resource.name}
202
204
  {i !== resourceTypes.length - 1 && <StyledTopicDivider aria-hidden="true">•</StyledTopicDivider>}
203
205
  </StyledResourceListElement>
204
206
  ))}
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { css } from '@emotion/react';
10
10
  import { breakpoints, fonts, mq, spacing } from '@ndla/core';
11
- import { HTMLAttributes, ReactNode } from 'react';
11
+ import { ComponentProps, ElementType, ReactNode } from 'react';
12
12
  import { HeadingLevel } from '../types';
13
13
 
14
14
  const style = css`
@@ -63,8 +63,8 @@ const style = css`
63
63
 
64
64
  type AllowedElements = HeadingLevel | 'p' | 'span';
65
65
 
66
- interface Props<T extends AllowedElements> extends HTMLAttributes<T> {
67
- element: HeadingLevel | 'p' | 'span';
66
+ interface Props<T extends AllowedElements> {
67
+ element: T;
68
68
  headingStyle: 'h1' | 'h2' | 'h3' | 'list-title' | 'default';
69
69
  serif?: boolean;
70
70
  /**
@@ -75,19 +75,19 @@ interface Props<T extends AllowedElements> extends HTMLAttributes<T> {
75
75
  */
76
76
  margin?: 'xlarge' | 'large' | 'normal' | 'small' | 'none';
77
77
  children: ReactNode;
78
- className?: string;
79
78
  }
80
79
 
81
80
  const Heading = <T extends AllowedElements>({
82
- element: Element,
81
+ element,
83
82
  children,
84
83
  headingStyle,
85
84
  margin = 'normal',
86
85
  serif,
87
- className,
88
- }: Props<T>) => {
86
+ ...rest
87
+ }: Props<T> & ComponentProps<T>) => {
88
+ const Element = element as ElementType;
89
89
  return (
90
- <Element css={style} data-serif={serif} data-style={headingStyle} data-margin={margin} className={className}>
90
+ <Element css={style} data-serif={serif} data-style={headingStyle} data-margin={margin} {...rest}>
91
91
  {children}
92
92
  </Element>
93
93
  );
package/src/index.ts CHANGED
@@ -277,3 +277,5 @@ export { KeyFigure } from './KeyFigure';
277
277
  export { default as ContactBlock } from './ContactBlock';
278
278
  export type { HeartButtonType } from './Embed';
279
279
  export { CampaignBlock } from './CampaignBlock';
280
+ export { Heading } from './Typography';
281
+ export type { HeadingLevel } from './types';
@@ -478,6 +478,7 @@ const messages = {
478
478
  onlyTeacher: 'This resource is accessible only to teachers who are logged in with Feide.',
479
479
  },
480
480
  possiblyOutdated: 'The article is outdated',
481
+ references: 'References',
481
482
  },
482
483
  competenceGoals: {
483
484
  competenceGoal: 'competence-goal',
@@ -694,6 +695,12 @@ const messages = {
694
695
  'assessment-resources': 'Assessment resource',
695
696
  topic: 'Topic',
696
697
  'multidisciplinary-topic': 'Multidisciplinary case',
698
+ image: 'Image',
699
+ concept: 'Concept',
700
+ audio: 'Audio',
701
+ podcast: 'Podcast',
702
+ h5p: 'H5P',
703
+ video: 'Video',
697
704
  },
698
705
  modal: {
699
706
  closeModal: 'Close',
@@ -990,6 +997,7 @@ const messages = {
990
997
  },
991
998
  },
992
999
  audio: {
1000
+ play: 'Play',
993
1001
  download: 'Download audio',
994
1002
  reuse: 'Use audio',
995
1003
  error: {
@@ -477,6 +477,7 @@ const messages = {
477
477
  onlyTeacher: 'Denne ressursen er bare tilgjengelig for lærere som er pålogget med Feide.',
478
478
  },
479
479
  possiblyOutdated: 'Artikkelen er foreldet.',
480
+ references: 'Referanser',
480
481
  },
481
482
  competenceGoals: {
482
483
  competenceGoal: 'kompetansemål',
@@ -693,6 +694,12 @@ const messages = {
693
694
  'assessment-resources': 'Vurderingsressurs',
694
695
  topic: 'Emne',
695
696
  'multidisciplinary-topic': 'Tverrfaglig case',
697
+ image: 'Bilde',
698
+ concept: 'Forklaring',
699
+ audio: 'Lyd',
700
+ podcast: 'Podkast',
701
+ h5p: 'H5P',
702
+ video: 'Video',
696
703
  },
697
704
  modal: {
698
705
  closeModal: 'Lukk',
@@ -989,6 +996,7 @@ const messages = {
989
996
  },
990
997
  },
991
998
  audio: {
999
+ play: 'Spill av',
992
1000
  download: 'Last ned lydfil',
993
1001
  reuse: 'Bruk lydfil',
994
1002
  error: {
@@ -477,6 +477,7 @@ const messages = {
477
477
  onlyTeacher: 'Denne ressursen er berre tilgjengeleg for lærarar som er pålogga med Feide.',
478
478
  },
479
479
  possiblyOutdated: 'Artikkelen er foreldet.',
480
+ references: 'Referanser',
480
481
  },
481
482
  competenceGoals: {
482
483
  competenceGoal: 'kompetansemål',
@@ -693,6 +694,12 @@ const messages = {
693
694
  'assessment-resources': 'Vurderingsressurs',
694
695
  topic: 'Emne',
695
696
  'multidisciplinary-topic': 'Tverrfagleg case',
697
+ image: 'Bilde',
698
+ concept: 'Forklaring',
699
+ audio: 'Lyd',
700
+ podcast: 'Podkast',
701
+ h5p: 'H5P',
702
+ video: 'Video',
696
703
  },
697
704
  modal: {
698
705
  closeModal: 'Lukk',
@@ -989,6 +996,7 @@ const messages = {
989
996
  },
990
997
  },
991
998
  audio: {
999
+ play: 'Spill av',
992
1000
  download: 'Last ned lydfil',
993
1001
  reuse: 'Bruk lydfil',
994
1002
  error: {
@@ -478,6 +478,7 @@ const messages = {
478
478
  onlyTeacher: 'Dát resursa lea dušše olamuttus oahpaheddjiide geat leat Feide bokte sisaloggejuvvon.',
479
479
  },
480
480
  possiblyOutdated: 'Artihkal lea boarásmuvvan.',
481
+ references: 'Referanser',
481
482
  },
482
483
  competenceGoals: {
483
484
  competenceGoal: 'Gealbomihttomearri',
@@ -694,6 +695,12 @@ const messages = {
694
695
  'assessment-resources': 'Árvoštallanresursa',
695
696
  topic: 'Fáddá',
696
697
  'multidisciplinary-topic': 'Fágaidrasttideaddji fáddá',
698
+ image: 'Bilde',
699
+ concept: 'Forklaring',
700
+ audio: 'Lyd',
701
+ podcast: 'Podkast',
702
+ h5p: 'H5P',
703
+ video: 'Video',
697
704
  },
698
705
  modal: {
699
706
  closeModal: 'Govčča',
@@ -990,6 +997,7 @@ const messages = {
990
997
  },
991
998
  },
992
999
  audio: {
1000
+ play: 'Spill av',
993
1001
  download: 'Viečča jietnafiilla',
994
1002
  reuse: 'Geavat jietnafiilla',
995
1003
  error: {
@@ -478,6 +478,7 @@ const messages = {
478
478
  onlyTeacher: 'Daate vierhtie ajve dïllesisnie lohkehtæjjide mah tjaangeme Feidine.',
479
479
  },
480
480
  possiblyOutdated: 'Artikkelen er foreldet.',
481
+ references: 'Referanser',
481
482
  },
482
483
  competenceGoals: {
483
484
  competenceGoal: 'maahtoe-ulmie',
@@ -697,6 +698,12 @@ const messages = {
697
698
  'assessment-resources': 'Vuarjasjimmievierhtie',
698
699
  topic: 'Teema',
699
700
  'multidisciplinary-topic': 'Tverrfaglig case',
701
+ image: 'Bilde',
702
+ concept: 'Forklaring',
703
+ audio: 'Lyd',
704
+ podcast: 'Podkast',
705
+ h5p: 'H5P',
706
+ video: 'Video',
700
707
  },
701
708
  modal: {
702
709
  closeModal: 'Dahph',
@@ -993,6 +1000,7 @@ const messages = {
993
1000
  },
994
1001
  },
995
1002
  audio: {
1003
+ play: 'Spill av',
996
1004
  download: 'Veedtjh tjoeje-fijlem',
997
1005
  reuse: 'Nuhtjh tjoeje-fijlem',
998
1006
  error: {
@@ -57,7 +57,7 @@ export const contentTypeMapping: Record<string, string> = {
57
57
  default: SUBJECT_MATERIAL,
58
58
  };
59
59
 
60
- export const resourceTypeMapping: Record<string, string> = {
60
+ export const resourceEmbedTypeMapping: Record<string, string> = {
61
61
  image: 'image',
62
62
  video: 'video',
63
63
  concept: 'concept',
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
 
9
- import { contentTypes, contentTypeMapping } from './ContentType';
9
+ import { contentTypes, contentTypeMapping, resourceEmbedTypeMapping } from './ContentType';
10
10
  import * as subjectCategories from './SubjectCategories';
11
11
  import * as subjectTypes from './SubjectTypes';
12
12
 
@@ -15,6 +15,7 @@ const model = {
15
15
  subjectCategories,
16
16
  subjectTypes,
17
17
  contentTypeMapping,
18
+ resourceEmbedTypeMapping,
18
19
  };
19
20
 
20
21
  export default model;
@@ -8,6 +8,7 @@
8
8
 
9
9
  import { colors } from '@ndla/core';
10
10
  import constants from '../model';
11
+ import { resourceEmbedTypeMapping } from '../model/ContentType';
11
12
  const { contentTypes } = constants;
12
13
 
13
14
  export const resourceTypeColor = (type: string) => {
@@ -30,6 +31,11 @@ export const resourceTypeColor = (type: string) => {
30
31
  return colors.learningPath.light;
31
32
  case contentTypes.MULTIDISCIPLINARY_TOPIC:
32
33
  return colors.learningPath.background;
34
+ case resourceEmbedTypeMapping.image:
35
+ case resourceEmbedTypeMapping.video:
36
+ case resourceEmbedTypeMapping.concept:
37
+ case resourceEmbedTypeMapping.audio:
38
+ return colors.brand.greyLight;
33
39
  default:
34
40
  return '';
35
41
  }