@ndla/ui 50.9.13 → 50.9.14
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/Embed/UuDisclaimerEmbed.js +11 -5
- package/es/ExpandableBox/ExpandableBox.js +2 -8
- package/es/all.css +1 -1
- package/lib/Embed/UuDisclaimerEmbed.js +11 -5
- package/lib/ExpandableBox/ExpandableBox.js +1 -8
- package/lib/all.css +1 -1
- package/package.json +17 -17
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +35 -1
- package/src/Embed/UuDisclaimerEmbed.tsx +9 -2
- package/src/ExpandableBox/ExpandableBox.tsx +1 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "50.9.
|
|
3
|
+
"version": "50.9.14",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
"types"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/accordion": "^3.0.
|
|
35
|
-
"@ndla/button": "^12.0.
|
|
36
|
-
"@ndla/carousel": "^4.0.
|
|
37
|
-
"@ndla/core": "^4.4.
|
|
38
|
-
"@ndla/dropdown-menu": "^1.0.
|
|
39
|
-
"@ndla/forms": "^6.0.
|
|
34
|
+
"@ndla/accordion": "^3.0.29",
|
|
35
|
+
"@ndla/button": "^12.0.34",
|
|
36
|
+
"@ndla/carousel": "^4.0.32",
|
|
37
|
+
"@ndla/core": "^4.4.1",
|
|
38
|
+
"@ndla/dropdown-menu": "^1.0.29",
|
|
39
|
+
"@ndla/forms": "^6.0.1",
|
|
40
40
|
"@ndla/hooks": "^2.1.5",
|
|
41
|
-
"@ndla/icons": "^5.0.
|
|
41
|
+
"@ndla/icons": "^5.0.11",
|
|
42
42
|
"@ndla/licenses": "^7.2.5",
|
|
43
|
-
"@ndla/modal": "^5.0.
|
|
44
|
-
"@ndla/notion": "^6.0.
|
|
45
|
-
"@ndla/safelink": "^4.1.
|
|
46
|
-
"@ndla/select": "^3.3.
|
|
47
|
-
"@ndla/switch": "^1.1.
|
|
48
|
-
"@ndla/tabs": "^3.2.
|
|
49
|
-
"@ndla/tooltip": "^6.0.
|
|
50
|
-
"@ndla/typography": "^0.4.
|
|
43
|
+
"@ndla/modal": "^5.0.31",
|
|
44
|
+
"@ndla/notion": "^6.0.32",
|
|
45
|
+
"@ndla/safelink": "^4.1.59",
|
|
46
|
+
"@ndla/select": "^3.3.6",
|
|
47
|
+
"@ndla/switch": "^1.1.35",
|
|
48
|
+
"@ndla/tabs": "^3.2.15",
|
|
49
|
+
"@ndla/tooltip": "^6.0.18",
|
|
50
|
+
"@ndla/typography": "^0.4.12",
|
|
51
51
|
"@ndla/util": "^4.0.4",
|
|
52
52
|
"@radix-ui/react-popover": "^1.0.7",
|
|
53
53
|
"@radix-ui/react-slider": "^1.1.2",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "fa56ac6f7c5fa3a4f877f02d9d52c216ab496fa7"
|
|
85
85
|
}
|
|
@@ -12,6 +12,8 @@ import H5pEmbed from "./H5pEmbed";
|
|
|
12
12
|
import IframeEmbed from "./IframeEmbed";
|
|
13
13
|
import UuDisclaimerEmbed from "./UuDisclaimerEmbed";
|
|
14
14
|
import { defaultParameters } from "../../../../stories/defaults";
|
|
15
|
+
import FactBox from "../FactBox";
|
|
16
|
+
import FramedContent from "../FramedContent";
|
|
15
17
|
|
|
16
18
|
const embedData: UuDisclaimerEmbedData = {
|
|
17
19
|
resource: "uu-disclaimer",
|
|
@@ -139,7 +141,7 @@ export const WithHtml: StoryObj<typeof UuDisclaimerEmbed> = {
|
|
|
139
141
|
},
|
|
140
142
|
children: (
|
|
141
143
|
<>
|
|
142
|
-
<
|
|
144
|
+
<p>Dette er html med en ekspanderboks</p>
|
|
143
145
|
<details>
|
|
144
146
|
<summary>Tittel</summary>
|
|
145
147
|
<p>innhold</p>
|
|
@@ -148,3 +150,35 @@ export const WithHtml: StoryObj<typeof UuDisclaimerEmbed> = {
|
|
|
148
150
|
),
|
|
149
151
|
},
|
|
150
152
|
};
|
|
153
|
+
|
|
154
|
+
export const WithFramedContent: StoryObj<typeof UuDisclaimerEmbed> = {
|
|
155
|
+
args: {
|
|
156
|
+
embed: {
|
|
157
|
+
resource: "uu-disclaimer",
|
|
158
|
+
status: "success",
|
|
159
|
+
embedData: embedData,
|
|
160
|
+
data: {},
|
|
161
|
+
},
|
|
162
|
+
children: (
|
|
163
|
+
<FramedContent>
|
|
164
|
+
<p>Dette er tekst i ramme</p>
|
|
165
|
+
</FramedContent>
|
|
166
|
+
),
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export const WithFactBox: StoryObj<typeof UuDisclaimerEmbed> = {
|
|
171
|
+
args: {
|
|
172
|
+
embed: {
|
|
173
|
+
resource: "uu-disclaimer",
|
|
174
|
+
status: "success",
|
|
175
|
+
embedData: embedData,
|
|
176
|
+
data: {},
|
|
177
|
+
},
|
|
178
|
+
children: (
|
|
179
|
+
<FactBox>
|
|
180
|
+
<p>Dette er faktaboks</p>
|
|
181
|
+
</FactBox>
|
|
182
|
+
),
|
|
183
|
+
},
|
|
184
|
+
};
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { ReactNode } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
11
|
import styled from "@emotion/styled";
|
|
12
|
+
import { spacing } from "@ndla/core";
|
|
12
13
|
import { InformationOutline } from "@ndla/icons/common";
|
|
13
14
|
import SafeLink from "@ndla/safelink";
|
|
14
15
|
import { UuDisclaimerMetaData } from "@ndla/types-embed";
|
|
@@ -31,6 +32,12 @@ const Disclaimer = styled.div`
|
|
|
31
32
|
-ms-user-select: none;
|
|
32
33
|
`;
|
|
33
34
|
|
|
35
|
+
const DisclaimerWrapper = styled.div`
|
|
36
|
+
> :nth-child(2) {
|
|
37
|
+
margin-top: ${spacing.xsmall};
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
|
|
34
41
|
const UuDisclaimerEmbed = ({ embed, children }: Props) => {
|
|
35
42
|
const { t } = useTranslation();
|
|
36
43
|
|
|
@@ -50,7 +57,7 @@ const UuDisclaimerEmbed = ({ embed, children }: Props) => {
|
|
|
50
57
|
) : null;
|
|
51
58
|
|
|
52
59
|
return (
|
|
53
|
-
|
|
60
|
+
<DisclaimerWrapper role="region">
|
|
54
61
|
<StyledMessageBox type="info">
|
|
55
62
|
<InformationOutline />
|
|
56
63
|
<Disclaimer>
|
|
@@ -59,7 +66,7 @@ const UuDisclaimerEmbed = ({ embed, children }: Props) => {
|
|
|
59
66
|
</Disclaimer>
|
|
60
67
|
</StyledMessageBox>
|
|
61
68
|
{children}
|
|
62
|
-
|
|
69
|
+
</DisclaimerWrapper>
|
|
63
70
|
);
|
|
64
71
|
};
|
|
65
72
|
|
|
@@ -18,14 +18,6 @@ export const ExpandableBox = ({ children, ...rest }: Props) => {
|
|
|
18
18
|
|
|
19
19
|
interface SummaryProps extends HTMLAttributes<HTMLElement> {}
|
|
20
20
|
|
|
21
|
-
const StyledSummary = styled.summary`
|
|
22
|
-
& > * {
|
|
23
|
-
display: inline;
|
|
24
|
-
font-size: ${fonts.size.text.metaText.medium};
|
|
25
|
-
font-weight: ${fonts.weight.normal};
|
|
26
|
-
}
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
21
|
export const ExpandableBoxSummary = ({ children, ...rest }: SummaryProps) => {
|
|
30
|
-
return <
|
|
22
|
+
return <summary {...rest}>{children}</summary>;
|
|
31
23
|
};
|