@ndla/ui 45.0.17 → 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.
- package/es/Article/Article.js +3 -3
- package/es/AudioPlayer/index.js +0 -2
- package/es/Embed/conceptComponents.js +15 -8
- package/es/Figure/Figure.js +11 -89
- package/es/Figure/index.js +1 -3
- package/es/Notion/index.js +1 -3
- package/es/all.css +1 -1
- package/es/index.js +3 -4
- package/lib/Article/Article.js +3 -3
- package/lib/AudioPlayer/index.d.ts +0 -2
- package/lib/AudioPlayer/index.js +0 -7
- package/lib/Embed/conceptComponents.js +17 -10
- package/lib/Figure/Figure.d.ts +0 -38
- package/lib/Figure/Figure.js +20 -96
- package/lib/Figure/index.d.ts +1 -3
- package/lib/Figure/index.js +2 -17
- package/lib/Notion/index.d.ts +0 -4
- package/lib/Notion/index.js +0 -14
- package/lib/all.css +1 -1
- package/lib/index.d.ts +3 -5
- package/lib/index.js +1 -32
- package/package.json +18 -22
- package/src/Article/Article.tsx +1 -1
- package/src/AudioPlayer/AudiPlayer.stories.tsx +88 -0
- package/src/AudioPlayer/index.ts +0 -2
- package/src/Embed/IframeEmbed.stories.tsx +15 -0
- package/src/Embed/ImageEmbed.stories.tsx +169 -2
- package/src/Embed/RelatedContentEmbed.stories.tsx +438 -0
- package/src/Embed/conceptComponents.tsx +13 -1
- package/src/Figure/Figure.tsx +1 -120
- package/src/Figure/index.ts +1 -3
- package/src/Notion/index.ts +0 -4
- package/src/index.ts +3 -13
- package/src/main.scss +0 -1
- package/es/Animation/Fade.js +0 -62
- package/es/Animation/index.js +0 -1
- package/es/AudioPlayer/initAudioPlayers.js +0 -60
- package/es/Dialog/Dialog.js +0 -70
- package/es/Dialog/index.js +0 -11
- package/es/Figure/FigureLicense.js +0 -72
- package/es/Figure/FigureLicenseDialog.js +0 -54
- package/es/Notion/ConceptNotion.js +0 -135
- package/es/Notion/FigureNotion.js +0 -93
- package/es/Notion/NotionVisualElement.js +0 -68
- package/es/utils/createUniversalPortal.js +0 -25
- package/lib/Animation/Fade.d.ts +0 -17
- package/lib/Animation/Fade.js +0 -70
- package/lib/Animation/index.d.ts +0 -1
- package/lib/Animation/index.js +0 -13
- package/lib/AudioPlayer/initAudioPlayers.d.ts +0 -11
- package/lib/AudioPlayer/initAudioPlayers.js +0 -69
- package/lib/Dialog/Dialog.d.ts +0 -23
- package/lib/Dialog/Dialog.js +0 -75
- package/lib/Dialog/index.d.ts +0 -10
- package/lib/Dialog/index.js +0 -22
- package/lib/Figure/FigureLicense.d.ts +0 -33
- package/lib/Figure/FigureLicense.js +0 -76
- package/lib/Figure/FigureLicenseDialog.d.ts +0 -29
- package/lib/Figure/FigureLicenseDialog.js +0 -57
- package/lib/Notion/ConceptNotion.d.ts +0 -24
- package/lib/Notion/ConceptNotion.js +0 -141
- package/lib/Notion/FigureNotion.d.ts +0 -27
- package/lib/Notion/FigureNotion.js +0 -97
- package/lib/Notion/NotionVisualElement.d.ts +0 -22
- package/lib/Notion/NotionVisualElement.js +0 -75
- package/lib/utils/createUniversalPortal.d.ts +0 -9
- package/lib/utils/createUniversalPortal.js +0 -32
- package/src/Animation/Fade.tsx +0 -46
- package/src/Animation/index.ts +0 -1
- package/src/AudioPlayer/initAudioPlayers.tsx +0 -57
- package/src/Dialog/Dialog.tsx +0 -80
- package/src/Dialog/component.dialog.scss +0 -144
- package/src/Dialog/index.ts +0 -13
- package/src/Figure/FigureLicense.tsx +0 -75
- package/src/Figure/FigureLicenseDialog.tsx +0 -51
- package/src/Notion/ConceptNotion.tsx +0 -170
- package/src/Notion/FigureNotion.tsx +0 -104
- package/src/Notion/NotionVisualElement.tsx +0 -80
- 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,
|
|
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
|
|
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
|
|
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 =
|
|
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"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "
|
|
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.
|
|
35
|
-
"@ndla/
|
|
36
|
-
"@ndla/
|
|
37
|
-
"@ndla/
|
|
38
|
-
"@ndla/
|
|
39
|
-
"@ndla/
|
|
40
|
-
"@ndla/forms": "^4.3.25",
|
|
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.
|
|
41
|
+
"@ndla/icons": "^4.0.9",
|
|
43
42
|
"@ndla/licenses": "^7.1.4",
|
|
44
|
-
"@ndla/modal": "^4.0.
|
|
45
|
-
"@ndla/notion": "^
|
|
46
|
-
"@ndla/safelink": "^4.1.
|
|
47
|
-
"@ndla/select": "^2.4.
|
|
48
|
-
"@ndla/switch": "^1.1.
|
|
49
|
-
"@ndla/tabs": "^3.0.
|
|
50
|
-
"@ndla/tooltip": "^4.1.
|
|
51
|
-
"@ndla/typography": "^0.2.
|
|
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": "
|
|
83
|
+
"gitHead": "90560600cb69b9c47dec3ec4b1966c770a94e7db"
|
|
88
84
|
}
|
package/src/Article/Article.tsx
CHANGED
|
@@ -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
|
+
};
|
package/src/AudioPlayer/index.ts
CHANGED
|
@@ -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: {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
import { Meta, StoryObj } from '@storybook/react';
|
|
10
10
|
import { ImageEmbedData } from '@ndla/types-embed';
|
|
11
|
-
import { IImageMetaInformationV3 } from '@ndla/types-backend/
|
|
11
|
+
import { IImageMetaInformationV3 } from '@ndla/types-backend/image-api';
|
|
12
|
+
import { ReactNode } from 'react';
|
|
12
13
|
import ImageEmbed from './ImageEmbed';
|
|
13
14
|
import { defaultParameters } from '../../../../stories/defaults';
|
|
14
15
|
import StoryFavoriteButton from '../../../../stories/StoryFavoriteButton';
|
|
@@ -81,6 +82,7 @@ const metaData: IImageMetaInformationV3 = {
|
|
|
81
82
|
},
|
|
82
83
|
};
|
|
83
84
|
|
|
85
|
+
/** Bilder har tre mulige plasseringer: fullbredde midtstilt, venstrestilt og høyrestilt. Bilder kan være i størrelsene ekstra liten, liten, medium og stor (fullbredde). Bilder som ikke er fullbredde, kan ekspanderes på klikk. */
|
|
84
86
|
const meta: Meta<typeof ImageEmbed> = {
|
|
85
87
|
title: 'Components/Embeds/ImageEmbed',
|
|
86
88
|
component: ImageEmbed,
|
|
@@ -118,6 +120,8 @@ export const ImageEmbedStory: StoryObj<typeof ImageEmbed> = {
|
|
|
118
120
|
},
|
|
119
121
|
};
|
|
120
122
|
|
|
123
|
+
ImageEmbedStory.storyName = 'ImageEmbed';
|
|
124
|
+
|
|
121
125
|
export const Failed: StoryObj<typeof ImageEmbed> = {
|
|
122
126
|
args: {
|
|
123
127
|
heartButton: StoryFavoriteButton,
|
|
@@ -129,4 +133,167 @@ export const Failed: StoryObj<typeof ImageEmbed> = {
|
|
|
129
133
|
},
|
|
130
134
|
};
|
|
131
135
|
|
|
132
|
-
|
|
136
|
+
export const FullWidth: StoryObj<typeof ImageEmbed> = {
|
|
137
|
+
args: {
|
|
138
|
+
heartButton: StoryFavoriteButton,
|
|
139
|
+
embed: {
|
|
140
|
+
resource: 'image',
|
|
141
|
+
status: 'success',
|
|
142
|
+
embedData: embedData,
|
|
143
|
+
data: metaData,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
render: (args) => (
|
|
147
|
+
<TextWrapper>
|
|
148
|
+
<ImageEmbed {...args} />
|
|
149
|
+
</TextWrapper>
|
|
150
|
+
),
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const TextWrapper = ({ children }: { children: ReactNode }) => (
|
|
154
|
+
<>
|
|
155
|
+
<p>
|
|
156
|
+
Du har en kjempegod idé til en kortfilm. Men det koster mange penger å produsere filmen. Derfor er du avhengig av
|
|
157
|
+
at noen tenner på idéen din og bestemmer seg for å bruke ressurser på nettopp dette prosjektet.
|
|
158
|
+
</p>
|
|
159
|
+
{children}
|
|
160
|
+
|
|
161
|
+
<p>
|
|
162
|
+
Pitching er også en god måte å bevisstgjøre seg selv på. Når du pitcher, blir idéen og historien i den filmen du
|
|
163
|
+
planlegger å lage, tydeligere for både deg selv og dem du eventuelt jobber sammen med i klassen.
|
|
164
|
+
</p>
|
|
165
|
+
<p>
|
|
166
|
+
Pitching er også en god måte å bevisstgjøre seg selv på. Når du pitcher, blir idéen og historien i den filmen du
|
|
167
|
+
planlegger å lage, tydeligere for både deg selv og dem du eventuelt jobber sammen med i klassen.
|
|
168
|
+
</p>
|
|
169
|
+
<p>
|
|
170
|
+
Pitching er også en god måte å bevisstgjøre seg selv på. Når du pitcher, blir idéen og historien i den filmen du
|
|
171
|
+
planlegger å lage, tydeligere for både deg selv og dem du eventuelt jobber sammen med i klassen.
|
|
172
|
+
</p>
|
|
173
|
+
</>
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
export const FloatLeft: StoryObj<typeof ImageEmbed> = {
|
|
177
|
+
args: {
|
|
178
|
+
heartButton: StoryFavoriteButton,
|
|
179
|
+
embed: {
|
|
180
|
+
resource: 'image',
|
|
181
|
+
status: 'success',
|
|
182
|
+
embedData: {
|
|
183
|
+
...embedData,
|
|
184
|
+
align: 'left',
|
|
185
|
+
},
|
|
186
|
+
data: metaData,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
render: (args) => (
|
|
190
|
+
<TextWrapper>
|
|
191
|
+
<ImageEmbed {...args} />
|
|
192
|
+
</TextWrapper>
|
|
193
|
+
),
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export const FloatRight: StoryObj<typeof ImageEmbed> = {
|
|
197
|
+
args: {
|
|
198
|
+
heartButton: StoryFavoriteButton,
|
|
199
|
+
embed: {
|
|
200
|
+
resource: 'image',
|
|
201
|
+
status: 'success',
|
|
202
|
+
embedData: {
|
|
203
|
+
...embedData,
|
|
204
|
+
align: 'right',
|
|
205
|
+
},
|
|
206
|
+
data: metaData,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
render: (args) => (
|
|
211
|
+
<TextWrapper>
|
|
212
|
+
<ImageEmbed {...args} />
|
|
213
|
+
</TextWrapper>
|
|
214
|
+
),
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export const FloatRightSmall: StoryObj<typeof ImageEmbed> = {
|
|
218
|
+
args: {
|
|
219
|
+
heartButton: StoryFavoriteButton,
|
|
220
|
+
embed: {
|
|
221
|
+
resource: 'image',
|
|
222
|
+
status: 'success',
|
|
223
|
+
embedData: {
|
|
224
|
+
...embedData,
|
|
225
|
+
size: 'small',
|
|
226
|
+
align: 'right',
|
|
227
|
+
},
|
|
228
|
+
data: metaData,
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
render: (args) => (
|
|
232
|
+
<TextWrapper>
|
|
233
|
+
<ImageEmbed {...args} />
|
|
234
|
+
</TextWrapper>
|
|
235
|
+
),
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export const FloatLeftSmall: StoryObj<typeof ImageEmbed> = {
|
|
239
|
+
args: {
|
|
240
|
+
heartButton: StoryFavoriteButton,
|
|
241
|
+
embed: {
|
|
242
|
+
resource: 'image',
|
|
243
|
+
status: 'success',
|
|
244
|
+
embedData: {
|
|
245
|
+
...embedData,
|
|
246
|
+
size: 'small',
|
|
247
|
+
align: 'left',
|
|
248
|
+
},
|
|
249
|
+
data: metaData,
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
render: (args) => (
|
|
253
|
+
<TextWrapper>
|
|
254
|
+
<ImageEmbed {...args} />
|
|
255
|
+
</TextWrapper>
|
|
256
|
+
),
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export const FloatRightExtraSmall: StoryObj<typeof ImageEmbed> = {
|
|
260
|
+
args: {
|
|
261
|
+
heartButton: StoryFavoriteButton,
|
|
262
|
+
embed: {
|
|
263
|
+
resource: 'image',
|
|
264
|
+
status: 'success',
|
|
265
|
+
embedData: {
|
|
266
|
+
...embedData,
|
|
267
|
+
size: 'xsmall',
|
|
268
|
+
align: 'right',
|
|
269
|
+
},
|
|
270
|
+
data: metaData,
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
render: (args) => (
|
|
274
|
+
<TextWrapper>
|
|
275
|
+
<ImageEmbed {...args} />
|
|
276
|
+
</TextWrapper>
|
|
277
|
+
),
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export const FloatLeftExtraSmall: StoryObj<typeof ImageEmbed> = {
|
|
281
|
+
args: {
|
|
282
|
+
heartButton: StoryFavoriteButton,
|
|
283
|
+
embed: {
|
|
284
|
+
resource: 'image',
|
|
285
|
+
status: 'success',
|
|
286
|
+
embedData: {
|
|
287
|
+
...embedData,
|
|
288
|
+
size: 'xsmall',
|
|
289
|
+
align: 'left',
|
|
290
|
+
},
|
|
291
|
+
data: metaData,
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
render: (args) => (
|
|
295
|
+
<TextWrapper>
|
|
296
|
+
<ImageEmbed {...args} />
|
|
297
|
+
</TextWrapper>
|
|
298
|
+
),
|
|
299
|
+
};
|