@ndla/ui 56.0.35-alpha.0 → 56.0.36-alpha.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/dist/panda.buildinfo.json +7 -6
- package/dist/styles.css +20 -16
- package/es/CampaignBlock/CampaignBlock.js +36 -47
- package/es/Embed/CodeEmbed.js +6 -2
- package/es/Embed/ConceptEmbed.js +1 -0
- package/es/Embed/EmbedErrorPlaceholder.js +8 -9
- package/es/locale/messages-en.js +2 -1
- package/es/locale/messages-nb.js +2 -1
- package/es/locale/messages-nn.js +2 -1
- package/es/locale/messages-se.js +2 -1
- package/es/locale/messages-sma.js +2 -1
- package/lib/CampaignBlock/CampaignBlock.d.ts +4 -2
- package/lib/CampaignBlock/CampaignBlock.js +35 -46
- package/lib/Embed/CodeEmbed.js +7 -2
- package/lib/Embed/ConceptEmbed.js +1 -0
- package/lib/Embed/EmbedErrorPlaceholder.js +7 -8
- package/lib/LicenseByline/EmbedByline.d.ts +1 -1
- package/lib/locale/messages-en.d.ts +1 -0
- package/lib/locale/messages-en.js +2 -1
- package/lib/locale/messages-nb.d.ts +1 -0
- package/lib/locale/messages-nb.js +2 -1
- package/lib/locale/messages-nn.d.ts +1 -0
- package/lib/locale/messages-nn.js +2 -1
- package/lib/locale/messages-se.d.ts +1 -0
- package/lib/locale/messages-se.js +2 -1
- package/lib/locale/messages-sma.d.ts +1 -0
- package/lib/locale/messages-sma.js +2 -1
- package/package.json +6 -6
- package/src/CampaignBlock/CampaignBlock.tsx +43 -44
- package/src/ContentTypeHero/ContentTypeHero.stories.tsx +3 -4
- package/src/Embed/AudioEmbed.stories.tsx +3 -3
- package/src/Embed/BrightcoveEmbed.stories.tsx +3 -3
- package/src/Embed/CodeEmbed.tsx +5 -2
- package/src/Embed/ConceptEmbed.stories.tsx +3 -3
- package/src/Embed/ConceptEmbed.tsx +1 -0
- package/src/Embed/EmbedErrorPlaceholder.tsx +8 -9
- package/src/Embed/ExternalEmbed.stories.tsx +3 -3
- package/src/Embed/H5pEmbed.stories.tsx +3 -3
- package/src/Embed/IframeEmbed.stories.tsx +3 -3
- package/src/Embed/ImageEmbed.stories.tsx +3 -4
- package/src/Embed/RelatedContentEmbed.stories.tsx +3 -3
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +3 -4
- package/src/Grid/Grid.stories.tsx +4 -3
- package/src/LicenseByline/EmbedByline.tsx +1 -1
- package/src/locale/messages-en.ts +1 -0
- package/src/locale/messages-nb.ts +1 -0
- package/src/locale/messages-nn.ts +1 -0
- package/src/locale/messages-se.ts +1 -0
- package/src/locale/messages-sma.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.36-alpha.0",
|
|
4
4
|
"description": "UI component library for NDLA",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ndla/core": "^5.0.2",
|
|
36
|
-
"@ndla/icons": "^8.0.
|
|
36
|
+
"@ndla/icons": "^8.0.25-alpha.0",
|
|
37
37
|
"@ndla/licenses": "^8.0.3-alpha.0",
|
|
38
|
-
"@ndla/primitives": "^1.0.
|
|
39
|
-
"@ndla/safelink": "^7.0.
|
|
38
|
+
"@ndla/primitives": "^1.0.33-alpha.0",
|
|
39
|
+
"@ndla/safelink": "^7.0.33-alpha.0",
|
|
40
40
|
"@ndla/styled-system": "^0.0.22",
|
|
41
41
|
"@ndla/util": "^5.0.0-alpha.0",
|
|
42
42
|
"html-react-parser": "^5.1.8",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-router-dom": "> 6.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@ndla/preset-panda": "^0.0.
|
|
53
|
+
"@ndla/preset-panda": "^0.0.34",
|
|
54
54
|
"@ndla/types-backend": "^0.2.86",
|
|
55
55
|
"@ndla/types-embed": "^5.0.3-alpha.0",
|
|
56
56
|
"@pandacss/dev": "^0.46.0"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "183d252ef9c40520099fadd2ee6a48e46eb1c71e"
|
|
62
62
|
}
|
|
@@ -10,8 +10,9 @@ import parse from "html-react-parser";
|
|
|
10
10
|
import { ReactNode } from "react";
|
|
11
11
|
import { ArrowRightLine } from "@ndla/icons/common";
|
|
12
12
|
import { Text } from "@ndla/primitives";
|
|
13
|
-
import {
|
|
13
|
+
import { SafeLinkButton } from "@ndla/safelink";
|
|
14
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
|
+
import { CampaignBlockEmbedData } from "@ndla/types-embed";
|
|
15
16
|
import { HeadingLevel } from "../types";
|
|
16
17
|
import { getPossiblyRelativeUrl } from "../utils/relativeUrl";
|
|
17
18
|
|
|
@@ -29,9 +30,10 @@ interface Props {
|
|
|
29
30
|
text?: string;
|
|
30
31
|
};
|
|
31
32
|
image?: Image;
|
|
32
|
-
imageSide?: "
|
|
33
|
+
imageSide?: CampaignBlockEmbedData["imageSide"];
|
|
33
34
|
className?: string;
|
|
34
35
|
path?: string;
|
|
36
|
+
background?: CampaignBlockEmbedData["background"];
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
const Wrapper = styled("div", {
|
|
@@ -46,7 +48,6 @@ const Container = styled("div", {
|
|
|
46
48
|
base: {
|
|
47
49
|
display: "grid",
|
|
48
50
|
gridTemplateColumns: "1fr",
|
|
49
|
-
gap: "medium",
|
|
50
51
|
border: "1px solid",
|
|
51
52
|
borderColor: "stroke.default",
|
|
52
53
|
backgroundColor: "background.default",
|
|
@@ -77,32 +78,19 @@ const Container = styled("div", {
|
|
|
77
78
|
},
|
|
78
79
|
},
|
|
79
80
|
},
|
|
81
|
+
background: {
|
|
82
|
+
neutral: {},
|
|
83
|
+
brand1: {
|
|
84
|
+
backgroundColor: "surface.brand.1",
|
|
85
|
+
},
|
|
86
|
+
brand3: {
|
|
87
|
+
backgroundColor: "surface.brand.3",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
80
90
|
},
|
|
81
91
|
defaultVariants: {
|
|
82
92
|
imageSide: "left",
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
const LinkText = styled(Text, {
|
|
87
|
-
base: {
|
|
88
|
-
display: "flex",
|
|
89
|
-
gap: "xxsmall",
|
|
90
|
-
textDecoration: "underline",
|
|
91
|
-
_hover: {
|
|
92
|
-
textDecoration: "none",
|
|
93
|
-
},
|
|
94
|
-
paddingBlock: "xsmall",
|
|
95
|
-
fontWeight: "bold",
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
const LinkHeader = styled(Text, {
|
|
100
|
-
base: {
|
|
101
|
-
display: "flex",
|
|
102
|
-
textDecoration: "underline",
|
|
103
|
-
_hover: {
|
|
104
|
-
textDecoration: "none",
|
|
105
|
-
},
|
|
93
|
+
background: "neutral",
|
|
106
94
|
},
|
|
107
95
|
});
|
|
108
96
|
|
|
@@ -122,6 +110,7 @@ const StyledImg = styled("img", {
|
|
|
122
110
|
height: "340px",
|
|
123
111
|
},
|
|
124
112
|
},
|
|
113
|
+
backgroundColor: "background.default",
|
|
125
114
|
},
|
|
126
115
|
});
|
|
127
116
|
|
|
@@ -135,6 +124,7 @@ const ContentWrapper = styled("div", {
|
|
|
135
124
|
justifyContent: "center",
|
|
136
125
|
paddingBlock: "medium",
|
|
137
126
|
paddingInline: "medium",
|
|
127
|
+
position: "relative",
|
|
138
128
|
},
|
|
139
129
|
});
|
|
140
130
|
|
|
@@ -150,20 +140,32 @@ const StyledText = styled(Text, {
|
|
|
150
140
|
},
|
|
151
141
|
});
|
|
152
142
|
|
|
153
|
-
interface
|
|
143
|
+
interface LinkButtonProps {
|
|
154
144
|
url?: string;
|
|
155
145
|
path?: string;
|
|
156
146
|
children: ReactNode;
|
|
157
147
|
}
|
|
158
148
|
|
|
159
|
-
const
|
|
149
|
+
const StyledSafeLinkButton = styled(SafeLinkButton, {
|
|
160
150
|
base: {
|
|
161
|
-
|
|
151
|
+
boxShadow: "full",
|
|
152
|
+
border: "1px solid",
|
|
153
|
+
borderColor: "stroke.default",
|
|
162
154
|
},
|
|
163
155
|
});
|
|
164
156
|
|
|
165
|
-
const
|
|
166
|
-
if (url)
|
|
157
|
+
const LinkButton = ({ url, children, path }: LinkButtonProps) => {
|
|
158
|
+
if (url)
|
|
159
|
+
return (
|
|
160
|
+
<StyledSafeLinkButton
|
|
161
|
+
to={getPossiblyRelativeUrl(url, path)}
|
|
162
|
+
target="_blank"
|
|
163
|
+
variant="secondary"
|
|
164
|
+
rel="noopener noreferrer"
|
|
165
|
+
>
|
|
166
|
+
{children}
|
|
167
|
+
</StyledSafeLinkButton>
|
|
168
|
+
);
|
|
167
169
|
return children;
|
|
168
170
|
};
|
|
169
171
|
|
|
@@ -176,27 +178,24 @@ const CampaignBlock = ({
|
|
|
176
178
|
url,
|
|
177
179
|
path,
|
|
178
180
|
className,
|
|
181
|
+
background,
|
|
179
182
|
}: Props) => {
|
|
180
183
|
const imageComponent = image && <StyledImg src={`${image.src}?width=455`} height={340} width={455} alt={image.alt} />;
|
|
181
|
-
|
|
184
|
+
|
|
182
185
|
return (
|
|
183
186
|
<Wrapper>
|
|
184
|
-
<Container className={className} data-embed-type="campaign-block" imageSide={imageSide}>
|
|
187
|
+
<Container className={className} data-embed-type="campaign-block" imageSide={imageSide} background={background}>
|
|
185
188
|
{imageSide === "left" && imageComponent}
|
|
186
189
|
<ContentWrapper>
|
|
187
|
-
<
|
|
188
|
-
<
|
|
189
|
-
|
|
190
|
-
</HeaderComponent>
|
|
191
|
-
</MaybeLinkText>
|
|
190
|
+
<Text asChild consumeCss textStyle="heading.small">
|
|
191
|
+
<InternalHeading>{parse(title)}</InternalHeading>
|
|
192
|
+
</Text>
|
|
192
193
|
<StyledText textStyle="body.xlarge">{parse(description)}</StyledText>
|
|
193
194
|
{!!url?.url && (
|
|
194
|
-
<
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
</LinkText>
|
|
199
|
-
</MaybeLinkText>
|
|
195
|
+
<LinkButton url={url.url} path={path}>
|
|
196
|
+
{parse(url.text ?? "")}
|
|
197
|
+
<ArrowRightLine />
|
|
198
|
+
</LinkButton>
|
|
200
199
|
)}
|
|
201
200
|
</ContentWrapper>
|
|
202
201
|
{imageSide !== "left" && imageComponent}
|
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { Meta, StoryFn } from "@storybook/react";
|
|
10
|
-
import { HeroBackground, HeroContent, Text } from "@ndla/primitives";
|
|
10
|
+
import { HeroBackground, HeroContent, PageContent, Text } from "@ndla/primitives";
|
|
11
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
12
|
import { ContentTypeHero } from "./ContentTypeHero";
|
|
13
|
-
import { OneColumn } from "../Layout";
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* A thin wrapper around the `Hero` component that automatically assigns a variant based on the provided content type
|
|
@@ -31,7 +30,7 @@ export default {
|
|
|
31
30
|
export const HeroStory: StoryFn<typeof ContentTypeHero> = ({ ...args }) => (
|
|
32
31
|
<ContentTypeHero {...args}>
|
|
33
32
|
<HeroBackground />
|
|
34
|
-
<
|
|
33
|
+
<PageContent>
|
|
35
34
|
<HeroContent>Hello</HeroContent>
|
|
36
35
|
|
|
37
36
|
<styled.div css={{ background: "surface.default", padding: "medium" }}>
|
|
@@ -69,7 +68,7 @@ export const HeroStory: StoryFn<typeof ContentTypeHero> = ({ ...args }) => (
|
|
|
69
68
|
faucibus ac ut mauris. Fusce facilisis at erat a dignissim.
|
|
70
69
|
</Text>
|
|
71
70
|
</styled.div>
|
|
72
|
-
</
|
|
71
|
+
</PageContent>
|
|
73
72
|
</ContentTypeHero>
|
|
74
73
|
);
|
|
75
74
|
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
|
+
import { PageContent } from "@ndla/primitives";
|
|
10
11
|
import { AudioEmbedData, AudioMeta } from "@ndla/types-embed";
|
|
11
12
|
import AudioEmbed from "./AudioEmbed";
|
|
12
13
|
import { ArticleContent, ArticleWrapper } from "../Article";
|
|
13
|
-
import { OneColumn } from "../Layout";
|
|
14
14
|
|
|
15
15
|
const embedData: AudioEmbedData = {
|
|
16
16
|
resource: "audio",
|
|
@@ -187,13 +187,13 @@ const meta: Meta<typeof AudioEmbed> = {
|
|
|
187
187
|
tags: ["autodocs"],
|
|
188
188
|
decorators: [
|
|
189
189
|
(Story) => (
|
|
190
|
-
<
|
|
190
|
+
<PageContent variant="content" asChild>
|
|
191
191
|
<ArticleWrapper>
|
|
192
192
|
<ArticleContent>
|
|
193
193
|
<Story />
|
|
194
194
|
</ArticleContent>
|
|
195
195
|
</ArticleWrapper>
|
|
196
|
-
</
|
|
196
|
+
</PageContent>
|
|
197
197
|
),
|
|
198
198
|
],
|
|
199
199
|
};
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
|
+
import { PageContent } from "@ndla/primitives";
|
|
10
11
|
import { BrightcoveData, BrightcoveEmbedData, BrightcoveMetaData } from "@ndla/types-embed";
|
|
11
12
|
import BrightcoveEmbed from "./BrightcoveEmbed";
|
|
12
13
|
import { ArticleContent, ArticleWrapper } from "../Article";
|
|
13
|
-
import { OneColumn } from "../Layout";
|
|
14
14
|
|
|
15
15
|
const embedData: BrightcoveEmbedData = {
|
|
16
16
|
resource: "brightcove",
|
|
@@ -157,13 +157,13 @@ const meta: Meta<typeof BrightcoveEmbed> = {
|
|
|
157
157
|
tags: ["autodocs"],
|
|
158
158
|
decorators: [
|
|
159
159
|
(Story) => (
|
|
160
|
-
<
|
|
160
|
+
<PageContent variant="content" asChild>
|
|
161
161
|
<ArticleWrapper>
|
|
162
162
|
<ArticleContent>
|
|
163
163
|
<Story />
|
|
164
164
|
</ArticleContent>
|
|
165
165
|
</ArticleWrapper>
|
|
166
|
-
</
|
|
166
|
+
</PageContent>
|
|
167
167
|
),
|
|
168
168
|
],
|
|
169
169
|
};
|
package/src/Embed/CodeEmbed.tsx
CHANGED
|
@@ -14,11 +14,10 @@ import { Button, Figure } from "@ndla/primitives";
|
|
|
14
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
15
|
import { CodeMetaData } from "@ndla/types-embed";
|
|
16
16
|
import { copyTextToClipboard } from "@ndla/util";
|
|
17
|
+
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
17
18
|
import { CodeBlock, codeLanguageOptions } from "../CodeBlock";
|
|
18
19
|
import { ICodeLangugeOption } from "../CodeBlock/codeLanguageOptions";
|
|
19
20
|
|
|
20
|
-
// TODO: We need an error state for this
|
|
21
|
-
|
|
22
21
|
interface Props {
|
|
23
22
|
embed: CodeMetaData;
|
|
24
23
|
}
|
|
@@ -61,6 +60,10 @@ const CodeEmbed = ({ embed }: Props) => {
|
|
|
61
60
|
}
|
|
62
61
|
}, [isCopied]);
|
|
63
62
|
|
|
63
|
+
if (embed.status === "error") {
|
|
64
|
+
return <EmbedErrorPlaceholder type="code" />;
|
|
65
|
+
}
|
|
66
|
+
|
|
64
67
|
return (
|
|
65
68
|
<StyledFigure data-embed-type="code-block">
|
|
66
69
|
<StyledFigCaption>{embed.embedData.title || getTitleFromFormat(embed.embedData.codeFormat)}</StyledFigCaption>
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
|
+
import { PageContent } from "@ndla/primitives";
|
|
10
11
|
import { ConceptData, ConceptEmbedData } from "@ndla/types-embed";
|
|
11
12
|
import { ConceptEmbed } from "./ConceptEmbed";
|
|
12
13
|
import { ArticleContent, ArticleWrapper } from "../Article";
|
|
13
|
-
import { OneColumn } from "../Layout";
|
|
14
14
|
|
|
15
15
|
const blockEmbedData: ConceptEmbedData = {
|
|
16
16
|
contentId: "35",
|
|
@@ -149,13 +149,13 @@ const meta: Meta<typeof ConceptEmbed> = {
|
|
|
149
149
|
tags: ["autodocs"],
|
|
150
150
|
decorators: [
|
|
151
151
|
(Story) => (
|
|
152
|
-
<
|
|
152
|
+
<PageContent variant="content" asChild>
|
|
153
153
|
<ArticleWrapper>
|
|
154
154
|
<ArticleContent>
|
|
155
155
|
<Story />
|
|
156
156
|
</ArticleContent>
|
|
157
157
|
</ArticleWrapper>
|
|
158
|
-
</
|
|
158
|
+
</PageContent>
|
|
159
159
|
),
|
|
160
160
|
],
|
|
161
161
|
};
|
|
@@ -46,6 +46,7 @@ export const ConceptEmbed = ({ embed, renderContext, lang, previewAlt }: Props)
|
|
|
46
46
|
return <span>{embed.embedData.linkText}</span>;
|
|
47
47
|
}
|
|
48
48
|
if (embed.status === "error") {
|
|
49
|
+
// TODO: This could be either concept or gloss. We don't know if it errors out. :)
|
|
49
50
|
return <EmbedErrorPlaceholder type="gloss" />;
|
|
50
51
|
}
|
|
51
52
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { ReactNode } from "react";
|
|
10
|
-
import {
|
|
10
|
+
import { Report } from "@ndla/icons/common";
|
|
11
11
|
import { Figure, type FigureFloat, type FigureSize } from "@ndla/primitives";
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
13
|
import { EmbedByline } from "../LicenseByline";
|
|
@@ -25,16 +25,15 @@ const ErrorPlaceholder = styled("div", {
|
|
|
25
25
|
display: "flex",
|
|
26
26
|
alignItems: "center",
|
|
27
27
|
justifyContent: "center",
|
|
28
|
-
|
|
28
|
+
background: "background.subtle",
|
|
29
29
|
height: "surface.xsmall",
|
|
30
|
+
border: "1px solid",
|
|
31
|
+
borderColor: "stroke.default",
|
|
30
32
|
borderRadius: "xsmall",
|
|
31
33
|
"& svg": {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
"&[data-embed-type='audio']": {
|
|
37
|
-
height: "surface.3xsmall",
|
|
34
|
+
height: "5xlarge",
|
|
35
|
+
width: "5xlarge",
|
|
36
|
+
fill: "stroke.default",
|
|
38
37
|
},
|
|
39
38
|
},
|
|
40
39
|
});
|
|
@@ -52,7 +51,7 @@ const EmbedErrorPlaceholder = ({ type, children, figureType, float }: Props) =>
|
|
|
52
51
|
<StyledFigure size={figureType} float={float} data-embed-type={type}>
|
|
53
52
|
{children ?? (
|
|
54
53
|
<ErrorPlaceholder data-embed-type={type}>
|
|
55
|
-
<
|
|
54
|
+
<Report />
|
|
56
55
|
</ErrorPlaceholder>
|
|
57
56
|
)}
|
|
58
57
|
<EmbedByline error type={type} />
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
|
+
import { PageContent } from "@ndla/primitives";
|
|
10
11
|
import { OembedEmbedData, OembedData } from "@ndla/types-embed";
|
|
11
12
|
import ExternalEmbed from "./ExternalEmbed";
|
|
12
13
|
import { ArticleWrapper, ArticleContent } from "../Article";
|
|
13
|
-
import { OneColumn } from "../Layout";
|
|
14
14
|
|
|
15
15
|
const embedData: OembedEmbedData = {
|
|
16
16
|
resource: "external",
|
|
@@ -55,7 +55,7 @@ const meta: Meta<typeof ExternalEmbed> = {
|
|
|
55
55
|
tags: ["autodocs"],
|
|
56
56
|
decorators: [
|
|
57
57
|
(Story) => (
|
|
58
|
-
<
|
|
58
|
+
<PageContent variant="content" asChild>
|
|
59
59
|
<ArticleWrapper>
|
|
60
60
|
<ArticleContent>
|
|
61
61
|
<section>
|
|
@@ -63,7 +63,7 @@ const meta: Meta<typeof ExternalEmbed> = {
|
|
|
63
63
|
</section>
|
|
64
64
|
</ArticleContent>
|
|
65
65
|
</ArticleWrapper>
|
|
66
|
-
</
|
|
66
|
+
</PageContent>
|
|
67
67
|
),
|
|
68
68
|
],
|
|
69
69
|
};
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
|
+
import { PageContent } from "@ndla/primitives";
|
|
10
11
|
import { H5pEmbedData, H5pData } from "@ndla/types-embed";
|
|
11
12
|
import H5pEmbed from "./H5pEmbed";
|
|
12
13
|
import { ArticleWrapper, ArticleContent } from "../Article";
|
|
13
|
-
import { OneColumn } from "../Layout";
|
|
14
14
|
|
|
15
15
|
const embedData: H5pEmbedData = {
|
|
16
16
|
resource: "h5p",
|
|
@@ -52,13 +52,13 @@ const meta: Meta<typeof H5pEmbed> = {
|
|
|
52
52
|
tags: ["autodocs"],
|
|
53
53
|
decorators: [
|
|
54
54
|
(Story) => (
|
|
55
|
-
<
|
|
55
|
+
<PageContent variant="content" asChild>
|
|
56
56
|
<ArticleWrapper>
|
|
57
57
|
<ArticleContent>
|
|
58
58
|
<Story />
|
|
59
59
|
</ArticleContent>
|
|
60
60
|
</ArticleWrapper>
|
|
61
|
-
</
|
|
61
|
+
</PageContent>
|
|
62
62
|
),
|
|
63
63
|
],
|
|
64
64
|
};
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
|
+
import { PageContent } from "@ndla/primitives";
|
|
10
11
|
import { IframeData, IframeEmbedData } from "@ndla/types-embed";
|
|
11
12
|
import IframeEmbed from "./IframeEmbed";
|
|
12
13
|
import { ArticleWrapper, ArticleContent } from "../Article";
|
|
13
|
-
import { OneColumn } from "../Layout";
|
|
14
14
|
|
|
15
15
|
const embedData: IframeEmbedData = {
|
|
16
16
|
width: "708px",
|
|
@@ -27,13 +27,13 @@ const meta: Meta<typeof IframeEmbed> = {
|
|
|
27
27
|
tags: ["autodocs"],
|
|
28
28
|
decorators: [
|
|
29
29
|
(Story) => (
|
|
30
|
-
<
|
|
30
|
+
<PageContent variant="content" asChild>
|
|
31
31
|
<ArticleWrapper>
|
|
32
32
|
<ArticleContent>
|
|
33
33
|
<Story />
|
|
34
34
|
</ArticleContent>
|
|
35
35
|
</ArticleWrapper>
|
|
36
|
-
</
|
|
36
|
+
</PageContent>
|
|
37
37
|
),
|
|
38
38
|
],
|
|
39
39
|
};
|
|
@@ -8,14 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
import { ReactNode } from "react";
|
|
10
10
|
import { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
11
|
-
import { Text } from "@ndla/primitives";
|
|
11
|
+
import { PageContent, Text } from "@ndla/primitives";
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
13
|
import { IImageMetaInformationV3 } from "@ndla/types-backend/image-api";
|
|
14
14
|
import { ImageEmbedData } from "@ndla/types-embed";
|
|
15
15
|
import ImageEmbed from "./ImageEmbed";
|
|
16
16
|
import { ArticleWrapper, ArticleContent } from "../Article";
|
|
17
17
|
import { Grid } from "../Grid";
|
|
18
|
-
import { OneColumn } from "../Layout";
|
|
19
18
|
|
|
20
19
|
const embedData: ImageEmbedData = {
|
|
21
20
|
resource: "image",
|
|
@@ -96,13 +95,13 @@ const meta: Meta<typeof ImageEmbed> = {
|
|
|
96
95
|
},
|
|
97
96
|
decorators: [
|
|
98
97
|
(Story) => (
|
|
99
|
-
<
|
|
98
|
+
<PageContent variant="content" asChild>
|
|
100
99
|
<ArticleWrapper>
|
|
101
100
|
<ArticleContent>
|
|
102
101
|
<Story />
|
|
103
102
|
</ArticleContent>
|
|
104
103
|
</ArticleWrapper>
|
|
105
|
-
</
|
|
104
|
+
</PageContent>
|
|
106
105
|
),
|
|
107
106
|
],
|
|
108
107
|
};
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
|
+
import { PageContent } from "@ndla/primitives";
|
|
10
11
|
import { RelatedContentMetaData } from "@ndla/types-embed";
|
|
11
12
|
import RelatedContentEmbed from "./RelatedContentEmbed";
|
|
12
13
|
import { ArticleWrapper, ArticleContent } from "../Article";
|
|
13
|
-
import { OneColumn } from "../Layout";
|
|
14
14
|
import RelatedArticleList from "../RelatedArticleList";
|
|
15
15
|
|
|
16
16
|
const filmResourceMeta: RelatedContentMetaData = {
|
|
@@ -367,13 +367,13 @@ const meta: Meta<typeof RelatedContentEmbed> = {
|
|
|
367
367
|
tags: ["autodocs"],
|
|
368
368
|
decorators: [
|
|
369
369
|
(Story) => (
|
|
370
|
-
<
|
|
370
|
+
<PageContent variant="content" asChild>
|
|
371
371
|
<ArticleWrapper>
|
|
372
372
|
<ArticleContent>
|
|
373
373
|
<Story />
|
|
374
374
|
</ArticleContent>
|
|
375
375
|
</ArticleWrapper>
|
|
376
|
-
</
|
|
376
|
+
</PageContent>
|
|
377
377
|
),
|
|
378
378
|
],
|
|
379
379
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
|
-
import { ExpandableBox, ExpandableBoxSummary, FramedContent } from "@ndla/primitives";
|
|
10
|
+
import { ExpandableBox, ExpandableBoxSummary, FramedContent, PageContent } from "@ndla/primitives";
|
|
11
11
|
import { UuDisclaimerEmbedData } from "@ndla/types-embed";
|
|
12
12
|
import H5pEmbed from "./H5pEmbed";
|
|
13
13
|
import IframeEmbed from "./IframeEmbed";
|
|
@@ -15,7 +15,6 @@ import UuDisclaimerEmbed from "./UuDisclaimerEmbed";
|
|
|
15
15
|
import { ArticleWrapper, ArticleContent } from "../Article";
|
|
16
16
|
import CopyParagraphButton from "../CopyParagraphButton";
|
|
17
17
|
import FactBox from "../FactBox";
|
|
18
|
-
import { OneColumn } from "../Layout";
|
|
19
18
|
|
|
20
19
|
const embedData: UuDisclaimerEmbedData = {
|
|
21
20
|
resource: "uu-disclaimer",
|
|
@@ -29,13 +28,13 @@ const meta: Meta<typeof UuDisclaimerEmbed> = {
|
|
|
29
28
|
tags: ["autodocs"],
|
|
30
29
|
decorators: [
|
|
31
30
|
(Story) => (
|
|
32
|
-
<
|
|
31
|
+
<PageContent variant="content" asChild>
|
|
33
32
|
<ArticleWrapper>
|
|
34
33
|
<ArticleContent>
|
|
35
34
|
<Story />
|
|
36
35
|
</ArticleContent>
|
|
37
36
|
</ArticleWrapper>
|
|
38
|
-
</
|
|
37
|
+
</PageContent>
|
|
39
38
|
),
|
|
40
39
|
],
|
|
41
40
|
};
|