diff --git a/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-chromium-linux.png b/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-chromium-linux.png index d669a910c..29ce69fe5 100644 Binary files a/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-chromium-linux.png and b/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-chromium-linux.png differ diff --git a/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-webkit-linux.png b/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-webkit-linux.png index f118521fe..f27ffbd6f 100644 Binary files a/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-webkit-linux.png and b/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-webkit-linux.png differ diff --git a/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx b/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx index 8a629309a..1591fcff3 100644 --- a/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx +++ b/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx @@ -12,19 +12,13 @@ import BackgroundCard from '../BackgroundCard'; import data from './data.json'; -const transformedContentList = data.common.list.map((item) => { - return { - ...item, - text: item?.text && yfmTransform(item.text), - }; -}) as ContentItemProps[]; - -const transformedContentDarkList = data.common.darkList.map((item) => { - return { - ...item, - text: item?.text && yfmTransform(item.text), - }; -}) as ContentItemProps[]; +const transformContentList = (list: ContentItemProps[]) => + list.map((item) => { + return { + ...item, + text: item?.text && yfmTransform(item.text), + }; + }) as ContentItemProps[]; const getPaddingBottomTitle = (padding: string) => data.paddings.title.replace('{{padding}}', padding); @@ -59,7 +53,7 @@ const DefaultTemplate: StoryFn = (args) => (
- +
); @@ -87,9 +81,11 @@ const CardThemesTemplate: StoryFn<{items: BackgroundCardProps[]}> = (args) => (
))} diff --git a/src/sub-blocks/BackgroundCard/__stories__/data.json b/src/sub-blocks/BackgroundCard/__stories__/data.json index 4a84d5f45..145a43593 100644 --- a/src/sub-blocks/BackgroundCard/__stories__/data.json +++ b/src/sub-blocks/BackgroundCard/__stories__/data.json @@ -35,21 +35,36 @@ "title": "Lorem ipsum ipsum" } ], - "darkList": [ - { - "icon": "/story-assets/icon_1_dark.svg", - "title": "Lorem ipsum", - "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation." - }, - { - "icon": "/story-assets/icon_2_dark.svg", - "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation." - }, - { - "icon": "/story-assets/icon_3_dark.svg", - "title": "Lorem ipsum ipsum" - } - ], + "themed": { + "lightList": [ + { + "icon": "/story-assets/icon_1_light.svg", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + }, + { + "icon": "/story-assets/icon_2_light.svg", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + }, + { + "icon": "/story-assets/icon_3_light.svg", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + } + ], + "darkList": [ + { + "icon": "/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": "/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." + }, + { + "icon": "/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." + } + ] + }, "buttons": [ { "text": "Button\r",