@ndla/ui 45.0.16 → 46.0.0

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 (99) hide show
  1. package/es/Article/Article.js +3 -3
  2. package/es/AudioPlayer/index.js +0 -2
  3. package/es/Embed/conceptComponents.js +15 -8
  4. package/es/Figure/Figure.js +11 -89
  5. package/es/Figure/index.js +1 -3
  6. package/es/Notion/index.js +1 -3
  7. package/es/all.css +1 -1
  8. package/es/index.js +3 -4
  9. package/es/locale/messages-en.js +7 -2
  10. package/es/locale/messages-nb.js +7 -2
  11. package/es/locale/messages-nn.js +7 -2
  12. package/es/locale/messages-se.js +7 -2
  13. package/es/locale/messages-sma.js +7 -2
  14. package/lib/Article/Article.js +3 -3
  15. package/lib/AudioPlayer/index.d.ts +0 -2
  16. package/lib/AudioPlayer/index.js +0 -7
  17. package/lib/Embed/conceptComponents.js +17 -10
  18. package/lib/Figure/Figure.d.ts +0 -38
  19. package/lib/Figure/Figure.js +20 -96
  20. package/lib/Figure/index.d.ts +1 -3
  21. package/lib/Figure/index.js +2 -17
  22. package/lib/Notion/index.d.ts +0 -4
  23. package/lib/Notion/index.js +0 -14
  24. package/lib/all.css +1 -1
  25. package/lib/index.d.ts +3 -5
  26. package/lib/index.js +1 -32
  27. package/lib/locale/messages-en.d.ts +5 -0
  28. package/lib/locale/messages-en.js +7 -2
  29. package/lib/locale/messages-nb.d.ts +5 -0
  30. package/lib/locale/messages-nb.js +7 -2
  31. package/lib/locale/messages-nn.d.ts +5 -0
  32. package/lib/locale/messages-nn.js +7 -2
  33. package/lib/locale/messages-se.d.ts +5 -0
  34. package/lib/locale/messages-se.js +7 -2
  35. package/lib/locale/messages-sma.d.ts +5 -0
  36. package/lib/locale/messages-sma.js +7 -2
  37. package/package.json +18 -22
  38. package/src/Article/Article.tsx +1 -1
  39. package/src/AudioPlayer/AudiPlayer.stories.tsx +88 -0
  40. package/src/AudioPlayer/index.ts +0 -2
  41. package/src/Embed/IframeEmbed.stories.tsx +15 -0
  42. package/src/Embed/ImageEmbed.stories.tsx +169 -2
  43. package/src/Embed/RelatedContentEmbed.stories.tsx +438 -0
  44. package/src/Embed/conceptComponents.tsx +13 -1
  45. package/src/Figure/Figure.tsx +1 -120
  46. package/src/Figure/index.ts +1 -3
  47. package/src/Notion/index.ts +0 -4
  48. package/src/index.ts +3 -13
  49. package/src/locale/messages-en.ts +7 -2
  50. package/src/locale/messages-nb.ts +7 -2
  51. package/src/locale/messages-nn.ts +7 -2
  52. package/src/locale/messages-se.ts +7 -2
  53. package/src/locale/messages-sma.ts +7 -2
  54. package/src/main.scss +0 -1
  55. package/es/Animation/Fade.js +0 -62
  56. package/es/Animation/index.js +0 -1
  57. package/es/AudioPlayer/initAudioPlayers.js +0 -60
  58. package/es/Dialog/Dialog.js +0 -70
  59. package/es/Dialog/index.js +0 -11
  60. package/es/Figure/FigureLicense.js +0 -72
  61. package/es/Figure/FigureLicenseDialog.js +0 -54
  62. package/es/Notion/ConceptNotion.js +0 -135
  63. package/es/Notion/FigureNotion.js +0 -93
  64. package/es/Notion/NotionVisualElement.js +0 -68
  65. package/es/utils/createUniversalPortal.js +0 -25
  66. package/lib/Animation/Fade.d.ts +0 -17
  67. package/lib/Animation/Fade.js +0 -70
  68. package/lib/Animation/index.d.ts +0 -1
  69. package/lib/Animation/index.js +0 -13
  70. package/lib/AudioPlayer/initAudioPlayers.d.ts +0 -11
  71. package/lib/AudioPlayer/initAudioPlayers.js +0 -69
  72. package/lib/Dialog/Dialog.d.ts +0 -23
  73. package/lib/Dialog/Dialog.js +0 -75
  74. package/lib/Dialog/index.d.ts +0 -10
  75. package/lib/Dialog/index.js +0 -22
  76. package/lib/Figure/FigureLicense.d.ts +0 -33
  77. package/lib/Figure/FigureLicense.js +0 -76
  78. package/lib/Figure/FigureLicenseDialog.d.ts +0 -29
  79. package/lib/Figure/FigureLicenseDialog.js +0 -57
  80. package/lib/Notion/ConceptNotion.d.ts +0 -24
  81. package/lib/Notion/ConceptNotion.js +0 -141
  82. package/lib/Notion/FigureNotion.d.ts +0 -27
  83. package/lib/Notion/FigureNotion.js +0 -97
  84. package/lib/Notion/NotionVisualElement.d.ts +0 -22
  85. package/lib/Notion/NotionVisualElement.js +0 -75
  86. package/lib/utils/createUniversalPortal.d.ts +0 -9
  87. package/lib/utils/createUniversalPortal.js +0 -32
  88. package/src/Animation/Fade.tsx +0 -46
  89. package/src/Animation/index.ts +0 -1
  90. package/src/AudioPlayer/initAudioPlayers.tsx +0 -57
  91. package/src/Dialog/Dialog.tsx +0 -80
  92. package/src/Dialog/component.dialog.scss +0 -144
  93. package/src/Dialog/index.ts +0 -13
  94. package/src/Figure/FigureLicense.tsx +0 -75
  95. package/src/Figure/FigureLicenseDialog.tsx +0 -51
  96. package/src/Notion/ConceptNotion.tsx +0 -170
  97. package/src/Notion/FigureNotion.tsx +0 -104
  98. package/src/Notion/NotionVisualElement.tsx +0 -80
  99. package/src/utils/createUniversalPortal.tsx +0 -23
