@ndla/ui 13.2.1 → 15.0.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 (245) hide show
  1. package/es/Article/Article.js +22 -3
  2. package/es/Article/ArticleFavoritesButton.js +38 -0
  3. package/es/Article/index.js +2 -1
  4. package/es/Breadcrumb/ActionBreadcrumb.js +57 -0
  5. package/es/Breadcrumb/index.js +1 -0
  6. package/es/Footer/FooterAuth.js +15 -22
  7. package/es/InfoBlock/InfoBlock.js +55 -0
  8. package/es/InfoBlock/index.js +1 -0
  9. package/es/LearningPaths/LearningPathMenu.js +3 -4
  10. package/es/Masthead/MastheadAuthModal.js +2 -2
  11. package/es/MyNdla/Navigation/VerticalNavigation.js +51 -0
  12. package/es/MyNdla/Navigation/index.js +2 -0
  13. package/es/MyNdla/Resource/Folder.js +86 -0
  14. package/{lib/MyNdla/ResourceDash/ResourcesView.d.ts → es/MyNdla/Resource/index.js} +2 -3
  15. package/es/MyNdla/index.js +3 -4
  16. package/es/Notion/ConceptNotion.js +2 -1
  17. package/es/Notion/FigureNotion.js +13 -9
  18. package/es/Notion/NotionVisualElement.js +3 -2
  19. package/es/Resource/BlockResource.js +73 -0
  20. package/es/Resource/ListResource.js +66 -0
  21. package/es/Resource/index.js +10 -0
  22. package/es/Resource/resourceComponents.js +97 -0
  23. package/es/ResourceGroup/ResourceGroup.js +7 -5
  24. package/es/ResourceGroup/ResourceItem.js +28 -30
  25. package/es/ResourceGroup/ResourceList.js +18 -6
  26. package/es/Search/ActiveFilters.js +6 -7
  27. package/es/Search/ContentTypeResult.js +6 -8
  28. package/es/SearchTypeResult/ActiveFilters.js +6 -10
  29. package/es/SearchTypeResult/SearchViewType.js +5 -5
  30. package/es/SnackBar/SnackBar.js +117 -0
  31. package/es/SnackBar/index.js +9 -0
  32. package/es/TagSelector/SuggestionInput.js +240 -0
  33. package/es/TagSelector/Suggestions.js +93 -0
  34. package/es/TagSelector/TagSelector.js +137 -0
  35. package/es/TagSelector/index.js +9 -0
  36. package/es/TopicIntroductionList/TopicIntroduction.js +2 -4
  37. package/es/TopicIntroductionList/TopicShortcutItem.js +1 -3
  38. package/es/TreeStructure/FolderItem.js +130 -0
  39. package/es/TreeStructure/FolderItems.js +123 -0
  40. package/es/TreeStructure/FolderNameInput.js +112 -0
  41. package/es/TreeStructure/TreeStructure.js +254 -0
  42. package/es/TreeStructure/TreeStructure.types.js +0 -0
  43. package/es/TreeStructure/TreeStructureWrapper.js +13 -0
  44. package/es/TreeStructure/helperFunctions.js +92 -0
  45. package/es/TreeStructure/index.js +9 -0
  46. package/es/TreeStructure/keyboardNavigation/keyboardNavigation.js +182 -0
  47. package/es/TreeStructure/keyboardNavigation/keyboardNavigation.types.js +0 -0
  48. package/es/User/AuthModal.js +15 -24
  49. package/es/User/UserInfo.js +70 -0
  50. package/es/User/apiTypes.js +0 -0
  51. package/es/User/index.js +2 -0
  52. package/es/User/parseUserObject.js +102 -0
  53. package/es/all.css +90 -0
  54. package/es/index.js +9 -3
  55. package/es/locale/messages-en.js +75 -8
  56. package/es/locale/messages-nb.js +74 -7
  57. package/es/locale/messages-nn.js +74 -7
  58. package/es/locale/messages-se.js +74 -7
  59. package/es/locale/messages-sma.js +74 -7
  60. package/lib/Article/Article.d.ts +3 -1
  61. package/lib/Article/Article.js +43 -23
  62. package/lib/Article/ArticleFavoritesButton.d.ts +15 -0
  63. package/lib/Article/ArticleFavoritesButton.js +56 -0
  64. package/lib/Article/index.d.ts +2 -1
  65. package/lib/Article/index.js +8 -0
  66. package/lib/Breadcrumb/ActionBreadcrumb.d.ts +16 -0
  67. package/lib/Breadcrumb/ActionBreadcrumb.js +72 -0
  68. package/lib/Breadcrumb/index.d.ts +1 -0
  69. package/lib/Breadcrumb/index.js +8 -0
  70. package/lib/Footer/FooterAuth.d.ts +1 -1
  71. package/lib/Footer/FooterAuth.js +17 -17
  72. package/lib/InfoBlock/InfoBlock.d.ts +8 -0
  73. package/lib/InfoBlock/InfoBlock.js +58 -0
  74. package/lib/InfoBlock/index.d.ts +1 -0
  75. package/lib/InfoBlock/index.js +13 -0
  76. package/lib/LearningPaths/LearningPathMenu.js +3 -4
  77. package/lib/Masthead/MastheadAuthModal.d.ts +3 -3
  78. package/lib/Masthead/MastheadAuthModal.js +3 -3
  79. package/lib/MyNdla/Navigation/VerticalNavigation.d.ts +10 -0
  80. package/lib/MyNdla/Navigation/VerticalNavigation.js +61 -0
  81. package/lib/MyNdla/Navigation/index.d.ts +2 -0
  82. package/lib/MyNdla/Navigation/index.js +15 -0
  83. package/lib/MyNdla/Resource/Folder.d.ts +20 -0
  84. package/lib/MyNdla/Resource/Folder.js +100 -0
  85. package/lib/MyNdla/Resource/index.d.ts +9 -0
  86. package/lib/MyNdla/Resource/index.js +15 -0
  87. package/lib/MyNdla/index.d.ts +3 -4
  88. package/lib/MyNdla/index.js +9 -11
  89. package/lib/Notion/ConceptNotion.js +2 -1
  90. package/lib/Notion/FigureNotion.d.ts +1 -1
  91. package/lib/Notion/FigureNotion.js +12 -8
  92. package/lib/Notion/NotionVisualElement.js +3 -2
  93. package/lib/Resource/BlockResource.d.ts +20 -0
  94. package/lib/Resource/BlockResource.js +84 -0
  95. package/lib/Resource/ListResource.d.ts +20 -0
  96. package/lib/Resource/ListResource.js +78 -0
  97. package/lib/Resource/index.d.ts +11 -0
  98. package/lib/Resource/index.js +29 -0
  99. package/lib/Resource/resourceComponents.d.ts +24 -0
  100. package/lib/Resource/resourceComponents.js +106 -0
  101. package/lib/ResourceGroup/ResourceGroup.d.ts +2 -1
  102. package/lib/ResourceGroup/ResourceGroup.js +7 -5
  103. package/lib/ResourceGroup/ResourceItem.d.ts +5 -1
  104. package/lib/ResourceGroup/ResourceItem.js +29 -30
  105. package/lib/ResourceGroup/ResourceList.d.ts +3 -1
  106. package/lib/ResourceGroup/ResourceList.js +18 -6
  107. package/lib/Search/ActiveFilters.js +6 -7
  108. package/lib/Search/ContentTypeResult.js +6 -8
  109. package/lib/SearchTypeResult/ActiveFilters.js +6 -10
  110. package/lib/SearchTypeResult/SearchViewType.js +5 -5
  111. package/lib/SnackBar/SnackBar.d.ts +23 -0
  112. package/lib/SnackBar/SnackBar.js +127 -0
  113. package/lib/SnackBar/index.d.ts +10 -0
  114. package/lib/SnackBar/index.js +15 -0
  115. package/lib/TagSelector/SuggestionInput.d.ts +19 -0
  116. package/lib/TagSelector/SuggestionInput.js +255 -0
  117. package/lib/TagSelector/Suggestions.d.ts +12 -0
  118. package/lib/TagSelector/Suggestions.js +96 -0
  119. package/lib/TagSelector/TagSelector.d.ts +16 -0
  120. package/lib/TagSelector/TagSelector.js +150 -0
  121. package/lib/TagSelector/index.d.ts +10 -0
  122. package/lib/TagSelector/index.js +19 -0
  123. package/lib/TopicIntroductionList/TopicIntroduction.js +2 -4
  124. package/lib/TopicIntroductionList/TopicShortcutItem.js +1 -3
  125. package/lib/TreeStructure/FolderItem.d.ts +27 -0
  126. package/lib/TreeStructure/FolderItem.js +140 -0
  127. package/lib/TreeStructure/FolderItems.d.ts +11 -0
  128. package/lib/TreeStructure/FolderItems.js +130 -0
  129. package/lib/TreeStructure/FolderNameInput.d.ts +15 -0
  130. package/lib/TreeStructure/FolderNameInput.js +125 -0
  131. package/lib/TreeStructure/TreeStructure.d.ts +12 -0
  132. package/lib/TreeStructure/TreeStructure.js +273 -0
  133. package/lib/TreeStructure/TreeStructure.types.d.ts +63 -0
  134. package/lib/TreeStructure/TreeStructure.types.js +1 -0
  135. package/lib/TreeStructure/TreeStructureWrapper.d.ts +12 -0
  136. package/lib/TreeStructure/TreeStructureWrapper.js +24 -0
  137. package/lib/TreeStructure/helperFunctions.d.ts +5 -0
  138. package/lib/TreeStructure/helperFunctions.js +103 -0
  139. package/lib/TreeStructure/index.d.ts +10 -0
  140. package/lib/TreeStructure/index.js +15 -0
  141. package/lib/TreeStructure/keyboardNavigation/keyboardNavigation.d.ts +11 -0
  142. package/lib/TreeStructure/keyboardNavigation/keyboardNavigation.js +186 -0
  143. package/lib/TreeStructure/keyboardNavigation/keyboardNavigation.types.d.ts +26 -0
  144. package/lib/TreeStructure/keyboardNavigation/keyboardNavigation.types.js +1 -0
  145. package/lib/User/AuthModal.d.ts +3 -3
  146. package/lib/User/AuthModal.js +16 -23
  147. package/lib/User/UserInfo.d.ts +13 -0
  148. package/lib/User/UserInfo.js +84 -0
  149. package/lib/User/apiTypes.d.ts +61 -0
  150. package/lib/User/apiTypes.js +1 -0
  151. package/lib/User/index.d.ts +4 -0
  152. package/lib/User/index.js +8 -0
  153. package/lib/User/parseUserObject.d.ts +32 -0
  154. package/lib/User/parseUserObject.js +105 -0
  155. package/lib/all.css +90 -0
  156. package/lib/index.d.ts +14 -3
  157. package/lib/index.js +76 -10
  158. package/lib/locale/messages-en.d.ts +67 -0
  159. package/lib/locale/messages-en.js +75 -8
  160. package/lib/locale/messages-nb.d.ts +67 -0
  161. package/lib/locale/messages-nb.js +74 -7
  162. package/lib/locale/messages-nn.d.ts +67 -0
  163. package/lib/locale/messages-nn.js +74 -7
  164. package/lib/locale/messages-se.d.ts +67 -0
  165. package/lib/locale/messages-se.js +74 -7
  166. package/lib/locale/messages-sma.d.ts +67 -0
  167. package/lib/locale/messages-sma.js +74 -7
  168. package/lib/types.d.ts +1 -1
  169. package/package.json +11 -11
  170. package/src/Article/Article.tsx +31 -0
  171. package/src/Article/ArticleFavoritesButton.tsx +40 -0
  172. package/src/Article/index.ts +2 -0
  173. package/src/Breadcrumb/ActionBreadcrumb.tsx +68 -0
  174. package/src/Breadcrumb/index.ts +2 -0
  175. package/src/Footer/FooterAuth.tsx +7 -9
  176. package/src/InfoBlock/InfoBlock.tsx +61 -0
  177. package/src/InfoBlock/index.ts +1 -0
  178. package/src/LearningPaths/LearningPathMenu.tsx +1 -1
  179. package/src/Masthead/MastheadAuthModal.tsx +4 -5
  180. package/src/MyNdla/Navigation/VerticalNavigation.tsx +93 -0
  181. package/src/MyNdla/Navigation/index.ts +2 -0
  182. package/src/MyNdla/Resource/Folder.tsx +143 -0
  183. package/src/MyNdla/Resource/index.ts +10 -0
  184. package/src/MyNdla/index.ts +3 -5
  185. package/src/Notion/ConceptNotion.tsx +1 -0
  186. package/src/Notion/FigureNotion.tsx +12 -5
  187. package/src/Notion/NotionVisualElement.tsx +1 -1
  188. package/src/Resource/BlockResource.tsx +101 -0
  189. package/src/Resource/ListResource.tsx +111 -0
  190. package/src/Resource/index.ts +12 -0
  191. package/src/Resource/resourceComponents.tsx +143 -0
  192. package/src/ResourceGroup/ResourceGroup.tsx +3 -0
  193. package/src/ResourceGroup/ResourceItem.tsx +20 -3
  194. package/src/ResourceGroup/ResourceList.tsx +16 -3
  195. package/src/Search/ActiveFilters.jsx +0 -1
  196. package/src/Search/ContentTypeResult.tsx +8 -9
  197. package/src/SearchTypeResult/ActiveFilters.tsx +1 -3
  198. package/src/SearchTypeResult/SearchViewType.tsx +1 -1
  199. package/src/SnackBar/SnackBar.tsx +183 -0
  200. package/src/SnackBar/index.ts +13 -0
  201. package/src/TagSelector/SuggestionInput.tsx +230 -0
  202. package/src/TagSelector/Suggestions.tsx +125 -0
  203. package/src/TagSelector/TagSelector.tsx +111 -0
  204. package/src/TagSelector/index.ts +13 -0
  205. package/src/TopicIntroductionList/TopicIntroduction.tsx +2 -2
  206. package/src/TopicIntroductionList/TopicShortcutItem.tsx +1 -5
  207. package/src/TreeStructure/FolderItem.tsx +160 -0
  208. package/src/TreeStructure/FolderItems.tsx +109 -0
  209. package/src/TreeStructure/FolderNameInput.tsx +109 -0
  210. package/src/TreeStructure/TreeStructure.tsx +184 -0
  211. package/src/TreeStructure/TreeStructure.types.ts +69 -0
  212. package/src/TreeStructure/TreeStructureWrapper.tsx +34 -0
  213. package/src/TreeStructure/helperFunctions.ts +52 -0
  214. package/src/TreeStructure/index.ts +11 -0
  215. package/src/TreeStructure/keyboardNavigation/keyboardNavigation.ts +161 -0
  216. package/src/TreeStructure/keyboardNavigation/keyboardNavigation.types.ts +28 -0
  217. package/src/User/AuthModal.tsx +5 -26
  218. package/src/User/UserInfo.tsx +80 -0
  219. package/src/User/__tests__/parseUserObject-test.ts +315 -0
  220. package/src/User/apiTypes.ts +74 -0
  221. package/src/User/index.ts +4 -0
  222. package/src/User/parseUserObject.ts +83 -0
  223. package/src/all.scss +2 -0
  224. package/src/index.ts +15 -4
  225. package/src/locale/messages-en.ts +69 -7
  226. package/src/locale/messages-nb.ts +68 -6
  227. package/src/locale/messages-nn.ts +68 -6
  228. package/src/locale/messages-se.ts +68 -6
  229. package/src/locale/messages-sma.ts +68 -6
  230. package/src/types.ts +1 -1
  231. package/es/MyNdla/ResourceDash/Breadcrumbs.js +0 -22
  232. package/es/MyNdla/ResourceDash/ResourceElement.js +0 -27
  233. package/es/MyNdla/ResourceDash/ResourcesView.js +0 -43
  234. package/es/MyNdla/ResourceDash/index.js +0 -4
  235. package/lib/MyNdla/ResourceDash/Breadcrumbs.d.ts +0 -15
  236. package/lib/MyNdla/ResourceDash/Breadcrumbs.js +0 -35
  237. package/lib/MyNdla/ResourceDash/ResourceElement.d.ts +0 -18
  238. package/lib/MyNdla/ResourceDash/ResourceElement.js +0 -38
  239. package/lib/MyNdla/ResourceDash/ResourcesView.js +0 -57
  240. package/lib/MyNdla/ResourceDash/index.d.ts +0 -4
  241. package/lib/MyNdla/ResourceDash/index.js +0 -31
  242. package/src/MyNdla/ResourceDash/Breadcrumbs.tsx +0 -31
  243. package/src/MyNdla/ResourceDash/ResourceElement.tsx +0 -50
  244. package/src/MyNdla/ResourceDash/ResourcesView.tsx +0 -42
  245. package/src/MyNdla/ResourceDash/index.ts +0 -5
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _styledBase = _interopRequireDefault(require("@emotion/styled-base"));
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _core = require("@emotion/core");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
- var ResourceElementWrapper = (0, _styledBase["default"])("div", {
17
- target: "eskq45w0",
18
- label: "ResourceElementWrapper"
19
- })("display:flex;align-items:center;padding:0.5rem;border:1px solid rgba(209,214,219,1);border-radius:2px;background:", function (_ref) {
20
- var type = _ref.type;
21
- return type === 'folder' ? '#fafaf9' : '#fff';
22
- }, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlc291cmNlRWxlbWVudC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0JxRSIsImZpbGUiOiJSZXNvdXJjZUVsZW1lbnQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMjItcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgUmVhY3QsIHsgUmVhY3RFbGVtZW50IH0gZnJvbSAncmVhY3QnO1xuLy8gaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tICdyZWFjdC1pMThuZXh0JztcblxudHlwZSBSZXNvdXJjZUVsZW1lbnRXcmFwcGVyUHJvcCA9IHtcbiAgdHlwZTogJ2ZvbGRlcicgfCAncmVzb3VyY2UnO1xufTtcblxuY29uc3QgUmVzb3VyY2VFbGVtZW50V3JhcHBlciA9IHN0eWxlZC5kaXY8UmVzb3VyY2VFbGVtZW50V3JhcHBlclByb3A+YFxuICBkaXNwbGF5OiBmbGV4O1xu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BSZXNvdXJjZUVsZW1lbnQ7XG4iXX0= */"));
23
-
24
- var ResourceElement = function ResourceElement(_ref2) {
25
- var type = _ref2.type,
26
- title = _ref2.title,
27
- description = _ref2.description,
28
- leftSide = _ref2.leftSide,
29
- rightSide = _ref2.rightSide,
30
- children = _ref2.children;
31
- // const { t } = useTranslation();
32
- return (0, _core.jsx)(ResourceElementWrapper, {
33
- type: type
34
- }, (0, _core.jsx)("div", null, leftSide), (0, _core.jsx)("div", null, (0, _core.jsx)("h1", null, title), (0, _core.jsx)("p", null, description), children), (0, _core.jsx)("div", null, rightSide));
35
- };
36
-
37
- var _default = ResourceElement;
38
- exports["default"] = _default;
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = exports.ResourcesView = void 0;
7
-
8
- var _styledBase = _interopRequireDefault(require("@emotion/styled-base"));
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _ResourceElement = _interopRequireDefault(require("./ResourceElement"));
13
-
14
- var _core = require("@emotion/core");
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
-
18
- 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)."; }
19
-
20
- var ResourcesWrapper = (0, _styledBase["default"])("div", {
21
- target: "eef59gq0",
22
- label: "ResourcesWrapper"
23
- })(process.env.NODE_ENV === "production" ? {
24
- name: "1hhdphc",
25
- styles: "display:flex;flex-direction:column;gap:1rem;0;"
26
- } : {
27
- name: "1hhdphc",
28
- styles: "display:flex;flex-direction:column;gap:1rem;0;",
29
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlc291cmNlc1ZpZXcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3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pbGQuLiBpbnNlcnQgY29udGVudDwvcD5cbiAgICAgIDwvUmVzb3VyY2VFbGVtZW50PlxuICAgICAgPFJlc291cmNlRWxlbWVudFxuICAgICAgICB0eXBlPVwicmVzb3VyY2VcIlxuICAgICAgICB0aXRsZT1cIkV4YW1wbGUgUmVzb3VyY2VcIlxuICAgICAgICBsZWZ0U2lkZT17PGltZyBzcmM9XCJodHRwOi8vcGxhY2VraXR0ZW4uY29tLzIwMC8yMDBcIiBhbHQ9XCJCcnJyXCIgLz59XG4gICAgICAgIHJpZ2h0U2lkZT17PHNwYW4+I3RhZzwvc3Bhbj59XG4gICAgICAgIGRlc2NyaXB0aW9uPVwic29tZSBkZXNjcmlwdGlvblwiPlxuICAgICAgICA8cD5JbSBhIGNoaWxkLi4gaW5zZXJ0IGNvbnRlbnQ8L3A+XG4gICAgICA8L1Jlc291cmNlRWxlbWVudD5cbiAgICA8L1Jlc291cmNlc1dyYXBwZXI+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBSZXNvdXJjZXNWaWV3O1xuIl19 */",
30
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
31
- });
32
-
33
- var ResourcesView = function ResourcesView() {
34
- return (0, _core.jsx)(ResourcesWrapper, null, (0, _core.jsx)(_ResourceElement["default"], {
35
- type: "folder",
36
- title: "Example folder",
37
- leftSide: (0, _core.jsx)("img", {
38
- src: "http://placekitten.com/200/200",
39
- alt: "Mjaoo"
40
- }),
41
- rightSide: (0, _core.jsx)("span", null, "#tag"),
42
- description: "some description"
43
- }, (0, _core.jsx)("p", null, "Im a child.. insert content")), (0, _core.jsx)(_ResourceElement["default"], {
44
- type: "resource",
45
- title: "Example Resource",
46
- leftSide: (0, _core.jsx)("img", {
47
- src: "http://placekitten.com/200/200",
48
- alt: "Brrr"
49
- }),
50
- rightSide: (0, _core.jsx)("span", null, "#tag"),
51
- description: "some description"
52
- }, (0, _core.jsx)("p", null, "Im a child.. insert content")));
53
- };
54
-
55
- exports.ResourcesView = ResourcesView;
56
- var _default = ResourcesView;
57
- exports["default"] = _default;
@@ -1,4 +0,0 @@
1
- import Breadcrumbs from './Breadcrumbs';
2
- import ResourceElement from './ResourceElement';
3
- import ResourcesView from './ResourcesView';
4
- export { ResourcesView, ResourceElement, Breadcrumbs };
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Breadcrumbs", {
7
- enumerable: true,
8
- get: function get() {
9
- return _Breadcrumbs["default"];
10
- }
11
- });
12
- Object.defineProperty(exports, "ResourceElement", {
13
- enumerable: true,
14
- get: function get() {
15
- return _ResourceElement["default"];
16
- }
17
- });
18
- Object.defineProperty(exports, "ResourcesView", {
19
- enumerable: true,
20
- get: function get() {
21
- return _ResourcesView["default"];
22
- }
23
- });
24
-
25
- var _Breadcrumbs = _interopRequireDefault(require("./Breadcrumbs"));
26
-
27
- var _ResourceElement = _interopRequireDefault(require("./ResourceElement"));
28
-
29
- var _ResourcesView = _interopRequireDefault(require("./ResourcesView"));
30
-
31
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -1,31 +0,0 @@
1
- /**
2
- * Copyright (c) 2022-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
-
9
- import styled from '@emotion/styled';
10
- import React from 'react';
11
-
12
- const BreadcrumbsWrapper = styled.div``;
13
-
14
- type BreadcrumbsProps = {
15
- items: {
16
- title: string;
17
- url: string;
18
- }[];
19
- };
20
-
21
- export const Breadcrumbs = ({ items }: BreadcrumbsProps) => {
22
- <BreadcrumbsWrapper>
23
- {items.map(({ title, url }) => (
24
- <a key={url} href={url}>
25
- {title}
26
- </a>
27
- ))}
28
- </BreadcrumbsWrapper>;
29
- };
30
-
31
- export default Breadcrumbs;
@@ -1,50 +0,0 @@
1
- /**
2
- * Copyright (c) 2022-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
-
9
- import styled from '@emotion/styled';
10
- import React, { ReactElement } from 'react';
11
- // import { useTranslation } from 'react-i18next';
12
-
13
- type ResourceElementWrapperProp = {
14
- type: 'folder' | 'resource';
15
- };
16
-
17
- const ResourceElementWrapper = styled.div<ResourceElementWrapperProp>`
18
- display: flex;
19
- align-items: center;
20
- padding: 0.5rem;
21
- border: 1px solid rgba(209, 214, 219, 1);
22
- border-radius: 2px;
23
- background: ${({ type }) => (type === 'folder' ? '#fafaf9' : '#fff')};
24
- `;
25
-
26
- type ResourceElementProps = {
27
- type: 'folder' | 'resource';
28
- title: string;
29
- rightSide?: ReactElement;
30
- leftSide?: ReactElement;
31
- description?: string;
32
- children?: ReactElement;
33
- };
34
-
35
- const ResourceElement = ({ type, title, description, leftSide, rightSide, children }: ResourceElementProps) => {
36
- // const { t } = useTranslation();
37
- return (
38
- <ResourceElementWrapper type={type}>
39
- <div>{leftSide}</div>
40
- <div>
41
- <h1>{title}</h1>
42
- <p>{description}</p>
43
- {children}
44
- </div>
45
- <div>{rightSide}</div>
46
- </ResourceElementWrapper>
47
- );
48
- };
49
-
50
- export default ResourceElement;
@@ -1,42 +0,0 @@
1
- /**
2
- * Copyright (c) 2022-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
-
9
- import styled from '@emotion/styled';
10
- import React from 'react';
11
- import ResourceElement from './ResourceElement';
12
-
13
- const ResourcesWrapper = styled.div`
14
- display: flex;
15
- flex-direction: column;
16
- gap: 1rem; 0;
17
- `;
18
-
19
- export const ResourcesView = () => {
20
- return (
21
- <ResourcesWrapper>
22
- <ResourceElement
23
- type="folder"
24
- title="Example folder"
25
- leftSide={<img src="http://placekitten.com/200/200" alt="Mjaoo" />}
26
- rightSide={<span>#tag</span>}
27
- description="some description">
28
- <p>Im a child.. insert content</p>
29
- </ResourceElement>
30
- <ResourceElement
31
- type="resource"
32
- title="Example Resource"
33
- leftSide={<img src="http://placekitten.com/200/200" alt="Brrr" />}
34
- rightSide={<span>#tag</span>}
35
- description="some description">
36
- <p>Im a child.. insert content</p>
37
- </ResourceElement>
38
- </ResourcesWrapper>
39
- );
40
- };
41
-
42
- export default ResourcesView;
@@ -1,5 +0,0 @@
1
- import Breadcrumbs from './Breadcrumbs';
2
- import ResourceElement from './ResourceElement';
3
- import ResourcesView from './ResourcesView';
4
-
5
- export { ResourcesView, ResourceElement, Breadcrumbs };