Skip to content

Commit 07e2a96

Browse files
author
Juli Ovechkina
authored
feat: add content-list (#468)
1 parent 8ec58bc commit 07e2a96

File tree

19 files changed

+350
-24
lines changed

19 files changed

+350
-24
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"test:watch": "jest --watchAll"
8181
},
8282
"dependencies": {
83-
"@gravity-ui/dynamic-forms": "^1.9.2",
83+
"@gravity-ui/dynamic-forms": "^1.11.0",
8484
"@gravity-ui/i18n": "^1.0.0",
8585
"ajv": "^8.12.0",
8686
"bem-cn-lite": "^4.0.0",

src/blocks/ContentLayout/ContentLayout.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ $block: '.#{$ns}content-layout-block';
6363
@media (max-width: map-get($gridBreakpoints, 'sm')) {
6464
&_background {
6565
padding: $indentM;
66-
67-
picture {
68-
display: none;
69-
}
7066
}
7167
}
7268
}

src/blocks/ContentLayout/__stories__/ContentLayout.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import * as ContentLayoutStories from './ContentLayout.stories.tsx';
1515
- `theme?: 'default' | 'dark' | 'light'` — Cube theme: default, dark, or monochrome light ('default' by default).
1616
- `textWidth?: 's' | 'm' | 'l'` — Number of columns occupied by content within a cube: 6, 8, and 10 out of 12 columns, respectively.
1717

18-
`textContent:` — See the [Content](?path=/story/components-content--default&viewMode=docs) component.
18+
`textContent:` — See the [Content](?path=/docs/components-content--docs) component.
1919

2020
`fileContent?: FileLink[]` — Array of objects that describe file links
2121

src/blocks/ContentLayout/__stories__/ContentLayout.stories.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ const DefaultTemplate: StoryFn<ContentLayoutBlockModel> = (args) => (
4747
buttons: data.common.buttons as ButtonProps[],
4848
},
4949
},
50+
{
51+
...args,
52+
textContent: {
53+
...args.textContent,
54+
list: data.common.list.map((item) => {
55+
return {
56+
...item,
57+
text: item?.text && yfmTransform(item.text),
58+
};
59+
}),
60+
links: data.common.links as LinkProps[],
61+
},
62+
},
5063
],
5164
}}
5265
/>

src/blocks/ContentLayout/__stories__/data.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,30 @@
4848
"href": "https://example.ppt",
4949
"text": "PPT file"
5050
}
51+
],
52+
"list": [
53+
{
54+
"icon": {
55+
"light": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_1_light.svg",
56+
"dark": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_1_dark.svg"
57+
},
58+
"title": "Lorem ipsum",
59+
"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."
60+
},
61+
{
62+
"icon": {
63+
"light": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_2_light.svg",
64+
"dark": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_2_dark.svg"
65+
},
66+
"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."
67+
},
68+
{
69+
"icon": {
70+
"light": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_3_light.svg",
71+
"dark": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_3_dark.svg"
72+
},
73+
"title": "Lorem ipsum ipsum"
74+
}
5175
]
5276
},
5377
"withImageAndBackgroundColor": {

src/blocks/Media/__stories__/Media.stories.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ const DefaultTemplate: StoryFn<MediaBlockModel> = (args) => (
4141
...args,
4242
buttons: data.common.buttons as ButtonProps[],
4343
},
44+
{
45+
...args,
46+
list: data.common.list.map((item) => {
47+
return {
48+
...item,
49+
text: item?.text && yfmTransform(item.text),
50+
};
51+
}),
52+
links: data.common.links as LinkProps[],
53+
},
4454
],
4555
}}
4656
/>

src/blocks/Media/__stories__/data.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,30 @@
2222
"theme": "outlined",
2323
"url": "#"
2424
}
25+
],
26+
"list": [
27+
{
28+
"icon": {
29+
"light": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_1_light.svg",
30+
"dark": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_1_dark.svg"
31+
},
32+
"title": "Lorem ipsum",
33+
"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."
34+
},
35+
{
36+
"icon": {
37+
"light": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_2_light.svg",
38+
"dark": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_2_dark.svg"
39+
},
40+
"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."
41+
},
42+
{
43+
"icon": {
44+
"light": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_3_light.svg",
45+
"dark": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/icon_3_dark.svg"
46+
},
47+
"title": "Lorem ipsum ipsum"
48+
}
2549
]
2650
},
2751
"imageSlider": {

src/components/ImageBase/ImageBase.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface ImageBaseProps extends Partial<ImageObjectProps> {
1212

1313
export const ImageBase = (props: ImageBaseProps) => {
1414
const {Image} = React.useContext(ImageContext);
15+
1516
return Image ? <Image {...props} /> : <img {...props} />;
1617
};
1718

src/components/MediaBase/MediaBaseContent.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@ import './MediaBaseContent.scss';
1111
const b = block('media-base-content');
1212

1313
const MediaContent = (props: MediaContentProps) => {
14-
const {title, description, button, links, buttons = [], additionalInfo, size = 'l'} = props;
14+
const {
15+
title,
16+
description,
17+
button,
18+
links,
19+
buttons = [],
20+
additionalInfo,
21+
size = 'l',
22+
list,
23+
} = props;
1524
const allButtons = button ? [{...button, size: 'xl' as ButtonSize}, ...buttons] : buttons;
1625
return (
1726
<div className={b()}>
@@ -21,6 +30,7 @@ const MediaContent = (props: MediaContentProps) => {
2130
links={links}
2231
theme="default"
2332
buttons={allButtons}
33+
list={list}
2434
additionalInfo={additionalInfo}
2535
size={size}
2636
colSizes={{all: 12, md: 12}}

0 commit comments

Comments
 (0)