@ndla/ui 22.1.0 → 23.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 (94) hide show
  1. package/es/Animation/DisplayOnPageYOffset.js +1 -1
  2. package/es/Article/Article.js +3 -3
  3. package/es/Article/ArticleByline.js +5 -6
  4. package/es/Breadcrumb/ActionBreadcrumb.js +3 -3
  5. package/es/Figure/FigureOpenDialogButton.js +1 -2
  6. package/es/Filter/FilterListPhone.js +1 -1
  7. package/es/Frontpage/FrontpageProgramMenu.js +10 -11
  8. package/es/NDLAFilm/AllMoviesAlphabetically.js +12 -12
  9. package/es/ResourceBox/ResourceBox.js +7 -35
  10. package/es/ResourceGroup/ResourceItem.js +13 -13
  11. package/es/ResourceGroup/ResourceList.js +3 -3
  12. package/es/Search/ActiveFilters.js +18 -18
  13. package/es/Search/SearchPage.js +1 -1
  14. package/es/SearchTypeResult/ActiveFilters.js +18 -18
  15. package/es/SearchTypeResult/SearchFieldHeader.js +5 -6
  16. package/es/TopicMenu/TopicMenu.js +1 -1
  17. package/es/TreeStructure/FolderItem.js +34 -29
  18. package/es/TreeStructure/TreeStructure.js +5 -3
  19. package/es/TreeStructure/TreeStructureWrapper.js +2 -2
  20. package/es/all.css +1 -1
  21. package/es/locale/messages-en.js +2 -0
  22. package/es/locale/messages-nb.js +2 -0
  23. package/es/locale/messages-nn.js +2 -0
  24. package/es/locale/messages-se.js +2 -0
  25. package/es/locale/messages-sma.js +2 -0
  26. package/lib/Animation/DisplayOnPageYOffset.js +2 -2
  27. package/lib/Article/Article.js +4 -4
  28. package/lib/Article/ArticleByline.js +4 -4
  29. package/lib/Breadcrumb/ActionBreadcrumb.js +3 -3
  30. package/lib/Filter/FilterListPhone.js +2 -2
  31. package/lib/Frontpage/FrontpageProgramMenu.js +9 -9
  32. package/lib/NDLAFilm/AllMoviesAlphabetically.js +13 -13
  33. package/lib/ResourceBox/ResourceBox.d.ts +1 -4
  34. package/lib/ResourceBox/ResourceBox.js +15 -35
  35. package/lib/ResourceGroup/ResourceItem.js +12 -14
  36. package/lib/ResourceGroup/ResourceList.js +2 -4
  37. package/lib/Search/ActiveFilters.js +30 -32
  38. package/lib/Search/SearchPage.js +2 -2
  39. package/lib/SearchTypeResult/ActiveFilters.js +37 -39
  40. package/lib/SearchTypeResult/SearchFieldHeader.js +6 -6
  41. package/lib/TopicMenu/TopicMenu.js +2 -2
  42. package/lib/TreeStructure/FolderItem.d.ts +1 -1
  43. package/lib/TreeStructure/FolderItem.js +34 -29
  44. package/lib/TreeStructure/TreeStructure.d.ts +0 -1
  45. package/lib/TreeStructure/TreeStructure.js +5 -3
  46. package/lib/TreeStructure/TreeStructureWrapper.js +2 -2
  47. package/lib/TreeStructure/types.d.ts +1 -0
  48. package/lib/all.css +1 -1
  49. package/lib/locale/messages-en.d.ts +2 -0
  50. package/lib/locale/messages-en.js +2 -0
  51. package/lib/locale/messages-nb.d.ts +2 -0
  52. package/lib/locale/messages-nb.js +2 -0
  53. package/lib/locale/messages-nn.d.ts +2 -0
  54. package/lib/locale/messages-nn.js +2 -0
  55. package/lib/locale/messages-se.d.ts +2 -0
  56. package/lib/locale/messages-se.js +2 -0
  57. package/lib/locale/messages-sma.d.ts +2 -0
  58. package/lib/locale/messages-sma.js +2 -0
  59. package/package.json +17 -16
  60. package/src/Animation/DisplayOnPageYOffset.tsx +1 -1
  61. package/src/Article/Article.tsx +1 -1
  62. package/src/Article/ArticleByline.tsx +1 -2
  63. package/src/Breadcrumb/ActionBreadcrumb.tsx +1 -2
  64. package/src/Figure/FigureOpenDialogButton.tsx +1 -2
  65. package/src/Filter/FilterListPhone.jsx +1 -1
  66. package/src/Frontpage/FrontpageProgramMenu.tsx +1 -2
  67. package/src/NDLAFilm/AllMoviesAlphabetically.tsx +1 -1
  68. package/src/ResourceBox/ResourceBox.tsx +1 -20
  69. package/src/ResourceGroup/ResourceItem.tsx +1 -1
  70. package/src/ResourceGroup/ResourceList.tsx +1 -1
  71. package/src/Search/ActiveFilters.jsx +1 -1
  72. package/src/Search/SearchPage.jsx +1 -1
  73. package/src/SearchTypeResult/ActiveFilters.tsx +1 -1
  74. package/src/SearchTypeResult/SearchFieldHeader.tsx +1 -2
  75. package/src/TopicMenu/TopicMenu.jsx +1 -1
  76. package/src/TreeStructure/FolderItem.tsx +7 -2
  77. package/src/TreeStructure/TreeStructure.tsx +2 -1
  78. package/src/TreeStructure/TreeStructureWrapper.tsx +9 -12
  79. package/src/TreeStructure/types.ts +1 -0
  80. package/src/locale/messages-en.ts +2 -0
  81. package/src/locale/messages-nb.ts +2 -0
  82. package/src/locale/messages-nn.ts +2 -0
  83. package/src/locale/messages-se.ts +2 -0
  84. package/src/locale/messages-sma.ts +2 -0
  85. package/src/main.scss +0 -1
  86. package/es/BackgroundImage/BackgroundImage.js +0 -27
  87. package/es/BackgroundImage/index.js +0 -2
  88. package/lib/BackgroundImage/BackgroundImage.d.ts +0 -12
  89. package/lib/BackgroundImage/BackgroundImage.js +0 -40
  90. package/lib/BackgroundImage/index.d.ts +0 -2
  91. package/lib/BackgroundImage/index.js +0 -13
  92. package/src/BackgroundImage/BackgroundImage.tsx +0 -32
  93. package/src/BackgroundImage/component.background-image.scss +0 -52
  94. package/src/BackgroundImage/index.ts +0 -3
