@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.
Files changed (73) hide show
  1. package/dist/panda.buildinfo.json +24 -21
  2. package/dist/styles.css +82 -67
  3. package/es/Article/Article.js +22 -94
  4. package/es/Article/index.js +1 -1
  5. package/es/CampaignBlock/CampaignBlock.js +33 -5
  6. package/es/ContentTypeBadge/ContentTypeBadge.js +2 -0
  7. package/es/TreeStructure/TreeStructure.js +292 -181
  8. package/es/TreeStructure/helperFunctions.js +0 -3
  9. package/es/TreeStructure/index.js +1 -2
  10. package/es/index.js +1 -1
  11. package/es/locale/messages-en.js +3 -3
  12. package/es/locale/messages-nb.js +3 -3
  13. package/es/locale/messages-nn.js +3 -3
  14. package/es/locale/messages-se.js +3 -3
  15. package/es/locale/messages-sma.js +3 -3
  16. package/es/styles.css +82 -67
  17. package/lib/Article/Article.d.ts +3 -18
  18. package/lib/Article/Article.js +22 -94
  19. package/lib/Article/index.d.ts +1 -1
  20. package/lib/Article/index.js +0 -12
  21. package/lib/CampaignBlock/CampaignBlock.js +33 -5
  22. package/lib/ContentTypeBadge/ContentTypeBadge.js +2 -0
  23. package/lib/TreeStructure/TreeStructure.d.ts +7 -6
  24. package/lib/TreeStructure/TreeStructure.js +293 -180
  25. package/lib/TreeStructure/helperFunctions.d.ts +0 -2
  26. package/lib/TreeStructure/helperFunctions.js +2 -6
  27. package/lib/TreeStructure/index.d.ts +1 -2
  28. package/lib/TreeStructure/index.js +2 -3
  29. package/lib/TreeStructure/types.d.ts +4 -22
  30. package/lib/index.d.ts +1 -1
  31. package/lib/index.js +0 -12
  32. package/lib/locale/messages-en.js +3 -3
  33. package/lib/locale/messages-nb.js +3 -3
  34. package/lib/locale/messages-nn.js +3 -3
  35. package/lib/locale/messages-se.js +3 -3
  36. package/lib/locale/messages-sma.js +3 -3
  37. package/lib/styles.css +82 -67
  38. package/package.json +7 -8
  39. package/src/Article/Article.tsx +22 -107
  40. package/src/Article/index.ts +0 -2
  41. package/src/CampaignBlock/CampaignBlock.tsx +35 -4
  42. package/src/ContentTypeBadge/ContentTypeBadge.tsx +2 -0
  43. package/src/TreeStructure/TreeStructure.stories.tsx +38 -68
  44. package/src/TreeStructure/TreeStructure.tsx +307 -194
  45. package/src/TreeStructure/helperFunctions.ts +0 -5
  46. package/src/TreeStructure/index.ts +1 -2
  47. package/src/TreeStructure/types.ts +4 -25
  48. package/src/index.ts +0 -2
  49. package/src/locale/messages-en.ts +3 -3
  50. package/src/locale/messages-nb.ts +3 -3
  51. package/src/locale/messages-nn.ts +3 -3
  52. package/src/locale/messages-se.ts +3 -3
  53. package/src/locale/messages-sma.ts +3 -3
  54. package/es/TreeStructure/AddFolderButton.js +0 -80
  55. package/es/TreeStructure/ComboboxButton.js +0 -127
  56. package/es/TreeStructure/FolderItem.js +0 -225
  57. package/es/TreeStructure/FolderItems.js +0 -95
  58. package/es/TreeStructure/arrowNavigation.js +0 -35
  59. package/lib/TreeStructure/AddFolderButton.d.ts +0 -17
  60. package/lib/TreeStructure/AddFolderButton.js +0 -85
  61. package/lib/TreeStructure/ComboboxButton.d.ts +0 -27
  62. package/lib/TreeStructure/ComboboxButton.js +0 -134
  63. package/lib/TreeStructure/FolderItem.d.ts +0 -17
  64. package/lib/TreeStructure/FolderItem.js +0 -230
  65. package/lib/TreeStructure/FolderItems.d.ts +0 -22
  66. package/lib/TreeStructure/FolderItems.js +0 -100
  67. package/lib/TreeStructure/arrowNavigation.d.ts +0 -10
  68. package/lib/TreeStructure/arrowNavigation.js +0 -42
  69. package/src/TreeStructure/AddFolderButton.tsx +0 -79
  70. package/src/TreeStructure/ComboboxButton.tsx +0 -172
  71. package/src/TreeStructure/FolderItem.tsx +0 -307
  72. package/src/TreeStructure/FolderItems.tsx +0 -121
  73. 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
- desktop: {
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: "xsmall",
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 ? LinkText : _primitives.Text;
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)(_primitives.Text, {
123
- textStyle: "body.large",
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,
@@ -23,6 +23,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
23
23
  *
24
24
  */
25
25
 
26
+ // TODO: Remove this component
27
+
26
28
  const StyledContentTypeBadge = (0, _jsx2.styled)("div", {
27
29
  base: {
28
30
  display: "inline-flex",
@@ -1,14 +1,16 @@
1
1
  /**
2
- * Copyright (c) 2022-present, NDLA.
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 { CommonTreeStructureProps, NewFolderInputFunc } from "./types";
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 extends CommonTreeStructureProps {
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, folders, label, loading, maxLevel, onSelectFolder, targetResource, type, newFolderInput, ariaDescribedby, }: TreeStructureProps) => import("react/jsx-runtime").JSX.Element;
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;