@redneckz/wildless-cms-uni-blocks 0.3.76 → 0.3.77
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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +6 -8
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Accordion/AccordionContent.d.ts +4 -1
- package/dist/components/GroupBlock/GroupBlockContent.d.ts +2 -2
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +10 -1
- package/dist/components/PictureText/PictureTextContent.d.ts +1 -0
- package/dist/components/StepsBlock/StepsBlock.js +3 -2
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +2 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -0
- package/dist/model/Picture.d.ts +6 -0
- package/dist/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
- package/dist/ui-kit/Img/Img.js +2 -6
- package/dist/ui-kit/Img/Img.js.map +1 -1
- package/dist/utils/checkIsIconRenderable.d.ts +2 -0
- package/dist/utils/checkIsIconRenderable.js +5 -0
- package/dist/utils/checkIsIconRenderable.js.map +1 -0
- package/lib/components/Accordion/AccordionContent.d.ts +4 -1
- package/lib/components/GroupBlock/GroupBlockContent.d.ts +2 -2
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +10 -1
- package/lib/components/PictureText/PictureTextContent.d.ts +1 -0
- package/lib/components/StepsBlock/StepsBlock.js +3 -2
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +2 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -0
- package/lib/model/Picture.d.ts +6 -0
- package/lib/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
- package/lib/ui-kit/Img/Img.js +2 -6
- package/lib/ui-kit/Img/Img.js.map +1 -1
- package/lib/utils/checkIsIconRenderable.d.ts +2 -0
- package/lib/utils/checkIsIconRenderable.js +2 -0
- package/lib/utils/checkIsIconRenderable.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +3 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/Accordion/AccordionContent.d.ts +4 -1
- package/mobile/dist/components/GroupBlock/GroupBlockContent.d.ts +2 -2
- package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +10 -1
- package/mobile/dist/components/PictureText/PictureTextContent.d.ts +1 -0
- package/mobile/dist/components/StepsBlock/StepsBlock.js +2 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -0
- package/mobile/dist/model/Picture.d.ts +6 -0
- package/mobile/dist/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
- package/mobile/dist/utils/checkIsIconRenderable.d.ts +2 -0
- package/mobile/dist/utils/checkIsIconRenderable.js +5 -0
- package/mobile/dist/utils/checkIsIconRenderable.js.map +1 -0
- package/mobile/lib/components/Accordion/AccordionContent.d.ts +4 -1
- package/mobile/lib/components/GroupBlock/GroupBlockContent.d.ts +2 -2
- package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +10 -1
- package/mobile/lib/components/PictureText/PictureTextContent.d.ts +1 -0
- package/mobile/lib/components/StepsBlock/StepsBlock.js +2 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -0
- package/mobile/lib/model/Picture.d.ts +6 -0
- package/mobile/lib/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
- package/mobile/lib/utils/checkIsIconRenderable.d.ts +2 -0
- package/mobile/lib/utils/checkIsIconRenderable.js +2 -0
- package/mobile/lib/utils/checkIsIconRenderable.js.map +1 -0
- package/mobile/src/components/Accordion/Accordion.example.json +13 -6
- package/mobile/src/components/Accordion/AccordionContent.ts +4 -1
- package/mobile/src/components/ContentPage/ContentPage.page.json +1 -1
- package/mobile/src/components/GroupBlock/GroupBlock.example.json +72 -3
- package/mobile/src/components/GroupBlock/GroupBlockContent.ts +2 -2
- package/mobile/src/components/LinkDocs/LinkDocsContent.ts +10 -1
- package/mobile/src/components/OtherProducts/OtherProducts.example.json +12 -6
- package/mobile/src/components/PictureText/PictureTextContent.ts +1 -0
- package/mobile/src/components/ProductBlock/ProductBlock.example.json +3 -10
- package/mobile/src/components/ProductTile/ProductTile.example.json +1 -2
- package/mobile/src/components/PromoTile/PromoTile.example.json +1 -2
- package/mobile/src/components/StepsBlock/StepsBlock.example.json +18 -3
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +6 -1
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +11 -0
- package/mobile/src/components/Tile/Tile.example.json +2 -9
- package/mobile/src/model/Picture.ts +7 -0
- package/mobile/src/ui-kit/BlocksList/BlocksListProps.ts +42 -20
- package/mobile/src/utils/checkIsIconRenderable.tsx +3 -0
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.example.json +13 -6
- package/src/components/Accordion/AccordionContent.ts +4 -1
- package/src/components/ContentPage/ContentPage.page.json +1 -1
- package/src/components/GroupBlock/GroupBlock.example.json +72 -3
- package/src/components/GroupBlock/GroupBlockContent.ts +2 -2
- package/src/components/LinkDocs/LinkDocsContent.ts +10 -1
- package/src/components/OtherProducts/OtherProducts.example.json +12 -6
- package/src/components/PictureText/PictureTextContent.ts +1 -0
- package/src/components/ProductBlock/ProductBlock.example.json +3 -10
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +2 -2
- package/src/components/ProductTile/ProductTile.example.json +1 -2
- package/src/components/PromoTile/PromoTile.example.json +1 -2
- package/src/components/StepsBlock/StepsBlock.example.json +18 -3
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +6 -1
- package/src/components/StepsBlock/StepsBlock.tsx +19 -13
- package/src/components/StepsBlock/StepsBlockContent.ts +11 -0
- package/src/components/Tile/Tile.example.json +2 -9
- package/src/model/Picture.ts +7 -0
- package/src/ui-kit/BlocksList/BlocksListProps.ts +42 -20
- package/src/ui-kit/Img/Img.tsx +9 -16
- package/src/utils/checkIsIconRenderable.tsx +3 -0
|
@@ -27,71 +27,93 @@ export interface BlocksCommonProps {
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* @title Заголовок
|
|
30
|
-
* @default {"blockListType": "Headline"}
|
|
31
30
|
*/
|
|
32
31
|
export type HeadlineBlockListDef = HeadlineContent &
|
|
33
|
-
BlocksCommonProps & {
|
|
32
|
+
BlocksCommonProps & {
|
|
33
|
+
/** @default Headline */
|
|
34
|
+
blockListType: 'Headline';
|
|
35
|
+
};
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
38
|
* @title Список документов
|
|
37
|
-
* @default {"blockListType": "LinkDocs"}
|
|
38
39
|
*/
|
|
39
40
|
export type LinkDocsBlockListDef = LinkDocsContent &
|
|
40
|
-
BlocksCommonProps & {
|
|
41
|
+
BlocksCommonProps & {
|
|
42
|
+
/** @default LinkDocs */
|
|
43
|
+
blockListType: 'LinkDocs';
|
|
44
|
+
};
|
|
41
45
|
|
|
42
46
|
/**
|
|
43
47
|
* @title Текстовый блок
|
|
44
|
-
* @default {"blockListType": "TextBlock"}
|
|
45
48
|
*/
|
|
46
49
|
export type TextBlockBlockListDef = TextBlockContent &
|
|
47
|
-
BlocksCommonProps & {
|
|
50
|
+
BlocksCommonProps & {
|
|
51
|
+
/** @default TextBlock */
|
|
52
|
+
blockListType: 'TextBlock';
|
|
53
|
+
};
|
|
48
54
|
|
|
49
55
|
/**
|
|
50
56
|
* @title Картинка с текстом
|
|
51
|
-
* @default {"blockListType": "PictureText"}
|
|
52
57
|
*/
|
|
53
58
|
export type PictureTextBlockListDef = PictureTextContent &
|
|
54
|
-
BlocksCommonProps & {
|
|
59
|
+
BlocksCommonProps & {
|
|
60
|
+
/** @default PictureText */
|
|
61
|
+
blockListType: 'PictureText';
|
|
62
|
+
};
|
|
55
63
|
|
|
56
64
|
/**
|
|
57
65
|
* @title Продуктовый блок
|
|
58
|
-
* @default {"blockListType": "ProductBlock"}
|
|
59
66
|
*/
|
|
60
67
|
export type ProductBlockBlockListDef = ProductBlockContent &
|
|
61
|
-
BlocksCommonProps & {
|
|
68
|
+
BlocksCommonProps & {
|
|
69
|
+
/** @default ProductBlock */
|
|
70
|
+
blockListType: 'ProductBlock';
|
|
71
|
+
};
|
|
62
72
|
|
|
63
73
|
/**
|
|
64
74
|
* @title Плитка
|
|
65
|
-
* @default {"blockListType": "Tile"}
|
|
66
75
|
*/
|
|
67
|
-
export type TileBlockListDef = TileContent &
|
|
76
|
+
export type TileBlockListDef = TileContent &
|
|
77
|
+
BlocksCommonProps & {
|
|
78
|
+
/** @default Tile */
|
|
79
|
+
blockListType: 'Tile';
|
|
80
|
+
};
|
|
68
81
|
|
|
69
82
|
/**
|
|
70
83
|
* @title Продуктовая плитка
|
|
71
|
-
* @default {"blockListType": "ProductTile"}
|
|
72
84
|
*/
|
|
73
85
|
export type ProductTileBlockListDef = ProductTileContent &
|
|
74
|
-
BlocksCommonProps & {
|
|
86
|
+
BlocksCommonProps & {
|
|
87
|
+
/** @default ProductTile */
|
|
88
|
+
blockListType: 'ProductTile';
|
|
89
|
+
};
|
|
75
90
|
|
|
76
91
|
/**
|
|
77
92
|
* @title Галерея
|
|
78
|
-
* @default {"blockListType": "Gallery"}
|
|
79
93
|
*/
|
|
80
|
-
export type GalleryBlockListDef = GalleryContent &
|
|
94
|
+
export type GalleryBlockListDef = GalleryContent &
|
|
95
|
+
BlocksCommonProps & {
|
|
96
|
+
/** @default Gallery */
|
|
97
|
+
blockListType: 'Gallery';
|
|
98
|
+
};
|
|
81
99
|
|
|
82
100
|
/**
|
|
83
101
|
* @title Мини-галлерея
|
|
84
|
-
* @default {"blockListType": "MiniGallery"}
|
|
85
102
|
*/
|
|
86
103
|
export type MiniGalleryBlockListDef = MiniGalleryContent &
|
|
87
|
-
BlocksCommonProps & {
|
|
104
|
+
BlocksCommonProps & {
|
|
105
|
+
/** @default MiniGallery */
|
|
106
|
+
blockListType: 'MiniGallery';
|
|
107
|
+
};
|
|
88
108
|
|
|
89
109
|
/**
|
|
90
110
|
* @title Список ссылок
|
|
91
|
-
* @default {"blockListType": "LinkList"}
|
|
92
111
|
*/
|
|
93
112
|
export type LinkListBlockListDef = LinkListContent &
|
|
94
|
-
BlocksCommonProps & {
|
|
113
|
+
BlocksCommonProps & {
|
|
114
|
+
/** @default LinkList */
|
|
115
|
+
blockListType: 'LinkList';
|
|
116
|
+
};
|
|
95
117
|
|
|
96
118
|
/**
|
|
97
119
|
* @title Содержимое блока
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "Аккордеон",
|
|
3
|
+
"accordionAlignTitle": "center",
|
|
3
4
|
"accordionItems": [
|
|
4
5
|
{
|
|
5
6
|
"label": "Аккордеон 1",
|
|
@@ -10,12 +11,14 @@
|
|
|
10
11
|
{
|
|
11
12
|
"blockListType": "TextBlock",
|
|
12
13
|
"title": "Текстовый блок",
|
|
13
|
-
"description": "Описание текстового блока"
|
|
14
|
+
"description": "Описание текстового блока",
|
|
15
|
+
"style": ["col-span-12"]
|
|
14
16
|
},
|
|
15
17
|
{
|
|
16
18
|
"blockListType": "TextBlock",
|
|
17
19
|
"title": "Текстовый блок №2",
|
|
18
|
-
"description": "Описание текстового блока №2"
|
|
20
|
+
"description": "Описание текстового блока №2",
|
|
21
|
+
"style": ["col-span-12"]
|
|
19
22
|
}
|
|
20
23
|
]
|
|
21
24
|
},
|
|
@@ -28,12 +31,14 @@
|
|
|
28
31
|
{
|
|
29
32
|
"blockListType": "TextBlock",
|
|
30
33
|
"title": "Текстовый блок",
|
|
31
|
-
"description": "Описание текстового блока"
|
|
34
|
+
"description": "Описание текстового блока",
|
|
35
|
+
"style": ["col-span-6"]
|
|
32
36
|
},
|
|
33
37
|
{
|
|
34
38
|
"blockListType": "TextBlock",
|
|
35
39
|
"title": "Текстовый блок №2",
|
|
36
|
-
"description": "Описание текстового блока №2"
|
|
40
|
+
"description": "Описание текстового блока №2",
|
|
41
|
+
"style": ["col-span-6"]
|
|
37
42
|
}
|
|
38
43
|
]
|
|
39
44
|
},
|
|
@@ -46,12 +51,14 @@
|
|
|
46
51
|
{
|
|
47
52
|
"blockListType": "TextBlock",
|
|
48
53
|
"title": "Текстовый блок",
|
|
49
|
-
"description": "Описание текстового блока"
|
|
54
|
+
"description": "Описание текстового блока",
|
|
55
|
+
"style": ["col-span-12"]
|
|
50
56
|
},
|
|
51
57
|
{
|
|
52
58
|
"blockListType": "TextBlock",
|
|
53
59
|
"title": "Текстовый блок №2",
|
|
54
|
-
"description": "Описание текстового блока №2"
|
|
60
|
+
"description": "Описание текстового блока №2",
|
|
61
|
+
"style": ["col-span-12"]
|
|
55
62
|
}
|
|
56
63
|
]
|
|
57
64
|
}
|
|
@@ -31,7 +31,10 @@ export interface AccordionItemCommonProps {
|
|
|
31
31
|
export interface AccordionContent {
|
|
32
32
|
/** @title Заголовок */
|
|
33
33
|
title?: string;
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @title Выравнивание заголовка
|
|
36
|
+
* @default center
|
|
37
|
+
*/
|
|
35
38
|
accordionAlignTitle?: AlignType;
|
|
36
39
|
version?: BlockVersion;
|
|
37
40
|
/** @title Список */
|
|
@@ -10,19 +10,88 @@
|
|
|
10
10
|
"blockType": "ProductBlock",
|
|
11
11
|
"title": "Продуктовый блок",
|
|
12
12
|
"description": "Описание текстового блока",
|
|
13
|
-
"tags": ["tag2"]
|
|
13
|
+
"tags": ["tag2"],
|
|
14
|
+
"backwardButton": {
|
|
15
|
+
"text": "Кнопка возврата",
|
|
16
|
+
"icon": { "icon": "ArrowLeftIcon" }
|
|
17
|
+
},
|
|
18
|
+
"image": {
|
|
19
|
+
"format": "webp",
|
|
20
|
+
"size": {
|
|
21
|
+
"width": 234,
|
|
22
|
+
"height": 234
|
|
23
|
+
}
|
|
24
|
+
}
|
|
14
25
|
},
|
|
15
26
|
{
|
|
16
27
|
"blockType": "ProductTile",
|
|
17
28
|
"title": "Продуктовая плитка",
|
|
18
29
|
"description": "Описание текстового блока",
|
|
19
|
-
"tags": ["tag1"]
|
|
30
|
+
"tags": ["tag1"],
|
|
31
|
+
"image": {
|
|
32
|
+
"format": "webp",
|
|
33
|
+
"size": {
|
|
34
|
+
"width": 300
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"version": "primary",
|
|
38
|
+
"benefits": [
|
|
39
|
+
{
|
|
40
|
+
"label": "Преимущество 1",
|
|
41
|
+
"description": "Описание"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"label": "Преимущество 2",
|
|
45
|
+
"description": "Описание"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"label": "Преимущество 3",
|
|
49
|
+
"description": "Описание"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"buttons": [
|
|
53
|
+
{
|
|
54
|
+
"text": "Кнопка",
|
|
55
|
+
"version": "primary"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
20
58
|
},
|
|
21
59
|
{
|
|
22
60
|
"blockType": "ProductBlock",
|
|
23
61
|
"title": "Продуктовый блок",
|
|
24
62
|
"description": "Описание текстового блока",
|
|
25
|
-
"tags": ["tag2"]
|
|
63
|
+
"tags": ["tag2"],
|
|
64
|
+
"headingType": "h2",
|
|
65
|
+
"backwardButton": {
|
|
66
|
+
"text": "Кнопка возврата",
|
|
67
|
+
"icon": { "icon": "ArrowLeftIcon" }
|
|
68
|
+
},
|
|
69
|
+
"image": {
|
|
70
|
+
"format": "webp",
|
|
71
|
+
"size": {
|
|
72
|
+
"width": 234,
|
|
73
|
+
"height": 234
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"items": ["Элемент списка 1", "Элемент списка 2", "Элемент списка 3"],
|
|
77
|
+
"isDotted": true,
|
|
78
|
+
"buttons": [
|
|
79
|
+
{
|
|
80
|
+
"text": "Кнопка",
|
|
81
|
+
"version": "secondary"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"version": "primary",
|
|
85
|
+
"benefits": [
|
|
86
|
+
{
|
|
87
|
+
"label": "Преимущество №1",
|
|
88
|
+
"icon": {"icon": "ClockIcon"}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"label": "Преимущество №2",
|
|
92
|
+
"icon": {"icon": "SignDocsIcon"}
|
|
93
|
+
}
|
|
94
|
+
]
|
|
26
95
|
}
|
|
27
96
|
]
|
|
28
97
|
}
|
|
@@ -28,7 +28,16 @@ export interface LinkDocsContent {
|
|
|
28
28
|
title?: string;
|
|
29
29
|
/** @title Описание */
|
|
30
30
|
description?: string;
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @title Иконка
|
|
33
|
+
* @default {
|
|
34
|
+
* "size": {
|
|
35
|
+
* "width": 24,
|
|
36
|
+
* "height": 24
|
|
37
|
+
* },
|
|
38
|
+
* "format": "webp"
|
|
39
|
+
* }
|
|
40
|
+
*/
|
|
32
41
|
icon?: Picture;
|
|
33
42
|
/** @title Список */
|
|
34
43
|
documents?: LinkDocsItem[];
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
{
|
|
8
8
|
"blockListType": "TextBlock",
|
|
9
9
|
"title": "Текстовый блок",
|
|
10
|
-
"description": "Описание текстового блока"
|
|
10
|
+
"description": "Описание текстового блока",
|
|
11
|
+
"style": ["col-span-12"]
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
14
|
"blockListType": "TextBlock",
|
|
14
15
|
"title": "Текстовый блок №2",
|
|
15
|
-
"description": "Описание текстового блока №2"
|
|
16
|
+
"description": "Описание текстового блока №2",
|
|
17
|
+
"style": ["col-span-12"]
|
|
16
18
|
}
|
|
17
19
|
]
|
|
18
20
|
},
|
|
@@ -22,12 +24,14 @@
|
|
|
22
24
|
{
|
|
23
25
|
"blockListType": "TextBlock",
|
|
24
26
|
"title": "Текстовый блок",
|
|
25
|
-
"description": "Описание текстового блока"
|
|
27
|
+
"description": "Описание текстового блока",
|
|
28
|
+
"style": ["col-span-12"]
|
|
26
29
|
},
|
|
27
30
|
{
|
|
28
31
|
"blockListType": "TextBlock",
|
|
29
32
|
"title": "Текстовый блок №2",
|
|
30
|
-
"description": "Описание текстового блока №2"
|
|
33
|
+
"description": "Описание текстового блока №2",
|
|
34
|
+
"style": ["col-span-12"]
|
|
31
35
|
}
|
|
32
36
|
]
|
|
33
37
|
},
|
|
@@ -37,12 +41,14 @@
|
|
|
37
41
|
{
|
|
38
42
|
"blockListType": "TextBlock",
|
|
39
43
|
"title": "Текстовый блок",
|
|
40
|
-
"description": "Описание текстового блока"
|
|
44
|
+
"description": "Описание текстового блока",
|
|
45
|
+
"style": ["col-span-12"]
|
|
41
46
|
},
|
|
42
47
|
{
|
|
43
48
|
"blockListType": "TextBlock",
|
|
44
49
|
"title": "Текстовый блок №2",
|
|
45
|
-
"description": "Описание текстового блока №2"
|
|
50
|
+
"description": "Описание текстового блока №2",
|
|
51
|
+
"style": ["col-span-12"]
|
|
46
52
|
}
|
|
47
53
|
]
|
|
48
54
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"description": "Описание",
|
|
4
4
|
"headingType": "h2",
|
|
5
5
|
"backwardButton": {
|
|
6
|
-
"href": "https://rshb.ru",
|
|
7
6
|
"text": "Кнопка возврата",
|
|
8
7
|
"icon": { "icon": "ArrowLeftIcon" }
|
|
9
8
|
},
|
|
@@ -12,24 +11,18 @@
|
|
|
12
11
|
"size": {
|
|
13
12
|
"width": 234,
|
|
14
13
|
"height": 234
|
|
15
|
-
}
|
|
16
|
-
"alt": "",
|
|
17
|
-
"title": ""
|
|
14
|
+
}
|
|
18
15
|
},
|
|
19
16
|
"items": ["Элемент списка 1", "Элемент списка 2", "Элемент списка 3"],
|
|
20
17
|
"isDotted": true,
|
|
21
18
|
"buttons": [
|
|
22
19
|
{
|
|
23
20
|
"text": "Кнопка",
|
|
24
|
-
"version": "secondary"
|
|
25
|
-
"target": "",
|
|
26
|
-
"icon": {
|
|
27
|
-
"alt": "",
|
|
28
|
-
"title": ""
|
|
29
|
-
}
|
|
21
|
+
"version": "secondary"
|
|
30
22
|
}
|
|
31
23
|
],
|
|
32
24
|
"version": "primary",
|
|
25
|
+
"benefitsVersion": "normal",
|
|
33
26
|
"benefits": [
|
|
34
27
|
{
|
|
35
28
|
"label": "Преимущество №1",
|
|
@@ -2,7 +2,7 @@ import type { Picture } from '../../model/Picture';
|
|
|
2
2
|
import { context } from '../../react/setup-fixture';
|
|
3
3
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
4
4
|
import { ProductBlock } from './ProductBlock';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ProductBlockBenefit, ProductBlockContent } from './ProductBlockContent';
|
|
6
6
|
|
|
7
7
|
const image: Picture = {
|
|
8
8
|
src: 'money-1.png',
|
|
@@ -18,7 +18,7 @@ const benefits: ProductBlockBenefit[] = [
|
|
|
18
18
|
{
|
|
19
19
|
label: 'До 5 млн ₽',
|
|
20
20
|
description: 'Кредитный лимит',
|
|
21
|
-
icon: { icon: '
|
|
21
|
+
icon: { icon: 'CalendarTickIcon', iconVersion: 'white' },
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
label: 'От 16,9%',
|
|
@@ -8,19 +8,34 @@
|
|
|
8
8
|
"label": "Шаг №1",
|
|
9
9
|
"description": "Описание шага №1",
|
|
10
10
|
"icon": {
|
|
11
|
-
"icon": "NewDocIcon"
|
|
11
|
+
"icon": "NewDocIcon",
|
|
12
|
+
"size": {
|
|
13
|
+
"width": 48,
|
|
14
|
+
"height": 48
|
|
15
|
+
},
|
|
16
|
+
"format": "webp"
|
|
12
17
|
}
|
|
13
18
|
},
|
|
14
19
|
{
|
|
15
20
|
"label": "Шаг №2",
|
|
16
21
|
"icon": {
|
|
17
|
-
"icon": "PassSendIcon"
|
|
22
|
+
"icon": "PassSendIcon",
|
|
23
|
+
"size": {
|
|
24
|
+
"width": 48,
|
|
25
|
+
"height": 48
|
|
26
|
+
},
|
|
27
|
+
"format": "webp"
|
|
18
28
|
}
|
|
19
29
|
},
|
|
20
30
|
{
|
|
21
31
|
"description": "Шаг №3 без заголовка",
|
|
22
32
|
"icon": {
|
|
23
|
-
"icon": "ActualBalanceIcon"
|
|
33
|
+
"icon": "ActualBalanceIcon",
|
|
34
|
+
"size": {
|
|
35
|
+
"width": 48,
|
|
36
|
+
"height": 48
|
|
37
|
+
},
|
|
38
|
+
"format": "webp"
|
|
24
39
|
}
|
|
25
40
|
}
|
|
26
41
|
]
|
|
@@ -5,6 +5,7 @@ import type { UniBlockProps } from '../../types';
|
|
|
5
5
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
6
|
import { Img } from '../../ui-kit/Img/Img';
|
|
7
7
|
import type { Step, StepsBlockContent } from './StepsBlockContent';
|
|
8
|
+
import { checkIsIconRenderable } from '../../utils/checkIsIconRenderable';
|
|
8
9
|
import { getStyleMap } from './StepsBlockStyleMaps';
|
|
9
10
|
|
|
10
11
|
export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
|
|
@@ -109,7 +110,11 @@ const renderIconArea = (size: SizeVersion, version: BlockVersion) => (step: Step
|
|
|
109
110
|
className={`${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`}
|
|
110
111
|
>
|
|
111
112
|
<span className={`font-medium flex self-center ${styleMap.title} ${iconTextSize}`}>
|
|
112
|
-
{(step
|
|
113
|
+
{checkIsIconRenderable(step?.icon) ? (
|
|
114
|
+
<Img image={step.icon} width={iconSize} height={iconSize} asSVG />
|
|
115
|
+
) : (
|
|
116
|
+
<span>{i + 1}</span>
|
|
117
|
+
)}
|
|
113
118
|
</span>
|
|
114
119
|
</div>
|
|
115
120
|
);
|
|
@@ -5,7 +5,9 @@ import { Heading } from '../../ui-kit/Heading/Heading';
|
|
|
5
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
6
|
import { joinList } from '../../utils/joinList';
|
|
7
7
|
import type { Step, StepsBlockContent } from './StepsBlockContent';
|
|
8
|
-
import {
|
|
8
|
+
import type { StyleType } from './StepsBlockStyleMaps';
|
|
9
|
+
import { getStyleMap } from './StepsBlockStyleMaps';
|
|
10
|
+
import { checkIsIconRenderable } from '../../utils/checkIsIconRenderable';
|
|
9
11
|
|
|
10
12
|
export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
|
|
11
13
|
|
|
@@ -63,19 +65,23 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
63
65
|
},
|
|
64
66
|
);
|
|
65
67
|
|
|
66
|
-
const renderStepIcon =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
const renderStepIcon =
|
|
69
|
+
(styleMap: StyleType) =>
|
|
70
|
+
({ icon }: Step, i: number) => {
|
|
71
|
+
return (
|
|
72
|
+
<div key={String(i)} className="flex flex-col items-center text-center relative">
|
|
73
|
+
<div
|
|
74
|
+
className={`h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 ${styleMap.iconBackground}`}
|
|
75
|
+
>
|
|
76
|
+
{checkIsIconRenderable(icon) ? (
|
|
77
|
+
<Img image={icon} width="48" height="48" asSVG />
|
|
78
|
+
) : (
|
|
79
|
+
<span className={`font-normal text-title-sm ${styleMap.title}`}>{i + 1}</span>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
75
82
|
</div>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
83
|
+
);
|
|
84
|
+
};
|
|
79
85
|
|
|
80
86
|
const renderStepTitle = (styleMap: StyleType, isMainButton: boolean) => (step: Step, i: number) => {
|
|
81
87
|
return (
|
|
@@ -11,6 +11,17 @@ export interface Step {
|
|
|
11
11
|
label?: string;
|
|
12
12
|
/** @title Описание */
|
|
13
13
|
description?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @title Иконка
|
|
16
|
+
* @default
|
|
17
|
+
* {
|
|
18
|
+
* "size": {
|
|
19
|
+
* "width": 48,
|
|
20
|
+
* "height": 48
|
|
21
|
+
* },
|
|
22
|
+
* "format": "webp"
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
14
25
|
icon?: Picture;
|
|
15
26
|
button?: ButtonProps;
|
|
16
27
|
}
|
|
@@ -7,21 +7,14 @@
|
|
|
7
7
|
"format": "webp",
|
|
8
8
|
"size": {
|
|
9
9
|
"width": 445
|
|
10
|
-
}
|
|
11
|
-
"alt": "",
|
|
12
|
-
"title": ""
|
|
10
|
+
}
|
|
13
11
|
},
|
|
14
12
|
"isDotted": true,
|
|
15
13
|
"items": ["Пункт 1", "Пункт 2", "Пункт 3"],
|
|
16
14
|
"buttons": [
|
|
17
15
|
{
|
|
18
16
|
"text": "Кнопка",
|
|
19
|
-
"version": "primary"
|
|
20
|
-
"target": "",
|
|
21
|
-
"icon": {
|
|
22
|
-
"alt": "",
|
|
23
|
-
"title": ""
|
|
24
|
-
}
|
|
17
|
+
"version": "primary"
|
|
25
18
|
}
|
|
26
19
|
],
|
|
27
20
|
"version": "primary"
|
package/src/model/Picture.ts
CHANGED
|
@@ -10,6 +10,12 @@ export interface Img {
|
|
|
10
10
|
title?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @title Брейкпоинт
|
|
15
|
+
* @enumNames ["1919px и меньше", "1439px и меньше", "1279px и меньше"]
|
|
16
|
+
*/
|
|
17
|
+
export type MediaQuery = '(max-width: 1919px)' | '(max-width: 1439px)' | '(max-width: 1279px)';
|
|
18
|
+
|
|
13
19
|
export interface ImgSource {
|
|
14
20
|
/** @title Иконка */
|
|
15
21
|
icon?: IconName;
|
|
@@ -20,6 +26,7 @@ export interface ImgSource {
|
|
|
20
26
|
format?: 'jpeg' | 'jpg' | 'png' | 'gif' | 'webp' | 'heif' | 'avif';
|
|
21
27
|
/** @hidden */
|
|
22
28
|
options?: Record<string, any>;
|
|
29
|
+
media?: MediaQuery;
|
|
23
30
|
/** @title Размер изображения */
|
|
24
31
|
size?: {
|
|
25
32
|
/** @title Ширина */
|