@redneckz/wildless-cms-uni-blocks 0.8.9 → 0.8.10

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 (213) hide show
  1. package/bin/migration-scripts/0.8.10.js +31 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +82 -48
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
  6. package/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  7. package/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  8. package/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
  9. package/bundle/components/Tile/TileContent.d.ts +2 -2
  10. package/dist/components/Calculator/Rate.js +1 -1
  11. package/dist/components/Calculator/Rate.js.map +1 -1
  12. package/dist/components/Calculator/constants.js +2 -2
  13. package/dist/components/Calculator/constants.js.map +1 -1
  14. package/dist/components/Calculator/rangeHelpers.d.ts +4 -0
  15. package/dist/components/Calculator/rangeHelpers.js +12 -0
  16. package/dist/components/Calculator/rangeHelpers.js.map +1 -0
  17. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  18. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  19. package/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
  20. package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  21. package/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
  22. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  23. package/dist/components/Carousel/Carousel.js +6 -4
  24. package/dist/components/Carousel/Carousel.js.map +1 -1
  25. package/dist/components/PictureText/renderBenefit.js +1 -0
  26. package/dist/components/PictureText/renderBenefit.js.map +1 -1
  27. package/dist/components/ProductTile/renderBenefit.js +1 -0
  28. package/dist/components/ProductTile/renderBenefit.js.map +1 -1
  29. package/dist/components/StepsBlock/StepsBlock.js +7 -13
  30. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  31. package/dist/components/StepsBlock/StepsBlock.mobile.js +24 -4
  32. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  33. package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  34. package/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  35. package/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
  36. package/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  37. package/{lib/components/StepsBlock/renderStepContent.d.ts → dist/components/StepsBlock/renderStep.d.ts} +5 -5
  38. package/dist/components/StepsBlock/renderStep.js +34 -0
  39. package/dist/components/StepsBlock/renderStep.js.map +1 -0
  40. package/dist/components/Tile/Tile.js +3 -3
  41. package/dist/components/Tile/Tile.js.map +1 -1
  42. package/dist/components/Tile/TileContent.d.ts +2 -2
  43. package/lib/components/Calculator/Rate.js +1 -1
  44. package/lib/components/Calculator/Rate.js.map +1 -1
  45. package/lib/components/Calculator/constants.js +2 -2
  46. package/lib/components/Calculator/constants.js.map +1 -1
  47. package/lib/components/Calculator/rangeHelpers.d.ts +4 -0
  48. package/lib/components/Calculator/rangeHelpers.js +8 -0
  49. package/lib/components/Calculator/rangeHelpers.js.map +1 -0
  50. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  51. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  52. package/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
  53. package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  54. package/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
  55. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  56. package/lib/components/Carousel/Carousel.js +6 -4
  57. package/lib/components/Carousel/Carousel.js.map +1 -1
  58. package/lib/components/PictureText/renderBenefit.js +1 -0
  59. package/lib/components/PictureText/renderBenefit.js.map +1 -1
  60. package/lib/components/ProductTile/renderBenefit.js +1 -0
  61. package/lib/components/ProductTile/renderBenefit.js.map +1 -1
  62. package/lib/components/StepsBlock/StepsBlock.js +7 -13
  63. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  64. package/lib/components/StepsBlock/StepsBlock.mobile.js +24 -4
  65. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  66. package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  67. package/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  68. package/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
  69. package/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  70. package/{dist/components/StepsBlock/renderStepContent.d.ts → lib/components/StepsBlock/renderStep.d.ts} +5 -5
  71. package/lib/components/StepsBlock/renderStep.js +31 -0
  72. package/lib/components/StepsBlock/renderStep.js.map +1 -0
  73. package/lib/components/Tile/Tile.js +3 -3
  74. package/lib/components/Tile/Tile.js.map +1 -1
  75. package/lib/components/Tile/TileContent.d.ts +2 -2
  76. package/mobile/bundle/bundle.umd.js +32 -5
  77. package/mobile/bundle/bundle.umd.min.js +1 -1
  78. package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
  79. package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  80. package/mobile/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  81. package/mobile/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
  82. package/mobile/bundle/components/Tile/TileContent.d.ts +2 -2
  83. package/mobile/dist/components/Calculator/Rate.js +1 -1
  84. package/mobile/dist/components/Calculator/Rate.js.map +1 -1
  85. package/mobile/dist/components/Calculator/constants.js +2 -2
  86. package/mobile/dist/components/Calculator/constants.js.map +1 -1
  87. package/mobile/dist/components/Calculator/rangeHelpers.d.ts +4 -0
  88. package/mobile/dist/components/Calculator/rangeHelpers.js +12 -0
  89. package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -0
  90. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  91. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  92. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
  93. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  94. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
  95. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  96. package/mobile/dist/components/Carousel/Carousel.js +6 -4
  97. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  98. package/mobile/dist/components/PictureText/renderBenefit.js +1 -0
  99. package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -1
  100. package/mobile/dist/components/ProductTile/renderBenefit.js +1 -0
  101. package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
  102. package/mobile/dist/components/StepsBlock/StepsBlock.js +24 -4
  103. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  104. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  105. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  106. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
  107. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  108. package/mobile/dist/components/StepsBlock/renderStep.d.ts +11 -0
  109. package/mobile/dist/components/StepsBlock/renderStep.js +34 -0
  110. package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -0
  111. package/mobile/dist/components/Tile/Tile.js +3 -3
  112. package/mobile/dist/components/Tile/Tile.js.map +1 -1
  113. package/mobile/dist/components/Tile/TileContent.d.ts +2 -2
  114. package/mobile/lib/components/Calculator/Rate.js +1 -1
  115. package/mobile/lib/components/Calculator/Rate.js.map +1 -1
  116. package/mobile/lib/components/Calculator/constants.js +2 -2
  117. package/mobile/lib/components/Calculator/constants.js.map +1 -1
  118. package/mobile/lib/components/Calculator/rangeHelpers.d.ts +4 -0
  119. package/mobile/lib/components/Calculator/rangeHelpers.js +8 -0
  120. package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -0
  121. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  122. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  123. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
  124. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  125. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
  126. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  127. package/mobile/lib/components/Carousel/Carousel.js +6 -4
  128. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  129. package/mobile/lib/components/PictureText/renderBenefit.js +1 -0
  130. package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -1
  131. package/mobile/lib/components/ProductTile/renderBenefit.js +1 -0
  132. package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
  133. package/mobile/lib/components/StepsBlock/StepsBlock.js +24 -4
  134. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  135. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  136. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  137. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
  138. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  139. package/mobile/lib/components/StepsBlock/renderStep.d.ts +11 -0
  140. package/mobile/lib/components/StepsBlock/renderStep.js +31 -0
  141. package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -0
  142. package/mobile/lib/components/Tile/Tile.js +3 -3
  143. package/mobile/lib/components/Tile/Tile.js.map +1 -1
  144. package/mobile/lib/components/Tile/TileContent.d.ts +2 -2
  145. package/mobile/src/components/Calculator/Rate.tsx +1 -1
  146. package/mobile/src/components/Calculator/constants.ts +2 -2
  147. package/mobile/src/components/Calculator/rangeHelpers.ts +24 -0
  148. package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
  149. package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
  150. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
  151. package/mobile/src/components/Carousel/Carousel.tsx +6 -4
  152. package/mobile/src/components/PictureText/renderBenefit.tsx +1 -0
  153. package/mobile/src/components/ProductTile/renderBenefit.tsx +1 -0
  154. package/mobile/src/components/StepsBlock/StepsBlock.tsx +29 -5
  155. package/mobile/src/components/StepsBlock/StepsBlock.ui.json +6 -0
  156. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +13 -1
  157. package/mobile/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
  158. package/mobile/src/components/StepsBlock/renderStep.tsx +83 -0
  159. package/mobile/src/components/Tile/Tile.example.json +1 -1
  160. package/mobile/src/components/Tile/Tile.tsx +4 -4
  161. package/mobile/src/components/Tile/Tile.ui.json +7 -1
  162. package/mobile/src/components/Tile/TileContent.ts +2 -2
  163. package/package.json +1 -1
  164. package/src/components/Calculator/Rate.tsx +1 -1
  165. package/src/components/Calculator/constants.ts +2 -2
  166. package/src/components/Calculator/rangeHelpers.ts +24 -0
  167. package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
  168. package/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
  169. package/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
  170. package/src/components/Carousel/Carousel.tsx +6 -4
  171. package/src/components/PictureText/renderBenefit.tsx +1 -0
  172. package/src/components/ProductTile/renderBenefit.tsx +1 -0
  173. package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +19 -1
  174. package/src/components/StepsBlock/StepsBlock.fixture.tsx +10 -3
  175. package/src/components/StepsBlock/StepsBlock.mobile.tsx +29 -5
  176. package/src/components/StepsBlock/StepsBlock.tsx +28 -16
  177. package/src/components/StepsBlock/StepsBlock.ui.json +6 -0
  178. package/src/components/StepsBlock/StepsBlockContent.ts +13 -1
  179. package/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
  180. package/src/components/StepsBlock/renderStep.tsx +83 -0
  181. package/src/components/Tile/Tile.example.json +1 -1
  182. package/src/components/Tile/Tile.fixture.tsx +2 -2
  183. package/src/components/Tile/Tile.tsx +4 -4
  184. package/src/components/Tile/Tile.ui.json +7 -1
  185. package/src/components/Tile/TileContent.ts +2 -2
  186. package/bundle/utils/checkIsIconRenderable.d.ts +0 -2
  187. package/dist/components/StepsBlock/renderStepContent.js +0 -19
  188. package/dist/components/StepsBlock/renderStepContent.js.map +0 -1
  189. package/dist/utils/checkIsIconRenderable.d.ts +0 -2
  190. package/dist/utils/checkIsIconRenderable.js +0 -5
  191. package/dist/utils/checkIsIconRenderable.js.map +0 -1
  192. package/lib/components/StepsBlock/renderStepContent.js +0 -16
  193. package/lib/components/StepsBlock/renderStepContent.js.map +0 -1
  194. package/lib/utils/checkIsIconRenderable.d.ts +0 -2
  195. package/lib/utils/checkIsIconRenderable.js +0 -2
  196. package/lib/utils/checkIsIconRenderable.js.map +0 -1
  197. package/mobile/bundle/utils/checkIsIconRenderable.d.ts +0 -2
  198. package/mobile/dist/components/StepsBlock/renderStepContent.d.ts +0 -11
  199. package/mobile/dist/components/StepsBlock/renderStepContent.js +0 -19
  200. package/mobile/dist/components/StepsBlock/renderStepContent.js.map +0 -1
  201. package/mobile/dist/utils/checkIsIconRenderable.d.ts +0 -2
  202. package/mobile/dist/utils/checkIsIconRenderable.js +0 -5
  203. package/mobile/dist/utils/checkIsIconRenderable.js.map +0 -1
  204. package/mobile/lib/components/StepsBlock/renderStepContent.d.ts +0 -11
  205. package/mobile/lib/components/StepsBlock/renderStepContent.js +0 -16
  206. package/mobile/lib/components/StepsBlock/renderStepContent.js.map +0 -1
  207. package/mobile/lib/utils/checkIsIconRenderable.d.ts +0 -2
  208. package/mobile/lib/utils/checkIsIconRenderable.js +0 -2
  209. package/mobile/lib/utils/checkIsIconRenderable.js.map +0 -1
  210. package/mobile/src/components/StepsBlock/renderStepContent.tsx +0 -83
  211. package/mobile/src/utils/checkIsIconRenderable.tsx +0 -3
  212. package/src/components/StepsBlock/renderStepContent.tsx +0 -83
  213. package/src/utils/checkIsIconRenderable.tsx +0 -3
