@ndla/ui 33.4.4 → 34.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 (86) hide show
  1. package/es/Article/Article.js +7 -7
  2. package/es/Article/ArticleByline.js +14 -14
  3. package/es/Article/ArticleHeaderWrapper.js +4 -2
  4. package/es/BannerCard/BannerCard.js +13 -10
  5. package/es/CompetenceGoalTab/CompetenceGoalItem.js +69 -51
  6. package/es/CompetenceGoalTab/CompetenceGoalTab.js +25 -47
  7. package/es/CompetenceGoalTab/CompetenceItem.js +38 -90
  8. package/es/CompetenceGoals/CompetenceGoalsDialog.js +4 -4
  9. package/es/MyNdla/Resource/FolderInput.js +5 -5
  10. package/es/SnackBar/DefaultSnackbar.js +7 -10
  11. package/es/all.css +1 -1
  12. package/es/index.js +0 -2
  13. package/es/locale/messages-en.js +6 -3
  14. package/es/locale/messages-nb.js +6 -3
  15. package/es/locale/messages-nn.js +6 -3
  16. package/es/locale/messages-se.js +6 -3
  17. package/es/locale/messages-sma.js +6 -3
  18. package/lib/Article/Article.d.ts +3 -3
  19. package/lib/Article/Article.js +7 -7
  20. package/lib/Article/ArticleByline.js +14 -14
  21. package/lib/Article/ArticleHeaderWrapper.d.ts +2 -2
  22. package/lib/Article/ArticleHeaderWrapper.js +4 -2
  23. package/lib/BannerCard/BannerCard.d.ts +12 -3
  24. package/lib/BannerCard/BannerCard.js +13 -10
  25. package/lib/CompetenceGoalTab/CompetenceGoalItem.js +69 -51
  26. package/lib/CompetenceGoalTab/CompetenceGoalTab.d.ts +1 -2
  27. package/lib/CompetenceGoalTab/CompetenceGoalTab.js +23 -46
  28. package/lib/CompetenceGoalTab/CompetenceItem.d.ts +6 -2
  29. package/lib/CompetenceGoalTab/CompetenceItem.js +37 -89
  30. package/lib/CompetenceGoals/CompetenceGoalsDialog.js +4 -4
  31. package/lib/MyNdla/Resource/FolderInput.js +4 -4
  32. package/lib/SnackBar/DefaultSnackbar.js +6 -9
  33. package/lib/all.css +1 -1
  34. package/lib/index.d.ts +0 -2
  35. package/lib/index.js +0 -202
  36. package/lib/locale/messages-en.d.ts +4 -1
  37. package/lib/locale/messages-en.js +6 -3
  38. package/lib/locale/messages-nb.d.ts +4 -1
  39. package/lib/locale/messages-nb.js +6 -3
  40. package/lib/locale/messages-nn.d.ts +4 -1
  41. package/lib/locale/messages-nn.js +6 -3
  42. package/lib/locale/messages-se.d.ts +4 -1
  43. package/lib/locale/messages-se.js +6 -3
  44. package/lib/locale/messages-sma.d.ts +4 -1
  45. package/lib/locale/messages-sma.js +6 -3
  46. package/lib/types.d.ts +1 -1
  47. package/package.json +6 -6
  48. package/src/Article/Article.tsx +6 -6
  49. package/src/Article/ArticleByline.tsx +12 -12
  50. package/src/Article/ArticleHeaderWrapper.tsx +9 -3
  51. package/src/BannerCard/BannerCard.tsx +7 -7
  52. package/src/CompetenceGoalTab/CompetenceGoalItem.tsx +36 -39
  53. package/src/CompetenceGoalTab/CompetenceGoalTab.tsx +32 -76
  54. package/src/CompetenceGoalTab/CompetenceItem.tsx +55 -74
  55. package/src/CompetenceGoals/CompetenceGoalsDialog.tsx +1 -1
  56. package/src/Filter/component.filter.scss +4 -4
  57. package/src/MyNdla/Resource/FolderInput.tsx +3 -3
  58. package/src/SnackBar/DefaultSnackbar.tsx +8 -16
  59. package/src/index.ts +0 -3
  60. package/src/locale/messages-en.ts +7 -3
  61. package/src/locale/messages-nb.ts +7 -3
  62. package/src/locale/messages-nn.ts +7 -3
  63. package/src/locale/messages-se.ts +7 -3
  64. package/src/locale/messages-sma.ts +7 -3
  65. package/src/main.scss +0 -1
  66. package/src/types.ts +1 -1
  67. package/es/CompetenceGoalTab/SearchButton.js +0 -46
  68. package/es/TopicMenu/SubtopicLinkList.js +0 -255
  69. package/es/TopicMenu/TopicMenu.js +0 -364
  70. package/es/TopicMenu/TopicMenuButton.js +0 -37
  71. package/es/TopicMenu/index.js +0 -11
  72. package/es/index-javascript.js +0 -9
  73. package/lib/CompetenceGoalTab/SearchButton.d.ts +0 -14
  74. package/lib/CompetenceGoalTab/SearchButton.js +0 -53
  75. package/lib/TopicMenu/SubtopicLinkList.js +0 -255
  76. package/lib/TopicMenu/TopicMenu.js +0 -365
  77. package/lib/TopicMenu/TopicMenuButton.js +0 -36
  78. package/lib/TopicMenu/index.js +0 -24
  79. package/lib/index-javascript.js +0 -21
  80. package/src/CompetenceGoalTab/SearchButton.tsx +0 -54
  81. package/src/TopicMenu/SubtopicLinkList.jsx +0 -247
  82. package/src/TopicMenu/TopicMenu.jsx +0 -370
  83. package/src/TopicMenu/TopicMenuButton.jsx +0 -51
  84. package/src/TopicMenu/component.topic-menu.scss +0 -960
  85. package/src/TopicMenu/index.js +0 -12
  86. package/src/index-javascript.js +0 -9
