@redneckz/wildless-cms-uni-blocks 0.3.75 → 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.
Files changed (158) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +19 -21
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/Accordion/AccordionContent.d.ts +4 -1
  5. package/dist/components/Calculator/renderRate.js +1 -1
  6. package/dist/components/Calculator/renderRate.js.map +1 -1
  7. package/dist/components/Catalog/Catalog.js +2 -2
  8. package/dist/components/Catalog/Catalog.js.map +1 -1
  9. package/dist/components/Catalog/CatalogContent.d.ts +1 -0
  10. package/dist/components/GroupBlock/GroupBlockContent.d.ts +2 -2
  11. package/dist/components/LinkDocs/LinkDocsContent.d.ts +10 -1
  12. package/dist/components/PictureText/PictureTextContent.d.ts +1 -0
  13. package/dist/components/ProductTile/ProductTile.js +7 -8
  14. package/dist/components/ProductTile/ProductTile.js.map +1 -1
  15. package/dist/components/StepsBlock/StepsBlock.js +3 -2
  16. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  17. package/dist/components/StepsBlock/StepsBlock.mobile.js +2 -1
  18. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  19. package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -0
  20. package/dist/model/Picture.d.ts +6 -0
  21. package/dist/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
  22. package/dist/ui-kit/Button/ButtonInner.js +2 -2
  23. package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
  24. package/dist/ui-kit/Foldable/Foldable.js +1 -1
  25. package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  26. package/dist/ui-kit/Img/Img.js +2 -6
  27. package/dist/ui-kit/Img/Img.js.map +1 -1
  28. package/dist/utils/checkIsIconRenderable.d.ts +2 -0
  29. package/dist/utils/checkIsIconRenderable.js +5 -0
  30. package/dist/utils/checkIsIconRenderable.js.map +1 -0
  31. package/lib/common.css +1 -1
  32. package/lib/components/Accordion/AccordionContent.d.ts +4 -1
  33. package/lib/components/Calculator/renderRate.js +1 -1
  34. package/lib/components/Calculator/renderRate.js.map +1 -1
  35. package/lib/components/Catalog/Catalog.js +2 -2
  36. package/lib/components/Catalog/Catalog.js.map +1 -1
  37. package/lib/components/Catalog/CatalogContent.d.ts +1 -0
  38. package/lib/components/GroupBlock/GroupBlockContent.d.ts +2 -2
  39. package/lib/components/LinkDocs/LinkDocsContent.d.ts +10 -1
  40. package/lib/components/PictureText/PictureTextContent.d.ts +1 -0
  41. package/lib/components/ProductTile/ProductTile.js +7 -8
  42. package/lib/components/ProductTile/ProductTile.js.map +1 -1
  43. package/lib/components/StepsBlock/StepsBlock.js +3 -2
  44. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  45. package/lib/components/StepsBlock/StepsBlock.mobile.js +2 -1
  46. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  47. package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -0
  48. package/lib/model/Picture.d.ts +6 -0
  49. package/lib/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
  50. package/lib/ui-kit/Button/ButtonInner.js +2 -2
  51. package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
  52. package/lib/ui-kit/Foldable/Foldable.js +1 -1
  53. package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  54. package/lib/ui-kit/Img/Img.js +2 -6
  55. package/lib/ui-kit/Img/Img.js.map +1 -1
  56. package/lib/utils/checkIsIconRenderable.d.ts +2 -0
  57. package/lib/utils/checkIsIconRenderable.js +2 -0
  58. package/lib/utils/checkIsIconRenderable.js.map +1 -0
  59. package/mobile/bundle/bundle.umd.js +5 -3
  60. package/mobile/bundle/bundle.umd.min.js +1 -1
  61. package/mobile/dist/components/Accordion/AccordionContent.d.ts +4 -1
  62. package/mobile/dist/components/Calculator/renderRate.js +1 -1
  63. package/mobile/dist/components/Calculator/renderRate.js.map +1 -1
  64. package/mobile/dist/components/Catalog/Catalog.js +2 -2
  65. package/mobile/dist/components/Catalog/Catalog.js.map +1 -1
  66. package/mobile/dist/components/Catalog/CatalogContent.d.ts +1 -0
  67. package/mobile/dist/components/GroupBlock/GroupBlockContent.d.ts +2 -2
  68. package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +10 -1
  69. package/mobile/dist/components/PictureText/PictureTextContent.d.ts +1 -0
  70. package/mobile/dist/components/ProductTile/ProductTile.js +7 -8
  71. package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
  72. package/mobile/dist/components/StepsBlock/StepsBlock.js +2 -1
  73. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  74. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -0
  75. package/mobile/dist/model/Picture.d.ts +6 -0
  76. package/mobile/dist/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
  77. package/mobile/dist/ui-kit/Button/ButtonInner.js +2 -2
  78. package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
  79. package/mobile/dist/ui-kit/Foldable/Foldable.js +1 -1
  80. package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  81. package/mobile/dist/utils/checkIsIconRenderable.d.ts +2 -0
  82. package/mobile/dist/utils/checkIsIconRenderable.js +5 -0
  83. package/mobile/dist/utils/checkIsIconRenderable.js.map +1 -0
  84. package/mobile/lib/components/Accordion/AccordionContent.d.ts +4 -1
  85. package/mobile/lib/components/Calculator/renderRate.js +1 -1
  86. package/mobile/lib/components/Calculator/renderRate.js.map +1 -1
  87. package/mobile/lib/components/Catalog/Catalog.js +2 -2
  88. package/mobile/lib/components/Catalog/Catalog.js.map +1 -1
  89. package/mobile/lib/components/Catalog/CatalogContent.d.ts +1 -0
  90. package/mobile/lib/components/GroupBlock/GroupBlockContent.d.ts +2 -2
  91. package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +10 -1
  92. package/mobile/lib/components/PictureText/PictureTextContent.d.ts +1 -0
  93. package/mobile/lib/components/ProductTile/ProductTile.js +7 -8
  94. package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
  95. package/mobile/lib/components/StepsBlock/StepsBlock.js +2 -1
  96. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  97. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -0
  98. package/mobile/lib/model/Picture.d.ts +6 -0
  99. package/mobile/lib/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
  100. package/mobile/lib/ui-kit/Button/ButtonInner.js +2 -2
  101. package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
  102. package/mobile/lib/ui-kit/Foldable/Foldable.js +1 -1
  103. package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  104. package/mobile/lib/utils/checkIsIconRenderable.d.ts +2 -0
  105. package/mobile/lib/utils/checkIsIconRenderable.js +2 -0
  106. package/mobile/lib/utils/checkIsIconRenderable.js.map +1 -0
  107. package/mobile/src/components/Accordion/Accordion.example.json +13 -6
  108. package/mobile/src/components/Accordion/AccordionContent.ts +4 -1
  109. package/mobile/src/components/Calculator/renderRate.tsx +1 -3
  110. package/mobile/src/components/Catalog/Catalog.tsx +2 -1
  111. package/mobile/src/components/Catalog/CatalogContent.ts +1 -0
  112. package/mobile/src/components/ContentPage/ContentPage.page.json +1 -1
  113. package/mobile/src/components/GroupBlock/GroupBlock.example.json +72 -3
  114. package/mobile/src/components/GroupBlock/GroupBlockContent.ts +2 -2
  115. package/mobile/src/components/LinkDocs/LinkDocsContent.ts +10 -1
  116. package/mobile/src/components/OtherProducts/OtherProducts.example.json +12 -6
  117. package/mobile/src/components/PictureText/PictureTextContent.ts +1 -0
  118. package/mobile/src/components/ProductBlock/ProductBlock.example.json +3 -10
  119. package/mobile/src/components/ProductTile/ProductTile.example.json +1 -2
  120. package/mobile/src/components/ProductTile/ProductTile.tsx +28 -30
  121. package/mobile/src/components/PromoTile/PromoTile.example.json +1 -2
  122. package/mobile/src/components/StepsBlock/StepsBlock.example.json +18 -3
  123. package/mobile/src/components/StepsBlock/StepsBlock.tsx +6 -1
  124. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +11 -0
  125. package/mobile/src/components/Tile/Tile.example.json +2 -9
  126. package/mobile/src/model/Picture.ts +7 -0
  127. package/mobile/src/ui-kit/BlocksList/BlocksListProps.ts +42 -20
  128. package/mobile/src/ui-kit/Button/ButtonInner.tsx +2 -2
  129. package/mobile/src/ui-kit/Foldable/Foldable.tsx +1 -1
  130. package/mobile/src/utils/checkIsIconRenderable.tsx +3 -0
  131. package/package.json +2 -2
  132. package/src/components/Accordion/Accordion.example.json +13 -6
  133. package/src/components/Accordion/AccordionContent.ts +4 -1
  134. package/src/components/Calculator/renderRate.tsx +1 -3
  135. package/src/components/Catalog/Catalog.tsx +2 -1
  136. package/src/components/Catalog/CatalogContent.ts +1 -0
  137. package/src/components/ContentPage/ContentPage.page.json +1 -1
  138. package/src/components/GroupBlock/GroupBlock.example.json +72 -3
  139. package/src/components/GroupBlock/GroupBlockContent.ts +2 -2
  140. package/src/components/LinkDocs/LinkDocsContent.ts +10 -1
  141. package/src/components/OtherProducts/OtherProducts.example.json +12 -6
  142. package/src/components/PictureText/PictureTextContent.ts +1 -0
  143. package/src/components/ProductBlock/ProductBlock.example.json +3 -10
  144. package/src/components/ProductBlock/ProductBlock.fixture.tsx +2 -2
  145. package/src/components/ProductTile/ProductTile.example.json +1 -2
  146. package/src/components/ProductTile/ProductTile.tsx +28 -30
  147. package/src/components/PromoTile/PromoTile.example.json +1 -2
  148. package/src/components/StepsBlock/StepsBlock.example.json +18 -3
  149. package/src/components/StepsBlock/StepsBlock.mobile.tsx +6 -1
  150. package/src/components/StepsBlock/StepsBlock.tsx +19 -13
  151. package/src/components/StepsBlock/StepsBlockContent.ts +11 -0
  152. package/src/components/Tile/Tile.example.json +2 -9
  153. package/src/model/Picture.ts +7 -0
  154. package/src/ui-kit/BlocksList/BlocksListProps.ts +42 -20
  155. package/src/ui-kit/Button/ButtonInner.tsx +2 -2
  156. package/src/ui-kit/Foldable/Foldable.tsx +1 -1
  157. package/src/ui-kit/Img/Img.tsx +9 -16
  158. package/src/utils/checkIsIconRenderable.tsx +3 -0
