@redneckz/wildless-cms-uni-blocks 0.3.29 → 0.3.32

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 (243) hide show
  1. package/README.md +1 -1
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +70 -55
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/dist/components/Accordion/Accordion.js +2 -6
  6. package/dist/components/Accordion/Accordion.js.map +1 -1
  7. package/dist/components/Accordion/AccordionContent.d.ts +3 -3
  8. package/dist/components/Accordion/AccordionItem.js +4 -11
  9. package/dist/components/Accordion/AccordionItem.js.map +1 -1
  10. package/dist/components/Accordion/AccordionItem.mobile.js +6 -3
  11. package/dist/components/Accordion/AccordionItem.mobile.js.map +1 -1
  12. package/dist/components/Accordion/AccordionItemInner.js +2 -2
  13. package/dist/components/Accordion/AccordionItemInner.js.map +1 -1
  14. package/dist/components/Accordion/AccordionItemInner.mobile.js +2 -3
  15. package/dist/components/Accordion/AccordionItemInner.mobile.js.map +1 -1
  16. package/dist/components/Footer/MediaButton.js +1 -1
  17. package/dist/components/Footer/MediaButton.js.map +1 -1
  18. package/dist/components/Header/Header.js +1 -1
  19. package/dist/components/Header/Header.js.map +1 -1
  20. package/dist/components/MobileAppTile/MobileAppTile.js +1 -1
  21. package/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
  22. package/dist/components/OtherProducts/OtherProductsContent.d.ts +3 -12
  23. package/dist/components/PictureText/PictureText.js +8 -4
  24. package/dist/components/PictureText/PictureText.js.map +1 -1
  25. package/dist/components/PictureText/PictureTextContent.d.ts +7 -0
  26. package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
  27. package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
  28. package/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
  29. package/dist/components/Recommendation/Recommendation.js +1 -1
  30. package/dist/components/Recommendation/RecommendationCard.js +1 -1
  31. package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
  32. package/dist/components/StepsBlock/StepsBlock.js +8 -2
  33. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  34. package/dist/components/StepsBlock/StepsBlock.mobile.js +10 -4
  35. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  36. package/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -2
  37. package/dist/components/TextBlock/TextBlockContent.d.ts +1 -1
  38. package/dist/ui-kit/BlocksList/EmbeddableBlocks.mobile.d.ts +8 -0
  39. package/dist/ui-kit/BlocksList/EmbeddableBlocks.mobile.js +17 -0
  40. package/dist/ui-kit/BlocksList/EmbeddableBlocks.mobile.js.map +1 -0
  41. package/dist/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
  42. package/dist/ui-kit/BlocksList/renderBlocksList.js +3 -3
  43. package/dist/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
  44. package/dist/ui-kit/Button/ButtonInner.js +1 -1
  45. package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
  46. package/dist/ui-kit/Heading/Heading.js +1 -1
  47. package/dist/ui-kit/Heading/Heading.js.map +1 -1
  48. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  49. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  50. package/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js +7 -1
  51. package/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
  52. package/dist/ui-kit/Tabs/Tabs.js +1 -1
  53. package/dist/ui-kit/Tabs/Tabs.js.map +1 -1
  54. package/lib/common.css +1 -1
  55. package/lib/components/Accordion/Accordion.js +2 -6
  56. package/lib/components/Accordion/Accordion.js.map +1 -1
  57. package/lib/components/Accordion/AccordionContent.d.ts +3 -3
  58. package/lib/components/Accordion/AccordionItem.js +4 -11
  59. package/lib/components/Accordion/AccordionItem.js.map +1 -1
  60. package/lib/components/Accordion/AccordionItem.mobile.js +6 -3
  61. package/lib/components/Accordion/AccordionItem.mobile.js.map +1 -1
  62. package/lib/components/Accordion/AccordionItemInner.js +2 -2
  63. package/lib/components/Accordion/AccordionItemInner.js.map +1 -1
  64. package/lib/components/Accordion/AccordionItemInner.mobile.js +2 -3
  65. package/lib/components/Accordion/AccordionItemInner.mobile.js.map +1 -1
  66. package/lib/components/Footer/MediaButton.js +1 -1
  67. package/lib/components/Footer/MediaButton.js.map +1 -1
  68. package/lib/components/Header/Header.js +1 -1
  69. package/lib/components/Header/Header.js.map +1 -1
  70. package/lib/components/MobileAppTile/MobileAppTile.js +1 -1
  71. package/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
  72. package/lib/components/OtherProducts/OtherProductsContent.d.ts +3 -12
  73. package/lib/components/PictureText/PictureText.js +8 -4
  74. package/lib/components/PictureText/PictureText.js.map +1 -1
  75. package/lib/components/PictureText/PictureTextContent.d.ts +7 -0
  76. package/lib/components/ProductGalleryGreen/ProductGalleryGreen.fixture.d.ts +1 -0
  77. package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
  78. package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
  79. package/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
  80. package/lib/components/Recommendation/Recommendation.js +1 -1
  81. package/lib/components/Recommendation/RecommendationCard.js +1 -1
  82. package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
  83. package/lib/components/StepsBlock/StepsBlock.fixture.d.ts +1 -0
  84. package/lib/components/StepsBlock/StepsBlock.js +8 -2
  85. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  86. package/lib/components/StepsBlock/StepsBlock.mobile.js +10 -4
  87. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  88. package/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -2
  89. package/lib/components/TextBlock/TextBlockContent.d.ts +1 -1
  90. package/lib/ui-kit/BlocksList/EmbeddableBlocks.mobile.d.ts +8 -0
  91. package/lib/ui-kit/BlocksList/EmbeddableBlocks.mobile.js +15 -0
  92. package/lib/ui-kit/BlocksList/EmbeddableBlocks.mobile.js.map +1 -0
  93. package/lib/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
  94. package/lib/ui-kit/BlocksList/renderBlocksList.js +3 -3
  95. package/lib/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
  96. package/lib/ui-kit/Button/ButtonInner.js +1 -1
  97. package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
  98. package/lib/ui-kit/Heading/Heading.js +1 -1
  99. package/lib/ui-kit/Heading/Heading.js.map +1 -1
  100. package/lib/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.d.ts +3 -0
  101. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  102. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  103. package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.d.ts +4 -1
  104. package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js +7 -1
  105. package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
  106. package/lib/ui-kit/Tabs/Tabs.js +1 -1
  107. package/lib/ui-kit/Tabs/Tabs.js.map +1 -1
  108. package/mobile/bundle/bundle.umd.js +87 -189
  109. package/mobile/bundle/bundle.umd.min.js +1 -1
  110. package/mobile/dist/components/Accordion/AccordionContent.d.ts +3 -3
  111. package/mobile/dist/components/Accordion/AccordionItem.js +6 -3
  112. package/mobile/dist/components/Accordion/AccordionItem.js.map +1 -1
  113. package/mobile/dist/components/Accordion/AccordionItemInner.js +2 -3
  114. package/mobile/dist/components/Accordion/AccordionItemInner.js.map +1 -1
  115. package/mobile/dist/components/Footer/MediaButton.js +1 -1
  116. package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
  117. package/mobile/dist/components/OtherProducts/OtherProductsContent.d.ts +3 -12
  118. package/mobile/dist/components/PictureText/PictureText.js +8 -4
  119. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  120. package/mobile/dist/components/PictureText/PictureTextContent.d.ts +7 -0
  121. package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
  122. package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
  123. package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
  124. package/mobile/dist/components/Recommendation/Recommendation.js +1 -1
  125. package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
  126. package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
  127. package/mobile/dist/components/StepsBlock/StepsBlock.js +10 -4
  128. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  129. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -2
  130. package/mobile/dist/components/TextBlock/TextBlockContent.d.ts +1 -1
  131. package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.d.ts +0 -4
  132. package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.js +0 -8
  133. package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.js.map +1 -1
  134. package/mobile/dist/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
  135. package/mobile/dist/ui-kit/BlocksList/renderBlocksList.js +3 -3
  136. package/mobile/dist/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
  137. package/mobile/dist/ui-kit/Button/ButtonInner.js +1 -1
  138. package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
  139. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  140. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  141. package/mobile/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js +7 -1
  142. package/mobile/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
  143. package/mobile/dist/ui-kit/Tabs/Tabs.js +1 -1
  144. package/mobile/dist/ui-kit/Tabs/Tabs.js.map +1 -1
  145. package/mobile/lib/components/Accordion/AccordionContent.d.ts +3 -3
  146. package/mobile/lib/components/Accordion/AccordionItem.js +6 -3
  147. package/mobile/lib/components/Accordion/AccordionItem.js.map +1 -1
  148. package/mobile/lib/components/Accordion/AccordionItemInner.js +2 -3
  149. package/mobile/lib/components/Accordion/AccordionItemInner.js.map +1 -1
  150. package/mobile/lib/components/Footer/MediaButton.js +1 -1
  151. package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
  152. package/mobile/lib/components/OtherProducts/OtherProductsContent.d.ts +3 -12
  153. package/mobile/lib/components/PictureText/PictureText.js +8 -4
  154. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  155. package/mobile/lib/components/PictureText/PictureTextContent.d.ts +7 -0
  156. package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
  157. package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
  158. package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
  159. package/mobile/lib/components/Recommendation/Recommendation.js +1 -1
  160. package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
  161. package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
  162. package/mobile/lib/components/StepsBlock/StepsBlock.js +10 -4
  163. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  164. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -2
  165. package/mobile/lib/components/TextBlock/TextBlockContent.d.ts +1 -1
  166. package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.d.ts +0 -4
  167. package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.js +0 -8
  168. package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.js.map +1 -1
  169. package/mobile/lib/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
  170. package/mobile/lib/ui-kit/BlocksList/renderBlocksList.js +3 -3
  171. package/mobile/lib/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
  172. package/mobile/lib/ui-kit/Button/ButtonInner.js +1 -1
  173. package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
  174. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  175. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  176. package/mobile/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js +7 -1
  177. package/mobile/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
  178. package/mobile/lib/ui-kit/Tabs/Tabs.js +1 -1
  179. package/mobile/lib/ui-kit/Tabs/Tabs.js.map +1 -1
  180. package/mobile/src/components/Accordion/Accordion.example.json +3 -0
  181. package/mobile/src/components/Accordion/AccordionContent.ts +4 -5
  182. package/mobile/src/components/Accordion/AccordionItem.tsx +32 -27
  183. package/mobile/src/components/Accordion/AccordionItemInner.tsx +8 -11
  184. package/mobile/src/components/Footer/MediaButton.tsx +1 -1
  185. package/mobile/src/components/Header/Header.example.json +3 -0
  186. package/mobile/src/components/OtherProducts/OtherProductsContent.ts +3 -12
  187. package/mobile/src/components/PictureText/PictureText.example.json +2 -0
  188. package/mobile/src/components/PictureText/PictureText.tsx +33 -7
  189. package/mobile/src/components/PictureText/PictureTextContent.ts +7 -0
  190. package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +2 -1
  191. package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +40 -17
  192. package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +2 -0
  193. package/mobile/src/components/Recommendation/Recommendation.tsx +1 -1
  194. package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
  195. package/mobile/src/components/StepsBlock/StepsBlock.tsx +14 -5
  196. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +3 -2
  197. package/mobile/src/components/TextBlock/TextBlockContent.ts +1 -1
  198. package/mobile/src/ui-kit/BlocksList/EmbeddableBlocks.tsx +0 -8
  199. package/mobile/src/ui-kit/BlocksList/renderBlocksList.tsx +4 -12
  200. package/mobile/src/ui-kit/Button/ButtonInner.tsx +2 -2
  201. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
  202. package/mobile/src/ui-kit/SwipeListControl/utils/getScrollPoints.spec.ts +18 -0
  203. package/mobile/src/ui-kit/SwipeListControl/utils/getScrollPoints.ts +10 -2
  204. package/mobile/src/ui-kit/Tabs/Tabs.tsx +1 -1
  205. package/package.json +2 -3
  206. package/src/components/Accordion/Accordion.example.json +3 -0
  207. package/src/components/Accordion/Accordion.fixture.mobile.tsx +1 -0
  208. package/src/components/Accordion/Accordion.fixture.tsx +2 -0
  209. package/src/components/Accordion/Accordion.tsx +4 -17
  210. package/src/components/Accordion/AccordionContent.ts +4 -5
  211. package/src/components/Accordion/AccordionItem.mobile.tsx +32 -27
  212. package/src/components/Accordion/AccordionItem.tsx +23 -49
  213. package/src/components/Accordion/AccordionItemInner.mobile.tsx +8 -11
  214. package/src/components/Accordion/AccordionItemInner.tsx +8 -10
  215. package/src/components/Footer/MediaButton.tsx +1 -1
  216. package/src/components/Header/Header.example.json +3 -0
  217. package/src/components/Header/Header.tsx +8 -1
  218. package/src/components/MobileAppTile/MobileAppTile.tsx +3 -3
  219. package/src/components/OtherProducts/OtherProducts.fixture.tsx +61 -6
  220. package/src/components/OtherProducts/OtherProductsContent.ts +3 -12
  221. package/src/components/PictureText/PictureText.example.json +2 -0
  222. package/src/components/PictureText/PictureText.tsx +33 -7
  223. package/src/components/PictureText/PictureTextContent.ts +7 -0
  224. package/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +2 -1
  225. package/src/components/ProductGalleryGreen/ProductGalleryGreen.fixture.tsx +74 -1
  226. package/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +40 -17
  227. package/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +2 -0
  228. package/src/components/Recommendation/Recommendation.tsx +1 -1
  229. package/src/components/Recommendation/RecommendationCard.tsx +1 -1
  230. package/src/components/StepsBlock/StepsBlock.fixture.tsx +14 -0
  231. package/src/components/StepsBlock/StepsBlock.mobile.tsx +14 -5
  232. package/src/components/StepsBlock/StepsBlock.tsx +13 -6
  233. package/src/components/StepsBlock/StepsBlockContent.ts +3 -2
  234. package/src/components/TextBlock/TextBlockContent.ts +1 -1
  235. package/src/ui-kit/BlocksList/EmbeddableBlocks.mobile.tsx +15 -0
  236. package/src/ui-kit/BlocksList/renderBlocksList.tsx +4 -12
  237. package/src/ui-kit/Button/ButtonInner.tsx +2 -2
  238. package/src/ui-kit/Heading/Heading.tsx +1 -3
  239. package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +24 -6
  240. package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
  241. package/src/ui-kit/SwipeListControl/utils/getScrollPoints.spec.ts +18 -0
  242. package/src/ui-kit/SwipeListControl/utils/getScrollPoints.ts +10 -2
  243. package/src/ui-kit/Tabs/Tabs.tsx +1 -1
