@ndla/ui 56.0.14-alpha.0 → 56.0.16-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 +24 -21
- package/dist/styles.css +82 -67
- package/es/Article/Article.js +22 -94
- package/es/Article/index.js +1 -1
- package/es/CampaignBlock/CampaignBlock.js +33 -5
- package/es/ContentTypeBadge/ContentTypeBadge.js +2 -0
- package/es/TreeStructure/TreeStructure.js +292 -181
- package/es/TreeStructure/helperFunctions.js +0 -3
- package/es/TreeStructure/index.js +1 -2
- package/es/index.js +1 -1
- package/es/locale/messages-en.js +3 -3
- package/es/locale/messages-nb.js +3 -3
- package/es/locale/messages-nn.js +3 -3
- package/es/locale/messages-se.js +3 -3
- package/es/locale/messages-sma.js +3 -3
- package/es/styles.css +82 -67
- package/lib/Article/Article.d.ts +3 -18
- package/lib/Article/Article.js +22 -94
- package/lib/Article/index.d.ts +1 -1
- package/lib/Article/index.js +0 -12
- package/lib/CampaignBlock/CampaignBlock.js +33 -5
- package/lib/ContentTypeBadge/ContentTypeBadge.js +2 -0
- package/lib/TreeStructure/TreeStructure.d.ts +7 -6
- package/lib/TreeStructure/TreeStructure.js +293 -180
- package/lib/TreeStructure/helperFunctions.d.ts +0 -2
- package/lib/TreeStructure/helperFunctions.js +2 -6
- package/lib/TreeStructure/index.d.ts +1 -2
- package/lib/TreeStructure/index.js +2 -3
- package/lib/TreeStructure/types.d.ts +4 -22
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -12
- package/lib/locale/messages-en.js +3 -3
- package/lib/locale/messages-nb.js +3 -3
- package/lib/locale/messages-nn.js +3 -3
- package/lib/locale/messages-se.js +3 -3
- package/lib/locale/messages-sma.js +3 -3
- package/lib/styles.css +82 -67
- package/package.json +7 -8
- package/src/Article/Article.tsx +22 -107
- package/src/Article/index.ts +0 -2
- package/src/CampaignBlock/CampaignBlock.tsx +35 -4
- package/src/ContentTypeBadge/ContentTypeBadge.tsx +2 -0
- package/src/TreeStructure/TreeStructure.stories.tsx +38 -68
- package/src/TreeStructure/TreeStructure.tsx +307 -194
- package/src/TreeStructure/helperFunctions.ts +0 -5
- package/src/TreeStructure/index.ts +1 -2
- package/src/TreeStructure/types.ts +4 -25
- package/src/index.ts +0 -2
- package/src/locale/messages-en.ts +3 -3
- package/src/locale/messages-nb.ts +3 -3
- package/src/locale/messages-nn.ts +3 -3
- package/src/locale/messages-se.ts +3 -3
- package/src/locale/messages-sma.ts +3 -3
- package/es/TreeStructure/AddFolderButton.js +0 -80
- package/es/TreeStructure/ComboboxButton.js +0 -127
- package/es/TreeStructure/FolderItem.js +0 -225
- package/es/TreeStructure/FolderItems.js +0 -95
- package/es/TreeStructure/arrowNavigation.js +0 -35
- package/lib/TreeStructure/AddFolderButton.d.ts +0 -17
- package/lib/TreeStructure/AddFolderButton.js +0 -85
- package/lib/TreeStructure/ComboboxButton.d.ts +0 -27
- package/lib/TreeStructure/ComboboxButton.js +0 -134
- package/lib/TreeStructure/FolderItem.d.ts +0 -17
- package/lib/TreeStructure/FolderItem.js +0 -230
- package/lib/TreeStructure/FolderItems.d.ts +0 -22
- package/lib/TreeStructure/FolderItems.js +0 -100
- package/lib/TreeStructure/arrowNavigation.d.ts +0 -10
- package/lib/TreeStructure/arrowNavigation.js +0 -42
- package/src/TreeStructure/AddFolderButton.tsx +0 -79
- package/src/TreeStructure/ComboboxButton.tsx +0 -172
- package/src/TreeStructure/FolderItem.tsx +0 -307
- package/src/TreeStructure/FolderItems.tsx +0 -121
- package/src/TreeStructure/arrowNavigation.ts +0 -54
|
@@ -22,7 +22,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
22
22
|
|
|
23
23
|
const Container = (0, _jsx2.styled)("div", {
|
|
24
24
|
base: {
|
|
25
|
+
width: "100%",
|
|
25
26
|
display: "flex",
|
|
27
|
+
gap: "medium",
|
|
26
28
|
flexDirection: "column",
|
|
27
29
|
border: "1px solid",
|
|
28
30
|
borderColor: "stroke.default",
|
|
@@ -41,6 +43,17 @@ const LinkText = (0, _jsx2.styled)(_primitives.Text, {
|
|
|
41
43
|
display: "flex",
|
|
42
44
|
gap: "xxsmall",
|
|
43
45
|
textDecoration: "underline",
|
|
46
|
+
_hover: {
|
|
47
|
+
textDecoration: "none"
|
|
48
|
+
},
|
|
49
|
+
paddingBlock: "xsmall",
|
|
50
|
+
fontWeight: "bold"
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const LinkHeader = (0, _jsx2.styled)(_primitives.Text, {
|
|
54
|
+
base: {
|
|
55
|
+
display: "flex",
|
|
56
|
+
textDecoration: "underline",
|
|
44
57
|
_hover: {
|
|
45
58
|
textDecoration: "none"
|
|
46
59
|
}
|
|
@@ -52,8 +65,11 @@ const StyledImg = (0, _jsx2.styled)("img", {
|
|
|
52
65
|
objectFit: "cover",
|
|
53
66
|
width: "100%",
|
|
54
67
|
height: "215px",
|
|
55
|
-
|
|
68
|
+
mobileWide: {
|
|
56
69
|
height: "340px"
|
|
70
|
+
},
|
|
71
|
+
tabletWide: {
|
|
72
|
+
width: "auto"
|
|
57
73
|
}
|
|
58
74
|
}
|
|
59
75
|
});
|
|
@@ -63,12 +79,24 @@ const ContentWrapper = (0, _jsx2.styled)("div", {
|
|
|
63
79
|
position: "relative",
|
|
64
80
|
display: "flex",
|
|
65
81
|
flexDirection: "column",
|
|
66
|
-
gap: "
|
|
82
|
+
gap: "medium",
|
|
67
83
|
alignItems: "flex-start",
|
|
84
|
+
justifyContent: "center",
|
|
68
85
|
paddingBlock: "medium",
|
|
69
86
|
paddingInline: "medium"
|
|
70
87
|
}
|
|
71
88
|
});
|
|
89
|
+
const StyledText = (0, _jsx2.styled)(_primitives.Text, {
|
|
90
|
+
base: {
|
|
91
|
+
tabletWide: {
|
|
92
|
+
display: "block",
|
|
93
|
+
overflow: "hidden",
|
|
94
|
+
position: "relative",
|
|
95
|
+
lineClamp: 4,
|
|
96
|
+
boxOrient: "vertical"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
72
100
|
const StyledSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
|
|
73
101
|
base: {
|
|
74
102
|
color: "inherit"
|
|
@@ -103,7 +131,7 @@ const CampaignBlock = _ref2 => {
|
|
|
103
131
|
width: 455,
|
|
104
132
|
alt: image.alt
|
|
105
133
|
});
|
|
106
|
-
const HeaderComponent = url?.url ?
|
|
134
|
+
const HeaderComponent = url?.url ? LinkHeader : _primitives.Text;
|
|
107
135
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
108
136
|
className: className,
|
|
109
137
|
"data-embed-type": "campaign-block",
|
|
@@ -119,8 +147,8 @@ const CampaignBlock = _ref2 => {
|
|
|
119
147
|
children: (0, _htmlReactParser.default)(title)
|
|
120
148
|
})
|
|
121
149
|
})
|
|
122
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
123
|
-
textStyle: "body.
|
|
150
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledText, {
|
|
151
|
+
textStyle: "body.xlarge",
|
|
124
152
|
children: (0, _htmlReactParser.default)(description)
|
|
125
153
|
}), !!url?.url && /*#__PURE__*/(0, _jsxRuntime.jsx)(MaybeLinkText, {
|
|
126
154
|
url: url.url,
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2024-present, NDLA.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the GPLv3 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import { IFolder } from "@ndla/types-backend/myndla-api";
|
|
9
|
-
import {
|
|
8
|
+
import { IFolder, IResource } from "@ndla/types-backend/myndla-api";
|
|
9
|
+
import { NewFolderInputFunc } from "./types";
|
|
10
10
|
export declare const MAX_LEVEL_FOR_FOLDERS = 5;
|
|
11
|
-
export interface TreeStructureProps
|
|
11
|
+
export interface TreeStructureProps {
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
targetResource?: IResource;
|
|
12
14
|
defaultOpenFolders?: string[];
|
|
13
15
|
folders: IFolder[];
|
|
14
16
|
label?: string;
|
|
@@ -17,5 +19,4 @@ export interface TreeStructureProps extends CommonTreeStructureProps {
|
|
|
17
19
|
onSelectFolder?: (id: string) => void;
|
|
18
20
|
ariaDescribedby?: string;
|
|
19
21
|
}
|
|
20
|
-
declare const TreeStructure: ({ defaultOpenFolders,
|
|
21
|
-
export default TreeStructure;
|
|
22
|
+
export declare const TreeStructure: ({ folders, defaultOpenFolders, newFolderInput, label, targetResource, loading, maxLevel, onSelectFolder, ariaDescribedby, }: TreeStructureProps) => import("react/jsx-runtime").JSX.Element;
|