@redneckz/wildless-cms-uni-blocks 0.3.92 → 0.3.93

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 (66) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +21 -10
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/ExchangeRateTile/renderButton.d.ts +3 -0
  5. package/dist/components/ExchangeRateTile/renderButton.js +9 -0
  6. package/dist/components/ExchangeRateTile/renderButton.js.map +1 -0
  7. package/dist/components/ProductBlock/ProductBlock.js +1 -1
  8. package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  9. package/dist/components/StepsBlock/StepsBlock.js +21 -8
  10. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  11. package/dist/components/StepsBlock/StepsBlock.mobile.js +3 -3
  12. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  13. package/dist/components/StepsBlock/StepsBlockContent.d.ts +5 -3
  14. package/dist/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
  15. package/dist/components/StepsBlock/StepsBlockStyleMaps.js +2 -4
  16. package/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  17. package/lib/common.css +1 -1
  18. package/lib/components/ExchangeRateTile/renderButton.d.ts +3 -0
  19. package/lib/components/ExchangeRateTile/renderButton.js +6 -0
  20. package/lib/components/ExchangeRateTile/renderButton.js.map +1 -0
  21. package/lib/components/ProductBlock/ProductBlock.js +1 -1
  22. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  23. package/lib/components/StepsBlock/StepsBlock.js +22 -9
  24. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  25. package/lib/components/StepsBlock/StepsBlock.mobile.js +4 -4
  26. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  27. package/lib/components/StepsBlock/StepsBlockContent.d.ts +5 -3
  28. package/lib/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
  29. package/lib/components/StepsBlock/StepsBlockStyleMaps.js +1 -2
  30. package/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  31. package/mobile/bundle/bundle.umd.js +3 -4
  32. package/mobile/bundle/bundle.umd.min.js +1 -1
  33. package/mobile/dist/components/ExchangeRateTile/renderButton.d.ts +3 -0
  34. package/mobile/dist/components/ExchangeRateTile/renderButton.js +9 -0
  35. package/mobile/dist/components/ExchangeRateTile/renderButton.js.map +1 -0
  36. package/mobile/dist/components/StepsBlock/StepsBlock.js +3 -3
  37. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  38. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +5 -3
  39. package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
  40. package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js +2 -4
  41. package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  42. package/mobile/lib/components/ExchangeRateTile/renderButton.d.ts +3 -0
  43. package/mobile/lib/components/ExchangeRateTile/renderButton.js +6 -0
  44. package/mobile/lib/components/ExchangeRateTile/renderButton.js.map +1 -0
  45. package/mobile/lib/components/StepsBlock/StepsBlock.js +4 -4
  46. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  47. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +5 -3
  48. package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
  49. package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js +1 -2
  50. package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  51. package/mobile/src/components/ExchangeRateTile/renderButton.tsx +10 -0
  52. package/mobile/src/components/StepsBlock/StepsBlock.example.json +15 -0
  53. package/mobile/src/components/StepsBlock/StepsBlock.tsx +4 -4
  54. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +5 -3
  55. package/mobile/src/components/StepsBlock/StepsBlockStyleMaps.ts +1 -3
  56. package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +1 -1
  57. package/package.json +1 -1
  58. package/src/components/ExchangeRateTile/renderButton.tsx +10 -0
  59. package/src/components/ProductBlock/ProductBlock.tsx +1 -1
  60. package/src/components/StepsBlock/StepsBlock.example.json +15 -0
  61. package/src/components/StepsBlock/StepsBlock.fixture.tsx +4 -3
  62. package/src/components/StepsBlock/StepsBlock.mobile.tsx +4 -4
  63. package/src/components/StepsBlock/StepsBlock.tsx +73 -38
  64. package/src/components/StepsBlock/StepsBlockContent.ts +5 -3
  65. package/src/components/StepsBlock/StepsBlockStyleMaps.ts +1 -3
  66. package/src/components/__snapshots__/Blocks.spec.tsx.snap +1 -1
