@ndla/ui 56.0.3-alpha.0 → 56.0.4-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 +34 -5
- package/dist/styles.css +144 -18
- package/es/Article/Article.js +1 -5
- package/es/Article/ArticleContent.js +27 -0
- package/es/Article/index.js +2 -1
- package/es/Embed/ImageEmbed.js +2 -1
- package/es/ErrorMessage/ErrorMessage.js +2 -0
- package/es/FileList/File.js +78 -23
- package/es/FileList/FileList.js +32 -37
- package/es/FileList/PdfFile.js +17 -16
- package/es/FileList/index.js +3 -5
- package/es/Grid/Grid.js +69 -48
- package/es/Grid/GridParallaxItem.js +32 -0
- package/es/Grid/index.js +2 -1
- package/es/KeyFigure/KeyFigure.js +28 -33
- package/es/LinkBlock/LinkBlockSection.js +1 -0
- package/es/RelatedArticleList/RelatedArticleList.js +1 -1
- package/es/index.js +1 -4
- package/es/styles.css +144 -18
- package/lib/Article/Article.d.ts +0 -1
- package/lib/Article/Article.js +3 -7
- package/lib/Article/ArticleContent.d.ts +11 -0
- package/lib/Article/ArticleContent.js +33 -0
- package/lib/Article/index.d.ts +2 -1
- package/lib/Article/index.js +2 -1
- package/lib/Embed/ImageEmbed.js +2 -1
- package/lib/ErrorMessage/ErrorMessage.js +2 -0
- package/lib/FileList/File.d.ts +5 -3
- package/lib/FileList/File.js +78 -23
- package/lib/FileList/FileList.d.ts +6 -6
- package/lib/FileList/FileList.js +35 -38
- package/lib/FileList/PdfFile.d.ts +2 -2
- package/lib/FileList/PdfFile.js +17 -15
- package/lib/FileList/index.d.ts +3 -5
- package/lib/FileList/index.js +19 -18
- package/lib/Grid/Grid.d.ts +4 -7
- package/lib/Grid/Grid.js +71 -49
- package/lib/Grid/GridParallaxItem.d.ts +9 -0
- package/lib/Grid/GridParallaxItem.js +39 -0
- package/lib/Grid/index.d.ts +2 -1
- package/lib/Grid/index.js +4 -5
- package/lib/KeyFigure/KeyFigure.js +30 -33
- package/lib/LinkBlock/LinkBlockSection.js +1 -0
- package/lib/RelatedArticleList/RelatedArticleList.js +1 -1
- package/lib/index.d.ts +1 -4
- package/lib/index.js +9 -24
- package/lib/styles.css +144 -18
- package/package.json +7 -7
- package/src/Article/Article.tsx +1 -6
- package/src/Article/ArticleContent.tsx +21 -0
- package/src/Article/index.ts +2 -1
- package/src/ContentTypeBadge/ContentTypeBadge.stories.tsx +8 -7
- package/src/Embed/ImageEmbed.tsx +3 -2
- package/src/ErrorMessage/ErrorMessage.tsx +2 -0
- package/src/FileList/File.tsx +63 -28
- package/src/FileList/FileList.stories.tsx +121 -12
- package/src/FileList/FileList.tsx +31 -37
- package/src/FileList/PdfFile.tsx +9 -9
- package/src/FileList/index.ts +3 -7
- package/src/Grid/Grid.stories.tsx +30 -31
- package/src/Grid/Grid.tsx +57 -85
- package/src/Grid/GridParallaxItem.tsx +26 -0
- package/src/Grid/index.ts +3 -1
- package/src/KeyFigure/KeyFigure.stories.tsx +18 -11
- package/src/KeyFigure/KeyFigure.tsx +33 -47
- package/src/LinkBlock/LinkBlockSection.tsx +1 -1
- package/src/RelatedArticleList/RelatedArticleList.tsx +1 -1
- package/src/index.ts +1 -7
- package/es/FileList/Format.js +0 -93
- package/es/Footer/FooterBlock.js +0 -17
- package/es/Footer/index.js +0 -9
- package/es/Messages/MessageBox.js +0 -79
- package/es/Messages/index.js +0 -10
- package/es/utils/resourceTypeColor.js +0 -46
- package/lib/FileList/Format.d.ts +0 -16
- package/lib/FileList/Format.js +0 -98
- package/lib/Footer/FooterBlock.d.ts +0 -13
- package/lib/Footer/FooterBlock.js +0 -24
- package/lib/Footer/index.d.ts +0 -8
- package/lib/Footer/index.js +0 -12
- package/lib/Messages/MessageBox.d.ts +0 -23
- package/lib/Messages/MessageBox.js +0 -87
- package/lib/Messages/index.d.ts +0 -9
- package/lib/Messages/index.js +0 -13
- package/lib/utils/resourceTypeColor.d.ts +0 -9
- package/lib/utils/resourceTypeColor.js +0 -54
- package/src/FileList/Format.tsx +0 -83
- package/src/Footer/Footer.stories.tsx +0 -35
- package/src/Footer/FooterBlock.tsx +0 -30
- package/src/Footer/index.ts +0 -9
- package/src/Messages/MessageBox.stories.tsx +0 -95
- package/src/Messages/MessageBox.tsx +0 -126
- package/src/Messages/index.ts +0 -11
- package/src/utils/resourceTypeColor.tsx +0 -46
package/lib/Article/Article.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ArticleWrapper = exports.ArticleHeader = exports.ArticleFooter = exports.
|
|
6
|
+
exports.ArticleWrapper = exports.ArticleHeader = exports.ArticleFooter = exports.Article = void 0;
|
|
7
7
|
var _primitives = require("@ndla/primitives");
|
|
8
8
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
9
9
|
var _ArticleByline = _interopRequireDefault(require("./ArticleByline"));
|
|
10
|
+
var _ArticleContent = require("./ArticleContent");
|
|
10
11
|
var _ = require("..");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -18,11 +19,6 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
18
19
|
*
|
|
19
20
|
*/
|
|
20
21
|
|
|
21
|
-
const ArticleContent = exports.ArticleContent = (0, _jsx2.styled)("section", {
|
|
22
|
-
base: {
|
|
23
|
-
width: "100%"
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
22
|
const ArticleWrapper = exports.ArticleWrapper = (0, _jsx2.styled)("article", {
|
|
27
23
|
base: {
|
|
28
24
|
display: "flex",
|
|
@@ -138,7 +134,7 @@ const Article = _ref => {
|
|
|
138
134
|
children: introduction
|
|
139
135
|
})
|
|
140
136
|
}), competenceGoals]
|
|
141
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ArticleContent, {
|
|
137
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArticleContent.ArticleContent, {
|
|
142
138
|
children: content
|
|
143
139
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleFooter, {
|
|
144
140
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ArticleByline.default, {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024-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
|
+
/// <reference types="react" />
|
|
9
|
+
export declare const ArticleContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
|
|
10
|
+
consumeCss?: boolean | undefined;
|
|
11
|
+
} & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ArticleContent = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _react2 = require("@ark-ui/react");
|
|
9
|
+
var _css = require("@ndla/styled-system/css");
|
|
10
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
/**
|
|
13
|
+
* Copyright (c) 2024-present, NDLA.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const StyledArticleContent = (0, _jsx2.styled)(_react2.ark.section, {}, {
|
|
21
|
+
baseComponent: true
|
|
22
|
+
});
|
|
23
|
+
const ArticleContent = exports.ArticleContent = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
24
|
+
let {
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
} = _ref;
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledArticleContent, {
|
|
29
|
+
className: (0, _css.cx)("ndla-article", className),
|
|
30
|
+
...props,
|
|
31
|
+
ref: ref
|
|
32
|
+
});
|
|
33
|
+
});
|
package/lib/Article/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import ArticleByline from "./ArticleByline";
|
|
9
9
|
import ArticleFootNotes from "./ArticleFootNotes";
|
|
10
|
-
export { Article,
|
|
10
|
+
export { Article, ArticleWrapper, ArticleHeader, ArticleFooter } from "./Article";
|
|
11
|
+
export { ArticleContent } from "./ArticleContent";
|
|
11
12
|
export { ArticleByline, ArticleFootNotes };
|
|
12
13
|
export { ArticleParagraph } from "./ArticleParagraph";
|
package/lib/Article/index.js
CHANGED
|
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "ArticleByline", {
|
|
|
18
18
|
Object.defineProperty(exports, "ArticleContent", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _ArticleContent.ArticleContent;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "ArticleFootNotes", {
|
|
@@ -54,5 +54,6 @@ Object.defineProperty(exports, "ArticleWrapper", {
|
|
|
54
54
|
var _ArticleByline = _interopRequireDefault(require("./ArticleByline"));
|
|
55
55
|
var _ArticleFootNotes = _interopRequireDefault(require("./ArticleFootNotes"));
|
|
56
56
|
var _Article = require("./Article");
|
|
57
|
+
var _ArticleContent = require("./ArticleContent");
|
|
57
58
|
var _ArticleParagraph = require("./ArticleParagraph");
|
|
58
59
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/lib/Embed/ImageEmbed.js
CHANGED
|
@@ -35,10 +35,11 @@ const errorSvgSrc = exports.errorSvgSrc = `data:image/svg+xml;charset=UTF-8,%3Cs
|
|
|
35
35
|
const getFigureProps = (size, float) => {
|
|
36
36
|
const actualFloat = float === "left" ? "left" : float === "right" ? "right" : undefined;
|
|
37
37
|
const replacedSize = size?.replace("-hide-byline", "") ?? "full";
|
|
38
|
+
const actualSize = replacedSize === "fullwidth" ? "full" : replacedSize;
|
|
38
39
|
return {
|
|
39
40
|
float: actualFloat,
|
|
40
41
|
// Figure expects you to set a size when floating. If you don't, the figure will simply take up the available width. Fallback to medium in those cases.
|
|
41
|
-
size:
|
|
42
|
+
size: actualSize === "full" && float ? "medium" : actualSize
|
|
42
43
|
};
|
|
43
44
|
};
|
|
44
45
|
const getSizes = (size, align) => {
|
package/lib/FileList/File.d.ts
CHANGED
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
import { ComponentPropsWithRef } from "react";
|
|
9
|
+
export interface FileProps extends ComponentPropsWithRef<"div"> {
|
|
9
10
|
title: string;
|
|
10
11
|
url: string;
|
|
11
12
|
fileExists: boolean;
|
|
12
13
|
fileType: string;
|
|
14
|
+
fileSize?: string;
|
|
13
15
|
}
|
|
14
16
|
export interface FileType {
|
|
15
17
|
title: string;
|
|
@@ -21,5 +23,5 @@ export interface FileFormat {
|
|
|
21
23
|
fileType: string;
|
|
22
24
|
tooltip: string;
|
|
23
25
|
}
|
|
24
|
-
declare const File: (
|
|
25
|
-
export
|
|
26
|
+
export declare const File: import("react").ForwardRefExoticComponent<Omit<FileProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export declare const FileListElement: ({ title, url, fileExists, fileType, fileSize }: FileProps) => import("react/jsx-runtime").JSX.Element;
|
package/lib/FileList/File.js
CHANGED
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
6
|
+
exports.FileListElement = exports.File = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _reactI18next = require("react-i18next");
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var _common = require("@ndla/icons/common");
|
|
10
|
+
var _primitives = require("@ndla/primitives");
|
|
11
|
+
var _safelink = require("@ndla/safelink");
|
|
12
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
13
|
+
var _patterns = require("@ndla/styled-system/patterns");
|
|
14
|
+
var _ = require(".");
|
|
11
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
16
|
/**
|
|
14
17
|
* Copyright (c) 2023-present, NDLA.
|
|
15
18
|
*
|
|
@@ -18,34 +21,86 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
18
21
|
*
|
|
19
22
|
*/
|
|
20
23
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const StyledSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
|
|
25
|
+
base: {
|
|
26
|
+
textUnderlineOffset: "2px",
|
|
27
|
+
textDecoration: "underline",
|
|
28
|
+
_hover: {
|
|
29
|
+
textDecoration: "none"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const StyledHStack = (0, _jsx2.styled)(_jsx2.HStack, {
|
|
34
|
+
base: {
|
|
35
|
+
position: "relative",
|
|
36
|
+
paddingBlock: "small",
|
|
37
|
+
paddingInlineEnd: "medium",
|
|
38
|
+
paddingInlineStart: "small",
|
|
39
|
+
width: "100%"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const File = exports.File = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
28
43
|
let {
|
|
29
44
|
title,
|
|
30
45
|
url,
|
|
31
46
|
fileExists,
|
|
32
|
-
fileType
|
|
47
|
+
fileType,
|
|
48
|
+
fileSize,
|
|
49
|
+
...rest
|
|
33
50
|
} = _ref;
|
|
34
51
|
const {
|
|
35
52
|
t
|
|
36
53
|
} = (0, _reactI18next.useTranslation)();
|
|
37
54
|
const tooltip = `${t("download")} ${url.split("/").pop()}`;
|
|
38
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
55
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledHStack, {
|
|
56
|
+
justify: "space-between",
|
|
57
|
+
ref: ref,
|
|
58
|
+
...rest,
|
|
59
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsx2.HStack, {
|
|
60
|
+
gap: "xxsmall",
|
|
61
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_common.DownloadLine, {}), fileExists ? /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSafeLink, {
|
|
62
|
+
unstyled: true,
|
|
63
|
+
css: _patterns.linkOverlay.raw(),
|
|
64
|
+
to: url,
|
|
65
|
+
title: tooltip,
|
|
66
|
+
children: title
|
|
67
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
68
|
+
textStyle: "label.medium",
|
|
69
|
+
children: title
|
|
70
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
71
|
+
textStyle: "label.large",
|
|
72
|
+
asChild: true,
|
|
73
|
+
consumeCss: true,
|
|
74
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
75
|
+
children: ["(", fileType?.toUpperCase(), ")"]
|
|
76
|
+
})
|
|
77
|
+
})]
|
|
78
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
79
|
+
textStyle: "label.large",
|
|
80
|
+
asChild: true,
|
|
81
|
+
consumeCss: true,
|
|
82
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
83
|
+
children: fileSize
|
|
84
|
+
})
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
const FileListElement = _ref2 => {
|
|
89
|
+
let {
|
|
90
|
+
title,
|
|
91
|
+
url,
|
|
92
|
+
fileExists,
|
|
93
|
+
fileType,
|
|
94
|
+
fileSize
|
|
95
|
+
} = _ref2;
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.FileListItem, {
|
|
97
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(File, {
|
|
46
98
|
title: title,
|
|
47
|
-
|
|
99
|
+
url: url,
|
|
100
|
+
fileExists: fileExists,
|
|
101
|
+
fileType: fileType,
|
|
102
|
+
fileSize: fileSize
|
|
48
103
|
})
|
|
49
104
|
});
|
|
50
105
|
};
|
|
51
|
-
|
|
106
|
+
exports.FileListElement = FileListElement;
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
interface Props extends
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
headingButtons?: ReactNode;
|
|
8
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
9
|
+
interface Props extends ComponentPropsWithoutRef<"div"> {
|
|
12
10
|
}
|
|
13
|
-
declare const
|
|
14
|
-
export
|
|
11
|
+
export declare const FileListWrapper: import("@ndla/styled-system/types").StyledComponent<"div", {}>;
|
|
12
|
+
export declare const FileListItem: import("@ndla/styled-system/types").StyledComponent<"li", {}>;
|
|
13
|
+
export declare const FileListEmbed: ({ children, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
package/lib/FileList/FileList.js
CHANGED
|
@@ -3,63 +3,60 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
6
|
+
exports.FileListWrapper = exports.FileListItem = exports.FileListEmbed = void 0;
|
|
8
7
|
var _reactI18next = require("react-i18next");
|
|
9
|
-
var
|
|
10
|
-
var
|
|
8
|
+
var _primitives = require("@ndla/primitives");
|
|
9
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
11
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
|
|
13
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /**
|
|
11
|
+
/**
|
|
14
12
|
* Copyright (c) 2023-present, NDLA.
|
|
15
13
|
*
|
|
16
14
|
* This source code is licensed under the GPLv3 license found in the
|
|
17
15
|
* LICENSE file in the root directory of this source tree.
|
|
18
16
|
*
|
|
19
17
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
|
|
19
|
+
const FileListWrapper = exports.FileListWrapper = (0, _jsx2.styled)("div", {
|
|
20
|
+
base: {
|
|
21
|
+
display: "flex",
|
|
22
|
+
flexDirection: "column",
|
|
23
|
+
gap: "xsmall"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const FileListItem = exports.FileListItem = (0, _jsx2.styled)("li", {
|
|
27
|
+
base: {
|
|
28
|
+
background: "surface.infoSubtle",
|
|
29
|
+
borderBlockEnd: "1px solid",
|
|
30
|
+
borderColor: "stroke.default",
|
|
31
|
+
display: "flex",
|
|
32
|
+
justifyContent: "space-between",
|
|
33
|
+
_hover: {
|
|
34
|
+
backgroundColor: "surface.infoSubtle.hover"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
39
37
|
});
|
|
40
|
-
const
|
|
38
|
+
const FileListEmbed = _ref => {
|
|
41
39
|
let {
|
|
42
40
|
children,
|
|
43
|
-
headingButtons,
|
|
44
41
|
...rest
|
|
45
42
|
} = _ref;
|
|
46
43
|
const {
|
|
47
44
|
t
|
|
48
45
|
} = (0, _reactI18next.useTranslation)();
|
|
49
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(FileListWrapper, {
|
|
50
47
|
...rest,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
"data-embed-type": "file-list",
|
|
49
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Heading, {
|
|
50
|
+
fontWeight: "bold",
|
|
51
|
+
textStyle: "heading.small",
|
|
52
|
+
asChild: true,
|
|
53
|
+
consumeCss: true,
|
|
54
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
|
|
56
55
|
children: t("files")
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
})]
|
|
60
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(FilesList, {
|
|
56
|
+
})
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
61
58
|
children: children
|
|
62
59
|
})]
|
|
63
60
|
});
|
|
64
61
|
};
|
|
65
|
-
|
|
62
|
+
exports.FileListEmbed = FileListEmbed;
|
|
@@ -9,5 +9,5 @@ interface Props {
|
|
|
9
9
|
title: string;
|
|
10
10
|
url: string;
|
|
11
11
|
}
|
|
12
|
-
declare const PdfFile: ({ title, url }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export
|
|
12
|
+
export declare const PdfFile: ({ title, url }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
package/lib/FileList/PdfFile.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.PdfFile = void 0;
|
|
7
7
|
var _primitives = require("@ndla/primitives");
|
|
8
8
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -32,19 +32,21 @@ const PdfFile = _ref => {
|
|
|
32
32
|
title,
|
|
33
33
|
url
|
|
34
34
|
} = _ref;
|
|
35
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
children:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
36
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledFigure, {
|
|
37
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Heading, {
|
|
38
|
+
asChild: true,
|
|
39
|
+
consumeCss: true,
|
|
40
|
+
textStyle: "title.medium",
|
|
41
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h4", {
|
|
42
|
+
children: title
|
|
43
|
+
})
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledIframe, {
|
|
45
|
+
title: title,
|
|
46
|
+
height: "1050",
|
|
47
|
+
src: url
|
|
48
|
+
})]
|
|
49
|
+
})
|
|
48
50
|
});
|
|
49
51
|
};
|
|
50
|
-
|
|
52
|
+
exports.PdfFile = PdfFile;
|
package/lib/FileList/index.d.ts
CHANGED
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export { default as Format } from "./Format";
|
|
12
|
-
export default FileList;
|
|
8
|
+
export { FileListEmbed, FileListItem } from "./FileList";
|
|
9
|
+
export { File, FileListElement } from "./File";
|
|
10
|
+
export { PdfFile } from "./PdfFile";
|
package/lib/FileList/index.js
CHANGED
|
@@ -6,32 +6,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "File", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return _File.
|
|
9
|
+
return _File.File;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "FileListElement", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _File.FileListElement;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "FileListEmbed", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _FileList.FileListEmbed;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "FileListItem", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _FileList.FileListItem;
|
|
16
28
|
}
|
|
17
29
|
});
|
|
18
30
|
Object.defineProperty(exports, "PdfFile", {
|
|
19
31
|
enumerable: true,
|
|
20
32
|
get: function () {
|
|
21
|
-
return _PdfFile.
|
|
33
|
+
return _PdfFile.PdfFile;
|
|
22
34
|
}
|
|
23
35
|
});
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var _PdfFile = _interopRequireDefault(require("./PdfFile"));
|
|
28
|
-
var _Format = _interopRequireDefault(require("./Format"));
|
|
29
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
|
-
/**
|
|
31
|
-
* Copyright (c) 2018-present, NDLA.
|
|
32
|
-
*
|
|
33
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
34
|
-
* LICENSE file in the root directory of this source tree.
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
var _default = exports.default = _FileList.default;
|
|
36
|
+
var _FileList = require("./FileList");
|
|
37
|
+
var _File = require("./File");
|
|
38
|
+
var _PdfFile = require("./PdfFile");
|
package/lib/Grid/Grid.d.ts
CHANGED
|
@@ -5,14 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { ReactNode } from "react";
|
|
9
9
|
export interface GridProps {
|
|
10
|
-
columns: "2" | "4" | "2x2";
|
|
10
|
+
columns: "2" | "3" | "4" | "2x2";
|
|
11
11
|
border?: "none" | "lightBlue";
|
|
12
|
-
background?: "transparent" | "white";
|
|
13
|
-
size?: boolean;
|
|
12
|
+
background?: "transparent" | "white" | "gray";
|
|
14
13
|
children?: ReactNode[];
|
|
15
14
|
}
|
|
16
|
-
declare const Grid: ({ columns, border, children, background
|
|
17
|
-
export declare const GridParallaxItem: ({ children, ...rest }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export default Grid;
|
|
15
|
+
export declare const Grid: ({ columns, border, children, background }: GridProps) => import("react/jsx-runtime").JSX.Element;
|