package/lib/index.d.ts CHANGED
@@ -10,7 +10,6 @@ export { ConceptNotionV2, ImageEmbed, AudioEmbed, H5pEmbed, ExternalEmbed, Ifram
10
10
  export { ArticleByline, ArticleFootNotes, ArticleIntroduction, ArticleTitle, ArticleWrapper, ArticleHeaderWrapper, default as Article, } from './Article';
11
11
  export { default as Table, TableStyling } from './Table';
12
12
  export { default as ResourcesWrapper, ResourcesTopicTitle } from './ResourcesWrapper';
13
- export { createUniversalPortal } from './utils/createUniversalPortal';
14
13
  export { default as NoContentBox } from './NoContentBox';
15
14
  export { default as Masthead, getMastheadHeight, useMastheadHeight, SkipToMainContent } from './Masthead';
16
15
  export { default as ContentLoader } from './ContentLoader';
@@ -29,7 +28,7 @@ export type { HeroContentType } from './Hero';
29
28
  export { SubjectMaterialHero, TasksAndActivitiesHero, AssessmentResourcesHero, SubjectHero, ExternalLearningResourcesHero, SourceMaterialHero, Hero, NdlaFilmHero, HeroContent, } from './Hero';
30
29
  export { FilterList, FilterListPhone, FilterButtons, ToggleItem } from './Filter';
31
30
  export { Footer, EditorName, FooterText } from './Footer';
32
- export { Figure, FigureCaption, FigureLicenseDialog, FigureExpandButton, FigureOpenDialogButton, FigureBylineExpandButton, } from './Figure';
31
+ export { Figure, FigureExpandButton, FigureOpenDialogButton, FigureBylineExpandButton } from './Figure';
33
32
  export type { FigureType } from './Figure';
34
33
  export { LanguageSelector } from './LanguageSelector';
35
34
  export { LearningPathWrapper, LearningPathContent, LearningPathMenu, LearningPathSticky, LearningPathInformation, LearningPathStickySibling, LearningPathStickyPlaceholder, LearningPathLastStepNavigation, LearningPathMobileStepInfo, LearningPathMobileHeader, } from './LearningPaths';
@@ -44,7 +43,7 @@ export { default as resourceTypeColor } from './utils/resourceTypeColor';
44
43
  export { default as CreatedBy } from './CreatedBy';
45
44
  export { MessageBox, MessageBoxTag, MessageBanner } from './Messages';
46
45
  export { ResourceBox } from './ResourceBox';
47
- export { default as AudioPlayer, initAudioPlayers } from './AudioPlayer';
46
+ export { default as AudioPlayer } from './AudioPlayer';
48
47
  export { NavigationBox, NavigationTopicAbout } from './Navigation';
49
48
  export { default as Programme } from './Programme';
50
49
  export { default as CompetenceGoalTab } from './CompetenceGoalTab';
@@ -73,8 +72,7 @@ export { default as ContentTypeBadge, SubjectMaterialBadge, TasksAndActivitiesBa
73
72
  export { SubjectChildContent, SubjectContent, SubjectFlexWrapper, SubjectHeader, SubjectNewContent, SubjectSecondaryContent, SubjectSectionTitle, SubjectSidebarWrapper, SubjectSocialContent, SubjectSocialSection, SubjectTopics, SubjectBanner, } from './Subject';
74
73
  export { default as CopyParagraphButton, CopyParagraphButtonV2 } from './CopyParagraphButton';
75
74
  export { default as ContentPlaceholder } from './ContentPlaceholder';
76
- export { Notion, ConceptNotion } from './Notion';
77
- export type { NotionVisualElementType, ConceptNotionType } from './Notion';
75
+ export { Notion } from './Notion';
78
76
  export { BannerCard } from './BannerCard';
79
77
  export { Folder, FolderInput } from './MyNdla';
80
78
  export { ListResource, BlockResource } from './Resource';
package/lib/index.js CHANGED
@@ -172,12 +172,6 @@ Object.defineProperty(exports, "ConceptListEmbed", {
172
172
  return _Embed.ConceptListEmbed;
173
173
  }
174
174
  });
175
- Object.defineProperty(exports, "ConceptNotion", {
176
- enumerable: true,
177
- get: function get() {
178
- return _Notion.ConceptNotion;
179
- }
180
- });
181
175
  Object.defineProperty(exports, "ConceptNotionV2", {
182
176
  enumerable: true,
183
177
  get: function get() {
@@ -328,24 +322,12 @@ Object.defineProperty(exports, "FigureBylineExpandButton", {
328
322
  return _Figure.FigureBylineExpandButton;
329
323
  }
330
324
  });
331
- Object.defineProperty(exports, "FigureCaption", {
332
- enumerable: true,
333
- get: function get() {
334
- return _Figure.FigureCaption;
335
- }
336
- });
337
325
  Object.defineProperty(exports, "FigureExpandButton", {
338
326
  enumerable: true,
339
327
  get: function get() {
340
328
  return _Figure.FigureExpandButton;
341
329
  }
342
330
  });
343
- Object.defineProperty(exports, "FigureLicenseDialog", {
344
- enumerable: true,
345
- get: function get() {
346
- return _Figure.FigureLicenseDialog;
347
- }
348
- });
349
331
  Object.defineProperty(exports, "FigureOpenDialogButton", {
350
332
  enumerable: true,
351
333
  get: function get() {
@@ -1198,12 +1180,6 @@ Object.defineProperty(exports, "constants", {
1198
1180
  return _model.default;
1199
1181
  }
1200
1182
  });
1201
- Object.defineProperty(exports, "createUniversalPortal", {
1202
- enumerable: true,
1203
- get: function get() {
1204
- return _createUniversalPortal.createUniversalPortal;
1205
- }
1206
- });
1207
1183
  Object.defineProperty(exports, "formatNestedMessages", {
1208
1184
  enumerable: true,
1209
1185
  get: function get() {
@@ -1222,12 +1198,6 @@ Object.defineProperty(exports, "i18nInstance", {
1222
1198
  return _i18n.i18nInstance;
1223
1199
  }
1224
1200
  });
1225
- Object.defineProperty(exports, "initAudioPlayers", {
1226
- enumerable: true,
1227
- get: function get() {
1228
- return _AudioPlayer.initAudioPlayers;
1229
- }
1230
- });
1231
1201
  Object.defineProperty(exports, "makeSrcQueryString", {
1232
1202
  enumerable: true,
1233
1203
  get: function get() {
@@ -1287,7 +1257,6 @@ var _Embed = require("./Embed");
1287
1257
  var _Article = _interopRequireWildcard(require("./Article"));
1288
1258
  var _Table = _interopRequireWildcard(require("./Table"));
1289
1259
  var _ResourcesWrapper = _interopRequireWildcard(require("./ResourcesWrapper"));
1290
- var _createUniversalPortal = require("./utils/createUniversalPortal");
1291
1260
  var _NoContentBox = _interopRequireDefault(require("./NoContentBox"));
1292
1261
  var _Masthead = _interopRequireWildcard(require("./Masthead"));
1293
1262
  var _ContentLoader = _interopRequireDefault(require("./ContentLoader"));
@@ -1317,7 +1286,7 @@ var _resourceTypeColor = _interopRequireDefault(require("./utils/resourceTypeCol
1317
1286
  var _CreatedBy = _interopRequireDefault(require("./CreatedBy"));
1318
1287
  var _Messages = require("./Messages");
1319
1288
  var _ResourceBox = require("./ResourceBox");
1320
- var _AudioPlayer = _interopRequireWildcard(require("./AudioPlayer"));
1289
+ var _AudioPlayer = _interopRequireDefault(require("./AudioPlayer"));
1321
1290
  var _Navigation = require("./Navigation");
1322
1291
  var _Programme = _interopRequireDefault(require("./Programme"));
1323
1292
  var _CompetenceGoalTab = _interopRequireDefault(require("./CompetenceGoalTab"));
@@ -121,6 +121,11 @@ declare const messages: {
121
121
  };
122
122
  };
123
123
  };
124
+ iconMenu: {
125
+ folders: string;
126
+ tags: string;
127
+ subjects: string;
128
+ };
124
129
  tagList: string;
125
130
  tags: string;
126
131
  tags_plural: string;
@@ -215,10 +215,10 @@ var messages = _objectSpread(_objectSpread({
215
215
  notionsHeading: 'Explanations',
216
216
  notionsRemove: 'Remove',
217
217
  showVideo: 'Watch video',
218
- concept: 'Show notion',
218
+ concept: 'Concept',
219
219
  gridView: 'Grid-view',
220
220
  listView: 'List-view',
221
- gloss: 'Show gloss'
221
+ gloss: 'Gloss'
222
222
  },
223
223
  contextModal: {
224
224
  button: '+ {{count}} more contexts',
@@ -1127,6 +1127,11 @@ var messages = _objectSpread(_objectSpread({
1127
1127
  }
1128
1128
  }
1129
1129
  },
1130
+ iconMenu: {
1131
+ folders: 'Folders',
1132
+ tags: 'Tags',
1133
+ subjects: 'Favourite subjects'
1134
+ },
1130
1135
  tagList: 'Tags',
1131
1136
  tags: '{{count}} tag',
1132
1137
  tags_plural: '{{count}} tags',
@@ -121,6 +121,11 @@ declare const messages: {
121
121
  };
122
122
  };
123
123
  };
124
+ iconMenu: {
125
+ folders: string;
126
+ tags: string;
127
+ subjects: string;
128
+ };
124
129
  tagList: string;
125
130
  tags: string;
126
131
  tags_plural: string;
@@ -213,8 +213,8 @@ var messages = _objectSpread(_objectSpread({
213
213
  notionsHeading: 'Begrepsforklaring',
214
214
  notionsRemove: 'Fjern',
215
215
  showVideo: 'Se video',
216
- concept: 'Se forklaring',
217
- gloss: 'Se glose',
216
+ concept: 'Begrepsforklaring',
217
+ gloss: 'Glose',
218
218
  gridView: 'Gallerivisning',
219
219
  listView: 'Listevisning'
220
220
  },
@@ -1125,6 +1125,11 @@ var messages = _objectSpread(_objectSpread({
1125
1125
  }
1126
1126
  }
1127
1127
  },
1128
+ iconMenu: {
1129
+ folders: 'Mapper',
1130
+ tags: 'Knagger',
1131
+ subjects: 'Favorittfag'
1132
+ },
1128
1133
  tagList: 'Emneknagger',
1129
1134
  tags: '{{count}} emneknagg',
1130
1135
  tags_plural: '{{count}} emneknagger',
@@ -121,6 +121,11 @@ declare const messages: {
121
121
  };
122
122
  };
123
123
  };
124
+ iconMenu: {
125
+ folders: string;
126
+ tags: string;
127
+ subjects: string;
128
+ };
124
129
  tagList: string;
125
130
  tags: string;
126
131
  tags_plural: string;
@@ -213,10 +213,10 @@ var messages = _objectSpread(_objectSpread({
213
213
  notionsHeading: 'Begrepsforklaring',
214
214
  notionsRemove: 'Fjern',
215
215
  showVideo: 'Sjå video',
216
- concept: 'Sjå forklaring',
216
+ concept: 'Begrepsforklaring',
217
217
  gridView: 'Gallerivisning',
218
218
  listView: 'Listevisning',
219
- gloss: 'Sjå glose'
219
+ gloss: 'Glose'
220
220
  },
221
221
  contextModal: {
222
222
  button: '+ {{count}} fleire stader',
@@ -1125,6 +1125,11 @@ var messages = _objectSpread(_objectSpread({
1125
1125
  }
1126
1126
  }
1127
1127
  },
1128
+ iconMenu: {
1129
+ folders: 'Mappar',
1130
+ tags: 'Knaggar',
1131
+ subjects: 'Favorittfag'
1132
+ },
1128
1133
  tagList: 'Emneknaggar',
1129
1134
  tags: '{{count}} emneknagg',
1130
1135
  tags_plural: '{{count}} emneknaggar',
@@ -121,6 +121,11 @@ declare const messages: {
121
121
  };
122
122
  };
123
123
  };
124
+ iconMenu: {
125
+ folders: string;
126
+ tags: string;
127
+ subjects: string;
128
+ };
124
129
  tagList: string;
125
130
  tags: string;
126
131
  tags_plural: string;
@@ -213,10 +213,10 @@ var messages = _objectSpread(_objectSpread({
213
213
  notionsHeading: 'Doabačilgehus',
214
214
  notionsRemove: 'Sihko',
215
215
  showVideo: 'Geahča video',
216
- concept: 'Geahča čilgehusa',
216
+ concept: 'Doabačilgehus',
217
217
  gridView: 'Galleriijačájáhus',
218
218
  listView: 'Čájáhus listtu vuođul',
219
- gloss: 'Geahča sánit'
219
+ gloss: 'Sánit'
220
220
  },
221
221
  contextModal: {
222
222
  button: '+ {{count}} eanet sajiin',
@@ -1125,6 +1125,11 @@ var messages = _objectSpread(_objectSpread({
1125
1125
  }
1126
1126
  }
1127
1127
  },
1128
+ iconMenu: {
1129
+ folders: 'Mapper',
1130
+ tags: 'Knagger',
1131
+ subjects: 'Favorittfag'
1132
+ },
1128
1133
  tagList: 'Fáddágilkor',
1129
1134
  tags: '{{count}} fáddágilkor',
1130
1135
  tags_plural: '{{count}} fáddágilkorat',
@@ -121,6 +121,11 @@ declare const messages: {
121
121
  };
122
122
  };
123
123
  };
124
+ iconMenu: {
125
+ folders: string;
126
+ tags: string;
127
+ subjects: string;
128
+ };
124
129
  tagList: string;
125
130
  tags: string;
126
131
  tags_plural: string;
@@ -213,10 +213,10 @@ var messages = _objectSpread(_objectSpread({
213
213
  notionsHeading: 'Baakoebuerkiestimmie',
214
214
  notionsRemove: 'Skubph',
215
215
  showVideo: 'Gïehtjh videjovem',
216
- concept: 'Gïehtjh buerkiestimmiem ',
216
+ concept: 'Begrepsforklaring',
217
217
  gridView: 'Gallerivisning',
218
218
  listView: 'Listevisning',
219
- gloss: 'Se glose'
219
+ gloss: 'Glose'
220
220
  },
221
221
  contextModal: {
222
222
  button: '+ {{count}} jieniebinie sijjine',
@@ -1125,6 +1125,11 @@ var messages = _objectSpread(_objectSpread({
1125
1125
  }
1126
1126
  }
1127
1127
  },
1128
+ iconMenu: {
1129
+ folders: 'Mapper',
1130
+ tags: 'Knagger',
1131
+ subjects: 'Favorittfag'
1132
+ },
1128
1133
  tagList: 'Emneknagg',
1129
1134
  tags: '{{count}} emneknagg',
1130
1135
  tags_plural: '{{count}} emneknagger',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "45.0.16",
3
+ "version": "46.0.0",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -31,37 +31,34 @@
31
31
  "types"
32
32
  ],
33
33
  "dependencies": {
34
- "@ndla/accordion": "^2.2.23",
35
- "@ndla/article-scripts": "^3.0.21",
36
- "@ndla/button": "^11.0.8",
37
- "@ndla/carousel": "^4.0.1",
38
- "@ndla/core": "^4.1.8",
39
- "@ndla/dropdown-menu": "^1.0.6",
40
- "@ndla/forms": "^4.3.24",
34
+ "@ndla/accordion": "^2.2.25",
35
+ "@ndla/button": "^11.0.10",
36
+ "@ndla/carousel": "^4.0.3",
37
+ "@ndla/core": "^4.1.9",
38
+ "@ndla/dropdown-menu": "^1.0.7",
39
+ "@ndla/forms": "^5.0.0",
41
40
  "@ndla/hooks": "^2.1.0",
42
- "@ndla/icons": "^4.0.7",
41
+ "@ndla/icons": "^4.0.9",
43
42
  "@ndla/licenses": "^7.1.4",
44
- "@ndla/modal": "^4.0.8",
45
- "@ndla/notion": "^5.0.26",
46
- "@ndla/safelink": "^4.1.22",
47
- "@ndla/select": "^2.4.14",
48
- "@ndla/switch": "^1.1.13",
49
- "@ndla/tabs": "^3.0.9",
50
- "@ndla/tooltip": "^4.1.19",
51
- "@ndla/typography": "^0.2.0",
43
+ "@ndla/modal": "^4.0.10",
44
+ "@ndla/notion": "^6.0.0",
45
+ "@ndla/safelink": "^4.1.24",
46
+ "@ndla/select": "^2.4.16",
47
+ "@ndla/switch": "^1.1.14",
48
+ "@ndla/tabs": "^3.0.10",
49
+ "@ndla/tooltip": "^4.1.21",
50
+ "@ndla/typography": "^0.2.1",
52
51
  "@ndla/util": "^3.2.0",
53
52
  "@radix-ui/react-popover": "^1.0.6",
54
53
  "@radix-ui/react-slider": "^1.1.2",
55
54
  "date-fns": "^2.30.0",
56
- "framer-motion": "^6.5.1",
57
55
  "html-react-parser": "^3.0.8",
58
56
  "i18next-browser-languagedetector": "^6.1.1",
59
57
  "react-bem-helper": "1.4.1",
60
58
  "react-device-detect": "^2.2.3",
61
59
  "react-select": "^5.7.5",
62
60
  "react-swipeable": "^7.0.0",
63
- "remarkable": "^2.0.1",
64
- "shave": "^2.5.10"
61
+ "remarkable": "^2.0.1"
65
62
  },
66
63
  "peerDependencies": {
67
64
  "@emotion/react": "^11.10.4",
@@ -72,7 +69,6 @@
72
69
  "react-i18next": "^11.18.6"
73
70
  },
74
71
  "devDependencies": {
75
- "@babel/plugin-proposal-optional-chaining": "^7.11.0",
76
72
  "@ndla/types-backend": "^0.2.21",
77
73
  "@ndla/types-embed": "^4.0.2",
78
74
  "css-loader": "^6.7.3",
@@ -84,5 +80,5 @@
84
80
  "publishConfig": {
85
81
  "access": "public"
86
82
  },
87
- "gitHead": "7f859ccc955408674bce9b7a8422b076034811b4"
83
+ "gitHead": "90560600cb69b9c47dec3ec4b1966c770a94e7db"
88
84
  }
@@ -62,7 +62,7 @@ export const ArticleTitle = ({ children, icon, label, id }: ArticleTitleProps) =
62
62
  <div {...classes('title', modifiers)}>
63
63
  {icon}
64
64
  {labelView}
65
- <Heading element="h1" headingStyle="h1" id={id} tabIndex={-1}>
65
+ <Heading element="h1" headingStyle="h1-resource" id={id} tabIndex={-1}>
66
66
  {children}
67
67
  </Heading>
68
68
  </div>
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Copyright (c) 2023-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import { Meta, StoryObj } from '@storybook/react';
10
+ import AudioPlayer from './AudioPlayer';
11
+ import { defaultParameters } from '../../../../stories/defaults';
12
+ const TextVersion = (
13
+ <>
14
+ <p>
15
+ So, I had graduated seven years ago from Berkeley with a dual degree in molecular and cell biology and
16
+ linguistics, and I had gone to a career fair here on campus, where I'd gotten an interview with a start-up called
17
+ Theranos. And at the time, there wasn't really that much information about the company, but the little that was
18
+ there was really impressive. Essentially, what the company was doing was creating a medical device where you would
19
+ be able to run your entire blood panel on a finger-stick of blood. So you wouldn't have to get a big needle stuck
20
+ in your arm in order to get your blood test done. So this was interesting not only because it was less painful,
21
+ </p>
22
+ <p>
23
+ And this was confirmed in an interview that the founder, Elizabeth Holmes, had said in the Wall Street Journal.
24
+ "The reality within our health-care system today is that when someone you care about gets really sick, by the time
25
+ you find out it's [most often] too late to do anything about it, It's heartbreaking." This was a moon shot that I
26
+ really wanted to be a part of and I really wanted to help build.{' '}
27
+ </p>
28
+ </>
29
+ );
30
+
31
+ const description =
32
+ 'Se gjerne nærmere på hvordan andre kjente fortellere griper saken an. Siri Knudsen i NRK P3 lot seg for eksempel inspirere av Asbjørnsen og Moe da hun jobbet med sin radiodokumentar om artisten Truls Heggero. Se gjerne nærmere på hvordan andre kjente fortellere griper saken an. Siri Knudsen i NRK P3 lot seg for eksempel inspirere av Asbjørnsen og Moe da hun jobbet med sin radiodokumentar om artisten Truls Heggero.';
33
+
34
+ /**
35
+ * Although the AudioPlayer is most commonly used as an embed, it can also be used as a standalone component.
36
+ * To see it used as an embed, check out the AudioEmbed component
37
+ */
38
+ const meta: Meta<typeof AudioPlayer> = {
39
+ title: 'Components/AudioPlayer',
40
+ component: AudioPlayer,
41
+ tags: ['autodocs'],
42
+ parameters: defaultParameters,
43
+ };
44
+
45
+ export default meta;
46
+
47
+ export const AudioPlayerStory: StoryObj<typeof AudioPlayer> = {
48
+ args: {
49
+ src: 'https://api.staging.ndla.no/audio/files/Alltid_Nyheter_nrk128kps.mp3',
50
+ title: 'Den gode lydhistoria',
51
+ textVersion: TextVersion,
52
+ },
53
+ };
54
+
55
+ AudioPlayerStory.storyName = 'AudioPlayer';
56
+
57
+ export const SimpleVariant: StoryObj<typeof AudioPlayer> = {
58
+ args: {
59
+ src: 'https://api.staging.ndla.no/audio/files/Alltid_Nyheter_nrk128kps.mp3',
60
+ title: 'Den gode lydhistoria',
61
+ textVersion: TextVersion,
62
+ speech: true,
63
+ },
64
+ };
65
+
66
+ export const PodcastWithoutImage: StoryObj<typeof AudioPlayer> = {
67
+ args: {
68
+ src: 'https://api.staging.ndla.no/audio/files/Alltid_Nyheter_nrk128kps.mp3',
69
+ title: 'Den gode lydhistoria',
70
+ textVersion: TextVersion,
71
+ subtitle: { title: 'Serienavn', url: '#' },
72
+ description,
73
+ },
74
+ };
75
+
76
+ export const PodcastWithImage: StoryObj<typeof AudioPlayer> = {
77
+ args: {
78
+ src: 'https://api.staging.ndla.no/audio/files/Alltid_Nyheter_nrk128kps.mp3',
79
+ title: 'Den gode lydhistoria',
80
+ textVersion: TextVersion,
81
+ subtitle: { title: 'Serienavn', url: '#' },
82
+ description,
83
+ img: {
84
+ url: 'https://api.ndla.no/image-api/raw/BagNsXHq.jpg?height=400',
85
+ alt: 'Mann blir målt og observert. Omgitt av ulike diagrammer. Illustrasjon.',
86
+ },
87
+ },
88
+ };
@@ -1,5 +1,3 @@
1
1
  import AudioPlayer from './AudioPlayer';
2
- import initAudioPlayers from './initAudioPlayers';
3
2
 
4
- export { initAudioPlayers };
5
3
  export default AudioPlayer;
@@ -137,6 +137,21 @@ export const OpensInNewWindow: StoryObj<typeof IframeEmbed> = {
137
137
  },
138
138
  };
139
139
 
140
+ export const NoDimensions: StoryObj<typeof IframeEmbed> = {
141
+ args: {
142
+ embed: {
143
+ resource: 'iframe',
144
+ status: 'success',
145
+ embedData: {
146
+ ...embedData,
147
+ width: undefined,
148
+ height: undefined,
149
+ },
150
+ data: opensInnewMetaData,
151
+ },
152
+ },
153
+ };
154
+
140
155
  export const OpensInNewWindowFailed: StoryObj<typeof IframeEmbed> = {
141
156
  args: {
142
157
  embed: {