@@ -5,10 +5,11 @@ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
5
  import { Button } from '../../ui-kit/Button/Button';
6
6
  import { Heading } from '../../ui-kit/Heading/Heading';
7
7
  import { Img } from '../../ui-kit/Img/Img';
8
- import { checkIsIconRenderable } from '../../utils/checkIsIconRenderable';
9
8
  import { getIconWithVersion } from '../../utils/getIconWithVersion';
10
9
  import { joinList } from '../../utils/joinList';
11
- import { renderStepContent } from './renderStepContent';
10
+ import { style } from '../../utils/style';
11
+ import { checkCanRenderIcon } from './checkCanRenderIcon';
12
+ import { renderStep } from './renderStep';
12
13
  import type { Step, StepsBlockContent } from './StepsBlockContent';
13
14
  import type { StyleType } from './StepsBlockStyleMaps';
14
15
  import { STEPS_BLOCK_STYLE_MAPS } from './StepsBlockStyleMaps';
@@ -20,39 +21,50 @@ const getLineOpacity = (showLines: boolean) => (showLines ? '' : 'opacity-0');
20
21
  const getPaddingX = (steps: number) => (steps < 5 ? 'px-[88px]' : 'px-[55px]');
21
22
 
22
23
  export const StepsBlock = JSX<StepsBlockProps>(
23
- ({ className = '', showLines = true, steps = [], button, version = 'primary', ...rest }) => {
24
- const { title } = rest;
25
- const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
24
+ ({
25
+ className = '',
26
+ showLines = true,
27
+ steps = [],
28
+ button,
29
+ version = 'primary',
30
+ title,
31
+ ...rest
32
+ }) => {
26
33
  const shortGaps = steps.length > 3;
34
+
35
+ const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
36
+
27
37
  const lineOpacity = getLineOpacity(showLines);
28
- const titleMargin = title ? 'mt-9' : '';
29
38
  const paddingX = getPaddingX(steps.length);
30
39
 
31
40
  return (
32
41
  <BlockWrapper
33
- className={[
42
+ className={style(
34
43
  'box-border py-12',
35
44
  shortGaps ? 'px-20' : 'px-[70px]',
36
45
  'flex flex-col items-center overflow-hidden',
37
46
  className,
38
- ].join(' ')}
47
+ )}
39
48
  version={version}
40
49
  {...rest}
41
50
  >
42
51
  {title ? (
43
- <Heading headingType="h3" className="max-w-[752px] text-center" title={title} />
52
+ <Heading headingType="h3" className="max-w-[752px] text-center mb-9" title={title} />
44
53
  ) : null}
45
54
  {steps?.length ? (
46
- <div className={`box-border ${titleMargin}`}>
47
- <div className={`flex items-center ${paddingX}`}>
48
- {joinList(<div className={`h-0.5 w-full bg-secondary-light ${lineOpacity}`} />)(
55
+ <div className="box-border">
56
+ <div className={style('flex items-center', paddingX)}>
57
+ {joinList(<div className={style('h-0.5 w-full bg-secondary-light', lineOpacity)} />)(
49
58
  steps.map(renderStepIcon(styleMap, version)),
50
59
  )}
51
60
  </div>
52
- <div className={`flex justify-between mt-4 ${shortGaps ? 'gap-x-3' : 'gap-x-[101px]'}`}>
53
- {steps.map(
54
- renderStepContent({ styleMap, isMainButton: Boolean(button?.text), version }),
61
+ <div
62
+ className={style(
63
+ 'flex justify-between mt-4',
64
+ shortGaps ? 'gap-x-3' : 'gap-x-[101px]',
55
65
  )}
66
+ >
67
+ {steps.map(renderStep({ styleMap, isMainButton: Boolean(button?.text), version }))}
56
68
  </div>
57
69
  </div>
58
70
  ) : null}
@@ -70,7 +82,7 @@ const renderStepIcon =
70
82
  <div
71
83
  className={`h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 flex justify-center items-center ${styleMap.iconBackground}`}
72
84
  >
73
- {checkIsIconRenderable(icon) ? (
85
+ {checkCanRenderIcon(icon) ? (
74
86
  <Img image={getIconWithVersion(icon || {}, version)} width="48" height="48" asSVG />
75
87
  ) : (
76
88
  <span className={`text-h4 ${styleMap.iconText}`}>{i + 1}</span>
@@ -12,6 +12,12 @@
12
12
  "iconRight": {
13
13
  "ui:field": "icon"
14
14
  }
15
+ },
16
+ "__html": {
17
+ "ui:widget": "html"
18
+ },
19
+ "type": {
20
+ "ui:widget": "hidden"
15
21
  }
16
22
  }
17
23
  }
@@ -1,6 +1,8 @@
1
1
  import type { BlockVersion } from '../../model/BlockVersion';
2
+ import type { DefaultListItemType } from '../../model/DefaultListItemType';
2
3
  import type { DescriptionProps, HeadlineCommonProps, LabelProps } from '../../model/HeadlineType';
3
4
  import type { IconProps } from '../../model/Picture';
5
+ import type { RichTextItem } from '../../model/RichTextItem';
4
6
  import type { SizeVersion } from '../../model/SizeVersion';
5
7
  import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
6
8
 
@@ -16,10 +18,20 @@ type StepCommonProps = IconProps & {
16
18
  items?: string[];
17
19
  };
18
20
 
21
+ /**
22
+ * @title Стандартный
23
+ */
24
+ export type DefaultStep = DescriptionProps & LabelProps & StepCommonProps & DefaultListItemType;
25
+
26
+ /**
27
+ * @title Форматированный текст
28
+ */
29
+ type RichTextStep = RichTextItem & IconProps;
30
+
19
31
  /**
20
32
  * @title Шаг
21
33
  */
22
- export type Step = DescriptionProps & LabelProps & StepCommonProps;
34
+ export type Step = DefaultStep | RichTextStep;
23
35
 
24
36
  /**
25
37
  * @title Блок шаги
@@ -0,0 +1,3 @@
1
+ import type { Picture } from '../../model/Picture';
2
+
3
+ export const checkCanRenderIcon = (icon?: Picture) => Boolean(icon?.icon || icon?.src);
@@ -0,0 +1,83 @@
1
+ import type { BlockVersion } from '../../model/BlockVersion';
2
+ import type { ButtonVersion } from '../../model/ButtonVersion';
3
+ import type { VNode } from '../../model/VNode';
4
+ import { Button } from '../../ui-kit/Button/Button';
5
+ import { List } from '../../ui-kit/List/List';
6
+ import { RichText } from '../../ui-kit/RichText/RichText';
7
+ import { Text } from '../../ui-kit/Text/Text';
8
+ import { assertUnreachable } from '../../utils/assertUnreachable';
9
+ import { style } from '../../utils/style';
10
+ import type { DefaultStep, Step } from './StepsBlockContent';
11
+ import type { StyleType } from './StepsBlockStyleMaps';
12
+
13
+ interface RenderStepProps {
14
+ styleMap: StyleType;
15
+ isMainButton: boolean;
16
+ version?: BlockVersion;
17
+ }
18
+
19
+ // TODO: Create universal function for this case
20
+ export const renderStep =
21
+ (props: RenderStepProps) =>
22
+ // Linter doesn't understand that switch processes all cases
23
+ // eslint-disable-next-line consistent-return
24
+ (step: Step, i: number, arr: Step[]): VNode => {
25
+ const { type } = step;
26
+
27
+ if (!(type === 'default' || type === 'rte')) {
28
+ return null;
29
+ }
30
+
31
+ switch (type) {
32
+ case 'default':
33
+ return renderDefaultStep(props)(step, i, arr);
34
+ case 'rte':
35
+ return <RichText __html={step.__html} />;
36
+ default:
37
+ assertUnreachable(step);
38
+ }
39
+ };
40
+
41
+ const renderDefaultStep =
42
+ ({ styleMap, isMainButton, version }: RenderStepProps) =>
43
+ (step: DefaultStep, i: number, arr: Step[]) => {
44
+ const { label, description, button, items, isDotted } = step;
45
+
46
+ return (
47
+ <div
48
+ key={String(i)}
49
+ className={style(
50
+ 'relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden',
51
+ getContainerWidth(arr.length),
52
+ )}
53
+ >
54
+ <div className={style(button?.text ? 'mb-8' : '', 'text-center')}>
55
+ {label ? (
56
+ <div className="mb-2">
57
+ <Text size="text-h6">{label}</Text>
58
+ </div>
59
+ ) : null}
60
+ <div className="flex flex-col items-center">
61
+ {description ? <div className={styleMap.description}>{description}</div> : null}
62
+ <List
63
+ className={style(description ? `${styleMap.description} mt-0.5` : 'text-h6')}
64
+ items={items}
65
+ listItemSize="M"
66
+ isDotted={isDotted}
67
+ />
68
+ </div>
69
+ </div>
70
+ {button?.text && !isMainButton ? (
71
+ <Button
72
+ className="box-border py-3 h-12 w-full max-w-[240px] mt-auto"
73
+ version={version as ButtonVersion}
74
+ {...button}
75
+ >
76
+ {button?.text}
77
+ </Button>
78
+ ) : null}
79
+ </div>
80
+ );
81
+ };
82
+
83
+ const getContainerWidth = (length: number): string => (length < 5 ? 'w-[276px]' : 'w-[210px]');
@@ -2,7 +2,7 @@
2
2
  "content": {
3
3
  "title": "Плитка",
4
4
  "headingType": "h3",
5
- "description": "Описание",
5
+ "__html": "<p>Описание</p>",
6
6
  "image": {
7
7
  "format": "webp",
8
8
  "size": {
@@ -46,8 +46,8 @@ export const TILE: TileContent = {
46
46
  export const TILE_PREMIUM: TileContent = {
47
47
  title: 'Премиальные продукты',
48
48
  headingType: 'h4',
49
- description:
50
- 'Выделенные зоны обслуживания и персональный финансовый консультант. Полный спектр премиальных продуктов, подчеркивающих ваш статус',
49
+ __html:
50
+ '<p>Выделенные зоны обслуживания и персональный финансовый консультант. <strong>Полный спектр</strong> премиальных продуктов, <u>подчеркивающих</u> ваш статус</p>',
51
51
  buttons: [
52
52
  {
53
53
  href: 'https://rshb.ru',
@@ -5,7 +5,7 @@ import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
5
5
  import { Heading } from '../../ui-kit/Heading/Heading';
6
6
  import { Img } from '../../ui-kit/Img/Img';
7
7
  import { List } from '../../ui-kit/List/List';
8
- import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
8
+ import { RichText } from '../../ui-kit/RichText/RichText';
9
9
  import { Tags } from '../../ui-kit/Tags/Tags';
10
10
  import { BaseTile } from '../BaseTile/BaseTile';
11
11
  import { getTileMinHeight } from '../BaseTile/getTileMinHeight';
@@ -18,7 +18,7 @@ export const Tile = JSX<TileProps>(
18
18
  ({
19
19
  title,
20
20
  headingType = 'h3',
21
- description,
21
+ __html,
22
22
  items,
23
23
  buttons,
24
24
  image,
@@ -52,9 +52,9 @@ export const Tile = JSX<TileProps>(
52
52
  })}
53
53
  image={image?.src ? <Img className="mt-auto ml-7" image={image} /> : null}
54
54
  >
55
- {description ? (
55
+ {__html ? (
56
56
  <div className="max-w-[600px] mt-2.5">
57
- <Paragraph size="text-xl-light">{description}</Paragraph>
57
+ <RichText __html={__html} />
58
58
  </div>
59
59
  ) : null}
60
60
  {children}
@@ -1 +1,7 @@
1
- {}
1
+ {
2
+ "content": {
3
+ "__html": {
4
+ "ui:widget": "html"
5
+ }
6
+ }
7
+ }
@@ -1,17 +1,17 @@
1
1
  import type { BlockVersion } from '../../model/BlockVersion';
2
- import type { DescriptionProps } from '../../model/HeadlineType';
3
2
  import type { Picture } from '../../model/Picture';
4
3
  import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
5
4
  import type { HeadingCommonProps } from '../../ui-kit/Heading/HeadingProps';
6
5
  import type { ListContent } from '../../ui-kit/List/ListContent';
7
6
  import type { ListItemSize } from '../../ui-kit/List/ListProps';
7
+ import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
8
8
  import type { TagsContent } from '../../ui-kit/Tags/TagsContent';
9
9
 
10
10
  /**
11
11
  * @title Плитка
12
12
  */
13
13
  export type TileContent = HeadingCommonProps &
14
- DescriptionProps &
14
+ RichTextProps &
15
15
  ListContent &
16
16
  ButtonContent &
17
17
  TagsContent & {
@@ -1,2 +0,0 @@
1
- import type { Picture } from '../model/Picture';
2
- export declare const checkIsIconRenderable: (icon?: Picture) => boolean;
@@ -1,19 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.renderStepContent = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const Button_1 = require("../../ui-kit/Button/Button");
5
- const List_1 = require("../../ui-kit/List/List");
6
- const renderStepContent = ({ styleMap, isMainButton, version, }) => (step, i, { length }) => {
7
- const { label, description, button, items, isDotted } = step;
8
- const contentMarginClass = label && (description || items) ? 'mt-2' : '';
9
- return ((0, jsx_runtime_1.jsxs)("div", { className: `relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden ${getContainerWidth(length)}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: `${button?.text ? 'mb-8' : ''} text-center`, children: [renderStepLabel(label), (0, jsx_runtime_1.jsxs)("div", { className: `${contentMarginClass} flex flex-col items-center`, children: [renderStepDescription({
10
- description,
11
- className: styleMap.description,
12
- }), (0, jsx_runtime_1.jsx)(List_1.List, { className: getItemsClasses({ className: 'text-left', description, styleMap }), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
13
- };
14
- exports.renderStepContent = renderStepContent;
15
- const renderStepLabel = (label) => label ? (0, jsx_runtime_1.jsx)("div", { className: "text-h6", children: label }) : null;
16
- const renderStepDescription = ({ description, className = '', }) => (description ? (0, jsx_runtime_1.jsx)("div", { className: className, children: description }) : null);
17
- const getItemsClasses = ({ className, description, styleMap, }) => [description ? styleMap.description : 'text-h6', description ? 'mt-0.5' : '', className].join(' ');
18
- const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
19
- //# sourceMappingURL=renderStepContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderStepContent.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStepContent.tsx"],"names":[],"mappings":";;;AAGA,uDAAoD;AACpD,iDAA8C;AAIvC,MAAM,iBAAiB,GAC5B,CAAC,EACC,QAAQ,EACR,YAAY,EACZ,OAAO,GAKR,EAAE,EAAE,CACL,CAAC,IAAU,EAAE,CAAS,EAAE,EAAE,MAAM,EAAsB,EAAS,EAAE;IAC/D,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE7D,MAAM,kBAAkB,GAAG,KAAK,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzE,OAAO,CACL,iCAEE,SAAS,EAAE,uFAAuF,iBAAiB,CACjH,MAAM,CACP,EAAE,aAEH,iCAAK,SAAS,EAAE,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,eAAe,aACzD,eAAe,CAAC,KA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,CAAC,CAAC,IAAI,CAC3F,GAAG,CACJ,CAAC;AAEJ,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { Picture } from '../model/Picture';
2
- export declare const checkIsIconRenderable: (icon?: Picture) => boolean;
@@ -1,5 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.checkIsIconRenderable = void 0;
3
- const checkIsIconRenderable = (icon) => Boolean(icon?.icon || icon?.src);
4
- exports.checkIsIconRenderable = checkIsIconRenderable;
5
- //# sourceMappingURL=checkIsIconRenderable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkIsIconRenderable.js","sourceRoot":"","sources":["../../src/utils/checkIsIconRenderable.tsx"],"names":[],"mappings":";;AAEO,MAAM,qBAAqB,GAAG,CAAC,IAAc,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC;AAA7E,QAAA,qBAAqB,yBAAwD"}
@@ -1,16 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { Button } from '../../ui-kit/Button/Button.js';
3
- import { List } from '../../ui-kit/List/List.js';
4
- export const renderStepContent = ({ styleMap, isMainButton, version, }) => (step, i, { length }) => {
5
- const { label, description, button, items, isDotted } = step;
6
- const contentMarginClass = label && (description || items) ? 'mt-2' : '';
7
- return (_jsxs("div", { className: `relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden ${getContainerWidth(length)}`, children: [_jsxs("div", { className: `${button?.text ? 'mb-8' : ''} text-center`, children: [renderStepLabel(label), _jsxs("div", { className: `${contentMarginClass} flex flex-col items-center`, children: [renderStepDescription({
8
- description,
9
- className: styleMap.description,
10
- }), _jsx(List, { className: getItemsClasses({ className: 'text-left', description, styleMap }), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? (_jsx(Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
11
- };
12
- const renderStepLabel = (label) => label ? _jsx("div", { className: "text-h6", children: label }) : null;
13
- const renderStepDescription = ({ description, className = '', }) => (description ? _jsx("div", { className: className, children: description }) : null);
14
- const getItemsClasses = ({ className, description, styleMap, }) => [description ? styleMap.description : 'text-h6', description ? 'mt-0.5' : '', className].join(' ');
15
- const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
16
- //# sourceMappingURL=renderStepContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderStepContent.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStepContent.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAI9C,MAAM,CAAC,MAAM,iBAAiB,GAC5B,CAAC,EACC,QAAQ,EACR,YAAY,EACZ,OAAO,GAKR,EAAE,EAAE,CACL,CAAC,IAAU,EAAE,CAAS,EAAE,EAAE,MAAM,EAAsB,EAAS,EAAE;IAC/D,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE7D,MAAM,kBAAkB,GAAG,KAAK,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzE,OAAO,CACL,eAEE,SAAS,EAAE,uFAAuF,iBAAiB,CACjH,MAAM,CACP,EAAE,aAEH,eAAK,SAAS,EAAE,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,eAAe,aACzD,eAAe,CAAC,KAAK,CAAC,EACvB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MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { Picture } from '../model/Picture';
2
- export declare const checkIsIconRenderable: (icon?: Picture) => boolean;
@@ -1,2 +0,0 @@
1
- export const checkIsIconRenderable = (icon) => Boolean(icon?.icon || icon?.src);
2
- //# sourceMappingURL=checkIsIconRenderable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkIsIconRenderable.js","sourceRoot":"","sources":["../../src/utils/checkIsIconRenderable.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAc,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { Picture } from '../model/Picture';
2
- export declare const checkIsIconRenderable: (icon?: Picture) => boolean;
@@ -1,11 +0,0 @@
1
- import type { BlockVersion } from '../../model/BlockVersion';
2
- import type { VNode } from '../../model/VNode';
3
- import type { Step } from './StepsBlockContent';
4
- import type { StyleType } from './StepsBlockStyleMaps';
5
- export declare const renderStepContent: ({ styleMap, isMainButton, version, }: {
6
- styleMap: StyleType;
7
- isMainButton: boolean;
8
- version?: BlockVersion | undefined;
9
- }) => (step: Step, i: number, { length }: {
10
- length: number;
11
- }) => VNode;
@@ -1,19 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.renderStepContent = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const Button_1 = require("../../ui-kit/Button/Button");
5
- const List_1 = require("../../ui-kit/List/List");
6
- const renderStepContent = ({ styleMap, isMainButton, version, }) => (step, i, { length }) => {
7
- const { label, description, button, items, isDotted } = step;
8
- const contentMarginClass = label && (description || items) ? 'mt-2' : '';
9
- return ((0, jsx_runtime_1.jsxs)("div", { className: `relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden ${getContainerWidth(length)}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: `${button?.text ? 'mb-8' : ''} text-center`, children: [renderStepLabel(label), (0, jsx_runtime_1.jsxs)("div", { className: `${contentMarginClass} flex flex-col items-center`, children: [renderStepDescription({
10
- description,
11
- className: styleMap.description,
12
- }), (0, jsx_runtime_1.jsx)(List_1.List, { className: getItemsClasses({ className: 'text-left', description, styleMap }), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
13
- };
14
- exports.renderStepContent = renderStepContent;
15
- const renderStepLabel = (label) => label ? (0, jsx_runtime_1.jsx)("div", { className: "text-h6", children: label }) : null;
16
- const renderStepDescription = ({ description, className = '', }) => (description ? (0, jsx_runtime_1.jsx)("div", { className: className, children: description }) : null);
17
- const getItemsClasses = ({ className, description, styleMap, }) => [description ? styleMap.description : 'text-h6', description ? 'mt-0.5' : '', className].join(' ');
18
- const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
19
- //# sourceMappingURL=renderStepContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderStepContent.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStepContent.tsx"],"names":[],"mappings":";;;AAGA,uDAAoD;AACpD,iDAA8C;AAIvC,MAAM,iBAAiB,GAC5B,CAAC,EACC,QAAQ,EACR,YAAY,EACZ,OAAO,GAKR,EAAE,EAAE,CACL,CAAC,IAAU,EAAE,CAAS,EAAE,EAAE,MAAM,EAAsB,EAAS,EAAE;IAC/D,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE7D,MAAM,kBAAkB,GAAG,KAAK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AS,YAAG,WAAW,GAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAEnF,MAAM,eAAe,GAAG,CAAC,EACvB,SAAS,EACT,WAAW,EACX,QAAQ,GAKT,EAAU,EAAE,CACX,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,IAAI,CAC3F,GAAG,CACJ,CAAC;AAEJ,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { Picture } from '../model/Picture';
2
- export declare const checkIsIconRenderable: (icon?: Picture) => boolean;
@@ -1,5 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.checkIsIconRenderable = void 0;
3
- const checkIsIconRenderable = (icon) => Boolean(icon?.icon || icon?.src);
4
- exports.checkIsIconRenderable = checkIsIconRenderable;
5
- //# sourceMappingURL=checkIsIconRenderable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkIsIconRenderable.js","sourceRoot":"","sources":["../../src/utils/checkIsIconRenderable.tsx"],"names":[],"mappings":";;AAEO,MAAM,qBAAqB,GAAG,CAAC,IAAc,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC;AAA7E,QAAA,qBAAqB,yBAAwD"}
@@ -1,11 +0,0 @@
1
- import type { BlockVersion } from '../../model/BlockVersion';
2
- import type { VNode } from '../../model/VNode';
3
- import type { Step } from './StepsBlockContent';
4
- import type { StyleType } from './StepsBlockStyleMaps';
5
- export declare const renderStepContent: ({ styleMap, isMainButton, version, }: {
6
- styleMap: StyleType;
7
- isMainButton: boolean;
8
- version?: BlockVersion | undefined;
9
- }) => (step: Step, i: number, { length }: {
10
- length: number;
11
- }) => VNode;
@@ -1,16 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { Button } from '../../ui-kit/Button/Button.js';
3
- import { List } from '../../ui-kit/List/List.js';
4
- export const renderStepContent = ({ styleMap, isMainButton, version, }) => (step, i, { length }) => {
5
- const { label, description, button, items, isDotted } = step;
6
- const contentMarginClass = label && (description || items) ? 'mt-2' : '';
7
- return (_jsxs("div", { className: `relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden ${getContainerWidth(length)}`, children: [_jsxs("div", { className: `${button?.text ? 'mb-8' : ''} text-center`, children: [renderStepLabel(label), _jsxs("div", { className: `${contentMarginClass} flex flex-col items-center`, children: [renderStepDescription({
8
- description,
9
- className: styleMap.description,
10
- }), _jsx(List, { className: getItemsClasses({ className: 'text-left', description, styleMap }), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? (_jsx(Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
11
- };
12
- const renderStepLabel = (label) => label ? _jsx("div", { className: "text-h6", children: label }) : null;
13
- const renderStepDescription = ({ description, className = '', }) => (description ? _jsx("div", { className: className, children: description }) : null);
14
- const getItemsClasses = ({ className, description, styleMap, }) => [description ? styleMap.description : 'text-h6', description ? 'mt-0.5' : '', className].join(' ');
15
- const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
16
- //# sourceMappingURL=renderStepContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderStepContent.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStepContent.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAI9C,MAAM,CAAC,MAAM,iBA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,CAAC,CAAC,cAAK,SAAS,EAAC,SAAS,YAAE,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAExD,MAAM,qBAAqB,GAAG,CAAC,EAC7B,WAAW,EACX,SAAS,GAAG,EAAE,GAIf,EAAS,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAK,SAAS,EAAE,SAAS,YAAG,WAAW,GAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAEnF,MAAM,eAAe,GAAG,CAAC,EACvB,SAAS,EACT,WAAW,EACX,QAAQ,GAKT,EAAU,EAAE,CACX,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,IAAI,CAC3F,GAAG,CACJ,CAAC;AAEJ,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { Picture } from '../model/Picture';
2
- export declare const checkIsIconRenderable: (icon?: Picture) => boolean;
@@ -1,2 +0,0 @@
1
- export const checkIsIconRenderable = (icon) => Boolean(icon?.icon || icon?.src);
2
- //# sourceMappingURL=checkIsIconRenderable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkIsIconRenderable.js","sourceRoot":"","sources":["../../src/utils/checkIsIconRenderable.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAc,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC"}
@@ -1,83 +0,0 @@
1
- import type { BlockVersion } from '../../model/BlockVersion';
2
- import type { ButtonVersion } from '../../model/ButtonVersion';
3
- import type { VNode } from '../../model/VNode';
4
- import { Button } from '../../ui-kit/Button/Button';
5
- import { List } from '../../ui-kit/List/List';
6
- import type { Step } from './StepsBlockContent';
7
- import type { StyleType } from './StepsBlockStyleMaps';
8
-
9
- export const renderStepContent =
10
- ({
11
- styleMap,
12
- isMainButton,
13
- version,
14
- }: {
15
- styleMap: StyleType;
16
- isMainButton: boolean;
17
- version?: BlockVersion;
18
- }) =>
19
- (step: Step, i: number, { length }: { length: number }): VNode => {
20
- const { label, description, button, items, isDotted } = step;
21
-
22
- const contentMarginClass = label && (description || items) ? 'mt-2' : '';
23
-
24
- return (
25
- <div
26
- key={String(i)}
27
- className={`relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden ${getContainerWidth(
28
- length,
29
- )}`}
30
- >
31
- <div className={`${button?.text ? 'mb-8' : ''} text-center`}>
32
- {renderStepLabel(label)}
33
- <div className={`${contentMarginClass} flex flex-col items-center`}>
34
- {renderStepDescription({
35
- description,
36
- className: styleMap.description,
37
- })}
38
- <List
39
- className={getItemsClasses({ className: 'text-left', description, styleMap })}
40
- items={items}
41
- listItemSize="M"
42
- isDotted={isDotted}
43
- />
44
- </div>
45
- </div>
46
- {button?.text && !isMainButton ? (
47
- <Button
48
- className="box-border py-3 h-12 w-full max-w-[240px] mt-auto"
49
- version={version as ButtonVersion}
50
- {...button}
51
- >
52
- {button?.text}
53
- </Button>
54
- ) : null}
55
- </div>
56
- );
57
- };
58
-
59
- const renderStepLabel = (label?: string): VNode =>
60
- label ? <div className="text-h6">{label}</div> : null;
61
-
62
- const renderStepDescription = ({
63
- description,
64
- className = '',
65
- }: {
66
- description?: string;
67
- className?: string;
68
- }): VNode => (description ? <div className={className}>{description}</div> : null);
69
-
70
- const getItemsClasses = ({
71
- className,
72
- description,
73
- styleMap,
74
- }: {
75
- className?: string;
76
- description?: string;
77
- styleMap: StyleType;
78
- }): string =>
79
- [description ? styleMap.description : 'text-h6', description ? 'mt-0.5' : '', className].join(
80
- ' ',
81
- );
82
-
83
- const getContainerWidth = (length: number): string => (length < 5 ? 'w-[276px]' : 'w-[210px]');
@@ -1,3 +0,0 @@
1
- import type { Picture } from '../model/Picture';
2
-
3
- export const checkIsIconRenderable = (icon?: Picture) => Boolean(icon?.icon || icon?.src);