@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
@@ -443,7 +443,8 @@ var messages = _objectSpread(_objectSpread({
443
443
  access: {
444
444
  onlyTeacher: 'This resource is accessible only to teachers who are logged in with Feide.'
445
445
  },
446
- possiblyOutdated: 'The article is outdated'
446
+ possiblyOutdated: 'The article is outdated',
447
+ references: 'References'
447
448
  },
448
449
  competenceGoals: {
449
450
  competenceGoal: 'competence-goal',
@@ -659,7 +660,13 @@ var messages = _objectSpread(_objectSpread({
659
660
  'source-material': 'Source material',
660
661
  'assessment-resources': 'Assessment resource',
661
662
  topic: 'Topic',
662
- 'multidisciplinary-topic': 'Multidisciplinary case'
663
+ 'multidisciplinary-topic': 'Multidisciplinary case',
664
+ image: 'Image',
665
+ concept: 'Concept',
666
+ audio: 'Audio',
667
+ podcast: 'Podcast',
668
+ h5p: 'H5P',
669
+ video: 'Video'
663
670
  },
664
671
  modal: {
665
672
  closeModal: 'Close'
@@ -951,6 +958,7 @@ var messages = _objectSpread(_objectSpread({
951
958
  }
952
959
  },
953
960
  audio: {
961
+ play: 'Play',
954
962
  download: 'Download audio',
955
963
  reuse: 'Use audio',
956
964
  error: {
@@ -715,6 +715,7 @@ declare const messages: {
715
715
  onlyTeacher: string;
716
716
  };
717
717
  possiblyOutdated: string;
718
+ references: string;
718
719
  };
719
720
  competenceGoals: {
720
721
  competenceGoal: string;
@@ -931,6 +932,12 @@ declare const messages: {
931
932
  'assessment-resources': string;
932
933
  topic: string;
933
934
  'multidisciplinary-topic': string;
935
+ image: string;
936
+ concept: string;
937
+ audio: string;
938
+ podcast: string;
939
+ h5p: string;
940
+ video: string;
934
941
  };
935
942
  modal: {
936
943
  closeModal: string;
@@ -1222,6 +1229,7 @@ declare const messages: {
1222
1229
  };
1223
1230
  };
1224
1231
  audio: {
1232
+ play: string;
1225
1233
  download: string;
1226
1234
  reuse: string;
1227
1235
  error: {
@@ -443,7 +443,8 @@ var messages = _objectSpread(_objectSpread({
443
443
  access: {
444
444
  onlyTeacher: 'Denne ressursen er bare tilgjengelig for lærere som er pålogget med Feide.'
445
445
  },
446
- possiblyOutdated: 'Artikkelen er foreldet.'
446
+ possiblyOutdated: 'Artikkelen er foreldet.',
447
+ references: 'Referanser'
447
448
  },
448
449
  competenceGoals: {
449
450
  competenceGoal: 'kompetansemål',
@@ -659,7 +660,13 @@ var messages = _objectSpread(_objectSpread({
659
660
  'source-material': 'Kildemateriale',
660
661
  'assessment-resources': 'Vurderingsressurs',
661
662
  topic: 'Emne',
662
- 'multidisciplinary-topic': 'Tverrfaglig case'
663
+ 'multidisciplinary-topic': 'Tverrfaglig case',
664
+ image: 'Bilde',
665
+ concept: 'Forklaring',
666
+ audio: 'Lyd',
667
+ podcast: 'Podkast',
668
+ h5p: 'H5P',
669
+ video: 'Video'
663
670
  },
664
671
  modal: {
665
672
  closeModal: 'Lukk'
@@ -951,6 +958,7 @@ var messages = _objectSpread(_objectSpread({
951
958
  }
952
959
  },
953
960
  audio: {
961
+ play: 'Spill av',
954
962
  download: 'Last ned lydfil',
955
963
  reuse: 'Bruk lydfil',
956
964
  error: {
@@ -715,6 +715,7 @@ declare const messages: {
715
715
  onlyTeacher: string;
716
716
  };
717
717
  possiblyOutdated: string;
718
+ references: string;
718
719
  };
719
720
  competenceGoals: {
720
721
  competenceGoal: string;
@@ -931,6 +932,12 @@ declare const messages: {
931
932
  'assessment-resources': string;
932
933
  topic: string;
933
934
  'multidisciplinary-topic': string;
935
+ image: string;
936
+ concept: string;
937
+ audio: string;
938
+ podcast: string;
939
+ h5p: string;
940
+ video: string;
934
941
  };
935
942
  modal: {
936
943
  closeModal: string;
@@ -1222,6 +1229,7 @@ declare const messages: {
1222
1229
  };
1223
1230
  };
1224
1231
  audio: {
1232
+ play: string;
1225
1233
  download: string;
1226
1234
  reuse: string;
1227
1235
  error: {
@@ -443,7 +443,8 @@ var messages = _objectSpread(_objectSpread({
443
443
  access: {
444
444
  onlyTeacher: 'Denne ressursen er berre tilgjengeleg for lærarar som er pålogga med Feide.'
445
445
  },
446
- possiblyOutdated: 'Artikkelen er foreldet.'
446
+ possiblyOutdated: 'Artikkelen er foreldet.',
447
+ references: 'Referanser'
447
448
  },
448
449
  competenceGoals: {
449
450
  competenceGoal: 'kompetansemål',
@@ -659,7 +660,13 @@ var messages = _objectSpread(_objectSpread({
659
660
  'source-material': 'Kjeldemateriale',
660
661
  'assessment-resources': 'Vurderingsressurs',
661
662
  topic: 'Emne',
662
- 'multidisciplinary-topic': 'Tverrfagleg case'
663
+ 'multidisciplinary-topic': 'Tverrfagleg case',
664
+ image: 'Bilde',
665
+ concept: 'Forklaring',
666
+ audio: 'Lyd',
667
+ podcast: 'Podkast',
668
+ h5p: 'H5P',
669
+ video: 'Video'
663
670
  },
664
671
  modal: {
665
672
  closeModal: 'Lukk'
@@ -951,6 +958,7 @@ var messages = _objectSpread(_objectSpread({
951
958
  }
952
959
  },
953
960
  audio: {
961
+ play: 'Spill av',
954
962
  download: 'Last ned lydfil',
955
963
  reuse: 'Bruk lydfil',
956
964
  error: {
@@ -715,6 +715,7 @@ declare const messages: {
715
715
  onlyTeacher: string;
716
716
  };
717
717
  possiblyOutdated: string;
718
+ references: string;
718
719
  };
719
720
  competenceGoals: {
720
721
  competenceGoal: string;
@@ -931,6 +932,12 @@ declare const messages: {
931
932
  'assessment-resources': string;
932
933
  topic: string;
933
934
  'multidisciplinary-topic': string;
935
+ image: string;
936
+ concept: string;
937
+ audio: string;
938
+ podcast: string;
939
+ h5p: string;
940
+ video: string;
934
941
  };
935
942
  modal: {
936
943
  closeModal: string;
@@ -1222,6 +1229,7 @@ declare const messages: {
1222
1229
  };
1223
1230
  };
1224
1231
  audio: {
1232
+ play: string;
1225
1233
  download: string;
1226
1234
  reuse: string;
1227
1235
  error: {
@@ -443,7 +443,8 @@ var messages = _objectSpread(_objectSpread({
443
443
  access: {
444
444
  onlyTeacher: 'Dát resursa lea dušše olamuttus oahpaheddjiide geat leat Feide bokte sisaloggejuvvon.'
445
445
  },
446
- possiblyOutdated: 'Artihkal lea boarásmuvvan.'
446
+ possiblyOutdated: 'Artihkal lea boarásmuvvan.',
447
+ references: 'Referanser'
447
448
  },
448
449
  competenceGoals: {
449
450
  competenceGoal: 'Gealbomihttomearri',
@@ -659,7 +660,13 @@ var messages = _objectSpread(_objectSpread({
659
660
  'source-material': 'Gáldomateriála',
660
661
  'assessment-resources': 'Árvoštallanresursa',
661
662
  topic: 'Fáddá',
662
- 'multidisciplinary-topic': 'Fágaidrasttideaddji fáddá'
663
+ 'multidisciplinary-topic': 'Fágaidrasttideaddji fáddá',
664
+ image: 'Bilde',
665
+ concept: 'Forklaring',
666
+ audio: 'Lyd',
667
+ podcast: 'Podkast',
668
+ h5p: 'H5P',
669
+ video: 'Video'
663
670
  },
664
671
  modal: {
665
672
  closeModal: 'Govčča'
@@ -951,6 +958,7 @@ var messages = _objectSpread(_objectSpread({
951
958
  }
952
959
  },
953
960
  audio: {
961
+ play: 'Spill av',
954
962
  download: 'Viečča jietnafiilla',
955
963
  reuse: 'Geavat jietnafiilla',
956
964
  error: {
@@ -715,6 +715,7 @@ declare const messages: {
715
715
  onlyTeacher: string;
716
716
  };
717
717
  possiblyOutdated: string;
718
+ references: string;
718
719
  };
719
720
  competenceGoals: {
720
721
  competenceGoal: string;
@@ -931,6 +932,12 @@ declare const messages: {
931
932
  'assessment-resources': string;
932
933
  topic: string;
933
934
  'multidisciplinary-topic': string;
935
+ image: string;
936
+ concept: string;
937
+ audio: string;
938
+ podcast: string;
939
+ h5p: string;
940
+ video: string;
934
941
  };
935
942
  modal: {
936
943
  closeModal: string;
@@ -1222,6 +1229,7 @@ declare const messages: {
1222
1229
  };
1223
1230
  };
1224
1231
  audio: {
1232
+ play: string;
1225
1233
  download: string;
1226
1234
  reuse: string;
1227
1235
  error: {
@@ -443,7 +443,8 @@ var messages = _objectSpread(_objectSpread({
443
443
  access: {
444
444
  onlyTeacher: 'Daate vierhtie ajve dïllesisnie lohkehtæjjide mah tjaangeme Feidine.'
445
445
  },
446
- possiblyOutdated: 'Artikkelen er foreldet.'
446
+ possiblyOutdated: 'Artikkelen er foreldet.',
447
+ references: 'Referanser'
447
448
  },
448
449
  competenceGoals: {
449
450
  competenceGoal: 'maahtoe-ulmie',
@@ -659,7 +660,13 @@ var messages = _objectSpread(_objectSpread({
659
660
  'source-material': 'Gaaltijevierhtieh',
660
661
  'assessment-resources': 'Vuarjasjimmievierhtie',
661
662
  topic: 'Teema',
662
- 'multidisciplinary-topic': 'Tverrfaglig case'
663
+ 'multidisciplinary-topic': 'Tverrfaglig case',
664
+ image: 'Bilde',
665
+ concept: 'Forklaring',
666
+ audio: 'Lyd',
667
+ podcast: 'Podkast',
668
+ h5p: 'H5P',
669
+ video: 'Video'
663
670
  },
664
671
  modal: {
665
672
  closeModal: 'Dahph'
@@ -951,6 +958,7 @@ var messages = _objectSpread(_objectSpread({
951
958
  }
952
959
  },
953
960
  audio: {
961
+ play: 'Spill av',
954
962
  download: 'Veedtjh tjoeje-fijlem',
955
963
  reuse: 'Nuhtjh tjoeje-fijlem',
956
964
  error: {
@@ -33,4 +33,4 @@ export declare const RESOURCE_TYPE_EXTERNAL_LEARNING_RESOURCES = "urn:resourcety
33
33
  export declare const RESOURCE_TYPE_SOURCE_MATERIAL = "urn:resourcetype:SourceMaterial";
34
34
  export declare const ListOfContentTypes: string[];
35
35
  export declare const contentTypeMapping: Record<string, string>;
36
- export declare const resourceTypeMapping: Record<string, string>;
36
+ export declare const resourceEmbedTypeMapping: Record<string, string>;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.resourceTypeMapping = exports.contentTypes = exports.contentTypeMapping = exports.TOPIC = exports.TASKS_AND_ACTIVITIES = exports.SUBJECT_MATERIAL = exports.SUBJECT = exports.SOURCE_MATERIAL = exports.RESOURCE_TYPE_TASKS_AND_ACTIVITIES = exports.RESOURCE_TYPE_SUBJECT_MATERIAL = exports.RESOURCE_TYPE_SOURCE_MATERIAL = exports.RESOURCE_TYPE_LEARNING_PATH = exports.RESOURCE_TYPE_EXTERNAL_LEARNING_RESOURCES = exports.RESOURCE_TYPE_ASSESSMENT_RESOURCES = exports.MULTIDISCIPLINARY_TOPIC = exports.ListOfContentTypes = exports.LEARNING_PATH = exports.EXTERNAL_LEARNING_RESOURCES = exports.ASSESSMENT_RESOURCES = void 0;
6
+ exports.resourceEmbedTypeMapping = exports.contentTypes = exports.contentTypeMapping = exports.TOPIC = exports.TASKS_AND_ACTIVITIES = exports.SUBJECT_MATERIAL = exports.SUBJECT = exports.SOURCE_MATERIAL = exports.RESOURCE_TYPE_TASKS_AND_ACTIVITIES = exports.RESOURCE_TYPE_SUBJECT_MATERIAL = exports.RESOURCE_TYPE_SOURCE_MATERIAL = exports.RESOURCE_TYPE_LEARNING_PATH = exports.RESOURCE_TYPE_EXTERNAL_LEARNING_RESOURCES = exports.RESOURCE_TYPE_ASSESSMENT_RESOURCES = exports.MULTIDISCIPLINARY_TOPIC = exports.ListOfContentTypes = exports.LEARNING_PATH = exports.EXTERNAL_LEARNING_RESOURCES = exports.ASSESSMENT_RESOURCES = void 0;
7
7
  var _contentTypeMapping;
8
8
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -63,10 +63,10 @@ var ListOfContentTypes = ['SUBJECT_MATERIAL', 'TASKS_AND_ACTIVITIES', 'ASSESSMEN
63
63
  exports.ListOfContentTypes = ListOfContentTypes;
64
64
  var contentTypeMapping = (_contentTypeMapping = {}, _defineProperty(_contentTypeMapping, RESOURCE_TYPE_LEARNING_PATH, LEARNING_PATH), _defineProperty(_contentTypeMapping, RESOURCE_TYPE_SUBJECT_MATERIAL, SUBJECT_MATERIAL), _defineProperty(_contentTypeMapping, RESOURCE_TYPE_TASKS_AND_ACTIVITIES, TASKS_AND_ACTIVITIES), _defineProperty(_contentTypeMapping, RESOURCE_TYPE_ASSESSMENT_RESOURCES, ASSESSMENT_RESOURCES), _defineProperty(_contentTypeMapping, RESOURCE_TYPE_EXTERNAL_LEARNING_RESOURCES, EXTERNAL_LEARNING_RESOURCES), _defineProperty(_contentTypeMapping, RESOURCE_TYPE_SOURCE_MATERIAL, SOURCE_MATERIAL), _defineProperty(_contentTypeMapping, "default", SUBJECT_MATERIAL), _contentTypeMapping);
65
65
  exports.contentTypeMapping = contentTypeMapping;
66
- var resourceTypeMapping = {
66
+ var resourceEmbedTypeMapping = {
67
67
  image: 'image',
68
68
  video: 'video',
69
69
  concept: 'concept',
70
70
  audio: 'audio'
71
71
  };
72
- exports.resourceTypeMapping = resourceTypeMapping;
72
+ exports.resourceEmbedTypeMapping = resourceEmbedTypeMapping;
@@ -22,5 +22,6 @@ declare const model: {
22
22
  subjectCategories: typeof subjectCategories;
23
23
  subjectTypes: typeof subjectTypes;
24
24
  contentTypeMapping: Record<string, string>;
25
+ resourceEmbedTypeMapping: Record<string, string>;
25
26
  };
26
27
  export default model;
@@ -22,7 +22,8 @@ var model = {
22
22
  contentTypes: _ContentType.contentTypes,
23
23
  subjectCategories: subjectCategories,
24
24
  subjectTypes: subjectTypes,
25
- contentTypeMapping: _ContentType.contentTypeMapping
25
+ contentTypeMapping: _ContentType.contentTypeMapping,
26
+ resourceEmbedTypeMapping: _ContentType.resourceEmbedTypeMapping
26
27
  };
27
28
  var _default = model;
28
29
  exports["default"] = _default;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.resourceTypeColor = exports["default"] = void 0;
7
7
  var _core = require("@ndla/core");
8
8
  var _model = _interopRequireDefault(require("../model"));
9
+ var _ContentType = require("../model/ContentType");
9
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
11
  /**
11
12
  * Copyright (c) 2022-present, NDLA.
@@ -36,6 +37,11 @@ var resourceTypeColor = function resourceTypeColor(type) {
36
37
  return _core.colors.learningPath.light;
37
38
  case contentTypes.MULTIDISCIPLINARY_TOPIC:
38
39
  return _core.colors.learningPath.background;
40
+ case _ContentType.resourceEmbedTypeMapping.image:
41
+ case _ContentType.resourceEmbedTypeMapping.video:
42
+ case _ContentType.resourceEmbedTypeMapping.concept:
43
+ case _ContentType.resourceEmbedTypeMapping.audio:
44
+ return _core.colors.brand.greyLight;
39
45
  default:
40
46
  return '';
41
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "37.0.1",
3
+ "version": "37.0.4",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -31,7 +31,7 @@
31
31
  "types"
32
32
  ],
33
33
  "dependencies": {
34
- "@ndla/accordion": "^2.2.0",
34
+ "@ndla/accordion": "^2.2.1",
35
35
  "@ndla/article-scripts": "^3.0.17",
36
36
  "@ndla/button": "^10.1.0",
37
37
  "@ndla/carousel": "^3.1.0",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "38258e7be60bc71be478fe407775f43bfa505d7b"
89
+ "gitHead": "db2b4d8eda31595ec90f1e2fc26972382214cad9"
90
90
  }
@@ -149,14 +149,14 @@ const ArticleByline = ({
149
149
  <AccordionRoot type="multiple" onValueChange={setOpenAccordions} value={openAccordions}>
150
150
  {licenseBox && (
151
151
  <AccordionItem value="rulesForUse">
152
- <AccordionHeader>{t('article.useContent')}</AccordionHeader>
152
+ <AccordionHeader headingLevel="h2">{t('article.useContent')}</AccordionHeader>
153
153
  <AccordionContent>{licenseBox}</AccordionContent>
154
154
  </AccordionItem>
155
155
  )}
156
156
 
157
157
  {!!footnotes?.length && (
158
158
  <AccordionItem value={referencesAccordionId}>
159
- <AccordionHeader>Referanser</AccordionHeader>
159
+ <AccordionHeader headingLevel="h2">{t('article.references')}</AccordionHeader>
160
160
  <AccordionContent forceMount>
161
161
  <ArticleFootNotes footNotes={footnotes} />
162
162
  </AccordionContent>
@@ -7,30 +7,10 @@
7
7
  */
8
8
 
9
9
  import React, { useRef } from 'react';
10
- import styled from '@emotion/styled';
11
- import { colors } from '@ndla/core';
10
+ import { useTranslation } from 'react-i18next';
12
11
  import { VolumeUp } from '@ndla/icons/common';
13
-
14
- const SpeechPlayButton = styled.button`
15
- background: none;
16
- border: none;
17
- display: flex;
18
- align-items: center;
19
- padding: 0;
20
- cursor: pointer;
21
- color: ${colors.brand.primary};
22
- margin-right: 0;
23
-
24
- &:hover,
25
- &:active,
26
- &:focus {
27
- color: ${colors.brand.secondary};
28
- }
29
- .c-icon {
30
- width: 24px;
31
- height: 24px;
32
- }
33
- `;
12
+ import Tooltip from '@ndla/tooltip';
13
+ import { IconButtonV2 } from '@ndla/button';
34
14
 
35
15
  type Props = {
36
16
  src: string;
@@ -38,6 +18,7 @@ type Props = {
38
18
  };
39
19
 
40
20
  const SpeechControl = ({ src, title }: Props) => {
21
+ const { t } = useTranslation();
41
22
  const audioRef = useRef<HTMLAudioElement>(null);
42
23
 
43
24
  const togglePlay = () => {
@@ -54,9 +35,11 @@ const SpeechControl = ({ src, title }: Props) => {
54
35
  <div>
55
36
  {/* eslint-disable-next-line jsx-a11y/media-has-caption */}
56
37
  <audio ref={audioRef} src={src} title={title} preload="metadata" />
57
- <SpeechPlayButton type="button" onClick={togglePlay}>
58
- <VolumeUp role="img" aria-label="play" title="play" />
59
- </SpeechPlayButton>
38
+ <Tooltip tooltip={t('audio.play')}>
39
+ <IconButtonV2 type="button" onClick={togglePlay} aria-label={t('audio.play')} variant="ghost">
40
+ <VolumeUp />
41
+ </IconButtonV2>
42
+ </Tooltip>
60
43
  </div>
61
44
  );
62
45
  };
@@ -65,19 +65,19 @@ export const ContentTypeBadge = ({ type, background, title, size = 'small', bord
65
65
  case contentTypes.MULTIDISCIPLINARY_TOPIC:
66
66
  icon = <MultidisciplinaryTopic />;
67
67
  break;
68
- case contentTypes.resourceTypeMapping.image:
68
+ case contentTypes.resourceEmbedTypeMapping.image:
69
69
  icon = <Media />;
70
70
  embedResource = true;
71
71
  break;
72
- case contentTypes.resourceTypeMapping.audio:
72
+ case contentTypes.resourceEmbedTypeMapping.audio:
73
73
  icon = <SquareAudio />;
74
74
  embedResource = true;
75
75
  break;
76
- case contentTypes.resourceTypeMapping.video:
76
+ case contentTypes.resourceEmbedTypeMapping.video:
77
77
  icon = <SquareVideo />;
78
78
  embedResource = true;
79
79
  break;
80
- case contentTypes.resourceTypeMapping.concept:
80
+ case contentTypes.resourceEmbedTypeMapping.concept:
81
81
  icon = <Concept />;
82
82
  embedResource = true;
83
83
  break;
@@ -88,7 +88,7 @@ export const ContentTypeBadge = ({ type, background, title, size = 'small', bord
88
88
  if (embedResource) {
89
89
  modifiers.push('embed-resource');
90
90
  }
91
- if (background || embedResource) {
91
+ if (background) {
92
92
  modifiers.push('background');
93
93
  }
94
94
  if (border) {
@@ -7,6 +7,7 @@
7
7
  */
8
8
 
9
9
  import { AudioMetaData, ImageMetaData } from '@ndla/types-embed';
10
+ import { COPYRIGHTED } from '@ndla/licenses';
10
11
  //@ts-ignore
11
12
  import { Remarkable } from 'remarkable';
12
13
  import AudioPlayer from '../AudioPlayer';
@@ -87,7 +88,9 @@ const AudioEmbed = ({ embed, heartButton: HeartButton }: Props) => {
87
88
  bottomRounded={!data.imageMeta}
88
89
  copyright={embed.data.copyright}
89
90
  >
90
- {HeartButton && <HeartButton embed={embed} />}
91
+ {HeartButton && embed.data.copyright.license.license.toLowerCase() !== COPYRIGHTED && (
92
+ <HeartButton embed={embed} />
93
+ )}
91
94
  </EmbedByline>
92
95
  {data.imageMeta && (
93
96
  <EmbedByline
@@ -98,7 +101,9 @@ const AudioEmbed = ({ embed, heartButton: HeartButton }: Props) => {
98
101
  bottomRounded
99
102
  copyright={data.imageMeta.copyright}
100
103
  >
101
- {HeartButton && <HeartButton embed={imageMetaToMockEmbed(embed)} />}
104
+ {HeartButton && data.imageMeta.copyright.license.license.toLowerCase() !== COPYRIGHTED && (
105
+ <HeartButton embed={imageMetaToMockEmbed(embed)} />
106
+ )}
102
107
  </EmbedByline>
103
108
  )}
104
109
  </Figure>
@@ -10,6 +10,7 @@ import sortBy from 'lodash/sortBy';
10
10
  import isNumber from 'lodash/isNumber';
11
11
  import styled from '@emotion/styled';
12
12
  import { spacing } from '@ndla/core';
13
+ import { COPYRIGHTED } from '@ndla/licenses';
13
14
  import { useEffect, useRef, useState } from 'react';
14
15
  import { BrightcoveEmbedData, BrightcoveMetaData, BrightcoveVideoSource } from '@ndla/types-embed';
15
16
  import { useTranslation } from 'react-i18next';
@@ -125,7 +126,7 @@ const BrightcoveEmbed = ({ embed, isConcept, heartButton: HeartButton }: Props)
125
126
  {t(`figure.button.${!showOriginalVideo ? 'original' : 'alternative'}`)}
126
127
  </LinkedVideoButton>
127
128
  )}
128
- {HeartButton && <HeartButton embed={embed} />}
129
+ {HeartButton && data.copyright?.license.license.toLowerCase() !== COPYRIGHTED && <HeartButton embed={embed} />}
129
130
  </EmbedByline>
130
131
  </Figure>
131
132
  );
@@ -16,6 +16,7 @@ import { Cross } from '@ndla/icons/action';
16
16
  import { breakpoints, colors, mq, spacing } from '@ndla/core';
17
17
  import { ConceptMetaData } from '@ndla/types-embed';
18
18
  import Tooltip from '@ndla/tooltip';
19
+ import { COPYRIGHTED } from '@ndla/licenses';
19
20
  import { Notion as UINotion } from '../Notion';
20
21
  import { Figure } from '../Figure';
21
22
  import { NotionImage } from '../Notion/NotionImage';
@@ -382,7 +383,7 @@ export const BlockConcept = ({
382
383
  />
383
384
  {copyright ? (
384
385
  <EmbedByline copyright={copyright} bottomRounded topRounded type="concept">
385
- {conceptHeartButton}
386
+ {copyright.license?.license.toLowerCase() !== COPYRIGHTED && conceptHeartButton}
386
387
  </EmbedByline>
387
388
  ) : (
388
389
  <BottomBorder />
@@ -11,6 +11,7 @@ import { ImageEmbedData, ImageMetaData } from '@ndla/types-embed';
11
11
  import { useTranslation } from 'react-i18next';
12
12
  import { MouseEventHandler, useState } from 'react';
13
13
  import { ExpandTwoArrows } from '@ndla/icons/action';
14
+ import { COPYRIGHTED } from '@ndla/licenses';
14
15
  import { ArrowCollapse, ChevronDown, ChevronUp } from '@ndla/icons/common';
15
16
  import { Figure, FigureType } from '../Figure';
16
17
  import Image, { ImageLink } from '../Image';
@@ -152,7 +153,7 @@ const ImageEmbed = ({ embed, previewAlt, heartButton: HeartButton }: Props) => {
152
153
  bottomRounded
153
154
  visibleAlt={previewAlt ? embed.embedData.alt : ''}
154
155
  >
155
- {HeartButton && <HeartButton embed={embed} />}
156
+ {HeartButton && data.copyright.license.license.toLowerCase() !== COPYRIGHTED && <HeartButton embed={embed} />}
156
157
  </EmbedByline>
157
158
  )}
158
159
  </Figure>
@@ -14,6 +14,7 @@ import { breakpoints, colors, fonts, misc, mq, spacing } from '@ndla/core';
14
14
  import { parseMarkdown } from '@ndla/util';
15
15
  import styled from '@emotion/styled';
16
16
  import { NotionDialogContent, NotionDialogText } from '@ndla/notion';
17
+ import { COPYRIGHTED } from '@ndla/licenses';
17
18
  import { Copyright } from '../types';
18
19
  import ImageEmbed from './ImageEmbed';
19
20
  import BrightcoveEmbed from './BrightcoveEmbed';
@@ -202,7 +203,7 @@ export const ConceptNotionV2 = forwardRef<HTMLDivElement, ConceptNotionProps>(
202
203
  </ContentPadding>
203
204
  {copyright && (
204
205
  <EmbedByline copyright={copyright} type="concept">
205
- {conceptHeartButton}
206
+ {copyright.license?.license.toLowerCase() !== COPYRIGHTED && conceptHeartButton}
206
207
  </EmbedByline>
207
208
  )}
208
209
  </div>