@@ -12,9 +12,7 @@ export function renderRate({ rate, title, sup, className = '' }: rateType) {
12
12
  <div>
13
13
  <div className="text-sm font-light ml-3">{title}</div>
14
14
  <div className="flex justify-start">
15
- <span
16
- className={`calc-rate-text font-mohave text-[200px] leading-[250px] pr-4 mt-[-16px] ${className}`}
17
- >
15
+ <span className={`calc-rate-text font-mohave text-title-huge pr-4 mt-[-16px] ${className}`}>
18
16
  {rateFormat}
19
17
  </span>
20
18
  {sup ? <span className="calc-rate-text text-[65px] leading-[75px]">{sup}</span> : ''}
@@ -14,12 +14,13 @@ const CARD_FULL_VIEW_COUNT = 3;
14
14
  const CARD_SHIFT = 430;
15
15
 
16
16
  export const Catalog = JSX<CatalogProps>(
17
- ({ context, cards = [], className = '', title, description }) => {
17
+ ({ context, cards = [], className = '', title, description, anchor = null }) => {
18
18
  const [activeCardIndex, setActiveCardIndex] = context.useState(0);
19
19
 
20
20
  return (
21
21
  <section
22
22
  className={`bg-white relative font-sans p-9 overflow-hidden text-center ${className}`}
23
+ id={anchor}
23
24
  >
24
25
  {title ? <Heading headingType="h2" className="mb-6" title={title} /> : null}
25
26
  {description ? <Description className="mb-6" description={description} /> : null}
@@ -22,5 +22,6 @@ export interface CatalogCardType extends HeadingContent, DescriptionContent, Ima
22
22
  */
23
23
  export type CatalogContent = HeadingContent &
24
24
  DescriptionContent & {
25
+ /** @title Список карточек */
25
26
  cards?: CatalogCardType[];
26
27
  };
@@ -2355,4 +2355,4 @@
2355
2355
  }
2356
2356
  }
2357
2357
  ]
2358
- }
2358
+ }
@@ -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
  }
