@ndla/ui 35.0.27 → 35.1.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/es/Animation/DisplayOnPageYOffset.js +4 -2
- package/es/Article/Article.js +5 -3
- package/es/Article/ArticleContent.js +4 -1
- package/es/Article/ArticleHeaderWrapper.js +6 -3
- package/es/Aside/Aside.js +4 -1
- package/es/AudioPlayer/AudioPlayer.js +2 -2
- package/es/AudioPlayer/Controls.js +2 -2
- package/es/Breadcrumb/Breadcrumb.js +6 -3
- package/es/Breadcrumblist/Breadcrumblist.js +2 -2
- package/es/CompetenceGoalTab/CompetenceGoalTab.js +2 -2
- package/es/CompetenceGoals/CompetenceGoalsDialog.js +4 -1
- package/es/ContactBlock/ContactBlock.js +150 -0
- package/es/ContactBlock/index.js +9 -0
- package/es/ContentCard/ContentCard.js +4 -1
- package/es/ContentLoader/index.js +4 -1
- package/es/ContentTypeBadge/ContentTypeBadge.js +4 -1
- package/es/CopyParagraphButton/CopyParagraphButton.js +2 -2
- package/es/CopyParagraphButton/CopyParagraphButtonV2.js +2 -2
- package/es/Dialog/Dialog.js +4 -1
- package/es/Embed/AudioEmbed.js +2 -2
- package/es/Embed/BrightcoveEmbed.js +6 -3
- package/es/Embed/ConceptEmbed.js +2 -2
- package/es/Embed/ImageEmbed.js +2 -2
- package/es/Embed/conceptComponents.js +4 -1
- package/es/FactBox/FactBox.js +4 -1
- package/es/FactBox/FactBoxV2.js +6 -3
- package/es/Figure/Figure.js +4 -1
- package/es/Figure/FigureLicense.js +4 -1
- package/es/Figure/FigureLicenseDialog.js +4 -1
- package/es/Figure/FigureLicenseDialogContent.js +4 -1
- package/es/Filter/FilterButtons.js +2 -2
- package/es/Filter/FilterCarousel.js +6 -3
- package/es/Filter/FilterList.js +6 -3
- package/es/Filter/FilterListPhone.js +6 -3
- package/es/Filter/ToggleItem.js +4 -1
- package/es/Footer/FooterAuth.js +4 -1
- package/es/Frontpage/FrontpageAllSubjects.js +1 -1
- package/es/Frontpage/FrontpageProgramMenu.js +2 -2
- package/es/Hero/Hero.js +4 -1
- package/es/Image/Image.js +4 -1
- package/es/Image/ImageLink.js +4 -1
- package/es/Image/LazyLoadImage.js +4 -1
- package/es/KeyPerformanceIndicator/KeyPerformanceIndicator.js +57 -0
- package/es/KeyPerformanceIndicator/index.js +9 -0
- package/es/Layout/PageContainer.js +4 -1
- package/es/LearningPaths/LearningPathMenu.js +2 -2
- package/es/Logo/Logo.js +4 -1
- package/es/Logo/SvgLogo.js +4 -1
- package/es/Masthead/MastheadAuthModal.js +4 -1
- package/es/Masthead/utils.js +2 -2
- package/es/MediaList/MediaList.js +4 -1
- package/es/MultidisciplinarySubject/List.js +4 -1
- package/es/MyNdla/Resource/FolderInput.js +4 -1
- package/es/NDLAFilm/AllMoviesAlphabetically.js +2 -2
- package/es/NDLAFilm/CategorySelect.js +2 -2
- package/es/NDLAFilm/FilmMovieList.js +4 -1
- package/es/NDLAFilm/FilmSlideshow.js +6 -3
- package/es/Notion/ConceptNotion.js +1 -1
- package/es/Notion/FigureNotion.js +1 -1
- package/es/RadioButtonGroup/RadioButtonGroup.js +4 -2
- package/es/RelatedArticleList/RelatedArticleList.js +4 -1
- package/es/RelatedArticleList/RelatedArticleV2.js +6 -3
- package/es/ResourceGroup/ResourceList.js +4 -1
- package/es/ResourcesWrapper/ResourcesWrapper.js +4 -1
- package/es/Search/ContentTypeResult.js +6 -3
- package/es/Search/SearchField.js +4 -1
- package/es/Search/SearchResult.js +3 -1
- package/es/Search/SearchResultSleeve.js +2 -2
- package/es/Search/ToggleSearchButton.js +4 -1
- package/es/SearchTypeResult/PopupFilter.js +2 -2
- package/es/SearchTypeResult/SearchFieldHeader.js +2 -2
- package/es/SearchTypeResult/SearchHeader.js +2 -2
- package/es/SearchTypeResult/SearchTypeResult.js +4 -1
- package/es/SearchTypeResult/components/SubjectFilters.js +6 -3
- package/es/SnackBar/SnackbarProvider.js +6 -3
- package/es/Table/Table.js +6 -3
- package/es/TagSelector/Control.js +4 -1
- package/es/TagSelector/DropdownIndicator.js +4 -1
- package/es/TagSelector/Input.js +4 -1
- package/es/TagSelector/Menu.js +4 -1
- package/es/TagSelector/MenuList.js +4 -1
- package/es/TagSelector/Option.js +4 -1
- package/es/TagSelector/SelectContainer.js +4 -1
- package/es/TagSelector/TagSelector.js +6 -3
- package/es/TagSelector/ValueButton.js +4 -1
- package/es/Translation/Translation.js +4 -1
- package/es/Translation/TranslationLine.js +4 -1
- package/es/TreeStructure/FolderItem.js +53 -22
- package/es/TreeStructure/FolderItems.js +4 -1
- package/es/TreeStructure/TreeStructure.js +2 -2
- package/es/TreeStructure/helperFunctions.js +4 -1
- package/es/User/UserInfo.js +2 -2
- package/es/User/parseUserObject.js +6 -3
- package/es/all.css +1 -1
- package/es/index.js +4 -1
- package/es/locale/messages-en.js +6 -1
- package/es/locale/messages-nb.js +6 -1
- package/es/locale/messages-nn.js +6 -1
- package/es/locale/messages-se.js +83 -78
- package/es/locale/messages-sma.js +6 -1
- package/es/model/ContentType.js +4 -1
- package/lib/Animation/DisplayOnPageYOffset.js +11 -3
- package/lib/Article/Article.js +12 -4
- package/lib/Article/ArticleAccessMessage.js +7 -1
- package/lib/Article/ArticleByline.js +7 -1
- package/lib/Article/ArticleContent.js +10 -1
- package/lib/Article/ArticleHeaderWrapper.js +12 -4
- package/lib/Aside/Aside.js +10 -1
- package/lib/AudioPlayer/AudioPlayer.js +9 -3
- package/lib/AudioPlayer/Controls.js +9 -3
- package/lib/Breadcrumb/Breadcrumb.js +12 -4
- package/lib/Breadcrumb/BreadcrumbItem.js +7 -1
- package/lib/Breadcrumb/HomeBreadcrumb.js +7 -1
- package/lib/Breadcrumblist/Breadcrumblist.js +9 -3
- package/lib/CompetenceGoalTab/CompetenceGoalItem.js +7 -1
- package/lib/CompetenceGoalTab/CompetenceGoalTab.js +9 -3
- package/lib/CompetenceGoalTab/CompetenceItem.js +7 -1
- package/lib/CompetenceGoals/CompetenceGoalsDialog.js +10 -2
- package/lib/ContactBlock/ContactBlock.d.ts +20 -0
- package/lib/ContactBlock/ContactBlock.js +154 -0
- package/lib/ContactBlock/index.d.ts +9 -0
- package/lib/ContactBlock/index.js +17 -0
- package/lib/ContentCard/ContentCard.js +4 -1
- package/lib/ContentLoader/index.js +11 -1
- package/lib/ContentPlaceholder/ContentPlaceholder.js +7 -1
- package/lib/ContentTypeBadge/ContentTypeBadge.js +4 -2
- package/lib/CopyParagraphButton/CopyParagraphButton.js +9 -3
- package/lib/CopyParagraphButton/CopyParagraphButtonV2.js +9 -3
- package/lib/CreatedBy/CreatedBy.js +7 -1
- package/lib/Dialog/Dialog.js +13 -1
- package/lib/Embed/AudioEmbed.js +9 -3
- package/lib/Embed/BrightcoveEmbed.js +13 -4
- package/lib/Embed/ConceptEmbed.js +9 -3
- package/lib/Embed/ConceptListEmbed.js +7 -1
- package/lib/Embed/ExternalEmbed.js +7 -1
- package/lib/Embed/H5pEmbed.js +7 -1
- package/lib/Embed/ImageEmbed.js +9 -3
- package/lib/Embed/conceptComponents.js +11 -2
- package/lib/FactBox/FactBox.js +10 -1
- package/lib/FactBox/FactBoxV2.js +12 -4
- package/lib/Figure/Figure.js +11 -1
- package/lib/Figure/FigureLicense.js +11 -1
- package/lib/Figure/FigureLicenseDialog.js +11 -1
- package/lib/Figure/FigureLicenseDialogContent.js +10 -1
- package/lib/FileList/FileListV2.js +7 -1
- package/lib/Filter/FilterButtons.js +9 -3
- package/lib/Filter/FilterCarousel.js +12 -4
- package/lib/Filter/FilterList.js +12 -4
- package/lib/Filter/FilterListPhone.js +12 -4
- package/lib/Filter/ToggleItem.js +10 -1
- package/lib/Footer/Footer.js +7 -1
- package/lib/Footer/FooterAuth.js +11 -2
- package/lib/Frontpage/FrontpageAllSubjects.js +1 -1
- package/lib/Frontpage/FrontpageProgramMenu.js +2 -2
- package/lib/Frontpage/illustrations/FrontpageSubjectIllustration.js +7 -1
- package/lib/Hero/Hero.js +10 -2
- package/lib/Image/Image.js +11 -2
- package/lib/Image/ImageLink.js +11 -2
- package/lib/Image/LazyLoadImage.js +11 -1
- package/lib/InfoBlock/InfoBlock.js +7 -1
- package/lib/KeyPerformanceIndicator/KeyPerformanceIndicator.d.ts +8 -0
- package/lib/KeyPerformanceIndicator/KeyPerformanceIndicator.js +62 -0
- package/lib/KeyPerformanceIndicator/index.d.ts +1 -0
- package/lib/KeyPerformanceIndicator/index.js +13 -0
- package/lib/LanguageSelector/LanguageSelector.js +7 -1
- package/lib/Layout/PageContainer.js +10 -1
- package/lib/LearningPaths/LearningPathLastStepNavigation.js +7 -1
- package/lib/LearningPaths/LearningPathMenu.js +9 -3
- package/lib/LearningPaths/LearningPathMenuIntro.js +7 -1
- package/lib/Logo/Logo.js +10 -1
- package/lib/Logo/SvgLogo.js +10 -1
- package/lib/Masthead/Masthead.js +7 -1
- package/lib/Masthead/MastheadAuthModal.js +11 -1
- package/lib/Masthead/utils.js +9 -3
- package/lib/MediaList/MediaList.js +10 -1
- package/lib/Messages/MessageBanner.js +7 -1
- package/lib/Messages/MessageBox.js +7 -1
- package/lib/Messages/MessageBoxTag.js +7 -1
- package/lib/MultidisciplinarySubject/List.js +4 -1
- package/lib/MyNdla/Resource/Folder.js +7 -1
- package/lib/MyNdla/Resource/FolderInput.js +10 -1
- package/lib/MyNdla/SettingsMenu.js +7 -1
- package/lib/NDLAFilm/AllMoviesAlphabetically.js +9 -3
- package/lib/NDLAFilm/CategorySelect.js +9 -2
- package/lib/NDLAFilm/FilmMovieList.js +9 -1
- package/lib/NDLAFilm/FilmSlideshow.js +12 -4
- package/lib/NDLAFilm/VisualElement.js +7 -1
- package/lib/Notion/ConceptNotion.js +6 -1
- package/lib/Notion/FigureNotion.js +6 -1
- package/lib/Notion/Notion.js +7 -1
- package/lib/Notion/NotionVisualElement.js +6 -1
- package/lib/RadioButtonGroup/RadioButtonGroup.js +10 -2
- package/lib/RelatedArticleList/RelatedArticleList.js +4 -2
- package/lib/RelatedArticleList/RelatedArticleV2.js +12 -3
- package/lib/Resource/BlockResource.js +7 -1
- package/lib/Resource/ListResource.js +7 -1
- package/lib/Resource/resourceComponents.js +7 -1
- package/lib/ResourceGroup/ResourceItem.js +7 -1
- package/lib/ResourceGroup/ResourceList.js +11 -1
- package/lib/ResourcesWrapper/ResourcesWrapper.js +11 -1
- package/lib/Search/ContentTypeResult.js +5 -3
- package/lib/Search/SearchField.js +10 -1
- package/lib/Search/SearchResult.js +3 -1
- package/lib/Search/SearchResultSleeve.js +8 -2
- package/lib/Search/ToggleSearchButton.js +11 -1
- package/lib/SearchTypeResult/ActiveFilterContent.js +7 -1
- package/lib/SearchTypeResult/ActiveFilters.js +7 -1
- package/lib/SearchTypeResult/PopupFilter.js +9 -3
- package/lib/SearchTypeResult/SearchFieldHeader.js +9 -3
- package/lib/SearchTypeResult/SearchFilterContent.js +7 -1
- package/lib/SearchTypeResult/SearchHeader.js +9 -3
- package/lib/SearchTypeResult/SearchItem.js +7 -1
- package/lib/SearchTypeResult/SearchItemList.js +7 -1
- package/lib/SearchTypeResult/SearchItems.js +7 -1
- package/lib/SearchTypeResult/SearchNotionItem.js +7 -1
- package/lib/SearchTypeResult/SearchSubjectItem.js +7 -1
- package/lib/SearchTypeResult/SearchTypeHeader.js +7 -1
- package/lib/SearchTypeResult/SearchTypeResult.js +9 -1
- package/lib/SearchTypeResult/SearchViewType.js +7 -1
- package/lib/SearchTypeResult/components/ItemContexts.js +7 -1
- package/lib/SearchTypeResult/components/ItemResourceHeader.js +7 -1
- package/lib/SearchTypeResult/components/ItemTopicHeader.js +7 -1
- package/lib/SearchTypeResult/components/SubjectFilters.js +12 -4
- package/lib/SnackBar/SnackbarProvider.js +12 -4
- package/lib/Table/Table.js +12 -4
- package/lib/TagSelector/Control.js +10 -1
- package/lib/TagSelector/DropdownIndicator.js +10 -2
- package/lib/TagSelector/Input.js +10 -1
- package/lib/TagSelector/Menu.js +11 -1
- package/lib/TagSelector/MenuList.js +10 -1
- package/lib/TagSelector/Option.js +10 -1
- package/lib/TagSelector/SelectContainer.js +10 -1
- package/lib/TagSelector/TagSelector.js +12 -4
- package/lib/TagSelector/ValueButton.js +10 -1
- package/lib/Topic/Topic.js +7 -1
- package/lib/Translation/Translation.js +10 -1
- package/lib/Translation/TranslationLine.js +10 -1
- package/lib/TreeStructure/AddFolderButton.js +7 -1
- package/lib/TreeStructure/FolderItem.js +60 -23
- package/lib/TreeStructure/FolderItems.js +11 -1
- package/lib/TreeStructure/TreeStructure.js +9 -3
- package/lib/TreeStructure/helperFunctions.js +4 -1
- package/lib/User/AuthModal.js +7 -1
- package/lib/User/UserInfo.js +8 -3
- package/lib/User/parseUserObject.js +12 -4
- package/lib/all.css +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +21 -0
- package/lib/locale/messages-en.d.ts +2 -0
- package/lib/locale/messages-en.js +12 -1
- package/lib/locale/messages-nb.d.ts +2 -0
- package/lib/locale/messages-nb.js +12 -1
- package/lib/locale/messages-nn.d.ts +2 -0
- package/lib/locale/messages-nn.js +12 -1
- package/lib/locale/messages-se.d.ts +2 -0
- package/lib/locale/messages-se.js +89 -78
- package/lib/locale/messages-sma.d.ts +2 -0
- package/lib/locale/messages-sma.js +12 -1
- package/lib/model/ContentType.js +4 -1
- package/package.json +16 -16
- package/src/BlogPost/BlogPost.stories.tsx +4 -3
- package/src/ContactBlock/ContactBlock.tsx +144 -0
- package/src/ContactBlock/Contactblock.stories.tsx +88 -0
- package/src/ContactBlock/index.ts +10 -0
- package/src/KeyPerformanceIndicator/KeyPerformanceIndicator.stories.tsx +79 -0
- package/src/KeyPerformanceIndicator/KeyPerformanceIndicator.tsx +66 -0
- package/src/KeyPerformanceIndicator/index.ts +9 -0
- package/src/LanguageSelector/LanguageSelector.stories.tsx +4 -3
- package/src/LetterFilter/LetterFilter.stories.tsx +4 -3
- package/src/MyNdla/Resource/Folder.stories.tsx +39 -0
- package/src/Resource/BlockResource.stories.tsx +52 -0
- package/src/Resource/Resource.stories.tsx +52 -0
- package/src/TreeStructure/FolderItem.tsx +39 -20
- package/src/index.ts +3 -0
- package/src/locale/messages-en.ts +2 -0
- package/src/locale/messages-nb.ts +2 -0
- package/src/locale/messages-nn.ts +2 -0
- package/src/locale/messages-se.ts +79 -77
- package/src/locale/messages-sma.ts +2 -0
- package/src/MyNdla/Resource/Folder.stories.mdx +0 -53
- package/src/Resource/BlockResource.stories.mdx +0 -58
- package/src/Resource/Resource.stories.mdx +0 -58
|
@@ -0,0 +1,52 @@
|
|
|
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 React from 'react';
|
|
10
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
11
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
12
|
+
import ListResource from './ListResource';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Enkle komponenter/Ressurser/ListResource',
|
|
16
|
+
component: ListResource,
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
parameters: {
|
|
19
|
+
...defaultParameters,
|
|
20
|
+
},
|
|
21
|
+
argTypes: {
|
|
22
|
+
resourceImage: {
|
|
23
|
+
control: false,
|
|
24
|
+
},
|
|
25
|
+
resourceTypes: {
|
|
26
|
+
control: false,
|
|
27
|
+
},
|
|
28
|
+
headingLevel: {
|
|
29
|
+
control: false,
|
|
30
|
+
},
|
|
31
|
+
menuItems: {
|
|
32
|
+
control: false,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
args: {
|
|
36
|
+
id: '1234',
|
|
37
|
+
link: '',
|
|
38
|
+
title: 'Tittel til ressurs',
|
|
39
|
+
resourceImage: {
|
|
40
|
+
src: '',
|
|
41
|
+
alt: '',
|
|
42
|
+
},
|
|
43
|
+
resourceTypes: [{ id: 'urn:resourcetype:learningPath', name: 'Læringssti' }],
|
|
44
|
+
tags: ['tag', 'tag', 'tag', 'tag'],
|
|
45
|
+
},
|
|
46
|
+
} as Meta<typeof ListResource>;
|
|
47
|
+
|
|
48
|
+
export const ListResourceStory: StoryFn<typeof ListResource> = (args) => {
|
|
49
|
+
return <ListResource {...args} />;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
ListResourceStory.storyName = 'ListResource';
|
|
@@ -10,6 +10,7 @@ import React, { KeyboardEvent, useEffect, useRef } from 'react';
|
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
11
|
import styled from '@emotion/styled';
|
|
12
12
|
import { ArrowDropDownRounded } from '@ndla/icons/common';
|
|
13
|
+
import { FolderOutlined, FolderShared } from '@ndla/icons/contentType';
|
|
13
14
|
import { Done } from '@ndla/icons/editor';
|
|
14
15
|
import { ButtonV2 as Button } from '@ndla/button';
|
|
15
16
|
import { colors, spacing, animations, spacingUnit, misc, fonts } from '@ndla/core';
|
|
@@ -45,6 +46,17 @@ const StyledName = styled.span`
|
|
|
45
46
|
text-align: left;
|
|
46
47
|
`;
|
|
47
48
|
|
|
49
|
+
const IconWrapper = styled.div`
|
|
50
|
+
display: flex;
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
const FolderIconWrapper = styled.div`
|
|
54
|
+
svg {
|
|
55
|
+
height: 24px;
|
|
56
|
+
width: 24px;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
|
|
48
60
|
const shouldForwardProp = (name: string) => !['selected', 'level', 'focused', 'isCreatingFolder'].includes(name);
|
|
49
61
|
|
|
50
62
|
interface FolderNameProps {
|
|
@@ -56,8 +68,7 @@ interface FolderNameProps {
|
|
|
56
68
|
|
|
57
69
|
const FolderName = styled(Button, { shouldForwardProp })<FolderNameProps>`
|
|
58
70
|
display: grid;
|
|
59
|
-
grid-template-columns:
|
|
60
|
-
|
|
71
|
+
grid-template-columns: auto 1fr auto;
|
|
61
72
|
padding-left: ${({ level }) => 0.75 * spacingUnit * level}px;
|
|
62
73
|
gap: ${spacing.xxsmall};
|
|
63
74
|
border: none;
|
|
@@ -171,6 +182,8 @@ const FolderItem = ({
|
|
|
171
182
|
const isMaxDepth = level > maxLevel;
|
|
172
183
|
const hideArrow = isMaxDepth || emptyFolder;
|
|
173
184
|
|
|
185
|
+
const FolderIcon = folder.status === 'shared' ? FolderShared : FolderOutlined;
|
|
186
|
+
|
|
174
187
|
const tabable = selected || focused || (!focusedFolder && !folder.parentId && index === 0);
|
|
175
188
|
|
|
176
189
|
return type === 'navigation' ? (
|
|
@@ -225,6 +238,7 @@ const FolderItem = ({
|
|
|
225
238
|
aria-selected={selected}
|
|
226
239
|
focused={focusedFolder?.id === folder.id}
|
|
227
240
|
aria-describedby={containsResource ? `alreadyAdded-${folder.id}` : undefined}
|
|
241
|
+
aria-label={`${name}${folder.status === 'shared' ? `, ${t('myNdla.folder.sharing.shared')}` : ''}`}
|
|
228
242
|
variant="ghost"
|
|
229
243
|
shape="sharp"
|
|
230
244
|
fontWeight="normal"
|
|
@@ -239,24 +253,29 @@ const FolderItem = ({
|
|
|
239
253
|
onClick={handleClickFolder}
|
|
240
254
|
isCreatingFolder={isCreatingFolder}
|
|
241
255
|
>
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
e
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
<IconWrapper>
|
|
257
|
+
{!hideArrow && (
|
|
258
|
+
<OpenButton
|
|
259
|
+
aria-hidden
|
|
260
|
+
tabIndex={-1}
|
|
261
|
+
isOpen={isOpen}
|
|
262
|
+
onClick={(e) => {
|
|
263
|
+
e.stopPropagation();
|
|
264
|
+
setFocusedFolder(folder);
|
|
265
|
+
if (isOpen) {
|
|
266
|
+
onCloseFolder(id);
|
|
267
|
+
} else {
|
|
268
|
+
onOpenFolder(id);
|
|
269
|
+
}
|
|
270
|
+
}}
|
|
271
|
+
>
|
|
272
|
+
<ArrowDropDownRounded />
|
|
273
|
+
</OpenButton>
|
|
274
|
+
)}
|
|
275
|
+
<FolderIconWrapper>
|
|
276
|
+
<FolderIcon />
|
|
277
|
+
</FolderIconWrapper>
|
|
278
|
+
</IconWrapper>
|
|
260
279
|
<StyledName>{name}</StyledName>
|
|
261
280
|
{containsResource && (
|
|
262
281
|
<StyledDone
|
package/src/index.ts
CHANGED
|
@@ -181,6 +181,7 @@ export { default as messagesNB } from './locale/messages-nb';
|
|
|
181
181
|
export { default as messagesNN } from './locale/messages-nn';
|
|
182
182
|
export { default as messagesEN } from './locale/messages-en';
|
|
183
183
|
export { default as messagesSE } from './locale/messages-se';
|
|
184
|
+
export { default as messagesSMA } from './locale/messages-sma';
|
|
184
185
|
|
|
185
186
|
export { default as RadioButtonGroup } from './RadioButtonGroup';
|
|
186
187
|
|
|
@@ -270,3 +271,5 @@ export type { TreeStructureProps } from './TreeStructure';
|
|
|
270
271
|
export { SearchField, SearchResultList, SearchResultItem, ActiveFilters, ToggleSearchButton } from './Search';
|
|
271
272
|
export { default as LetterFilter } from './LetterFilter';
|
|
272
273
|
export { BlogPostV2 } from './BlogPost';
|
|
274
|
+
export { KeyPerformanceIndicator } from './KeyPerformanceIndicator';
|
|
275
|
+
export { default as ContactBlock } from './ContactBlock';
|
|
@@ -256,24 +256,24 @@ const messages = {
|
|
|
256
256
|
archived: 'Dát leat heaittihuvvon fága mii ii ođasmahttojuvvo.',
|
|
257
257
|
},
|
|
258
258
|
subjectsPage: {
|
|
259
|
-
filterSubjects: '
|
|
260
|
-
scrollToGroup: '
|
|
261
|
-
goToTop: '
|
|
262
|
-
alphabeticSort: '
|
|
263
|
-
subjectGroup: '
|
|
259
|
+
filterSubjects: 'Filtarastte fágaid',
|
|
260
|
+
scrollToGroup: 'Njuike jovkui',
|
|
261
|
+
goToTop: 'Mana álgui',
|
|
262
|
+
alphabeticSort: 'Fágat alfabehtalaččat',
|
|
263
|
+
subjectGroup: 'Joavku "{{ category }}"',
|
|
264
264
|
allSubjects: 'Buot fágat',
|
|
265
|
-
myFavoriteSubjects: '
|
|
265
|
+
myFavoriteSubjects: 'Mu oiddotfágat',
|
|
266
266
|
errorDescription: 'Šállošat, boasttuvuohta čuožžilii fágaid viežžamis.',
|
|
267
267
|
chooseSubject: 'Vállje fága',
|
|
268
|
-
confirmRemove: '
|
|
269
|
-
addFavorite: '
|
|
270
|
-
removeFavorite: '
|
|
271
|
-
removeConfirmed: '{{subject}}
|
|
272
|
-
addConfirmed: '{{subject}}
|
|
273
|
-
subjectFavoritePitch: '
|
|
268
|
+
confirmRemove: 'Leat go sihkar ahte áiggut sihkkut {{subject}} oiddotfágain?',
|
|
269
|
+
addFavorite: 'Lasit oiddotfága',
|
|
270
|
+
removeFavorite: 'Sihko oiddotfága',
|
|
271
|
+
removeConfirmed: '{{subject}} lea sihkkojuvvon oiddotfágain',
|
|
272
|
+
addConfirmed: '{{subject}} lea lasihuvvon oiddotfágan',
|
|
273
|
+
subjectFavoritePitch: 'Háliidat go dán fága merket oiddotfágan?',
|
|
274
274
|
subjectFavoriteGuide:
|
|
275
|
-
'
|
|
276
|
-
shows: '
|
|
275
|
+
'Vai galggat sáhttit merket fága oiddohin, fertet logget sisa Mu NDLAii. Fága gávnnat bajimusas siiddus go leat sisaloggen.',
|
|
276
|
+
shows: 'Čájeha',
|
|
277
277
|
},
|
|
278
278
|
topicPage: {
|
|
279
279
|
articleErrorDescription: 'Šállošat, boasttuvuohta čuožžilii fáddáčilgehusa viežžamis.',
|
|
@@ -337,33 +337,33 @@ const messages = {
|
|
|
337
337
|
toolboxTeachers: 'Reaidokássa - oahpaheddjiide',
|
|
338
338
|
film: 'NDLA Filbma',
|
|
339
339
|
about: {
|
|
340
|
-
title: '
|
|
341
|
-
numbers: '
|
|
342
|
-
keyPersonnel: '
|
|
343
|
-
vacancies: '
|
|
344
|
-
vision: '
|
|
345
|
-
communityPurpose: '
|
|
346
|
-
history: '
|
|
347
|
-
cooperation: '
|
|
348
|
-
faq: '
|
|
349
|
-
follow: '
|
|
350
|
-
whoAreWe: '
|
|
351
|
-
whatWeDo: '
|
|
352
|
-
careers: '
|
|
353
|
-
contactUs: '
|
|
354
|
-
organizing: '
|
|
355
|
-
articlesOfAssociation: '
|
|
340
|
+
title: 'NDLA birra',
|
|
341
|
+
numbers: 'Logut ja raporttat',
|
|
342
|
+
keyPersonnel: 'Čoavddaolbmot',
|
|
343
|
+
vacancies: 'Almmuhusat',
|
|
344
|
+
vision: 'Niehkodoaivva ja árvvut',
|
|
345
|
+
communityPurpose: 'Min servvodatdoaibma',
|
|
346
|
+
history: 'NDLA historjá',
|
|
347
|
+
cooperation: 'Min ovttasbarggu',
|
|
348
|
+
faq: 'Dávjá jerron jearaladagat',
|
|
349
|
+
follow: 'Čuovo min sosiála medijaid',
|
|
350
|
+
whoAreWe: 'Geat leat mii?',
|
|
351
|
+
whatWeDo: 'Maid mii bargat?',
|
|
352
|
+
careers: 'Barggut min fitnodagas',
|
|
353
|
+
contactUs: 'Váldde oktavuođa minguin',
|
|
354
|
+
organizing: 'Organiseren',
|
|
355
|
+
articlesOfAssociation: 'Njuolggadusat',
|
|
356
356
|
},
|
|
357
357
|
},
|
|
358
358
|
menu: {
|
|
359
|
-
button: '
|
|
360
|
-
goToMainMenu: '
|
|
359
|
+
button: 'Fállu',
|
|
360
|
+
goToMainMenu: 'Mana váldofállui',
|
|
361
361
|
close: 'Govčča',
|
|
362
362
|
goTo: 'Mana deike',
|
|
363
363
|
search: 'Oza',
|
|
364
364
|
toFrontpage: 'Ovdasiidui',
|
|
365
365
|
subjectOverview: 'Buot fágat',
|
|
366
|
-
title: '
|
|
366
|
+
title: 'Raba fálu',
|
|
367
367
|
modalLabel: 'Vállje sisdoalu',
|
|
368
368
|
subjectPage: 'Ovdasiidu fágas',
|
|
369
369
|
backToSubjectFrontpage: 'Ruovttoluotta fága ovdasiidui',
|
|
@@ -501,9 +501,9 @@ const messages = {
|
|
|
501
501
|
competenceGoalClose: 'Govčča',
|
|
502
502
|
competenceGoalTitle: 'Mihttun lea ahte oahppi galgá máhttit:',
|
|
503
503
|
competenceTabLK20label: 'Gealbomihttomearri',
|
|
504
|
-
competenceTabLK20Tooltip: '
|
|
504
|
+
competenceTabLK20Tooltip: 'Čájet gealbomihtuid',
|
|
505
505
|
competenceTabCorelabel: 'Guovddášelemeanta',
|
|
506
|
-
competenceTabCoreTooltip: '
|
|
506
|
+
competenceTabCoreTooltip: 'Čájet guovddášelemeanttaid',
|
|
507
507
|
competenceGoalItem: {
|
|
508
508
|
title: 'Gealbomihttomearit ja árvvoštallan',
|
|
509
509
|
},
|
|
@@ -642,21 +642,21 @@ const messages = {
|
|
|
642
642
|
},
|
|
643
643
|
figure: {
|
|
644
644
|
button: {
|
|
645
|
-
alternative: 'Lonut mas dulkojuvvo oaidninváttuid ektui',
|
|
645
|
+
alternative: 'Lonut siidui mas dulkojuvvo oaidninváttuid ektui',
|
|
646
646
|
original: 'Lonut orginála videoi',
|
|
647
647
|
},
|
|
648
648
|
},
|
|
649
649
|
footer: {
|
|
650
650
|
aboutNDLA: 'NDLA birra',
|
|
651
|
-
socialMedia: '
|
|
651
|
+
socialMedia: 'Sosiála mediat',
|
|
652
652
|
selectLanguage: 'Vállje giela (language): ',
|
|
653
653
|
vision: 'Ovttas hábmet boahtteáiggi oahppama',
|
|
654
654
|
linksHeader: 'Eará NDLA neahttabáikkit',
|
|
655
655
|
info: 'Neahttabáiki lea ráhkaduvvon NDLA bokte rabas gáldokodain.',
|
|
656
656
|
editorInChief: 'Vásttolaš doaimmaheaddji:',
|
|
657
|
-
availabilityLink: '
|
|
657
|
+
availabilityLink: 'Beasatlašvuođajulggaštus',
|
|
658
658
|
privacyLink: 'Persovdnasuodjalusjulggaštus ja diehtočoahkku (gáhkožat)',
|
|
659
|
-
cookiesLink: 'Julggaštus
|
|
659
|
+
cookiesLink: 'Julggaštus diehtočoahku ektui (gáhkožat)',
|
|
660
660
|
socialMediaLinks: {
|
|
661
661
|
facebook: 'NDLA Facebookas',
|
|
662
662
|
facebookAria: 'Fina NDLA siiddus Facebookas',
|
|
@@ -674,7 +674,7 @@ const messages = {
|
|
|
674
674
|
ndlaLinks: {
|
|
675
675
|
ndla: 'ndla.no',
|
|
676
676
|
omNdla: 'NDLA birra',
|
|
677
|
-
aboutNdla: '
|
|
677
|
+
aboutNdla: 'NDLA birra',
|
|
678
678
|
blog: 'Fágablogga',
|
|
679
679
|
tips: 'Cavgileapmi ohppiide',
|
|
680
680
|
fyr: 'FYR-prošeakta',
|
|
@@ -766,7 +766,7 @@ const messages = {
|
|
|
766
766
|
hits: '{{count}} deaivama',
|
|
767
767
|
},
|
|
768
768
|
notions: {
|
|
769
|
-
tags: '
|
|
769
|
+
tags: 'Listu ja filttar',
|
|
770
770
|
usedIn: 'Adnojuvvo dás',
|
|
771
771
|
closeNotion: 'Govčča',
|
|
772
772
|
},
|
|
@@ -835,7 +835,7 @@ const messages = {
|
|
|
835
835
|
shortFilm: 'Oanehis filbma',
|
|
836
836
|
all: 'Buot filmmat A-Å',
|
|
837
837
|
},
|
|
838
|
-
allMovieGroupTitleLabel: '
|
|
838
|
+
allMovieGroupTitleLabel: 'Filmmat mat álget {{letter}}',
|
|
839
839
|
moreAboutNdlaFilm: {
|
|
840
840
|
header: 'NDLA Filbma',
|
|
841
841
|
firstParagraph:
|
|
@@ -933,7 +933,7 @@ const messages = {
|
|
|
933
933
|
frontpageMultidisciplinarySubject: {
|
|
934
934
|
heading: 'Fágaidrasttideaddji fáttát',
|
|
935
935
|
text: 'Oahppoplána golbma fágaidrasttideaddji fáttáin leat vuolggasadjin áigeguovdilis hástalusat servvodagas mat gáibidit beroštumi ja rahčamuša ovttaskas olbmuin ja searvevuođas lagasbirrasis, našunálalaččat ja máilmmeviidosaččat.',
|
|
936
|
-
linkText: 'Geahča
|
|
936
|
+
linkText: 'Geahča keisaid fágaidrasttideaddji fáttáin.',
|
|
937
937
|
publicHealthTopic: 'Álbmotdearvvašvuohta ja eallimis birgen',
|
|
938
938
|
democracyTopic: 'Demokratiija ja mielboargárvuohta',
|
|
939
939
|
sustainableTopic: 'Guoddevaš ovdáneapmi',
|
|
@@ -953,7 +953,7 @@ const messages = {
|
|
|
953
953
|
loadingText: 'Viežžá fáttá',
|
|
954
954
|
},
|
|
955
955
|
multidisciplinarySubject: {
|
|
956
|
-
subjectsLinksDescription: '
|
|
956
|
+
subjectsLinksDescription: 'Keisa mii gullá',
|
|
957
957
|
},
|
|
958
958
|
multibutton: {
|
|
959
959
|
open: 'Raba fálu',
|
|
@@ -964,6 +964,8 @@ const messages = {
|
|
|
964
964
|
title: 'Tihttel',
|
|
965
965
|
cancel: 'Botkke',
|
|
966
966
|
save: 'Vurke',
|
|
967
|
+
photo: 'Foto',
|
|
968
|
+
email: 'E-post',
|
|
967
969
|
image: {
|
|
968
970
|
altText: 'Molssaevttolaš teaksta',
|
|
969
971
|
caption: 'Govvateaksta',
|
|
@@ -1075,7 +1077,7 @@ const messages = {
|
|
|
1075
1077
|
mail: 'Eboasta',
|
|
1076
1078
|
username: 'Geavahan namma',
|
|
1077
1079
|
mobile: 'Telefonnummar',
|
|
1078
|
-
preferredLanguage: '
|
|
1080
|
+
preferredLanguage: 'Sávvojuvvon giella',
|
|
1079
1081
|
groupTypes: {
|
|
1080
1082
|
basic: 'Vuođđojoavku',
|
|
1081
1083
|
teaching: 'Oahpahusjoavku',
|
|
@@ -1100,8 +1102,8 @@ const messages = {
|
|
|
1100
1102
|
resources: '{{count}} resursa',
|
|
1101
1103
|
resources_plural: '{{count}} resurssat',
|
|
1102
1104
|
folders: '{{count}} máhpat',
|
|
1103
|
-
folders_plural: '{{count}}
|
|
1104
|
-
settings: '
|
|
1105
|
+
folders_plural: '{{count}} máhpat',
|
|
1106
|
+
settings: 'Válljemat',
|
|
1105
1107
|
folder: {
|
|
1106
1108
|
folder: 'Máhppa',
|
|
1107
1109
|
delete: 'Sihko máhpa',
|
|
@@ -1117,30 +1119,30 @@ const messages = {
|
|
|
1117
1119
|
onDragCancel: 'Sirdin botkejuvvui. Máhppa {{name}} lea luitojuvvon.',
|
|
1118
1120
|
dragHandle: 'Ordne máhpa {{name}}',
|
|
1119
1121
|
sharing: {
|
|
1120
|
-
share: '
|
|
1121
|
-
shared: '
|
|
1122
|
-
unShare: '
|
|
1123
|
-
link: '
|
|
1122
|
+
share: 'Juoge máhpa',
|
|
1123
|
+
shared: 'Juogaduvvon',
|
|
1124
|
+
unShare: 'Juohkin lea loahpahuvvon. Máhppa ii leat šat juogaduvvon.',
|
|
1125
|
+
link: 'Liŋka lea máŋgejuvvon.',
|
|
1124
1126
|
header: {
|
|
1125
|
-
private: '
|
|
1126
|
-
shared: '
|
|
1127
|
-
unShare: '
|
|
1127
|
+
private: 'Áiggut go juogadit dán máhpa?',
|
|
1128
|
+
shared: 'Dát máhpa lea juogaduvvon.',
|
|
1129
|
+
unShare: 'Háliidat go loahpahit máhpa juogadeami?',
|
|
1128
1130
|
},
|
|
1129
1131
|
description: {
|
|
1130
|
-
copy: '
|
|
1132
|
+
copy: 'Máŋge ja juoge dán liŋkka:',
|
|
1131
1133
|
private:
|
|
1132
|
-
'
|
|
1133
|
-
private2: '
|
|
1134
|
+
'Go juogát máhpa ráhkadat liŋkka mii lea rabas buohkaide geas lea liŋka. Sáhtát rievdadit sisdoalu dahje loahpahit juogadeami go háliidat.',
|
|
1135
|
+
private2: 'Go juogadat máhpa juogát buot máhpa sisdoalu, oktan vuollemáhpaiguin ja resursaiguin',
|
|
1134
1136
|
shared:
|
|
1135
|
-
'
|
|
1137
|
+
'Dál sáhtát juogadit dán liŋkka ohppiiguin dahje eará oahpaheddjiiguin. Jus rievdadat maidege máhpas šaddá rievdan oinnolaš buohkaide geaidda leat juogadan liŋkka',
|
|
1136
1138
|
unShare:
|
|
1137
|
-
'
|
|
1139
|
+
'Go loahpahat juogadeami ii doaimma liŋka juogaduvvon máhppii šat. Jus leat juogadan liŋkka ovttainge, de eai sáhte šat oaidnit máhpa sisdoalu',
|
|
1138
1140
|
},
|
|
1139
1141
|
button: {
|
|
1140
|
-
share: '
|
|
1141
|
-
preview: '
|
|
1142
|
-
unShare: '
|
|
1143
|
-
shareLink: '
|
|
1142
|
+
share: 'Juoge máhpa',
|
|
1143
|
+
preview: 'Čájet ovdagihtii juogaduvvon máhpa',
|
|
1144
|
+
unShare: 'Loahpat juogdeami',
|
|
1145
|
+
shareLink: 'Máŋge liŋkka',
|
|
1144
1146
|
},
|
|
1145
1147
|
},
|
|
1146
1148
|
},
|
|
@@ -1171,18 +1173,18 @@ const messages = {
|
|
|
1171
1173
|
detailView: 'Bienalaš oppalašlistu',
|
|
1172
1174
|
shortView: 'Oanehis listu',
|
|
1173
1175
|
sharedFolder: {
|
|
1174
|
-
info: '
|
|
1175
|
-
firstShared: '
|
|
1176
|
-
drawerButton: '
|
|
1177
|
-
drawerTitle: '
|
|
1176
|
+
info: 'Dán máhpas lea NDLA fágasisdoallu ja bargobihtát, čohkkejuvvon oahpaheaddjis.',
|
|
1177
|
+
firstShared: 'Máhppa juogaduvvui vuosttaš geardde {{date}}',
|
|
1178
|
+
drawerButton: 'Čájet máhpaid ja resurssaid',
|
|
1179
|
+
drawerTitle: 'Máhpat ja resurssat',
|
|
1178
1180
|
learningpathUnsupported:
|
|
1179
|
-
'
|
|
1181
|
+
'Oahppanbálgát eai sáhte njuolga čájehuvvot juogaduvvon máhpain. Jus deaddilat liŋkka navigerenfálus gurut bealde, rahpasa bálggis ođđa siiddus.',
|
|
1180
1182
|
description: {
|
|
1181
1183
|
info1:
|
|
1182
|
-
'
|
|
1183
|
-
info2: '
|
|
1184
|
+
'Dán máhpas gávnnat fágaávdnasiid ja bargobihtáid NDLAs. Oahpaheaddji lea čohkken artihkkaliid ja bidjan daid ortnetvurrui.',
|
|
1185
|
+
info2: 'Sáhtát bláđet artihkkaliid fálu vehkiin.',
|
|
1184
1186
|
info3:
|
|
1185
|
-
'
|
|
1187
|
+
'Jus háliidat gávdnat máhpa maŋŋel fas, sáhtát geavahit seamma liŋkka maid oahpaheaddjis leat ožžon, dahje sáhtát girjemearka bidjat siidui.',
|
|
1186
1188
|
},
|
|
1187
1189
|
willOpenInNewTab: 'Åpnes i ny fane.',
|
|
1188
1190
|
},
|
|
@@ -1206,7 +1208,7 @@ const messages = {
|
|
|
1206
1208
|
read: { read: 'Loga min', our: '.' },
|
|
1207
1209
|
privacy: 'personsuodjalusjulggaštusa',
|
|
1208
1210
|
privacyLink: 'https://om.ndla.no/gdpr',
|
|
1209
|
-
questions: { question: 'Smiehtat go maidege?', ask: 'Jeara min
|
|
1211
|
+
questions: { question: 'Smiehtat go maidege?', ask: 'Jeara min čeattas' },
|
|
1210
1212
|
wishToDelete: 'It go hálit geavaheaddjiprofiila min geahčen šat?',
|
|
1211
1213
|
terms: {
|
|
1212
1214
|
terms: 'Eavttut geavaheapmái',
|
|
@@ -1254,7 +1256,7 @@ const messages = {
|
|
|
1254
1256
|
tagsUpdated: 'Fáddágilkorat leat ođastuvvon',
|
|
1255
1257
|
show: 'Čájet',
|
|
1256
1258
|
save: 'Vurke resurssa',
|
|
1257
|
-
onDragStart: '
|
|
1259
|
+
onDragStart: 'Rohtte resurssa {{name}}. Resursa lea {{index}} posišuvnnas čuovvovačča {{length}} posišuvnnas',
|
|
1258
1260
|
onDragOver: 'Resursa {{name}} sirdojuvvui {{index}} posišuvdnii {{length}} posišuvnnas',
|
|
1259
1261
|
onDragOverMissingOver: 'Resursa {{name}} ii leat šat luoitinposišuvnnas',
|
|
1260
1262
|
onDragEnd: 'Resursa {{name}} luitojuvvui {{index}} posišuvdnii {{length}} posišuvnnas',
|
|
@@ -1290,12 +1292,12 @@ const messages = {
|
|
|
1290
1292
|
help: 'Veahket',
|
|
1291
1293
|
},
|
|
1292
1294
|
programme: {
|
|
1293
|
-
grades: '
|
|
1295
|
+
grades: 'Ceahkki',
|
|
1294
1296
|
},
|
|
1295
1297
|
embed: {
|
|
1296
|
-
conceptListError: '
|
|
1297
|
-
linkError: '
|
|
1298
|
-
unsupported: `Embed {{type}}
|
|
1298
|
+
conceptListError: 'Ii sáhttán čájehit čilgehuslisttu',
|
|
1299
|
+
linkError: 'Ii sáhttán čájehit liŋkka.',
|
|
1300
|
+
unsupported: `Embed {{type}} ii dorjojuvvo.`,
|
|
1299
1301
|
},
|
|
1300
1302
|
};
|
|
1301
1303
|
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
|
2
|
-
import { defaultParameters } from '../../../../../stories/defaults';
|
|
3
|
-
import { Pencil } from '@ndla/icons/action';
|
|
4
|
-
import { DeleteForever } from '@ndla/icons/editor';
|
|
5
|
-
|
|
6
|
-
import Folder from './Folder';
|
|
7
|
-
import ButtonV2 from '../../../../button/src/ButtonV2';
|
|
8
|
-
|
|
9
|
-
<Meta
|
|
10
|
-
title="Enkle komponenter/Mappe"
|
|
11
|
-
component={Folder}
|
|
12
|
-
parameters={{
|
|
13
|
-
...defaultParameters,
|
|
14
|
-
docs: {
|
|
15
|
-
inlineStories: true,
|
|
16
|
-
},
|
|
17
|
-
backgrounds: {},
|
|
18
|
-
}}
|
|
19
|
-
argTypes={{
|
|
20
|
-
menuItems: {
|
|
21
|
-
control: false,
|
|
22
|
-
},
|
|
23
|
-
}}
|
|
24
|
-
/>
|
|
25
|
-
|
|
26
|
-
export const Template = (args) => <Folder {...args} />;
|
|
27
|
-
|
|
28
|
-
# Mappe
|
|
29
|
-
|
|
30
|
-
<Canvas>
|
|
31
|
-
<Story
|
|
32
|
-
name="Mappe"
|
|
33
|
-
args={{
|
|
34
|
-
id: '3d88300c-1186-47f5-a99a-8ea93fa20981',
|
|
35
|
-
title: 'Dette er min tittel',
|
|
36
|
-
subFolders: 3,
|
|
37
|
-
subResources: 3,
|
|
38
|
-
description: '',
|
|
39
|
-
link: '',
|
|
40
|
-
type: 'list',
|
|
41
|
-
menuItems: [
|
|
42
|
-
{ icon: <Pencil />, text: 'Rediger', onClick: () => {} },
|
|
43
|
-
{ icon: <DeleteForever />, text: 'Slett', onClick: () => {}, type: 'danger' },
|
|
44
|
-
],
|
|
45
|
-
isShared: 'true',
|
|
46
|
-
}}>
|
|
47
|
-
{Template.bind({})}
|
|
48
|
-
</Story>
|
|
49
|
-
</Canvas>
|
|
50
|
-
|
|
51
|
-
### Props
|
|
52
|
-
|
|
53
|
-
<ArgsTable story="Mappe" />
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
|
2
|
-
import { defaultParameters } from '../../../../stories/defaults';
|
|
3
|
-
import { Pencil } from '@ndla/icons/action';
|
|
4
|
-
import { DeleteForever } from '@ndla/icons/editor';
|
|
5
|
-
|
|
6
|
-
import BlockResource from './BlockResource';
|
|
7
|
-
|
|
8
|
-
<Meta
|
|
9
|
-
title="Enkle komponenter/Ressurser/BlockResource"
|
|
10
|
-
component={BlockResource}
|
|
11
|
-
parameters={{
|
|
12
|
-
...defaultParameters,
|
|
13
|
-
docs: {
|
|
14
|
-
inlineStories: true,
|
|
15
|
-
},
|
|
16
|
-
backgrounds: {},
|
|
17
|
-
}}
|
|
18
|
-
argTypes={{
|
|
19
|
-
resourceImage: {
|
|
20
|
-
control: false,
|
|
21
|
-
},
|
|
22
|
-
resourceTypes: {
|
|
23
|
-
control: false,
|
|
24
|
-
},
|
|
25
|
-
headingLevel: {
|
|
26
|
-
control: false,
|
|
27
|
-
},
|
|
28
|
-
menuItems: {
|
|
29
|
-
control: false,
|
|
30
|
-
},
|
|
31
|
-
}}
|
|
32
|
-
/>
|
|
33
|
-
|
|
34
|
-
export const Template = (args) => <BlockResource {...args} />;
|
|
35
|
-
|
|
36
|
-
# Blokkressurs
|
|
37
|
-
|
|
38
|
-
<Canvas>
|
|
39
|
-
<Story
|
|
40
|
-
name="BlockResource"
|
|
41
|
-
args={{
|
|
42
|
-
id: '1234',
|
|
43
|
-
link: '',
|
|
44
|
-
title: 'Tittel til ressurs',
|
|
45
|
-
resourceImage: {
|
|
46
|
-
src: '',
|
|
47
|
-
alt: '',
|
|
48
|
-
},
|
|
49
|
-
resourceTypes: [{ id: 'urn:resourcetype:learningPath', name: 'Læringssti' }],
|
|
50
|
-
tags: ['tag', 'tag', 'tag', 'tag'],
|
|
51
|
-
}}>
|
|
52
|
-
{Template.bind({})}
|
|
53
|
-
</Story>
|
|
54
|
-
</Canvas>
|
|
55
|
-
|
|
56
|
-
### Props
|
|
57
|
-
|
|
58
|
-
<ArgsTable story="BlockResource" />
|