@@ -1,4 +1,5 @@
1
1
  import type { ProductBlockInnerContent } from '../ProductBlock/ProductBlockContent';
2
+ import type { BlockVersion } from '../../model/BlockVersion';
2
3
 
3
4
  /** @title Кнопка под слайдом */
4
5
  interface ProductGalleryNav {
@@ -29,4 +30,5 @@ export interface ProductGalleryGreenContent {
29
30
  duration?: number;
30
31
  /** @title Слайды */
31
32
  slides?: ProductSlide[];
33
+ version?: BlockVersion;
32
34
  }
@@ -24,7 +24,7 @@ export const Recommendation = JSX<RecommendationProps>(
24
24
  className={`relative font-sans p-[50px] overflow-hidden ${blockClassName} ${className}`}
25
25
  id={anchor}
26
26
  >
27
- {title ? <Heading headingType="h3" className="mb-8" title={title} /> : null}
27
+ {title ? <Heading headingType="h2" className="mb-8" title={title} /> : null}
28
28
  <div
29
29
  className="flex duration-1000 gap-4"
30
30
  style={{ transform: `translateX(-${activeCardIndex * CARD_SHIFT}px)` }}
@@ -25,7 +25,7 @@ export const RecommendationCard = JSX<RecommendationCardProps>(
25
25
  image={image?.src && <Img className="mt-auto ml-7" image={image} />}
26
26
  >
27
27
  {description ? <Description description={description} /> : null}
28
- {items?.length ? <List items={items} version={version} /> : null}
28
+ {items?.length ? <List className="text-m-base" items={items} version={version} /> : null}
29
29
  </BaseTile>
30
30
  </section>
31
31
  );
@@ -14,10 +14,24 @@ const steps = [
14
14
  label: 'Получение наличных',
15
15
  description: 'Получите наличные в отделении банка',
16
16
  },
17
+ {
18
+ label: 'Последний шаг!',
19
+ description: 'Получите наличные в отделении банка',
20
+ },
17
21
  ];
18
22
 
19
23
  export default {
20
24
  default: (
25
+ <div className="container grid grid-cols-12">
26
+ <StepsBlock
27
+ className="col-span-12"
28
+ context={context}
29
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
30
+ steps={steps.slice(0, 3)}
31
+ />
32
+ </div>
33
+ ),
34
+ '4 steps': (
21
35
  <div className="container grid grid-cols-12">
22
36
  <StepsBlock
23
37
  className="col-span-12"
@@ -16,6 +16,16 @@ type StyleType = {
16
16
  iconConnector: string;
17
17
  };
18
18
 
19
+ const STEPS_SIZE_MAP: Record<SizeVersion, string> = {
20
+ normal: 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]',
21
+ small: 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]',
22
+ };
23
+
24
+ const STEPS_TILE_DESCRIPTION_HEIGHT_MAP: Record<SizeVersion, string> = {
25
+ normal: 'min-h-[70px]',
26
+ small: 'min-h-[50px]',
27
+ };
28
+
19
29
  const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
20
30
  primary: {
21
31
  background: 'bg-white',
@@ -88,7 +98,9 @@ const renderStepTitle = (params: RenderStepTitleParams) => {
88
98
  <div className={`min-h-8 h-full w-[2px] ${style.iconConnector} ${margin}`} />
89
99
  )}
90
100
  </div>
91
- <div className="flex flex-col justify-start relative">
101
+ <div
102
+ className={`flex flex-col justify-center h-fit ${STEPS_TILE_DESCRIPTION_HEIGHT_MAP[size]}`}
103
+ >
92
104
  {step.label && (
93
105
  <div className="font-medium text-m-title-xs m-0 text-left">{step.label}</div>
94
106
  )}
@@ -110,10 +122,7 @@ const renderStepTitle = (params: RenderStepTitleParams) => {
110
122
  const renderIconArea = (params: RenderStepTitleParams) => {
111
123
  const { step, size, i, version } = params;
112
124
  const style = styleMaps(version);
113
- const iconAreaSize =
114
- size === 'normal'
115
- ? 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]'
116
- : 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]';
125
+ const iconAreaSize = STEPS_SIZE_MAP[size];
117
126
 
118
127
  const iconSize = size === 'normal' ? '38' : '27';
119
128
  const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
@@ -8,12 +8,17 @@ import type { Step, StepsBlockContent } from './StepsBlockContent';
8
8
  export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
9
9
 
10
10
  export const StepsBlock = JSX<StepsBlockProps>(
11
- ({ className, title, showLines = true, steps, anchor = null }) => {
11
+ ({ className = '', title, showLines = true, steps = [], anchor = null }) => {
12
+ const shortGaps = steps.length > 3;
13
+
12
14
  return (
13
15
  <section
14
- className={`box-border font-sans text-primary-text bg-white px-20 py-[50px] flex flex-col items-center ${
15
- className || ''
16
- }`}
16
+ className={[
17
+ 'box-border font-sans text-primary-text bg-white',
18
+ shortGaps ? 'px-20' : 'px-[70px]',
19
+ 'py-[50px] flex flex-col items-center',
20
+ className,
21
+ ].join(' ')}
17
22
  id={anchor}
18
23
  >
19
24
  <Heading headingType="h2" className="max-w-[47rem] text-center" title={title} />
@@ -24,9 +29,11 @@ export const StepsBlock = JSX<StepsBlockProps>(
24
29
  <div
25
30
  className={`h-0.5 w-full bg-secondary-light ${!showLines ? 'opacity-0' : ''}`}
26
31
  />,
27
- )(steps.map((step, i) => renderStepIcon(step, i)))}
32
+ )(steps.map(renderStepIcon))}
33
+ </div>
34
+ <div className={`flex justify-between ${shortGaps ? 'gap-x-3' : 'gap-x-[101px]'}`}>
35
+ {steps.map(renderStepTitle)}
28
36
  </div>
29
- <div className="flex justify-between gap-x-[101px]">{steps.map(renderStepTitle)}</div>
30
37
  </div>
31
38
  ) : null}