@@ -4,10 +4,10 @@ import type { GroupBlockDef } from './BlocksTypeProps';
4
4
  * @title Таб
5
5
  */
6
6
  export interface GroupBlockTab {
7
- /** @title Название */
8
- title?: string;
9
7
  /** @title Tег */
10
8
  tag?: string;
9
+ /** @title Название */
10
+ title?: string;
11
11
  }
12
12
 
13
13
  /**
@@ -28,7 +28,16 @@ export interface LinkDocsContent {
28
28
  title?: string;
29
29
  /** @title Описание */
30
30
  description?: string;
31
- /** @title Название иконки */
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
  }
@@ -6,6 +6,7 @@ import type { Picture } from '../../model/Picture';
6
6
  export type TitleWithImageContent = HeadingContent & ImageContent;
7
7
 
8
8
  export interface PictureTextBenefit {
9
+ /** @title Иконка */
9
10
  icon?: Picture;
10
11
  /** @title Название */
11
12
  label?: string;
@@ -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",
@@ -26,8 +26,7 @@
26
26
  "buttons": [
27
27
  {
28
28
  "text": "Кнопка",
29
- "version": "primary",
30
- "target": ""
29
+ "version": "primary"
31
30
  }
32
31
  ]
33
32
  }
@@ -5,7 +5,6 @@ import { ButtonSection } from '../../ui-kit/Button/ButtonSection';
5
5
  import { Description } from '../../ui-kit/Description/Description';