@@ -1,4 +1,4 @@
1
- const STEPS_BLOCK_STYLE_MAPS = {
1
+ export const STEPS_BLOCK_STYLE_MAPS = {
2
2
  primary: {
3
3
  background: 'bg-white',
4
4
  title: 'text-primary-text',
@@ -16,5 +16,4 @@ const STEPS_BLOCK_STYLE_MAPS = {
16
16
  iconConnector: 'bg-white',
17
17
  },
18
18
  };
19
- export const getStyleMap = (version) => STEPS_BLOCK_STYLE_MAPS[version];
20
19
  //# sourceMappingURL=StepsBlockStyleMaps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepsBlockStyleMaps.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlockStyleMaps.ts"],"names":[],"mappings":"AAWA,MAAM,sBAAsB,GAAoC;IAC9D,OAAO,EAAE;QACP,UAAU,EAAE,UAAU;QACtB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,qBAAqB;QAClC,QAAQ,EAAE,qBAAqB;QAC/B,cAAc,EAAE,iBAAiB;QACjC,aAAa,EAAE,oBAAoB;KACpC;IACD,SAAS,EAAE;QACT,UAAU,EAAE,iBAAiB;QAC7B,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,eAAe;QAC5B,QAAQ,EAAE,YAAY;QACtB,cAAc,EAAE,aAAa;QAC7B,aAAa,EAAE,UAAU;KAC1B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAqB,EAAa,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"StepsBlockStyleMaps.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlockStyleMaps.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,sBAAsB,GAAoC;IACrE,OAAO,EAAE;QACP,UAAU,EAAE,UAAU;QACtB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,qBAAqB;QAClC,QAAQ,EAAE,qBAAqB;QAC/B,cAAc,EAAE,iBAAiB;QACjC,aAAa,EAAE,oBAAoB;KACpC;IACD,SAAS,EAAE;QACT,UAAU,EAAE,iBAAiB;QAC7B,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,eAAe;QAC5B,QAAQ,EAAE,YAAY;QACtB,cAAc,EAAE,aAAa;QAC7B,aAAa,EAAE,UAAU;KAC1B;CACF,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { Button } from '../../ui-kit/Button/Button';
2
+ import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
3
+
4
+ export function renderButton(button: ButtonProps) {
5
+ return (
6
+ <Button className="py-4 mr-1" version={button?.version} href={button?.href} target="_blank">
7
+ {button?.text}
8
+ </Button>
9
+ );
10
+ }
@@ -14,6 +14,11 @@
14
14
  "height": 48
15
15
  },
16
16
  "format": "webp"
17
+ },
18
+ "button": {
19
+ "text": "Кнопка",
20
+ "target": "_blank",
21
+ "version": "primary"
17
22
  }
18
23
  },
19
24
  {
@@ -25,6 +30,11 @@
25
30
  "height": 48
26
31
  },
27
32
  "format": "webp"
33
+ },
34
+ "button": {
35
+ "text": "Кнопка",
36
+ "target": "_blank",
37
+ "version": "primary"
28
38
  }
29
39
  },
30
40
  {
@@ -36,6 +46,11 @@
36
46
  "height": 48
37
47
  },
38
48
  "format": "webp"
49
+ },
50
+ "button": {
51
+ "text": "Кнопка",
52
+ "target": "_blank",
53
+ "version": "primary"
39
54
  }
40
55
  }
41
56
  ],
@@ -6,7 +6,7 @@ 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
8
  import { checkIsIconRenderable } from '../../utils/checkIsIconRenderable';
9
- import { getStyleMap } from './StepsBlockStyleMaps';
9
+ import { STEPS_BLOCK_STYLE_MAPS } from './StepsBlockStyleMaps';
10
10
 
11
11
  export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
12
12
 