@@ -75,9 +75,9 @@ type ImageProps = {
75
75
  type BannerProps = {
76
76
  link: string;
77
77
  image: ImageProps;
78
- title: string;
79
- content: string;
80
- linkText: string;
78
+ title: { title: string; lang?: string };
79
+ content: { content: string; lang?: string };
80
+ linkText: { text: string; lang?: string };
81
81
  };
82
82
  export const BannerCard = ({ link, title, content, linkText, image }: BannerProps) => {
83
83
  return (
@@ -86,10 +86,10 @@ export const BannerCard = ({ link, title, content, linkText, image }: BannerProp
86
86
  <StyledImage alt={image.altText} src={image.imageSrc} />
87
87
  </ImageWrapper>
88
88
  <TextWrapper>
89
- <TitleText>{title}</TitleText>
90
- <ContentText>{content}</ContentText>
91
- <LinkText target="_self" to={link}>
92
- {linkText}
89
+ <TitleText lang={title.lang}>{title.title}</TitleText>
90
+ <ContentText lang={content.lang}>{content.content}</ContentText>
91
+ <LinkText target="_self" to={link} lang={linkText.lang}>
92
+ {linkText.text}
93
93
  </LinkText>
94
94
  </TextWrapper>
95
95
  </BannerWrapper>
@@ -9,49 +9,49 @@
9
9
  import React from 'react';
10
10
  import styled from '@emotion/styled';
11
11
  import { fonts, spacing, mq, breakpoints } from '@ndla/core';
12
+ import { Search } from '@ndla/icons/common';
13
+ import { SafeLinkButton } from '@ndla/safelink';
12
14
  import { useTranslation } from 'react-i18next';
13
15
  import { CompetenceGoalsItemType } from '../types';
14
- import SearchButton from './SearchButton';
15
16
 
16
17
  const GoalItem = styled.li`
17
18
  margin: ${spacing.medium} 0;
18
- list-style-type: none;
19
- display: flex;
20
- font-size: 18px;
21
- line-height: 24px;
22
19
  border-bottom: 1px solid #d1d6db;
23
20
  `;
24
21
 
25
- const GoalWrapper = styled.div`
26
- width: 100%;
27
- padding-bottom: ${spacing.small};
28
- `;
29
-
30
22
  const GoalsHeading = styled.h3`
31
23
  margin-top: 0;
32
- font-weight: ${fonts.weight.semibold};
33
24
  `;
25
+
26
+ const StyledSearch = styled(Search)`
27
+ height: 24px;
28
+ width: 24px;
29
+ min-width: 24px;
30
+ `;
31
+
34
32
  const GoalList = styled.ul`
35
33
  padding: 0;
36
34
  `;
37
- const GoalListElement = styled.li`
38
- ${fonts.sizes('22px', '32px')};
35
+
36
+ const GoalText = styled.p`
37
+ margin: 0;
39
38
  `;
40
- const GoalListElementInnerWrapper = styled.div`
39
+
40
+ const ListItemContent = styled.div`
41
41
  display: flex;
42
42
  justify-content: space-between;
43
+ ${fonts.sizes('22px', '32px')};
43
44
  ${mq.range({ until: breakpoints.tabletWide })} {
44
45
  flex-direction: column;
45
46
  }
46
47
  `;
47
48
 
48
- const GoalListInnerTextWrapper = styled.div`
49
- flex: 1;
50
- `;
51
-
52
49
  const GoalSearchWrapper = styled.div`
53
50
  margin-left: ${spacing.normal};
54
51
  flex: 0 0 289px;
52
+ span {
53
+ text-align: left;
54
+ }
55
55
 
56
56
  ${mq.range({ until: breakpoints.tabletWide })} {
57
57
  margin-left: 0;
@@ -64,27 +64,24 @@ const CompetenceGoalItem = ({ title, goals, isOembed }: CompetenceGoalsItemType)
64
64
  const { t } = useTranslation();
65
65
  return (
66
66
  <GoalItem>
67
- <GoalWrapper>
68
- <GoalsHeading>{title}</GoalsHeading>
69
- <GoalList>
70
- {goals.map((goal, index: number) => (
71
- <GoalListElement key={`${goal.text}${index}`}>
72
- <GoalListElementInnerWrapper>
73
- <GoalListInnerTextWrapper>{goal.text}</GoalListInnerTextWrapper>
74
- {goal.url && goal.type !== 'LK06' && (
75
- <GoalSearchWrapper>
76
- <SearchButton
77
- to={goal.url}
78
- text={t('competenceGoals.competenceGoalResourceSearchText')}
79
- target={isOembed ? '_blank' : '_self'}
80
- />
81
- </GoalSearchWrapper>
82
- )}
83
- </GoalListElementInnerWrapper>
84
- </GoalListElement>
85
- ))}
86
- </GoalList>
87
- </GoalWrapper>
67
+ <GoalsHeading>{title}</GoalsHeading>
68
+ <GoalList>
69
+ {goals.map((goal, index) => (
70
+ <li key={`${goal.text}${index}`}>
71
+ <ListItemContent>
72
+ <GoalText>{goal.text}</GoalText>
73
+ {goal.url && (
74
+ <GoalSearchWrapper>
75
+ <SafeLinkButton variant="outline" to={goal.url} target={isOembed ? '_blank' : '_self'}>
76
+ <StyledSearch size="large" />
77
+ <span>{t('competenceGoals.competenceGoalResourceSearchText', { goal: goal.id })}</span>
78
+ </SafeLinkButton>
79
+ </GoalSearchWrapper>
80
+ )}
81
+ </ListItemContent>
82
+ </li>
83
+ ))}
84
+ </GoalList>
88
85
  </GoalItem>
89
86
  );
90
87
  };
@@ -8,37 +8,24 @@
8
8
 
9
9
  import React, { useState } from 'react';
10
10
  import styled from '@emotion/styled';
11
- import { colors, spacing, mq, breakpoints } from '@ndla/core';
11
+ import { spacing } from '@ndla/core';
12
12
  import { useTranslation } from 'react-i18next';
13
- import { ArrowFeatureTips } from '@ndla/icons/common';
14
- import Button from '@ndla/button';
13
+ import { ButtonV2 } from '@ndla/button';
15
14
  import SafeLink from '@ndla/safelink';
16
15
  import { BY, CC, LicenseByline } from '@ndla/licenses';
16
+ import Tooltip from '@ndla/tooltip';
17
17
  import CompetenceItem, { ListItemProp } from './CompetenceItem';
18
18
 
19
19
  type CompetenceProps = {
20
20
  list: ListItemProp[];
21
- highlightSearchBox?: boolean;
22
21
  isOembed?: boolean;
23
22
  };
24
23
 
25
- const Wrapper = styled.div`
26
- h2 {
27
- margin: 0 0 ${spacing.medium};
28
- }
29
- position: relative;
30
- `;
31
-
32
- const TabWrapper = styled.div`
24
+ const ButtonWrapper = styled.div`
33
25
  display: flex;
34
- flex-direction: row;
26
+ padding-top: ${spacing.small};
27
+ gap: ${spacing.small};
35
28
  flex-wrap: wrap;
36
- button {
37
- margin: 8px 8px 8px 0;
38
- &:last-of-type {
39
- margin-right: 0;
40
- }
41
- }
42
29
  `;
43
30
 
44
31
  const LicenseIconsTextWrapper = styled.span`
@@ -46,66 +33,35 @@ const LicenseIconsTextWrapper = styled.span`
46
33
  margin-left: 5px;
47
34
  `;
48
35
 
49
- const HighlightWrapper = styled.div`
50
- position: absolute;
51
- right: 0;
52
- z-index: 200;
53
- display: flex;
54
- flex-direction: column;
55
- align-items: center;
56
- transform: translate(180px, 50%);
57
-
58
- svg {
59
- width: 32px;
60
- height: auto;
61
- position: relative;
62
- left: -38px;
63
- margin-top: ${spacing.normal};
64
- }
65
-
66
- ${mq.range({ until: breakpoints.wide })} {
67
- display: none;
68
- }
69
- `;
70
-
71
- const HighlightText = styled.span`
72
- font-family: 'Shadows Into Light Two';
73
- font-display: swap;
74
- display: inline-block;
75
- color: ${colors.text.light};
76
- transform: rotate(14deg);
77
- font-size: 20px;
78
- max-width: 170px;
79
- text-align: center;
80
- font-family: 'Shadows Into Light Two', cursive;
81
- `;
82
-
83
- const CompetenceGoalTab = ({ list, highlightSearchBox, isOembed }: CompetenceProps) => {
36
+ const CompetenceGoalTab = ({ list, isOembed }: CompetenceProps) => {
84
37
  const [currentTabItem, setCurrentTab] = useState(list[0]);
85
38
  const { t } = useTranslation();
86
39
 
87
40
  return (
88
- <Wrapper>
89
- <TabWrapper>
90
- {list.map((tabItem, index: number) => {
91
- const { id, title: tabTitle } = tabItem;
92
- return (
93
- <Button
94
- borderShape="rounded"
95
- lighter={id !== currentTabItem.id}
96
- size="normal"
97
- onClick={() => setCurrentTab(list[index])}
98
- key={`tabitem-${id}`}>
99
- {tabTitle}
100
- </Button>
101
- );
102
- })}
103
- </TabWrapper>
104
- {highlightSearchBox && (
105
- <HighlightWrapper>
106
- <HighlightText>{t('checkOutNewFeature')}</HighlightText>
107
- <ArrowFeatureTips />
108
- </HighlightWrapper>
41
+ <>
42
+ {list.length > 1 && (
43
+ <ButtonWrapper>
44
+ {list.map((tabItem, index) => {
45
+ const { id, title: tabTitle, type } = tabItem;
46
+ return (
47
+ <Tooltip
48
+ tooltip={
49
+ type === 'coreElement'
50
+ ? t('competenceGoals.competenceTabCoreTooltip')
51
+ : t('competenceGoals.showCompetenceGoals')
52
+ }
53
+ key={`tabitem-${id}`}>
54
+ <ButtonV2
55
+ shape="pill"
56
+ aria-current={id === currentTabItem.id}
57
+ colorTheme={id !== currentTabItem.id ? 'lighter' : undefined}
58
+ onClick={() => setCurrentTab(list[index])}>
59
+ {tabTitle}
60
+ </ButtonV2>
61
+ </Tooltip>
62
+ );
63
+ })}
64
+ </ButtonWrapper>
109
65
  )}
110
66
  <CompetenceItem item={currentTabItem} isOembed={isOembed} />
111
67
  <LicenseByline licenseRights={[CC, BY]}>
@@ -119,7 +75,7 @@ const CompetenceGoalTab = ({ list, highlightSearchBox, isOembed }: CompetencePro
119
75
  <SafeLink to="https://data.udir.no/" target="_blank">
120
76
  data.udir.no
121
77
  </SafeLink>
122
- </Wrapper>
78
+ </>
123
79
  );
124
80
  };
125
81
 
@@ -9,7 +9,7 @@
9
9
  import React from 'react';
10
10
  import styled from '@emotion/styled';
11
11
  import { MenuBook } from '@ndla/icons/action';
12
- import { fonts } from '@ndla/core';
12
+ import { spacing } from '@ndla/core';
13
13
  import { useTranslation } from 'react-i18next';
14
14
  import CompetenceGoalItem from './CompetenceGoalItem';
15
15
  import { CompetenceGoalsItemType } from '../types';
@@ -21,54 +21,43 @@ const GroupedGoalsWrapper = styled.div`
21
21
  const GroupedGoalsTitleWrapper = styled.div`
22
22
  border-bottom: 1px solid #d1d6db;
23
23
  `;
24
- const GroupedGoalsTitle = styled.h3`
25
- ${fonts.sizes('22px', '32px')};
26
- margin-bottom: 0;
24
+ const GroupedGoalsTitle = styled.h2`
27
25
  display: flex;
28
- `;
29
-
30
- const GroupedGoalsTitleIcon = styled.span`
31
- display: inline-flex;
32
26
  align-items: center;
33
- margin-right: 8px;
27
+ gap: ${spacing.xsmall};
28
+ svg {
29
+ width: 24px;
30
+ height: 24px;
31
+ }
34
32
  `;
35
33
 
36
- const GoalsInfo = styled.h4`
37
- ${fonts.sizes('22px', '32px')};
38
- margin-top: 0;
39
- font-weight: ${fonts.weight.normal};
34
+ const GoalsInfo = styled.p`
35
+ margin: 0;
40
36
  `;
41
37
 
42
- const Goals = styled.ul`
38
+ const GoalList = styled.ul`
43
39
  margin: 0;
44
40
  padding: 0;
45
41
  list-style-type: none;
46
42
  list-style-image: none;
47
43
  `;
48
44
 
49
- const CoreItem = styled.div`
50
- margin: 16px 0 24px;
51
- `;
52
45
  const GroupedCoreItemsWrapper = styled.div`
53
46
  margin: 24px 0 52px;
54
47
  `;
55
48
 
56
- const CoreItemTitle = styled.h4`
57
- font-size: 20px;
58
- `;
59
- const CoreItemText = styled.p`
60
- font-size: 18px;
61
- line-height: 32px;
62
- `;
63
-
64
49
  export type CompetenceTypeProps = 'competenceGoals' | 'coreElement';
65
50
  export type CompetenceGoals = {
66
- title?: string;
51
+ title: string;
67
52
  elements: CompetenceGoalsItemType[];
68
53
  };
69
54
  export type CoreElementItems = {
70
55
  title?: string;
71
- elements: any;
56
+ elements: {
57
+ id: string;
58
+ name: string;
59
+ text: string;
60
+ }[];
72
61
  };
73
62
  export type ListItemProp = {
74
63
  id: string;
@@ -89,59 +78,51 @@ const CompetenceItem = ({ item, isOembed }: ListItemProps) => {
89
78
  case 'competenceGoals':
90
79
  return (
91
80
  <>
92
- {groupedCompetenceGoals &&
93
- groupedCompetenceGoals.map((group) => (
94
- <GroupedGoalsWrapper key={group.title}>
95
- <GroupedGoalsTitleWrapper>
96
- {group.title && (
97
- <GroupedGoalsTitle>
98
- <GroupedGoalsTitleIcon>
99
- <MenuBook style={{ width: '24px', height: '24px' }} />
100
- </GroupedGoalsTitleIcon>
101
- {group.title}
102
- </GroupedGoalsTitle>
103
- )}
81
+ {groupedCompetenceGoals?.map((group) => (
82
+ <GroupedGoalsWrapper key={group.title}>
83
+ <GroupedGoalsTitleWrapper>
84
+ <hgroup>
85
+ <GroupedGoalsTitle>
86
+ <MenuBook />
87
+ {group.title}
88
+ </GroupedGoalsTitle>
104
89
  <GoalsInfo>{t('competenceGoals.competenceGoalTitle')}</GoalsInfo>
105
- </GroupedGoalsTitleWrapper>
106
- {group.elements.length > 0 && (
107
- <Goals>
108
- {group.elements.map((goal) => (
109
- <CompetenceGoalItem
110
- key={goal.id}
111
- id={goal.id}
112
- title={goal.title}
113
- goals={goal.goals}
114
- isOembed={isOembed}
115
- />
116
- ))}
117
- </Goals>
118
- )}
119
- </GroupedGoalsWrapper>
120
- ))}
90
+ </hgroup>
91
+ </GroupedGoalsTitleWrapper>
92
+ {group.elements.length > 0 && (
93
+ <GoalList>
94
+ {group.elements.map((goal) => (
95
+ <CompetenceGoalItem
96
+ key={goal.id}
97
+ id={goal.id}
98
+ title={goal.title}
99
+ goals={goal.goals}
100
+ isOembed={isOembed}
101
+ />
102
+ ))}
103
+ </GoalList>
104
+ )}
105
+ </GroupedGoalsWrapper>
106
+ ))}
121
107
  </>
122
108
  );
123
109
  case 'coreElement':
124
110
  return (
125
111
  <>
126
- {groupedCoreElementItems &&
127
- groupedCoreElementItems.map((group: any) => (
128
- <GroupedCoreItemsWrapper key={group.title}>
129
- {group.title && (
130
- <GroupedGoalsTitle>
131
- <GroupedGoalsTitleIcon>
132
- <MenuBook style={{ width: '24px', height: '24px' }} />
133
- </GroupedGoalsTitleIcon>
134
- {group.title}
135
- </GroupedGoalsTitle>
136
- )}
137
- {group.elements.map((coreItem: any) => (
138
- <CoreItem key={coreItem.id}>
139
- {coreItem.name && <CoreItemTitle>{coreItem.name}</CoreItemTitle>}
140
- {coreItem.text && <CoreItemText>{coreItem.text}</CoreItemText>}
141
- </CoreItem>
142
- ))}
143
- </GroupedCoreItemsWrapper>
144
- ))}
112
+ {groupedCoreElementItems?.map((group) => (
113
+ <GroupedCoreItemsWrapper key={group.title}>
114
+ <GroupedGoalsTitle>
115
+ <MenuBook />
116
+ {group.title}
117
+ </GroupedGoalsTitle>
118
+ {group.elements.map((coreItem) => (
119
+ <div key={coreItem.id}>
120
+ <h3>{coreItem.name}</h3>
121
+ <p>{coreItem.text}</p>
122
+ </div>
123
+ ))}
124
+ </GroupedCoreItemsWrapper>
125
+ ))}
145
126
  </>
146
127
  );
147
128
  default:
@@ -21,7 +21,7 @@ const HeaderWrapper = styled.div`
21
21
  width: 100%;
22
22
  `;
23
23
 
24
- const HeadingWrapper = styled.h2`
24
+ const HeadingWrapper = styled.h1`
25
25
  display: flex;
26
26
  align-items: center;
27
27
  ${fonts.sizes('18px', '32px')};
@@ -131,7 +131,7 @@
131
131
  @include mq($until: mobileWide) {
132
132
  width: 100% !important;
133
133
  margin: $spacing 0 0 0 !important;
134
- padding: $spacing--small / 2 $left-margin-narrow-screen;
134
+ padding: $spacing--small / 2 20px;
135
135
  background: $brand-grey--lighter;
136
136
  flex-direction: row;
137
137
  .c-filter__item label {
@@ -267,7 +267,8 @@
267
267
  display: none !important;
268
268
  }
269
269
 
270
- &--no-results, &--disabled {
270
+ &--no-results,
271
+ &--disabled {
271
272
  cursor: not-allowed;
272
273
  pointer-events: none;
273
274
  color: $brand-color--tertiary;
@@ -335,7 +336,6 @@
335
336
  .c-filter__text {
336
337
  flex-grow: 1;
337
338
  }
338
-
339
339
  }
340
340
  }
341
341
  }
@@ -496,7 +496,7 @@
496
496
  display: flex;
497
497
  align-items: baseline;
498
498
  h1 {
499
- margin-right:$spacing;
499
+ margin-right: $spacing;
500
500
  }
501
501
  }
502
502
  }
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import styled from '@emotion/styled';
10
- import { IconButton, IconButtonV2 } from '@ndla/button';
10
+ import { IconButtonV2 } from '@ndla/button';
11
11
  import { Cross } from '@ndla/icons/action';
12
12
  import React, { ComponentProps, forwardRef, useEffect } from 'react';
13
13
  import { isMobile } from 'react-device-detect';
@@ -95,9 +95,9 @@ const FolderInput = forwardRef<HTMLInputElement, Props>(({ loading, error, onClo
95
95
  <Done />
96
96
  </IconButtonV2>
97
97
  )}
98
- <IconButton aria-label={t('close')} title={t('close')} size="small" ghostPill onClick={onClose}>
98
+ <IconButtonV2 aria-label={t('close')} title={t('close')} size="small" variant="ghost" onClick={onClose}>
99
99
  <Cross />
100
- </IconButton>
100
+ </IconButtonV2>
101
101
  </>
102
102
  )}
103
103
  <div aria-live="assertive">
@@ -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 { IconButton } from '@ndla/button';
12
+ import { IconButtonV2 } from '@ndla/button';
13
13
  import { breakpoints, colors, fonts, misc, mq, shadows, spacing } from '@ndla/core';
14
14
  import { Cross } from '@ndla/icons/action';
15
15
  import { Snack, useSnack } from './SnackbarProvider';
@@ -29,19 +29,6 @@ const DefaultSnackContainer = styled.div`
29
29
  align-items: center;
30
30
  `;
31
31
 
32
- const StyledCloseButton = styled(IconButton)`
33
- svg {
34
- color: ${colors.brand.greyMedium};
35
- }
36
- &:hover,
37
- &:focus {
38
- background: ${colors.brand.greyDark};
39
- svg {
40
- color: ${colors.brand.greyLightest};
41
- }
42
- }
43
- `;
44
-
45
32
  const ButtonWrapper = styled.div`
46
33
  ${mq.range({ from: breakpoints.tablet })} {
47
34
  gap: ${spacing.xxsmall};
@@ -58,9 +45,14 @@ const DefaultSnack = (snack: Snack) => {
58
45
  {snack.content}
59
46
  <ButtonWrapper>
60
47
  {closable && (
61
- <StyledCloseButton size="xsmall" outline onClick={() => closeSnack(snack)} aria-label={t('snackbar.close')}>
48
+ <IconButtonV2
49
+ size="xsmall"
50
+ variant="outline"
51
+ colorTheme="greyLighter"
52
+ onClick={() => closeSnack(snack)}
53
+ aria-label={t('snackbar.close')}>
62
54
  <Cross />
63
- </StyledCloseButton>
55
+ </IconButtonV2>
64
56
  )}
65
57
  </ButtonWrapper>
66
58
  </DefaultSnackContainer>
package/src/index.ts CHANGED
@@ -9,9 +9,6 @@
9
9
  // Ignore typescript implicit any warning and export all javascript components
10
10
  // Move components to this file when they are migrated to typescript
11
11
 
12
- /** @ts-ignore */
13
- export * from './index-javascript';
14
-
15
12
  export { default as SectionHeading } from './SectionHeading';
16
13
 
17
14
  export {
@@ -267,6 +267,9 @@ const messages = {
267
267
  removeFavorite: 'Remove favorite subject',
268
268
  removeConfirmed: '{{subject}} is removed from your favorite subjects',
269
269
  addConfirmed: '{{subject}} is added to your favorite subjects',
270
+ subjectFavoritePitch: 'Do you want to favorite this subject?',
271
+ subjectFavoriteGuide:
272
+ 'To favorite a subject you must log in to My NDLA. You will find the subject on the top of this page after logging in.',
270
273
  shows: 'Shows',
271
274
  },
272
275
  topicPage: {
@@ -474,7 +477,7 @@ const messages = {
474
477
  useCompentenceGoalsFilter: 'Use filter',
475
478
  closeCompentenceGoalsFilter: 'Close filter',
476
479
  competenceGoalsNarrowBackButton: 'Go back',
477
- competenceGoalResourceSearchText: 'Search all resources appropriate to this goal',
480
+ competenceGoalResourceSearchText: 'View resources to competence goal {{goal}}',
478
481
  competenceGoalShowExtra: 'Show',
479
482
  competenceGoalCloseExtra: 'Hide',
480
483
  competenceCoreLabel: 'Core element',
@@ -485,9 +488,10 @@ const messages = {
485
488
  competenceSubjectSearchText: 'Go to topic page',
486
489
  competenceGoalClose: 'Close',
487
490
  competenceGoalTitle: 'The pupil is expected to be able to:',
488
- competenceTabLK06label: 'Competence goal (LK06)',
489
- competenceTabLK20label: 'Competence goal (LK20)',
491
+ competenceTabLK20label: 'Competence goal',
492
+ competenceTabLK20Tooltip: 'Show competence goals',
490
493
  competenceTabCorelabel: 'Core element',
494
+ competenceTabCoreTooltip: 'Show core elements',
491
495
  competenceGoalItem: {
492
496
  title: 'Competence goals and assessment',
493
497
  },
@@ -266,6 +266,9 @@ const messages = {
266
266
  removeFavorite: 'Fjern favorittfag',
267
267
  removeConfirmed: '{{subject}} er fjernet fra favorittfag',
268
268
  addConfirmed: '{{subject}} er lagt til som favorittfag',
269
+ subjectFavoritePitch: 'Ønsker du å favorittmerke dette faget?',
270
+ subjectFavoriteGuide:
271
+ 'For å favorittmerke et fag må du logge inn på Min NDLA. Du finner faget øverst på denne siden etter at du har logget inn.',
269
272
  shows: 'Viser',
270
273
  },
271
274
  topicPage: {
@@ -473,7 +476,7 @@ const messages = {
473
476
  useCompentenceGoalsFilter: 'Bruk filter',
474
477
  closeCompentenceGoalsFilter: 'Lukk filter',
475
478
  competenceGoalsNarrowBackButton: 'Tilbake',
476
- competenceGoalResourceSearchText: 'Søk på alle ressurser som passer til dette kompetansemålet',
479
+ competenceGoalResourceSearchText: 'Vis ressurser til kompetansemål {{goal}}',
477
480
  competenceGoalShowExtra: 'Vis støtte til læreplanen',
478
481
  competenceGoalCloseExtra: 'Skjul støtte til læreplanen',
479
482
  competenceCoreLabel: 'Kjerneelement',
@@ -484,9 +487,10 @@ const messages = {
484
487
  competenceSubjectSearchText: 'Gå til fagsiden',
485
488
  competenceGoalClose: 'Lukk',
486
489
  competenceGoalTitle: 'Målet er at eleven skal kunne:',
487
- competenceTabLK06label: 'Kompetansemål (LK06)',
488
- competenceTabLK20label: 'Kompetansemål (LK20)',
490
+ competenceTabLK20label: 'Kompetansemål',
491
+ competenceTabLK20Tooltip: 'Vis kompetansemål',
489
492
  competenceTabCorelabel: 'Kjerneelement',
493
+ competenceTabCoreTooltip: 'Vis kjerneelementer',
490
494
  competenceGoalItem: {
491
495
  title: 'Kompetansemål og vurdering',
492
496
  },