@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "35.0
|
|
3
|
+
"version": "35.1.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ndla/article-scripts": "^3.0.17",
|
|
35
|
-
"@ndla/button": "^10.0.
|
|
36
|
-
"@ndla/carousel": "^3.0.
|
|
35
|
+
"@ndla/button": "^10.0.13",
|
|
36
|
+
"@ndla/carousel": "^3.0.13",
|
|
37
37
|
"@ndla/core": "^3.1.3",
|
|
38
|
-
"@ndla/forms": "^4.2.
|
|
38
|
+
"@ndla/forms": "^4.2.22",
|
|
39
39
|
"@ndla/hooks": "^2.0.4",
|
|
40
|
-
"@ndla/icons": "^2.2.
|
|
40
|
+
"@ndla/icons": "^2.2.13",
|
|
41
41
|
"@ndla/licenses": "^7.0.4",
|
|
42
|
-
"@ndla/modal": "^2.2.
|
|
43
|
-
"@ndla/notion": "^4.2.
|
|
44
|
-
"@ndla/safelink": "^4.0.
|
|
45
|
-
"@ndla/switch": "^1.0.
|
|
46
|
-
"@ndla/tabs": "^2.1.
|
|
47
|
-
"@ndla/tooltip": "^4.0.
|
|
42
|
+
"@ndla/modal": "^2.2.17",
|
|
43
|
+
"@ndla/notion": "^4.2.19",
|
|
44
|
+
"@ndla/safelink": "^4.0.23",
|
|
45
|
+
"@ndla/switch": "^1.0.9",
|
|
46
|
+
"@ndla/tabs": "^2.1.20",
|
|
47
|
+
"@ndla/tooltip": "^4.0.21",
|
|
48
48
|
"@ndla/util": "^3.1.12",
|
|
49
49
|
"@radix-ui/react-accordion": "1.1.0",
|
|
50
50
|
"@radix-ui/react-dropdown-menu": "2.0.2",
|
|
@@ -75,16 +75,16 @@
|
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
|
|
77
77
|
"@ndla/types-backend": "0.2.1",
|
|
78
|
-
"@ndla/types-embed": "^1.0
|
|
78
|
+
"@ndla/types-embed": "^1.1.0",
|
|
79
79
|
"@types/reach__dialog": "^0.1.0",
|
|
80
80
|
"css-loader": "^6.7.3",
|
|
81
|
-
"mini-css-extract-plugin": "^2.7.
|
|
82
|
-
"sass-loader": "^13.2.
|
|
83
|
-
"webpack": "^5.
|
|
81
|
+
"mini-css-extract-plugin": "^2.7.5",
|
|
82
|
+
"sass-loader": "^13.2.2",
|
|
83
|
+
"webpack": "^5.79.0",
|
|
84
84
|
"webpack-cli": "^5.0.1"
|
|
85
85
|
},
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "c055a24586a13acac494f7cecda6b301fba80249"
|
|
90
90
|
}
|
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
11
11
|
import BlogPost from './BlogPost';
|
|
12
12
|
import { defaultParameters } from '../../../../stories/defaults';
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
15
|
title: 'Enkle komponenter/Blog Post',
|
|
16
16
|
component: BlogPost,
|
|
17
|
+
tags: ['autodocs'],
|
|
17
18
|
parameters: {
|
|
18
19
|
...defaultParameters,
|
|
19
20
|
},
|
|
@@ -28,9 +29,9 @@ export default {
|
|
|
28
29
|
url: 'https://api.test.ndla.no/image-api/raw/20080101-032119-ag.jpg',
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
|
-
} as
|
|
32
|
+
} as Meta<typeof BlogPost>;
|
|
32
33
|
|
|
33
|
-
export const BlogPostStory:
|
|
34
|
+
export const BlogPostStory: StoryFn<typeof BlogPost> = ({ ...args }) => {
|
|
34
35
|
return <BlogPost {...args} />;
|
|
35
36
|
};
|
|
36
37
|
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-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 { css } from '@emotion/react';
|
|
10
|
+
import styled from '@emotion/styled';
|
|
11
|
+
import { IImageMetaInformationV3 } from '@ndla/types-backend/image-api';
|
|
12
|
+
import { spacing, fonts, colors, mq, breakpoints, misc } from '@ndla/core';
|
|
13
|
+
import { BlobPointy, BlobRound } from '@ndla/icons/common';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import concat from 'lodash/concat';
|
|
16
|
+
import { errorSvgSrc } from '../Embed/ImageEmbed';
|
|
17
|
+
|
|
18
|
+
interface Props {
|
|
19
|
+
image?: IImageMetaInformationV3;
|
|
20
|
+
jobTitle: string;
|
|
21
|
+
description: string;
|
|
22
|
+
blobColor?: 'pink' | 'green';
|
|
23
|
+
blob?: 'pointy' | 'round';
|
|
24
|
+
imageWidth?: number;
|
|
25
|
+
name: string;
|
|
26
|
+
email: string;
|
|
27
|
+
}
|
|
28
|
+
const CardWrapper = styled.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
padding: 0 0 ${spacing.medium} ${spacing.medium};
|
|
32
|
+
font-family: ${fonts.sans};
|
|
33
|
+
justify-content: center;
|
|
34
|
+
border-radius: ${misc.borderRadius};
|
|
35
|
+
border: 1px solid ${colors.brand.lighter};
|
|
36
|
+
margin-top: ${spacing.mediumlarge};
|
|
37
|
+
${mq.range({ from: breakpoints.tabletWide })} {
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
padding: 0 0 ${spacing.medium} ${spacing.medium};
|
|
40
|
+
gap: ${spacing.nsmall};
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
const StyledHeader = styled.div`
|
|
45
|
+
${fonts.sizes('22px', '30px')};
|
|
46
|
+
font-weight: ${fonts.weight.bold};
|
|
47
|
+
margin: 0 0 ${spacing.xsmall} 0;
|
|
48
|
+
padding-top: ${spacing.medium};
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const StyledDescriptionInformation = styled.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
overflow-wrap: anywhere;
|
|
54
|
+
color: ${colors.text.light};
|
|
55
|
+
gap: ${spacing.xxsmall};
|
|
56
|
+
`;
|
|
57
|
+
const EmailLink = styled.a`
|
|
58
|
+
color: ${colors.text.light};
|
|
59
|
+
text-decoration-color: ${colors.text.light};
|
|
60
|
+
text-decoration-style: solid;
|
|
61
|
+
text-decoration: underline;
|
|
62
|
+
box-shadow: unset;
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
const SummaryBlock = styled.p`
|
|
66
|
+
font-family: ${fonts.serif};
|
|
67
|
+
padding: 0 ${spacing.medium} 0 0;
|
|
68
|
+
${mq.range({ from: breakpoints.tabletWide })} {
|
|
69
|
+
padding-top: 0;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
const ContentWrapper = styled.div`
|
|
74
|
+
display: flex;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
justify-content: space-between;
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
const BlobWrapper = styled.div`
|
|
80
|
+
height: 180px;
|
|
81
|
+
width: 90px;
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
const ImageWrapper = styled.div`
|
|
85
|
+
aspect-ratio: 16/9;
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: ${spacing.small};
|
|
89
|
+
padding: ${spacing.medium} ${spacing.medium} 0 0;
|
|
90
|
+
|
|
91
|
+
${mq.range({ from: breakpoints.tabletWide })} {
|
|
92
|
+
padding-right: 0;
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
|
|
96
|
+
const blobStyle = css`
|
|
97
|
+
width: 165px;
|
|
98
|
+
height: 180px;
|
|
99
|
+
transform: translate(10%, 0);
|
|
100
|
+
`;
|
|
101
|
+
const Email = styled.div`
|
|
102
|
+
min-width: 60px;
|
|
103
|
+
`;
|
|
104
|
+
const ContactBlock = ({ image, jobTitle, description, name, email, blobColor = 'green', blob = 'pointy' }: Props) => {
|
|
105
|
+
const { t } = useTranslation();
|
|
106
|
+
const isGreenBlob = blobColor === 'green';
|
|
107
|
+
const Blob = blob === 'pointy' ? BlobPointy : BlobRound;
|
|
108
|
+
const authors = concat(image?.copyright.processors, image?.copyright.creators, image?.copyright.rightsholders);
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<CardWrapper>
|
|
112
|
+
<ImageWrapper>
|
|
113
|
+
{image ? (
|
|
114
|
+
<>
|
|
115
|
+
<img alt={image.alttext.alttext} src={`${image.image.imageUrl}?width=286`} />
|
|
116
|
+
{`${t('photo')}: ${authors.reduce((acc, name) => (acc = `${acc} ${name?.name}`), '')} ${
|
|
117
|
+
image.copyright.license.license
|
|
118
|
+
}`}
|
|
119
|
+
</>
|
|
120
|
+
) : (
|
|
121
|
+
<img alt={t('image.error.url')} src={errorSvgSrc} />
|
|
122
|
+
)}
|
|
123
|
+
</ImageWrapper>
|
|
124
|
+
<div>
|
|
125
|
+
<ContentWrapper>
|
|
126
|
+
<div>
|
|
127
|
+
<StyledHeader>{name}</StyledHeader>
|
|
128
|
+
<StyledDescriptionInformation>{jobTitle}</StyledDescriptionInformation>
|
|
129
|
+
<StyledDescriptionInformation>
|
|
130
|
+
<Email>{`${t('email')}:`}</Email>
|
|
131
|
+
<EmailLink href={`mailto:${email}?subject=Contact us`}>{email}</EmailLink>
|
|
132
|
+
</StyledDescriptionInformation>
|
|
133
|
+
</div>
|
|
134
|
+
<BlobWrapper>
|
|
135
|
+
<Blob css={blobStyle} color={isGreenBlob ? colors.support.greenLight : colors.support.redLight} />
|
|
136
|
+
</BlobWrapper>
|
|
137
|
+
</ContentWrapper>
|
|
138
|
+
<SummaryBlock>{description}</SummaryBlock>
|
|
139
|
+
</div>
|
|
140
|
+
</CardWrapper>
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export default ContactBlock;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-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 ContactBlock from './ContactBlock';
|
|
12
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Enkle komponenter/Kontaktblokk',
|
|
16
|
+
component: ContactBlock,
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
args: {
|
|
19
|
+
image: {
|
|
20
|
+
id: '65750',
|
|
21
|
+
metaUrl: 'https://api.test.ndla.no/image-api/v3/images/65750',
|
|
22
|
+
title: {
|
|
23
|
+
title: 'Sigurd Trageton',
|
|
24
|
+
language: 'nb',
|
|
25
|
+
},
|
|
26
|
+
alttext: {
|
|
27
|
+
alttext: 'Sigurd Trageton',
|
|
28
|
+
language: 'nb',
|
|
29
|
+
},
|
|
30
|
+
copyright: {
|
|
31
|
+
license: {
|
|
32
|
+
license: 'CC-BY-SA-4.0',
|
|
33
|
+
description: 'Creative Commons Attribution-ShareAlike 4.0 International',
|
|
34
|
+
url: 'https://creativecommons.org/licenses/by-sa/4.0/',
|
|
35
|
+
},
|
|
36
|
+
origin: '',
|
|
37
|
+
creators: [
|
|
38
|
+
{
|
|
39
|
+
type: 'photographer',
|
|
40
|
+
name: 'Tom Knudsen',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
processors: [],
|
|
44
|
+
rightsholders: [],
|
|
45
|
+
},
|
|
46
|
+
tags: {
|
|
47
|
+
tags: ['Sigurd', 'Trageton', 'Portrett'],
|
|
48
|
+
language: 'nb',
|
|
49
|
+
},
|
|
50
|
+
caption: {
|
|
51
|
+
caption: 'Sigurd Trageton',
|
|
52
|
+
language: 'nb',
|
|
53
|
+
},
|
|
54
|
+
supportedLanguages: ['nb', 'nn'],
|
|
55
|
+
created: '2023-03-29T07:15:50Z',
|
|
56
|
+
createdBy: 'f-jBTU8O8kYbUW20lMeIuTSv',
|
|
57
|
+
modelRelease: 'not-set',
|
|
58
|
+
image: {
|
|
59
|
+
fileName: 'RVrVQIKh.jpg',
|
|
60
|
+
size: 404340,
|
|
61
|
+
contentType: 'image/jpeg',
|
|
62
|
+
imageUrl: 'https://api.test.ndla.no/image-api/raw/RVrVQIKh.jpg',
|
|
63
|
+
dimensions: {
|
|
64
|
+
width: 1600,
|
|
65
|
+
height: 2000,
|
|
66
|
+
},
|
|
67
|
+
language: 'nb',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
jobTitle: 'Daglig leder og ansvarlig redaktør, Vestland fylkeskommune',
|
|
71
|
+
description:
|
|
72
|
+
'Sigurd har variert ledererfaring fra utdanningssektoren, både fra videregående skole, nasjonalt senter og fra universitets/høgskolesektoren. Ansvarsområdene dekker bl.a. utdanning/opplæring/studiekvalitet, økonomi, HR, stratgi og IT-utvikling/-drift.',
|
|
73
|
+
name: 'Sigurd Trageton',
|
|
74
|
+
email: 'sigurd@ndla.no',
|
|
75
|
+
blobColor: 'green',
|
|
76
|
+
blob: 'pointy',
|
|
77
|
+
},
|
|
78
|
+
parameters: {
|
|
79
|
+
...defaultParameters,
|
|
80
|
+
layout: 'centered',
|
|
81
|
+
},
|
|
82
|
+
} as Meta<typeof ContactBlock>;
|
|
83
|
+
|
|
84
|
+
export const ContactBlockStory: StoryFn<typeof ContactBlock> = ({ ...args }) => {
|
|
85
|
+
return <ContactBlock {...args} />;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
ContactBlockStory.storyName = 'Kontaktblokk';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-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
|
+
import ContactBlock from './ContactBlock';
|
|
9
|
+
|
|
10
|
+
export default ContactBlock;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-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 KeyPerformanceIndicator from './KeyPerformanceIndicator';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Enkle komponenter/Nøkkeltall',
|
|
16
|
+
component: KeyPerformanceIndicator,
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
parameters: {
|
|
19
|
+
...defaultParameters,
|
|
20
|
+
layout: 'centered',
|
|
21
|
+
},
|
|
22
|
+
args: {
|
|
23
|
+
title: '500',
|
|
24
|
+
subTitle: 'TVERRFAGLIGE RESSURSER',
|
|
25
|
+
image: {
|
|
26
|
+
id: '65797',
|
|
27
|
+
metaUrl: 'https://api.test.ndla.no/image-api/v3/images/65797',
|
|
28
|
+
title: {
|
|
29
|
+
title: 'Nøkkeltall tverrfaglig',
|
|
30
|
+
language: 'nb',
|
|
31
|
+
},
|
|
32
|
+
alttext: {
|
|
33
|
+
alttext: 'Nøkkeltall tverrfaglig',
|
|
34
|
+
language: 'nb',
|
|
35
|
+
},
|
|
36
|
+
copyright: {
|
|
37
|
+
license: {
|
|
38
|
+
license: 'PD',
|
|
39
|
+
description: 'Public Domain Mark',
|
|
40
|
+
url: 'https://creativecommons.org/about/pdm',
|
|
41
|
+
},
|
|
42
|
+
origin: 'NDLA',
|
|
43
|
+
creators: [
|
|
44
|
+
{
|
|
45
|
+
type: 'artist',
|
|
46
|
+
name: 'Hedvig',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
processors: [],
|
|
50
|
+
rightsholders: [],
|
|
51
|
+
},
|
|
52
|
+
tags: {
|
|
53
|
+
tags: ['Nøkkeltall', 'Tverrfaglig', 'svg'],
|
|
54
|
+
language: 'nb',
|
|
55
|
+
},
|
|
56
|
+
caption: {
|
|
57
|
+
caption: '',
|
|
58
|
+
language: 'nb',
|
|
59
|
+
},
|
|
60
|
+
supportedLanguages: ['nb'],
|
|
61
|
+
created: '2023-04-18T11:20:34Z',
|
|
62
|
+
createdBy: 'f-jBTU8O8kYbUW20lMeIuTSv',
|
|
63
|
+
modelRelease: 'not-set',
|
|
64
|
+
image: {
|
|
65
|
+
fileName: 'wMowCjRg.svg',
|
|
66
|
+
size: 43278,
|
|
67
|
+
contentType: 'image/svg+xml',
|
|
68
|
+
imageUrl: 'https://api.test.ndla.no/image-api/raw/wMowCjRg.svg',
|
|
69
|
+
language: 'nb',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
} as Meta<typeof KeyPerformanceIndicator>;
|
|
74
|
+
|
|
75
|
+
export const KeyPerformanceIndicatorStory: StoryFn<typeof KeyPerformanceIndicator> = ({ ...args }) => {
|
|
76
|
+
return <KeyPerformanceIndicator {...args} />;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
KeyPerformanceIndicatorStory.storyName = 'Nøkkeltall';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-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 { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
11
|
+
import { IImageMetaInformationV3 } from '@ndla/types-backend/build/image-api';
|
|
12
|
+
|
|
13
|
+
const ContentWrapper = styled.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
padding: ${spacing.small};
|
|
19
|
+
align-items: center;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const StyledImage = styled.img`
|
|
23
|
+
max-width: 150px;
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
const TitleWrapper = styled.div`
|
|
27
|
+
color: ${colors.text.primary};
|
|
28
|
+
font-family: ${fonts.sans};
|
|
29
|
+
font-weight: ${fonts.weight.bold};
|
|
30
|
+
overflow-wrap: break-word;
|
|
31
|
+
${fonts.sizes('38px', '48px')};
|
|
32
|
+
${mq.range({ until: breakpoints.tabletWide })} {
|
|
33
|
+
${fonts.sizes('30px', '36px')};
|
|
34
|
+
}
|
|
35
|
+
max-width: 240px;
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const SubTitleWrapper = styled.div`
|
|
39
|
+
overflow-wrap: 'break-word';
|
|
40
|
+
${mq.range({ until: breakpoints.tabletWide })} {
|
|
41
|
+
padding-top: ${spacing.xxsmall};
|
|
42
|
+
${fonts.sizes('18px', '29px')};
|
|
43
|
+
color: ${colors.text.primary};
|
|
44
|
+
font-weight: ${fonts.weight.normal};
|
|
45
|
+
font-family: ${fonts.sans};
|
|
46
|
+
}
|
|
47
|
+
max-width: 240px;
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
interface Props {
|
|
51
|
+
image?: IImageMetaInformationV3;
|
|
52
|
+
title: string;
|
|
53
|
+
subTitle: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const KeyPerformanceIndicator = ({ image, title, subTitle }: Props) => {
|
|
57
|
+
return (
|
|
58
|
+
<ContentWrapper>
|
|
59
|
+
<StyledImage src={image?.image.imageUrl} alt={image?.alttext.alttext} />
|
|
60
|
+
<TitleWrapper>{title}</TitleWrapper>
|
|
61
|
+
<SubTitleWrapper>{subTitle}</SubTitleWrapper>
|
|
62
|
+
</ContentWrapper>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default KeyPerformanceIndicator;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-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
|
+
export { default as KeyPerformanceIndicator } from './KeyPerformanceIndicator';
|
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
11
11
|
import { LanguageSelector } from '@ndla/ui';
|
|
12
12
|
import styled from '@emotion/styled';
|
|
13
13
|
import { colors, spacing } from '@ndla/core';
|
|
14
14
|
import { defaultParameters } from '../../../../stories/defaults';
|
|
15
15
|
export default {
|
|
16
16
|
title: 'Enkle komponenter/LanguageSelector',
|
|
17
|
+
tags: ['autodocs'],
|
|
17
18
|
component: LanguageSelector,
|
|
18
19
|
parameters: {
|
|
19
20
|
...defaultParameters,
|
|
@@ -24,7 +25,7 @@ export default {
|
|
|
24
25
|
// eslint-disable-next-line no-console
|
|
25
26
|
onSelect: (locale) => console.log(`selected ${locale}`),
|
|
26
27
|
},
|
|
27
|
-
} as
|
|
28
|
+
} as Meta<typeof LanguageSelector>;
|
|
28
29
|
|
|
29
30
|
interface ButtonWrapperProps {
|
|
30
31
|
inverted?: boolean;
|
|
@@ -37,7 +38,7 @@ const ButtonWrapper = styled('div', { shouldForwardProp })<ButtonWrapperProps>`
|
|
|
37
38
|
padding: ${spacing.normal};
|
|
38
39
|
`;
|
|
39
40
|
|
|
40
|
-
export const LanguageSelectorStory:
|
|
41
|
+
export const LanguageSelectorStory: StoryFn<typeof LanguageSelector> = (args) => {
|
|
41
42
|
return (
|
|
42
43
|
<ButtonWrapper inverted={args.inverted}>
|
|
43
44
|
<LanguageSelector {...args} />
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
10
10
|
import { useArgs } from '@storybook/client-api';
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { defaultParameters } from '../../../../stories/defaults';
|
|
@@ -15,6 +15,7 @@ import LetterFilter from './LetterFilter';
|
|
|
15
15
|
export default {
|
|
16
16
|
title: 'Enkle komponenter/LetterFilter',
|
|
17
17
|
component: LetterFilter,
|
|
18
|
+
tags: ['autodocs'],
|
|
18
19
|
parameters: {
|
|
19
20
|
...defaultParameters,
|
|
20
21
|
},
|
|
@@ -22,9 +23,9 @@ export default {
|
|
|
22
23
|
enabledLetters: ['a', 'c'],
|
|
23
24
|
onChange: (value?: string) => {},
|
|
24
25
|
},
|
|
25
|
-
} as
|
|
26
|
+
} as Meta<typeof LetterFilter>;
|
|
26
27
|
|
|
27
|
-
export const LetterFilterStory:
|
|
28
|
+
export const LetterFilterStory: StoryFn<typeof LetterFilter> = (args) => {
|
|
28
29
|
const [, updateArgs] = useArgs();
|
|
29
30
|
|
|
30
31
|
return <LetterFilter {...args} onChange={(val) => updateArgs({ value: val })} />;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
import { Pencil } from '@ndla/icons/action';
|
|
4
|
+
import { DeleteForever } from '@ndla/icons/editor';
|
|
5
|
+
import { defaultParameters } from '../../../../../stories/defaults';
|
|
6
|
+
|
|
7
|
+
import Folder from './Folder';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Enkle komponenter/Mappe',
|
|
11
|
+
component: Folder,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
parameters: {
|
|
14
|
+
...defaultParameters,
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
menuItems: {
|
|
18
|
+
control: false,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
id: '3d88300c-1186-47f5-a99a-8ea93fa20981',
|
|
23
|
+
title: 'Dette er min tittel',
|
|
24
|
+
subFolders: 3,
|
|
25
|
+
subResources: 3,
|
|
26
|
+
description: '',
|
|
27
|
+
link: '',
|
|
28
|
+
type: 'list',
|
|
29
|
+
menuItems: [
|
|
30
|
+
{ icon: <Pencil />, text: 'Rediger', onClick: () => {} },
|
|
31
|
+
{ icon: <DeleteForever />, text: 'Slett', onClick: () => {}, type: 'danger' },
|
|
32
|
+
],
|
|
33
|
+
isShared: true,
|
|
34
|
+
},
|
|
35
|
+
} as Meta<typeof Folder>;
|
|
36
|
+
|
|
37
|
+
export const FolderStory: StoryFn<typeof Folder> = (args) => {
|
|
38
|
+
return <Folder {...args} />;
|
|
39
|
+
};
|
|
@@ -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 BlockResource from './BlockResource';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Enkle komponenter/Ressurser/BlockResource',
|
|
16
|
+
component: BlockResource,
|
|
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 BlockResource>;
|
|
47
|
+
|
|
48
|
+
export const BlockResourceStory: StoryFn<typeof BlockResource> = (args) => {
|
|
49
|
+
return <BlockResource {...args} />;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
BlockResourceStory.storyName = 'BlockResource';
|