32
39
  </section>
@@ -1,4 +1,4 @@
1
- import type { IconName } from '../../ui-kit/Icon/IconProps';
1
+ import type { IconName } from '../../icons/IconName';
2
2
  import type { SizeVersion } from '../../model/SizeVersion';
3
3
  import type { BlockVersion } from '../../model/BlockVersion';
4
4
 
@@ -26,9 +26,10 @@ export interface StepsBlockContent {
26
26
  /**
27
27
  * @title Шаги
28
28
  * @minItems 2
29
- * @maxItems 3
29
+ * @maxItems 4
30
30
  */
31
31
  steps?: Step[];
32
+ /** @title Размер шагов (моб.) */
32
33
  size?: SizeVersion; // TODO: mobile content
33
34
  version?: BlockVersion; // TODO: mobile content
34
35
  }
@@ -23,7 +23,7 @@ export interface TextBlockContent {
23
23
  iconVersion?: TextBlockIconVersion;
24
24
  image?: Picture;
25
25
  blockVersion?: TextBlockVersion;
26
- /** @title Маркеры списка (моб.) */ // TODO: mobile prop
26
+ /** @title Буллиты */ // TODO: mobile prop
27
27
  isDotted?: boolean;
28
28
  /** @title Список (моб.) */ // TODO: mobile prop
29
29
  items?: string[];
@@ -0,0 +1,15 @@
1
+ import { Headline } from '../../components/Headline/Headline';
2
+ import { LinkDocs } from '../../components/LinkDocs/LinkDocs';
3
+ import { ProductBlock } from '../../components/ProductBlock/ProductBlock';
4
+ import { TextBlock } from '../../components/TextBlock/TextBlock';
5
+ import { Gallery } from '../../components/Gallery/Gallery';
6
+ import { LinkList } from '../../components/LinkList/LinkList';
7
+
8
+ export const EmbeddableBlocks = {
9
+ Headline,
10
+ LinkDocs,
11
+ TextBlock,
12
+ ProductBlock,
13
+ Gallery,
14
+ LinkList,
15
+ };
@@ -2,27 +2,19 @@ import type { JSXBlock } from '../../components/ContentPage/ContentPage';
2
2
  import type { ContentPageContext } from '../../components/ContentPage/ContentPageContext';
3
3
  import type { BlockDef, ColumnsCount } from './BlocksListProps';
4
4
  import { EmbeddableBlocks } from './EmbeddableBlocks';
5
- import { BlockVersion } from '../../model/BlockVersion';
6
5
 
7
6
  type EmbeddableBlocksProps = {
8
7
  blocks?: BlockDef[];
9
8
  context: ContentPageContext;
10
9
  columns?: ColumnsCount;
11
10
  className?: string;
12
- version?: BlockVersion;
13
11
  };
14
12
 
15
- export const renderBlocksList = ({
16
- blocks,
17
- context,
18
- className,
19
- columns,
20
- version,
21
- }: EmbeddableBlocksProps) =>
22
- blocks?.length ? blocks.map(renderBlock({ context, className, columns, version })) : null;
13
+ export const renderBlocksList = ({ blocks, context, className, columns }: EmbeddableBlocksProps) =>
14
+ blocks?.length ? blocks.map(renderBlock({ context, className, columns })) : null;
23
15
 
24
16
  export const renderBlock =
25
- ({ context, columns, className, version }: EmbeddableBlocksProps) =>
17
+ ({ context, columns, className }: EmbeddableBlocksProps) =>
26
18
  (block: BlockDef, i: number) => {
27
19
  const type = block?.blockListType;
28
20
  if (!type || !(type in EmbeddableBlocks)) {
@@ -32,7 +24,7 @@ export const renderBlock =
32
24
  const EmbeddedBlock: JSXBlock = EmbeddableBlocks[type];
33
25
  return (
34
26
  <div className={`${className} ${columnsCountClass}`} key={`block_${i}`}>
35
- <EmbeddedBlock context={context} {...block} blockVersion={version} className="!p-0" />
27
+ <EmbeddedBlock context={context} {...block} className="!p-0" />
36
28
  </div>
37
29
  );
38
30
  };
@@ -13,8 +13,8 @@ export const ButtonInner = JSX<ButtonInnerProps>((props) => {
13
13
  {appendLeft ? appendLeft : null}
14
14
  {isWithText(props) ? (
15
15
  <div>
16
- <div className="text-m-2xs text-left">{aboveText}</div>
17
- <div className="text-m-button font-medium text-left">{text}</div>
16
+ <div className="text-m-2xs font-light text-left">{aboveText}</div>
17
+ <div className="text-m-button text-left">{text}</div>
18
18
  </div>
19
19
  ) : null}
20
20
  </div>
@@ -22,8 +22,6 @@ export const Heading = JSX<HeadingProps>((props) => {
22
22
  const Tag = headingType;
23
23
 
24
24
  return (
25
- <Tag className={`font-sans font-medium m-0 ${HEADING_STYLE_MAP[headingType]} ${className}`}>
26
- {title}
27
- </Tag>
25
+ <Tag className={`font-sans m-0 ${HEADING_STYLE_MAP[headingType]} ${className}`}>{title}</Tag>
28
26
  );
29
27
  });
@@ -1,16 +1,34 @@
1
1
  import { SwipeListControl } from './SwipeListControl';
2
2
  import { mobileContext } from '../../setup-fixture';
3
3
 
4
- const children = new Array(4).fill(0).map((_, i) => (
5
- <div key={String(i)} className="border border-main-stroke rounded-md text-center h-12">
6
- {`Element #${i}`}
7
- </div>
8
- ));
4
+ const generateChildren = (count: number) =>
5
+ new Array(count).fill(0).map((_, i) => (
6
+ <div key={String(i)} className="border border-main-stroke rounded-md text-center h-12">
7
+ {`Element #${i}`}
8
+ </div>
9
+ ));
9
10
 
10
11
  export default {
11
12
  default: (
12
13
  <div className="px-4 py-5 bg-white">
13
- <SwipeListControl context={mobileContext}>{children}</SwipeListControl>
14
+ <SwipeListControl context={mobileContext}>{generateChildren(5)}</SwipeListControl>
15
+ </div>
16
+ ),
17
+ 'w/o dots': (
18
+ <div className="px-4 py-5 bg-white">
19
+ <SwipeListControl context={mobileContext} showDots={false}>
20
+ {generateChildren(5)}
21
+ </SwipeListControl>
22
+ </div>
23
+ ),
24
+ '1 element': (
25
+ <div className="px-4 py-5 bg-white">
26
+ <SwipeListControl context={mobileContext}>{generateChildren(1)}</SwipeListControl>
27
+ </div>
28
+ ),
29
+ '2 elements': (
30
+ <div className="px-4 py-5 bg-white">
31
+ <SwipeListControl context={mobileContext}>{generateChildren(2)}</SwipeListControl>
14
32
  </div>
15
33
  ),
16
34
  };
@@ -22,7 +22,7 @@ export const SwipeListControlDots = JSX<SwipeListControlDotsProps>(
22
22
  const contentContainer = (e.currentTarget as HTMLElement).parentElement
23
23
  ?.previousElementSibling;
24
24
 
25
- contentContainer?.children[idx]?.scrollIntoView({ behavior: 'smooth' });
25
+ contentContainer?.children[idx]?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
26
26
  };
27
27
 
28
28
  return showDots && children?.length ? (
@@ -17,8 +17,26 @@ const scrollPoints: [number, number][] = [
17
17
  [1414, 1914],
18
18
  ];
19
19
 
20
+ const twoItemsScrollPointsProps = {
21
+ gap: 14,
22
+ padding: 16,
23
+ clientWidth: 414,
24
+ scrollWidth: 794,
25
+ childElementCount: 2,
26
+ itemWidth: 380,
27
+ };
28
+
29
+ const twoItemsScrollPoints: [number, number][] = [
30
+ [0, 380],
31
+ [380, 794],
32
+ ];
33
+
20
34
  describe('getScrollPoints', () => {
21
35
  it('should return array containing scroll breakpoints delimiting each child', () => {
22
36
  expect(getScrollPoints(props)).toEqual(scrollPoints);
23
37
  });
38
+
39
+ it('should correctly handle case with 2 items in container', () => {
40
+ expect(getScrollPoints(twoItemsScrollPointsProps)).toEqual(twoItemsScrollPoints);
41
+ });
24
42
  });
@@ -16,9 +16,17 @@ export const getScrollPoints = ({
16
16
  scrollWidth: number;
17
17
  childElementCount: number;
18
18
  itemWidth: number;
19
- }) => {
20
- const scrollItemWidth = itemWidth + gap;
19
+ }): [number, number][] => {
21
20
  const scrollableDistance = scrollWidth - clientWidth;
21
+
22
+ if (childElementCount === 2) {
23
+ return [
24
+ [0, scrollableDistance],
25
+ [scrollableDistance, scrollWidth],
26
+ ];
27
+ }
28
+
29
+ const scrollItemWidth = itemWidth + gap;
22
30
  const edgeScrollDistance = clientWidth - gap - padding;
23
31
 
24
32
  const lastScrollableIdx = childElementCount - 2;
@@ -19,7 +19,7 @@ const renderTab =
19
19
  return (
20
20
  <div
21
21
  key={String(index)}
22
- className={`flex h-full flex-1 cursor-pointer mr-2 last:mr-0 ${
22
+ className={`flex h-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${
23
23
  isActive ? ACTIVE_TAB_STYLE : TAB_STYLE
24
24
  }`}
25
25
  role="tab"