@@ -30,7 +30,7 @@ export const StepsBlock = JSX<StepsBlockProps>(
30
30
  size = 'normal',
31
31
  version = 'primary',
32
32
  }) => {
33
- const styleMap = getStyleMap(version);
33
+ const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
34
34
 
35
35
  return (
36
36
  <section
@@ -62,7 +62,7 @@ const renderStepTitle =
62
62
  (step: Step, i: number, steps: Step[]) => {
63
63
  const isLastStep = steps.length - 1 === i;
64
64
  const margin = size === 'normal' ? 'ml-[34px]' : 'ml-6';
65
- const styleMap = getStyleMap(version);
65
+ const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
66
66
 
67
67
  return (
68
68
  <div key={String(i)}>
@@ -93,7 +93,7 @@ const renderStepTitle =
93
93
  };
94
94
 
95
95
  const renderIconArea = (size: SizeVersion, version: BlockVersion) => (step: Step, i: number) => {
96
- const styleMap = getStyleMap(version);
96
+ const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
97
97
  const iconAreaSize = STEPS_SIZE_MAP[size];
98
98
 
99
99
  const iconSize = size === 'normal' ? '38' : '27';
@@ -1,7 +1,7 @@
1
1
  import type { BlockVersion } from '../../model/BlockVersion';
2
2
  import type { Picture } from '../../model/Picture';
3
3
  import type { SizeVersion } from '../../model/SizeVersion';
4
- import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
4
+ import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
5
5
 
6
6
  /**
7
7
  * @title Шаг
@@ -23,7 +23,8 @@ export interface Step {
23
23
  * }
24
24
  */
25
25
  icon?: Picture;
26
- button?: ButtonProps;
26
+ /** @title Кнопка */
27
+ button?: ButtonWithIconProps;
27
28
  }
28
29
 
29
30
  /**
@@ -45,7 +46,8 @@ export interface StepsBlockContent {
45
46
  * @maxItems 4
46
47
  */
47
48
  steps?: Step[];
48
- button?: ButtonProps;
49
+ /** @title Кнопка */
50
+ button?: ButtonWithIconProps;
49
51
  /**
50
52
  * @title Размер шагов (моб.)
51
53
  * @default normal
@@ -9,7 +9,7 @@ export type StyleType = {
9
9
  iconConnector: string;
10
10
  };
11
11
 
12
- const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
12
+ export const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
13
13
  primary: {
14
14
  background: 'bg-white',
15
15
  title: 'text-primary-text',
@@ -27,5 +27,3 @@ const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
27
27
  iconConnector: 'bg-white',
28
28
  },
29
29
  };
30
-
31
- export const getStyleMap = (version: BlockVersion): StyleType => STEPS_BLOCK_STYLE_MAPS[version];
@@ -693,7 +693,7 @@ exports[`Blocks Placeholder should render block "Placeholder" without content 1`
693
693
 
694
694
  exports[`Blocks ProductBlock should render block "ProductBlock" without content 1`] = `
695
695
  <section
696
- class="font-sans overflow-hidden p-[50px] box-border min-h-[528px] bg-white text-primary-text "
696
+ class="font-sans overflow-hidden p-[50px] flex flex-col box-border min-h-[528px] bg-white text-primary-text "
697
697
  >
698
698
  <div
699
699
  class="flex grow justify-between items-stretch h-full "
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.3.92",
3
+ "version": "0.3.93",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -0,0 +1,10 @@
1
+ import { Button } from '../../ui-kit/Button/Button';
2
+ import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
3
+
4
+ export function renderButton(button: ButtonProps) {
5
+ return (
6
+ <Button className="py-4 mr-1" version={button?.version} href={button?.href} target="_blank">
7
+ {button?.text}
8
+ </Button>
9
+ );
10
+ }
@@ -36,7 +36,7 @@ export const ProductBlock = JSX<ProductBlockProps>((props) => {
36
36
  return (
37
37
  <BlockWrapper
38
38
  context={context}
39
- className={`font-sans overflow-hidden p-[50px] box-border min-h-[528px] ${productBlockStyleMap[version]} ${className}`}
39
+ className={`font-sans overflow-hidden p-[50px] flex flex-col box-border min-h-[528px] ${productBlockStyleMap[version]} ${className}`}
40
40
  {...otherProps}
41
41
  >
42
42
  {backwardButton?.text
@@ -14,6 +14,11 @@
14
14
  "height": 48
15
15
  },
16
16
  "format": "webp"
17
+ },
18
+ "button": {
19
+ "text": "Кнопка",
20
+ "target": "_blank",
21
+ "version": "primary"
17
22
  }
18
23
  },
19
24
  {
@@ -25,6 +30,11 @@
25
30
  "height": 48
26
31
  },
27
32
  "format": "webp"
33
+ },
34
+ "button": {
35
+ "text": "Кнопка",
36
+ "target": "_blank",
37
+ "version": "primary"
28
38
  }
29
39
  },
30
40
  {
@@ -36,6 +46,11 @@
36
46
  "height": 48
37
47
  },
38
48
  "format": "webp"
49
+ },
50
+ "button": {
51
+ "text": "Кнопка",
52
+ "target": "_blank",
53
+ "version": "primary"
39
54
  }
40
55
  }
41
56
  ],
@@ -28,6 +28,7 @@ export default {
28
28
  context={context}
29
29
  title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
30
30
  steps={steps.slice(0, 3)}
31
+ version="secondary"
31
32
  />
32
33
  </div>
33
34
  ),
@@ -43,19 +44,19 @@ export default {
43
44
  label: 'В мобильном приложении или интернет-банке',
44
45
  description: 'Для всех клиентов Россельхозбанка',
45
46
  icon: { icon: 'SignDocsIcon' },
46
- button: { text: 'Войти в интернет-банк', href: 'https://www.rshb.ru/' },
47
+ button: { text: 'Войти в интернет-банк' },
47
48
  },
48
49
  {
49
50
  label: 'Через Госуслуги',
50
51
  description: 'При наличии данных в Единой биометрической системе',
51
52
  icon: { icon: 'ClockIcon' },
52
- button: { text: 'Оформить', href: 'https://www.rshb.ru/' },
53
+ button: { text: 'Оформить' },
53
54
  },
54
55
  {
55
56
  label: 'В офисах Россельхозбанка',
56
57
  description: 'Откройте вклад',
57
58
  icon: { icon: 'ComfortableCompIcon' },
58
- button: { text: 'Офисы на карте', href: 'https://www.rshb.ru/' },
59
+ button: { text: 'Офисы на карте' },
59
60
  },
60
61
  ]}
61
62
  />
@@ -6,7 +6,7 @@ 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
8
  import { checkIsIconRenderable } from '../../utils/checkIsIconRenderable';
9
- import { getStyleMap } from './StepsBlockStyleMaps';
9
+ import { STEPS_BLOCK_STYLE_MAPS } from './StepsBlockStyleMaps';
10
10
 
11
11
  export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
12
12
 
@@ -30,7 +30,7 @@ export const StepsBlock = JSX<StepsBlockProps>(
30
30
  size = 'normal',
31
31
  version = 'primary',
32
32
  }) => {
33
- const styleMap = getStyleMap(version);
33
+ const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
34
34
 
35
35
  return (
36
36
  <section
@@ -62,7 +62,7 @@ const renderStepTitle =
62
62
  (step: Step, i: number, steps: Step[]) => {
63
63
  const isLastStep = steps.length - 1 === i;
64
64
  const margin = size === 'normal' ? 'ml-[34px]' : 'ml-6';
65
- const styleMap = getStyleMap(version);
65
+ const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
66
66
 
67
67
  return (
68
68
  <div key={String(i)}>
@@ -93,7 +93,7 @@ const renderStepTitle =
93
93
  };
94
94
 
95
95
  const renderIconArea = (size: SizeVersion, version: BlockVersion) => (step: Step, i: number) => {
96
- const styleMap = getStyleMap(version);
96
+ const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
97
97
  const iconAreaSize = STEPS_SIZE_MAP[size];
98
98
 
99
99
  const iconSize = size === 'normal' ? '38' : '27';
@@ -1,5 +1,8 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useLink } from '../../hooks/useLink';
2
3
  import type { UniBlockProps } from '../../types';
4
+ import type { HandlerDecorator, Router } from '../ContentPage/ContentPageContext';
5
+ import type { BlockVersion } from '../../model/BlockVersion';
3
6
  import { Button } from '../../ui-kit/Button/Button';
4
7
  import { Heading } from '../../ui-kit/Heading/Heading';
5
8
  import { Img } from '../../ui-kit/Img/Img';
@@ -7,26 +10,32 @@ import { checkIsIconRenderable } from '../../utils/checkIsIconRenderable';
7
10
  import { joinList } from '../../utils/joinList';
8
11
  import type { Step, StepsBlockContent } from './StepsBlockContent';
9
12
  import type { StyleType } from './StepsBlockStyleMaps';
10
- import { getStyleMap } from './StepsBlockStyleMaps';
13
+ import { STEPS_BLOCK_STYLE_MAPS } from './StepsBlockStyleMaps';
11
14
 
12
15
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
13
16
 
14
17
  export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
15
18
 
19
+ const getLineOpacity = (showLines: boolean) => (showLines ? '' : 'opacity-0');
20
+
16
21
  export const StepsBlock = JSX<StepsBlockProps>(
17
22
  ({
18
23
  className = '',
19
- title,
20
24
  showLines = true,
21
25
  steps = [],
22
26
  button,
23
27
  version = 'primary',
28
+ context,
24
29
  ...rest
25
30
  }) => {
26
- const styleMap = getStyleMap(version);
31
+ const router = context.useRouter();
32
+ const { handlerDecorator } = context;
33
+
34
+ const { title } = rest;
35
+ const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
27
36
  const shortGaps = steps.length > 3;
28
- const stepGap = shortGaps ? 'gap-x-3' : 'gap-x-[101px]';
29
- const lineOpacity = showLines ? '' : 'opacity-0';
37
+ const lineOpacity = getLineOpacity(showLines);
38
+ const titleMargin = title ? 'mt-9' : '';
30
39
 
31
40
  return (
32
41
  <BlockWrapper
@@ -38,30 +47,38 @@ export const StepsBlock = JSX<StepsBlockProps>(
38
47
  styleMap.title,
39
48
  className,
40
49
  ].join(' ')}
50
+ context={context}
41
51
  {...rest}
42
52
  >
43
53
  {title ? (
44
- <Heading
45
- headingType="h3"
46
- as="h2"
47
- className="max-w-[47rem] text-center mb-9"
48
- title={title}
49
- />
54
+ <Heading headingType="h2" className="max-w-[752px] text-center" title={title} />
50
55
  ) : null}
51
56
  {steps?.length ? (
52
- <div className="box-border">
57
+ <div className={`box-border ${titleMargin}`}>
53
58
  <div className="flex items-center px-[88px]">
54
59
  {joinList(<div className={`h-0.5 w-full bg-secondary-light ${lineOpacity}`} />)(
55
60
  steps.map(renderStepIcon(styleMap)),
56
61
  )}
57
62
  </div>
58
- <div className={`flex justify-between whitespace-pre-line ${stepGap}`}>
59
- {steps.map(renderStepTitle(styleMap, Boolean(button?.text)))}
63
+ <div className={`flex justify-between ${shortGaps ? 'gap-x-3' : 'gap-x-[101px]'}`}>
64
+ {steps.map(
65
+ renderStepTitle({
66
+ styleMap,
67
+ isMainButton: Boolean(button?.text),
68
+ version,
69
+ router,
70
+ handlerDecorator,
71
+ }),
72
+ )}
60
73
  </div>
61
74
  </div>
62
75
  ) : null}
63
76
  {button?.text ? (
64
- <Button className="mt-8 w-full max-w-[240px]" version="primary" {...button} />
77
+ <Button
78
+ className="mt-8 w-full max-w-[240px]"
79
+ version="primary"
80
+ {...useLink({ router, handlerDecorator }, button)}
81
+ />
65
82
  ) : null}
66
83
  </BlockWrapper>
67
84
  );
@@ -74,7 +91,8 @@ const renderStepIcon =
74
91
  return (
75
92
  <div key={String(i)} className="flex flex-col items-center text-center">
76
93
  <div
77
- 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}`}
94
+ className={`h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10
95
+ ${styleMap.iconBackground} ${styleMap.title}`}
78
96
  >
79
97
  {checkIsIconRenderable(icon) ? (
80
98
  <Img image={icon} width="48" height="48" asSVG />
@@ -86,29 +104,46 @@ const renderStepIcon =
86
104
  );
87
105
  };
88
106
 
89
- const renderStepTitle = (styleMap: StyleType, isMainButton: boolean) => (step: Step, i: number) => {
90
- return (
91
- <div
92
- key={String(i)}
93
- className="flex flex-col items-center justify-between text-center w-[276px] overflow-hidden"
94
- >
95
- <div>
96
- {step.label ? <div className="text-xl m-0 mt-4">{step.label}</div> : null}
97
- {step.description ? (
98
- <div className={`text-l ${styleMap.description} ${step.label ? 'mt-2' : 'mt-4'}`}>
107
+ const renderStepTitle =
108
+ ({
109
+ styleMap,
110
+ isMainButton,
111
+ version,
112
+ router,
113
+ handlerDecorator,
114
+ }: {
115
+ styleMap: StyleType;
116
+ isMainButton: boolean;
117
+ version: BlockVersion;
118
+ router: Router;
119
+ handlerDecorator?: HandlerDecorator;
120
+ }) =>
121
+ (step: Step, i: number) => {
122
+ const additionalMarginClass = step?.label ? 'mt-2' : 'mt-4';
123
+
124
+ return (
125
+ <div
126
+ key={String(i)}
127
+ className="flex flex-col items-center justify-between text-center relative w-[276px]
128
+ whitespace-pre-line overflow-hidden"
129
+ >
130
+ {step?.label ? (
131
+ <div className="font-normal text-xl-light m-0 mt-4">{step.label}</div>
132
+ ) : null}
133
+ {step?.description ? (
134
+ <div className={`font-light text-base ${styleMap.description} ${additionalMarginClass}`}>
99
135
  {step.description}
100
136
  </div>
101
137
  ) : null}
138
+ {step.button?.text && !isMainButton ? (
139
+ <Button
140
+ className="box-border mt-8 py-3 h-12 w-full max-w-[240px]"
141
+ {...useLink({ router, handlerDecorator }, step.button)}
142
+ version={version}
143
+ >
144
+ {step.button.text}
145
+ </Button>
146
+ ) : null}
102
147
  </div>
103
- {step?.button?.text && !isMainButton ? (
104
- <Button
105
- className="mt-8 py-4 w-full max-w-[240px]"
106
- version="primary"
107
- href={step?.button?.href}
108
- >
109
- {step.button.text}
110
- </Button>
111
- ) : null}
112
- </div>
113
- );
114
- };
148
+ );
149
+ };
@@ -1,7 +1,7 @@
1
1
  import type { BlockVersion } from '../../model/BlockVersion';
2
2
  import type { Picture } from '../../model/Picture';
3
3
  import type { SizeVersion } from '../../model/SizeVersion';
4
- import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
4
+ import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
5
5
 
6
6
  /**
7
7
  * @title Шаг
@@ -23,7 +23,8 @@ export interface Step {
23
23
  * }
24
24
  */
25
25
  icon?: Picture;
26
- button?: ButtonProps;
26
+ /** @title Кнопка */
27
+ button?: ButtonWithIconProps;
27
28
  }
28
29
 
29
30
  /**
@@ -45,7 +46,8 @@ export interface StepsBlockContent {
45
46
  * @maxItems 4
46
47
  */
47
48
  steps?: Step[];
48
- button?: ButtonProps;
49
+ /** @title Кнопка */
50
+ button?: ButtonWithIconProps;
49
51
  /**
50
52
  * @title Размер шагов (моб.)
51
53
  * @default normal
@@ -9,7 +9,7 @@ export type StyleType = {
9
9
  iconConnector: string;
10
10
  };
11
11
 
12
- const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
12
+ export const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
13
13
  primary: {
14
14
  background: 'bg-white',
15
15
  title: 'text-primary-text',
@@ -27,5 +27,3 @@ const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
27
27
  iconConnector: 'bg-white',
28
28
  },
29
29
  };
30
-
31
- export const getStyleMap = (version: BlockVersion): StyleType => STEPS_BLOCK_STYLE_MAPS[version];
@@ -693,7 +693,7 @@ exports[`Blocks Placeholder should render block "Placeholder" without content 1`
693
693
 
694
694
  exports[`Blocks ProductBlock should render block "ProductBlock" without content 1`] = `
695
695
  <section
696
- class="font-sans overflow-hidden p-[50px] box-border min-h-[528px] bg-white text-primary-text "
696
+ class="font-sans overflow-hidden p-[50px] flex flex-col box-border min-h-[528px] bg-white text-primary-text "
697
697
  >
698
698
  <div
699
699
  class="flex grow justify-between items-stretch h-full "