6
6
  import { Heading } from '../../ui-kit/Heading/Heading';
7
7
  import { Img } from '../../ui-kit/Img/Img';
8
- import { BaseTile } from '../BaseTile/BaseTile';
9
8
  import { getTileMinHeight } from '../BaseTile/getTileMinHeight';
10
9
  import { getTileRightPadding } from '../BaseTile/getTileRightPadding';
11
10
  import type { ProductTileContent, TextBenefit } from './ProductTileContent';
@@ -33,39 +32,36 @@ export const ProductTile = JSX<ProductTileProps>(
33
32
  }) => {
34
33
  return (
35
34
  <section
36
- className={`bg-white overflow-hidden text-primary-text font-sans p-9 box-border ${className} ${
35
+ className={`bg-white overflow-hidden text-primary-text font-sans p-9 box-border min-h-[364px] relative justify-between grid ${className} ${
37
36
  productTileStyleMap[version]
38
37
  } ${getTileRightPadding(className)} ${getTileMinHeight(className)} `}
39
38
  id={anchor}
40
39
  >
41
- <BaseTile
42
- context={context}
43
- title={
44
- title ? (
45
- <Heading
46
- headingType={headingType}
47
- as="h3"
48
- title={title}
49
- className={`whitespace-pre-wrap max-w-[600px]`}
50
- />
51
- ) : null
52
- }
53
- buttons={
54
- buttons?.length ? (
55
- <ButtonSection context={context} buttons={buttons} className="flex mt-9 gap-3" />
56
- ) : null
57
- }
58
- image={image?.src && <Img className="mt-auto ml-7" image={image} />}
59
- >
40
+ <div className="z-[1]">
41
+ {title ? (
42
+ <Heading
43
+ headingType={headingType}
44
+ as="h3"
45
+ title={title}
46
+ className={`whitespace-pre-wrap text-h4`}
47
+ />
48
+ ) : null}
60
49
  {description ? (
61
- <Description className="mt-4 max-w-[600px]" description={description} />
50
+ <Description className="mt-2 text-md font-light" description={description} />
62
51
  ) : null}
63
52
  {renderBenefits(benefits || [], version)}
64
-
65
53
  {additionalDescription
66
54
  ? renderAdditionalDescription(additionalDescription, version)
67
55
  : null}
68
- </BaseTile>
56
+ </div>
57
+ {buttons?.length ? (
58
+ <ButtonSection
59
+ context={context}
60
+ buttons={buttons}
61
+ className="flex self-end mt-5 gap-4 z-[1]"
62
+ />
63
+ ) : null}
64
+ {image?.src ? <Img className="absolute right-0 bottom-0" image={image} /> : null}
69
65
  </section>
70
66
  );
71
67
  },
@@ -73,10 +69,12 @@ export const ProductTile = JSX<ProductTileProps>(
73
69
 
74
70
  function renderBenefits(benefits: TextBenefit[], version: BlockVersion) {
75
71
  return (
76
- <div className="flex mt-5 mb-1">
77
- {benefits.length ? <div className="mr-8">{benefits.map(renderBenefitLabel)}</div> : null}
72
+ <div className="flex mt-4">
73
+ {benefits.length ? (
74
+ <div className="mr-6 gap-2.5 text-title-2xs">{benefits.map(renderBenefitLabel)}</div>
75
+ ) : null}
78
76
  {benefits.length ? (
79
- <div className="pt-1">
77
+ <div className="pt-1 text-m">
80
78
  {benefits.map((_, i) => renderBenefitDescription(_, i, version))}
81
79
  </div>
82
80
  ) : null}
@@ -86,7 +84,7 @@ function renderBenefits(benefits: TextBenefit[], version: BlockVersion) {
86
84
 
87
85
  function renderBenefitLabel(benefit: TextBenefit, i: number) {
88
86
  return (
89
- <div key={String(i)} className={`text-xl font-medium ${i ? 'mt-2.5' : ''}`}>
87
+ <div key={String(i)} className={`${i ? 'mt-2.5' : ''}`}>
90
88
  {benefit.label}
91
89
  </div>
92
90
  );
@@ -99,7 +97,7 @@ function renderBenefitDescription(benefit: TextBenefit, i: number, version = 'pr
99
97
  };
100
98
 
101
99
  return (
102
- <div key={String(i)} className={`text-sm ${i ? 'mt-4' : ''} ${labelStyleMap[version]}`}>
100
+ <div key={String(i)} className={`${i ? 'mt-4' : ''} ${labelStyleMap[version]}`}>
103
101
  {benefit.description}
104
102
  </div>
105
103
  );
@@ -111,5 +109,5 @@ function renderAdditionalDescription(additionalDescription: string, version = 'p
111
109
  secondary: 'text-white',
112
110
  };
113
111
 
114
- return <div className={`text-sm mt-2.5 ${descStyleMap[version]}`}>{additionalDescription}</div>;
112
+ return <div className={`text-m mt-2.5 ${descStyleMap[version]}`}>{additionalDescription}</div>;
115
113
  }
@@ -6,8 +6,7 @@
6
6
  {
7
7
  "text": "Все акции",
8
8
  "href": "/credits",
9
- "version": "secondary",
10
- "target": ""
9
+ "version": "secondary"
11
10
  }
12
11
  ],
13
12
  "version": "secondary"
@@ -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.icon?.icon && <Img image={step.icon} width={iconSize} height={iconSize} />) || i + 1}
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
  );
@@ -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"
@@ -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 Ширина */
@@ -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 & { blockListType: 'Headline' };
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 & { blockListType: 'LinkDocs' };
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 & { blockListType: 'TextBlock' };
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 & { blockListType: 'PictureText' };
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 & { blockListType: 'ProductBlock' };
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 & BlocksCommonProps & { blockListType: 'Tile' };
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 & { blockListType: 'ProductTile' };
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 & BlocksCommonProps & { blockListType: 'Gallery' };
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 & { blockListType: 'MiniGallery' };
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 & { blockListType: 'LinkList' };
113
+ BlocksCommonProps & {
114
+ /** @default LinkList */
115
+ blockListType: 'LinkList';
116
+ };
95
117
 
96
118
  /**
97
119
  * @title Содержимое блока
@@ -15,7 +15,7 @@ export const ButtonInner = JSX<ButtonInnerProps>((props) => {
15
15
  {isWithText(props) ? (
16
16
  <div>
17
17
  <div className="text-m-2xs font-light text-left">{aboveText}</div>
18
- <div className="text-button text-left">{text}</div>
18
+ <div className="text-base text-left">{text}</div>
19
19
  </div>
20
20
  ) : null}
21
21
  {appendRight ? appendRight : null}
@@ -30,7 +30,7 @@ const getButtonStyle = (props: ButtonInnerProps) => {
30
30
  return '';
31
31
  }
32
32
 
33
- const withTextStyle = `px-8 gap-2 ${aboveText ? 'py-2' : 'py-[18px]'}`;
33
+ const withTextStyle = `px-9 gap-2 ${aboveText ? 'py-2' : 'py-4'}`;
34
34
 
35
35
  return [
36
36
  'flex items-center justify-center',
@@ -59,7 +59,7 @@ export const Foldable = JSX<FoldableProps>(
59
59
  onClick={handleToggle}
60
60
  >
61
61
  <span className="pr-3">{isActive ? 'Скрыть' : foldButtonLabel}</span>
62
- {icon && <Icon name={icon} iconVersion="white" width="20" height="20" asSVG />}
62
+ {icon ? <Icon name={icon} iconVersion="white" width="20" height="20" asSVG /> : null}
63
63
  </button>
64
64
  ) : null}
65
65
  </div>
@@ -0,0 +1,3 @@
1
+ import type { Picture } from '../model/Picture';
2
+
3
+ export const checkIsIconRenderable = (icon?: Picture) => Boolean(icon?.icon || icon?.src);