diff --git a/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx b/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx index 568b6ba26..a8a4527c7 100644 --- a/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx +++ b/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx @@ -38,6 +38,7 @@ export const ExtendedFeaturesBlock = ({ ({ title: itemTitle, text, + list, link, links, label, @@ -77,6 +78,7 @@ export const ExtendedFeaturesBlock = ({ text={text} links={itemLinks} size="s" + list={list} colSizes={{all: 12, md: 12}} buttons={buttons} additionalInfo={additionalInfo} diff --git a/src/blocks/ExtendedFeatures/__stories__/data.json b/src/blocks/ExtendedFeatures/__stories__/data.json index d2f22861d..7a3968855 100644 --- a/src/blocks/ExtendedFeatures/__stories__/data.json +++ b/src/blocks/ExtendedFeatures/__stories__/data.json @@ -52,6 +52,36 @@ "theme": "normal" } ] + }, + { + "title": "Sed do eiusmod tempor incididunt", + "text": "Ut enim ad minim veniam [quis nostrud](https://example.com) ullamco laboris nisi ut aliquip ex ea commodo consequat.", + "list": [ + { + "icon": { + "light": "/story-assets/icon_1_light.svg", + "dark": "/story-assets/icon_1_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_3_light.svg", + "dark": "/story-assets/icon_3_dark.svg" + }, + "title": "Lorem ipsum ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_2_light.svg", + "dark": "/story-assets/icon_2_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + } + ] } ] } diff --git a/src/sub-blocks/BasicCard/BasicCard.tsx b/src/sub-blocks/BasicCard/BasicCard.tsx index 15dedb3e7..4969c6f82 100644 --- a/src/sub-blocks/BasicCard/BasicCard.tsx +++ b/src/sub-blocks/BasicCard/BasicCard.tsx @@ -20,6 +20,7 @@ const BasicCard = (props: BasicCardProps) => { icon, additionalInfo, links, + list, buttons, iconPosition = IconPosition.Top, ...cardParams @@ -42,6 +43,7 @@ const BasicCard = (props: BasicCardProps) => { textId={descriptionId} additionalInfo={additionalInfo} links={links} + list={list} buttons={buttons} size="s" colSizes={{all: 12, md: 12}} diff --git a/src/sub-blocks/BasicCard/__stories__/BasicCard.stories.tsx b/src/sub-blocks/BasicCard/__stories__/BasicCard.stories.tsx index 6d2984c67..4fed42732 100644 --- a/src/sub-blocks/BasicCard/__stories__/BasicCard.stories.tsx +++ b/src/sub-blocks/BasicCard/__stories__/BasicCard.stories.tsx @@ -3,12 +3,27 @@ import React from 'react'; import yfm from '@doc-tools/transform'; import {Meta, StoryFn} from '@storybook/react'; -import {BasicCardProps} from '../../../models'; +import {yfmTransform} from '../../../../.storybook/utils'; +import {BasicCardProps, ContentItemProps} from '../../../models'; import {IconPosition} from '../../../models/constructor-items/sub-blocks'; import BasicCard from '../BasicCard'; import data from './data.json'; +const transformedContentList = data.list.map((item) => { + return { + ...item, + text: item?.text && yfmTransform(item.text), + }; +}) as ContentItemProps[]; + +const transformedShortContentList = data.shortList.map((item) => { + return { + ...item, + text: item?.text && yfmTransform(item.text), + }; +}) as ContentItemProps[]; + const getCardWithBorderTitle = (border: string) => data.withBorder.title.replace('{{border}}', border); @@ -60,6 +75,27 @@ const WithBorderTemplate: StoryFn = (args) => ( ); +const WithContentListTemplate: StoryFn = (args) => ( +
+
+ +
+
+ +
+
+); + const WithUrlTemplate: StoryFn = (args) => (
@@ -78,6 +114,7 @@ export const Default = DefaultTemplate.bind({}); export const WithIcon = WithIconTemplate.bind({}); export const WithBorder = WithBorderTemplate.bind({}); export const WithUrl = WithUrlTemplate.bind({}); +export const WithContentList = WithContentListTemplate.bind({}); const DefaultArgs = { ...data.default.content, @@ -94,3 +131,7 @@ WithUrl.args = { url: data.url, ...DefaultArgs, } as BasicCardProps; + +WithContentList.args = { + ...DefaultArgs, +} as BasicCardProps; diff --git a/src/sub-blocks/BasicCard/__stories__/data.json b/src/sub-blocks/BasicCard/__stories__/data.json index 548a34d2f..18bd3f5e8 100644 --- a/src/sub-blocks/BasicCard/__stories__/data.json +++ b/src/sub-blocks/BasicCard/__stories__/data.json @@ -10,6 +10,59 @@ "withBorder": { "title": "Card with border {{border}}" }, + "withContentList": { + "titleForLongList": "With content list", + "titleForShortList": "With content list without titles" + }, + "shortList": [ + { + "icon": { + "light": "/story-assets/icon_1_light.svg", + "dark": "/story-assets/icon_1_dark.svg" + }, + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + }, + { + "icon": { + "light": "/story-assets/icon_3_light.svg", + "dark": "/story-assets/icon_3_dark.svg" + }, + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + }, + { + "icon": { + "light": "/story-assets/icon_2_light.svg", + "dark": "/story-assets/icon_2_dark.svg" + }, + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + } + ], + "list": [ + { + "icon": { + "light": "/story-assets/icon_1_light.svg", + "dark": "/story-assets/icon_1_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_3_light.svg", + "dark": "/story-assets/icon_3_dark.svg" + }, + "title": "Lorem ipsum ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + { + "icon": { + "light": "/story-assets/icon_2_light.svg", + "dark": "/story-assets/icon_2_dark.svg" + }, + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + } + ], "url": "https://example.com", "default": { "content": {