@@ -86,6 +86,8 @@ declare const messages: {
86
86
  detailView: string;
87
87
  shortView: string;
88
88
  myPage: {
89
+ confirmDeleteAccount: string;
90
+ confirmDeleteAccountButton: string;
89
91
  myPage: string;
90
92
  logout: string;
91
93
  loginTerms: string;
@@ -987,6 +987,8 @@ var messages = _objectSpread(_objectSpread({
987
987
  detailView: 'Detailed listview',
988
988
  shortView: 'Short view',
989
989
  myPage: {
990
+ confirmDeleteAccount: 'Are you sure you want to delete your account?',
991
+ confirmDeleteAccountButton: 'Delete account',
990
992
  myPage: 'My page',
991
993
  logout: 'Log out of My NDLA',
992
994
  loginTerms: 'Log in with Feide to receive access. By logging on your accept your terms of service',
@@ -86,6 +86,8 @@ declare const messages: {
86
86
  detailView: string;
87
87
  shortView: string;
88
88
  myPage: {
89
+ confirmDeleteAccount: string;
90
+ confirmDeleteAccountButton: string;
89
91
  myPage: string;
90
92
  deleteAccount: string;
91
93
  logout: string;
@@ -987,6 +987,8 @@ var messages = _objectSpread(_objectSpread({
987
987
  detailView: 'Detaljrik listevisning',
988
988
  shortView: 'Kort visning',
989
989
  myPage: {
990
+ confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
991
+ confirmDeleteAccountButton: 'Slett konto',
990
992
  myPage: 'Min side',
991
993
  deleteAccount: 'Slett Min NDLA',
992
994
  logout: 'Logg ut av Min NDLA',
@@ -86,6 +86,8 @@ declare const messages: {
86
86
  detailView: string;
87
87
  shortView: string;
88
88
  myPage: {
89
+ confirmDeleteAccount: string;
90
+ confirmDeleteAccountButton: string;
89
91
  myPage: string;
90
92
  deleteAccount: string;
91
93
  logout: string;
@@ -987,6 +987,8 @@ var messages = _objectSpread(_objectSpread({
987
987
  detailView: 'Detaljrik listevisning',
988
988
  shortView: 'Kort visning',
989
989
  myPage: {
990
+ confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
991
+ confirmDeleteAccountButton: 'Slett konto',
990
992
  myPage: 'Min side',
991
993
  deleteAccount: 'Slett Min NDLA',
992
994
  logout: 'Logg ut av Min NDLA',
@@ -86,6 +86,8 @@ declare const messages: {
86
86
  detailView: string;
87
87
  shortView: string;
88
88
  myPage: {
89
+ confirmDeleteAccount: string;
90
+ confirmDeleteAccountButton: string;
89
91
  myPage: string;
90
92
  deleteAccount: string;
91
93
  logout: string;
@@ -987,6 +987,8 @@ var messages = _objectSpread(_objectSpread({
987
987
  detailView: 'Detaljrik listevisning',
988
988
  shortView: 'Kort visning',
989
989
  myPage: {
990
+ confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
991
+ confirmDeleteAccountButton: 'Slett konto',
990
992
  myPage: 'Min side',
991
993
  deleteAccount: 'Slett Min NDLA',
992
994
  logout: 'Logg ut av Min NDLA',
@@ -86,6 +86,8 @@ declare const messages: {
86
86
  detailView: string;
87
87
  shortView: string;
88
88
  myPage: {
89
+ confirmDeleteAccount: string;
90
+ confirmDeleteAccountButton: string;
89
91
  myPage: string;
90
92
  deleteAccount: string;
91
93
  logout: string;
@@ -987,6 +987,8 @@ var messages = _objectSpread(_objectSpread({
987
987
  detailView: 'Detaljrik listevisning',
988
988
  shortView: 'Kort visning',
989
989
  myPage: {
990
+ confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
991
+ confirmDeleteAccountButton: 'Slett konto',
990
992
  myPage: 'Min side',
991
993
  deleteAccount: 'Slett Min NDLA',
992
994
  logout: 'Logg ut av Min NDLA',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "22.1.0",
3
+ "version": "23.0.0",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -31,21 +31,22 @@
31
31
  "types"
32
32
  ],
33
33
  "dependencies": {
34
- "@ndla/button": "^3.2.1",
35
- "@ndla/carousel": "^1.2.15",
36
- "@ndla/core": "^2.3.3",
37
- "@ndla/forms": "^3.1.3",
38
- "@ndla/hooks": "^1.1.4",
39
- "@ndla/icons": "^1.11.3",
40
- "@ndla/licenses": "^5.0.6",
41
- "@ndla/modal": "^1.2.17",
42
- "@ndla/notion": "^3.1.28",
43
- "@ndla/safelink": "^2.2.5",
44
- "@ndla/switch": "^0.1.10",
45
- "@ndla/tabs": "^1.1.14",
46
- "@ndla/tooltip": "^2.1.5",
34
+ "@ndla/article-scripts": "^3.0.1",
35
+ "@ndla/button": "^3.3.1",
36
+ "@ndla/carousel": "^1.2.16",
37
+ "@ndla/core": "^2.3.4",
38
+ "@ndla/forms": "^3.1.4",
39
+ "@ndla/hooks": "^1.1.5",
40
+ "@ndla/icons": "^1.11.4",
41
+ "@ndla/licenses": "^5.0.7",
42
+ "@ndla/modal": "^1.2.18",
43
+ "@ndla/notion": "^3.1.30",
44
+ "@ndla/safelink": "^2.2.7",
45
+ "@ndla/switch": "^0.1.11",
46
+ "@ndla/tabs": "^1.1.15",
47
+ "@ndla/tooltip": "^2.1.6",
47
48
  "@ndla/types-learningpath-api": "^0.0.12",
48
- "@ndla/util": "^3.0.0",
49
+ "@ndla/util": "^3.0.1",
49
50
  "@reach/menu-button": "^0.16.2",
50
51
  "@reach/slider": "^0.16.0",
51
52
  "focus-trap-react": "^8.9.2",
@@ -84,5 +85,5 @@
84
85
  "publishConfig": {
85
86
  "access": "public"
86
87
  },
87
- "gitHead": "f4d197d1841b544f533371350b6c23ebce94012f"
88
+ "gitHead": "2f0095b2f2c730ff16d8c71fa8e867db87607c66"
88
89
  }
@@ -8,7 +8,7 @@
8
8
 
9
9
  import React, { Component, ReactNode } from 'react';
10
10
  import PropTypes from 'prop-types';
11
- import throttle from 'lodash/throttle';
11
+ import { throttle } from 'lodash';
12
12
  import Fade from './Fade';
13
13
 
14
14
  interface Props {
@@ -8,7 +8,7 @@
8
8
 
9
9
  import React, { ComponentType, ReactNode, useEffect, useRef, useState, forwardRef } from 'react';
10
10
  import BEMHelper from 'react-bem-helper';
11
- import isString from 'lodash/isString';
11
+ import { isString } from 'lodash';
12
12
  import parse from 'html-react-parser';
13
13
  import styled from '@emotion/styled';
14
14
 
@@ -13,8 +13,7 @@ import Button, { CopyButton } from '@ndla/button';
13
13
  import { colors, fonts, spacing } from '@ndla/core';
14
14
  import { copyTextToClipboard, printPage } from '@ndla/util';
15
15
  import { useTranslation } from 'react-i18next';
16
- import { LicenseByline } from '@ndla/licenses';
17
- import { getLicenseByAbbreviation } from '@ndla/licenses';
16
+ import { LicenseByline, getLicenseByAbbreviation } from '@ndla/licenses';
18
17
  import { TFunction } from 'i18next';
19
18
 
20
19
  const Wrapper = styled.div`
@@ -11,8 +11,7 @@ import { colors, fonts, spacing } from '@ndla/core';
11
11
  import { ChevronRight } from '@ndla/icons/common';
12
12
  import SafeLink from '@ndla/safelink';
13
13
  import React from 'react';
14
- import { MenuButton } from '@ndla/button';
15
- import { MenuItemProps } from '@ndla/button';
14
+ import { MenuButton, MenuItemProps } from '@ndla/button';
16
15
  import Breadcrumb from './Breadcrumb';
17
16
  import { IndexedBreadcrumbItem, SimpleBreadcrumbItem } from './BreadcrumbItem';
18
17
 
@@ -8,8 +8,7 @@
8
8
 
9
9
  import React from 'react';
10
10
  import { Play } from '@ndla/icons/common';
11
- import { ExpandTwoArrows } from '@ndla/icons/action';
12
- import { CursorClick } from '@ndla/icons/action';
11
+ import { ExpandTwoArrows, CursorClick } from '@ndla/icons/action';
13
12
 
14
13
  interface Props {
15
14
  type?: 'image' | 'video' | 'h5p' | 'iframe' | 'external';
@@ -12,7 +12,7 @@ import { ChevronDown, ChevronUp } from '@ndla/icons/common';
12
12
  import { Cross } from '@ndla/icons/action';
13
13
  import Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
14
14
  import Button from '@ndla/button';
15
- import debounce from 'lodash/debounce';
15
+ import { debounce } from 'lodash';
16
16
  import { classes } from './filterClasses';
17
17
  import ToggleItem from './ToggleItem';
18
18
  import ActiveFilters from '../Search/ActiveFilters';
@@ -1,8 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import styled from '@emotion/styled';
3
3
  import Button from '@ndla/button';
4
- import { fonts } from '@ndla/core';
5
- import { breakpoints, mq } from '@ndla/core';
4
+ import { fonts, breakpoints, mq } from '@ndla/core';
6
5
  import { useTranslation } from 'react-i18next';
7
6
  import NavigationBox, { ItemProps } from '../Navigation/NavigationBox';
8
7
  import FrontpageAllSubjects, { subjectsProps } from './FrontpageAllSubjects';
@@ -10,7 +10,7 @@ import React, { Fragment, RefObject, useEffect, useRef, useState } from 'react';
10
10
  import { isIE, browserVersion } from 'react-device-detect';
11
11
  import styled from '@emotion/styled';
12
12
  import { css } from '@emotion/core';
13
- import throttle from 'lodash/throttle';
13
+ import { throttle } from 'lodash';
14
14
  import { breakpoints, mq, spacing, spacingUnit, colors, fonts, animations } from '@ndla/core';
15
15
  import SafeLink from '@ndla/safelink';
16
16
  import { makeSrcQueryString } from '../Image';
@@ -10,7 +10,6 @@ import React from 'react';
10
10
  import { breakpoints, fonts, mq, colors, spacing } from '@ndla/core';
11
11
  import { useTranslation } from 'react-i18next';
12
12
  import { Launch } from '@ndla/icons/common';
13
- import { LicenseByline } from '@ndla/licenses';
14
13
  import { SafeLinkButton } from '@ndla/safelink';
15
14
  import styled from '@emotion/styled';
16
15
  import Image from '../Image';
@@ -81,12 +80,6 @@ const StyledImage = styled(Image)`
81
80
  }
82
81
  `;
83
82
 
84
- const LincenseWrapper = styled.div`
85
- position: absolute;
86
- top: 9px;
87
- right: 0;
88
- `;
89
-
90
83
  interface ImageMeta {
91
84
  src: string;
92
85
  alt: string;
@@ -96,25 +89,13 @@ interface Props {
96
89
  image: ImageMeta;
97
90
  title: string;
98
91
  caption: string;
99
- licenseRights: string[];
100
- authors?: string[];
101
- locale?: string;
102
92
  url: string;
103
93
  }
104
94
 
105
- export const ResourceBox = ({ image, title, caption, licenseRights, locale, authors, url }: Props) => {
95
+ export const ResourceBox = ({ image, title, caption, url }: Props) => {
106
96
  const { t } = useTranslation();
107
97
  return (
108
98
  <ResourceBoxContainer>
109
- <LincenseWrapper>
110
- <LicenseByline licenseRights={licenseRights} locale={locale} marginRight color={colors.brand.tertiary}>
111
- {authors && authors.length > 0 && (
112
- <div className="c-figure__byline-author-buttons">
113
- <span className="c-figure__byline-authors">{authors.join(' ')}</span>
114
- </div>
115
- )}
116
- </LicenseByline>
117
- </LincenseWrapper>
118
99
  <StyledImage src={image.src} alt={image.alt} />
119
100
  <ContentWrapper>
120
101
  <Title>{title}</Title>
@@ -9,7 +9,7 @@
9
9
  import React from 'react';
10
10
  import { useTranslation } from 'react-i18next';
11
11
  import styled from '@emotion/styled';
12
- import css from '@emotion/css';
12
+ import { css } from '@emotion/core';
13
13
  import { keyframes } from '@emotion/core';
14
14
  import SafeLink from '@ndla/safelink';
15
15
  import { Additional, Core, HumanMaleBoard } from '@ndla/icons/common';
@@ -8,7 +8,7 @@
8
8
 
9
9
  import React from 'react';
10
10
  import styled from '@emotion/styled';
11
- import css from '@emotion/css';
11
+ import { css } from '@emotion/core';
12
12
  import { keyframes } from '@emotion/core';
13
13
  import { useTranslation } from 'react-i18next';
14
14
  import NoContentBox from '../NoContentBox';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from '@emotion/styled';
4
- import css from '@emotion/css';
4
+ import { css } from '@emotion/core';
5
5
  import { spacing, mq, breakpoints } from '@ndla/core';
6
6
  import Tooltip from '@ndla/tooltip';
7
7
  import { useTranslation } from 'react-i18next';
@@ -2,7 +2,7 @@ import React, { Component, Fragment, createRef } from 'react';
2
2
  import BEMHelper from 'react-bem-helper';
3
3
  import PropTypes from 'prop-types';
4
4
  import { Back } from '@ndla/icons/common';
5
- import debounce from 'lodash/debounce';
5
+ import { debounce } from 'lodash';
6
6
  import { getCurrentBreakpoint, breakpoints } from '@ndla/util';
7
7
  import Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
8
8
  import Button from '@ndla/button';
@@ -9,7 +9,7 @@
9
9
  import React, { ReactElement } from 'react';
10
10
  import { useTranslation } from 'react-i18next';
11
11
  import styled from '@emotion/styled';
12
- import css from '@emotion/css';
12
+ import { css } from '@emotion/core';
13
13
  import { spacing, mq, breakpoints } from '@ndla/core';
14
14
  import Tooltip from '@ndla/tooltip';
15
15
  import Button from '@ndla/button';
@@ -7,9 +7,8 @@
7
7
  */
8
8
  import React, { FormEvent, useRef, useState } from 'react';
9
9
  import styled from '@emotion/styled';
10
- import { colors } from '@ndla/core';
11
10
  import { Search as SearchIcon } from '@ndla/icons/common';
12
- import { spacing } from '@ndla/core';
11
+ import { spacing, colors } from '@ndla/core';
13
12
  import { Cross as CrossIcon } from '@ndla/icons/action';
14
13
 
15
14
  import { useTranslation } from 'react-i18next';
@@ -12,7 +12,7 @@
12
12
  import React, { Fragment, useEffect, useState } from 'react';
13
13
  import PropTypes from 'prop-types';
14
14
  import BEMHelper from 'react-bem-helper';
15
- import debounce from 'lodash/debounce';
15
+ import { debounce } from 'lodash';
16
16
 
17
17
  import { Home, Back, Additional, ChevronRight } from '@ndla/icons/common';
18
18
  import { Cross } from '@ndla/icons/action';
@@ -49,19 +49,22 @@ const WrapperForFolderChild = styled.div`
49
49
  gap: ${spacing.xsmall};
50
50
  `;
51
51
 
52
- const shouldForwardProp = (name: string) => !['selected', 'noArrow'].includes(name);
52
+ const shouldForwardProp = (name: string) => !['selected', 'noArrow', 'fullWidth'].includes(name);
53
53
 
54
54
  interface FolderNameProps {
55
55
  selected?: boolean;
56
56
  noArrow?: boolean;
57
+ fullWidth?: boolean;
57
58
  }
58
59
 
59
60
  const FolderName = styled('button', { shouldForwardProp })<FolderNameProps>`
60
61
  cursor: pointer;
61
62
  padding: ${spacing.xsmall};
62
63
  margin: 0;
64
+ outline-offset: -2px;
65
+ outline-color: ${colors.brand.primary};
63
66
  margin-left: ${({ noArrow }) => (noArrow ? `29px` : `0px`)};
64
- flex-grow: 1;
67
+ flex-grow: ${({ fullWidth }) => fullWidth && 1};
65
68
  display: grid;
66
69
  grid-template-columns: auto 1fr auto;
67
70
  align-items: center;
@@ -116,6 +119,7 @@ const FolderItem = ({
116
119
  setSelectedFolder,
117
120
  targetResource,
118
121
  visibleFolders,
122
+ framed,
119
123
  }: Props) => {
120
124
  const { t } = useTranslation();
121
125
  const { id, icon, name } = folder;
@@ -173,6 +177,7 @@ const FolderItem = ({
173
177
  {onSelectFolder ? (
174
178
  <>
175
179
  <FolderName
180
+ fullWidth={framed}
176
181
  ref={ref}
177
182
  onKeyDown={(e) => arrowNavigation(e, id, visibleFolders, setFocusedId, onOpenFolder, onCloseFolder)}
178
183
  noArrow={hideArrow && !noPaddingWhenArrowIsHidden}
@@ -34,7 +34,6 @@ export interface TreeStructureProps extends CommonTreeStructureProps {
34
34
  defaultOpenFolders?: string[];
35
35
  folders: FolderType[];
36
36
  editable?: boolean;
37
- framed?: boolean;
38
37
  label?: string;
39
38
  maximumLevelsOfFoldersAllowed?: number;
40
39
  onNewFolder?: (name: string, parentId: string) => Promise<IFolder>;
@@ -118,6 +117,7 @@ const TreeStructure = ({
118
117
  onNewFolder?.(name, parentId).then((newFolder) => {
119
118
  if (newFolder) {
120
119
  setSelectedFolder(newFolder);
120
+ onSelectFolder?.(newFolder.id);
121
121
  setFocusedId(newFolder.id);
122
122
  setOpenFolders(uniq(openFolders.concat(parentId)));
123
123
  }
@@ -156,6 +156,7 @@ const TreeStructure = ({
156
156
  setSelectedFolder={setSelectedFolder}
157
157
  targetResource={targetResource}
158
158
  visibleFolders={visibleFolderIds}
159
+ framed={framed}
159
160
  />
160
161
  </TreeStructureStyledWrapper>
161
162
  {editable && (
@@ -13,18 +13,15 @@ import { colors, misc, spacing } from '@ndla/core';
13
13
  const TreeStructureWrapper = styled.div<{ framed?: boolean }>`
14
14
  padding: ${spacing.xsmall};
15
15
  ${({ framed }) =>
16
- framed
17
- ? css`
18
- border: 1px solid ${colors.brand.neutral7};
19
- border-radius: ${misc.borderRadius};
20
- max-height: 400px;
21
- overflow-y: scroll;
22
- scroll-behavior: smooth;
23
- padding: ${spacing.small};
24
- `
25
- : css`
26
- margin-left: -${spacing.medium};
27
- `}
16
+ framed &&
17
+ css`
18
+ border: 1px solid ${colors.brand.neutral7};
19
+ border-radius: ${misc.borderRadius};
20
+ max-height: 400px;
21
+ overflow-y: scroll;
22
+ scroll-behavior: smooth;
23
+ padding: ${spacing.small};
24
+ `}
28
25
  transition: ${misc.transition.default};
29
26
  &:focus-within {
30
27
  border-color: ${colors.brand.primary};
@@ -24,6 +24,7 @@ export interface CommonTreeStructureProps {
24
24
  openOnFolderClick?: boolean;
25
25
  menuItems?: TreeStructureMenuProps[];
26
26
  targetResource?: IResource;
27
+ framed?: boolean;
27
28
  }
28
29
 
29
30
  export interface CommonFolderItemsProps extends CommonTreeStructureProps {
@@ -1025,6 +1025,8 @@ const messages = {
1025
1025
  detailView: 'Detailed listview',
1026
1026
  shortView: 'Short view',
1027
1027
  myPage: {
1028
+ confirmDeleteAccount: 'Are you sure you want to delete your account?',
1029
+ confirmDeleteAccountButton: 'Delete account',
1028
1030
  myPage: 'My page',
1029
1031
  logout: 'Log out of My NDLA',
1030
1032
  loginTerms: 'Log in with Feide to receive access. By logging on your accept your terms of service',
@@ -1023,6 +1023,8 @@ const messages = {
1023
1023
  detailView: 'Detaljrik listevisning',
1024
1024
  shortView: 'Kort visning',
1025
1025
  myPage: {
1026
+ confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
1027
+ confirmDeleteAccountButton: 'Slett konto',
1026
1028
  myPage: 'Min side',
1027
1029
  deleteAccount: 'Slett Min NDLA',
1028
1030
  logout: 'Logg ut av Min NDLA',
@@ -1024,6 +1024,8 @@ const messages = {
1024
1024
  detailView: 'Detaljrik listevisning',
1025
1025
  shortView: 'Kort visning',
1026
1026
  myPage: {
1027
+ confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
1028
+ confirmDeleteAccountButton: 'Slett konto',
1027
1029
  myPage: 'Min side',
1028
1030
  deleteAccount: 'Slett Min NDLA',
1029
1031
  logout: 'Logg ut av Min NDLA',
@@ -1023,6 +1023,8 @@ const messages = {
1023
1023
  detailView: 'Detaljrik listevisning',
1024
1024
  shortView: 'Kort visning',
1025
1025
  myPage: {
1026
+ confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
1027
+ confirmDeleteAccountButton: 'Slett konto',
1026
1028
  myPage: 'Min side',
1027
1029
  deleteAccount: 'Slett Min NDLA',
1028
1030
  logout: 'Logg ut av Min NDLA',
@@ -1023,6 +1023,8 @@ const messages = {
1023
1023
  detailView: 'Detaljrik listevisning',
1024
1024
  shortView: 'Kort visning',
1025
1025
  myPage: {
1026
+ confirmDeleteAccount: 'Er du sikker på at du vil slette kontoen?',
1027
+ confirmDeleteAccountButton: 'Slett konto',
1026
1028
  myPage: 'Min side',
1027
1029
  deleteAccount: 'Slett Min NDLA',
1028
1030
  logout: 'Logg ut av Min NDLA',
package/src/main.scss CHANGED
@@ -16,7 +16,6 @@
16
16
  @import 'Aside/component.aside';
17
17
  @import 'Article/component.footnotes';
18
18
  @import 'NoContentBox/component.no-content-box.scss';
19
- @import 'BackgroundImage/component.background-image';
20
19
  @import 'Portrait/component.portrait.scss';
21
20
  @import 'global/components/component.logo';
22
21
  @import 'MediaList/component.medialist';
@@ -1,27 +0,0 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import React from 'react';
4
- import BEMHelper from 'react-bem-helper';
5
- import { jsx as ___EmotionJSX } from "@emotion/core";
6
- var classes = BEMHelper('c-background-image');
7
-
8
- var BackgroundImage = function BackgroundImage(_ref) {
9
- var images = _ref.images,
10
- _ref$showOverlay = _ref.showOverlay,
11
- showOverlay = _ref$showOverlay === void 0 ? false : _ref$showOverlay;
12
- return ___EmotionJSX("div", classes('', {
13
- showOverlay: showOverlay
14
- }), images && images.map(function (image) {
15
- return image.types.map(function (type) {
16
- return ___EmotionJSX("div", _extends({
17
- key: "".concat(image.url).concat(type)
18
- }, classes('background', type), {
19
- style: {
20
- backgroundImage: "url(".concat(image.url, ")")
21
- }
22
- }));
23
- });
24
- }));
25
- };
26
-
27
- export default BackgroundImage;
@@ -1,2 +0,0 @@
1
- import BackgroundImage from './BackgroundImage';
2
- export default BackgroundImage;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- declare type ImageType = 'mobile' | 'tablet' | 'desktop' | 'wide';
3
- interface Props {
4
- showOverlay?: boolean;
5
- className?: string;
6
- images: {
7
- url: string;
8
- types: ImageType[];
9
- }[];
10
- }
11
- declare const BackgroundImage: ({ images, showOverlay }: Props) => JSX.Element;
12
- export default BackgroundImage;
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _reactBemHelper = _interopRequireDefault(require("react-bem-helper"));
11
-
12
- var _core = require("@emotion/core");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
-
18
- var classes = (0, _reactBemHelper["default"])('c-background-image');
19
-
20
- var BackgroundImage = function BackgroundImage(_ref) {
21
- var images = _ref.images,
22
- _ref$showOverlay = _ref.showOverlay,
23
- showOverlay = _ref$showOverlay === void 0 ? false : _ref$showOverlay;
24
- return (0, _core.jsx)("div", classes('', {
25
- showOverlay: showOverlay
26
- }), images && images.map(function (image) {
27
- return image.types.map(function (type) {
28
- return (0, _core.jsx)("div", _extends({
29
- key: "".concat(image.url).concat(type)
30
- }, classes('background', type), {
31
- style: {
32
- backgroundImage: "url(".concat(image.url, ")")
33
- }
34
- }));
35
- });
36
- }));
37
- };
38
-
39
- var _default = BackgroundImage;
40
- exports["default"] = _default;
@@ -1,2 +0,0 @@
1
- import BackgroundImage from './BackgroundImage';
2
- export default BackgroundImage;
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _BackgroundImage = _interopRequireDefault(require("./BackgroundImage"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
- var _default = _BackgroundImage["default"];
13
- exports["default"] = _default;