@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.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +21 -10
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/ExchangeRateTile/renderButton.d.ts +3 -0
- package/dist/components/ExchangeRateTile/renderButton.js +9 -0
- package/dist/components/ExchangeRateTile/renderButton.js.map +1 -0
- package/dist/components/ProductBlock/ProductBlock.js +1 -1
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +21 -8
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +3 -3
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +5 -3
- package/dist/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
- package/dist/components/StepsBlock/StepsBlockStyleMaps.js +2 -4
- package/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ExchangeRateTile/renderButton.d.ts +3 -0
- package/lib/components/ExchangeRateTile/renderButton.js +6 -0
- package/lib/components/ExchangeRateTile/renderButton.js.map +1 -0
- package/lib/components/ProductBlock/ProductBlock.js +1 -1
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.js +22 -9
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +4 -4
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +5 -3
- package/lib/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
- package/lib/components/StepsBlock/StepsBlockStyleMaps.js +1 -2
- package/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +3 -4
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ExchangeRateTile/renderButton.d.ts +3 -0
- package/mobile/dist/components/ExchangeRateTile/renderButton.js +9 -0
- package/mobile/dist/components/ExchangeRateTile/renderButton.js.map +1 -0
- package/mobile/dist/components/StepsBlock/StepsBlock.js +3 -3
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +5 -3
- package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js +2 -4
- package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/renderButton.d.ts +3 -0
- package/mobile/lib/components/ExchangeRateTile/renderButton.js +6 -0
- package/mobile/lib/components/ExchangeRateTile/renderButton.js.map +1 -0
- package/mobile/lib/components/StepsBlock/StepsBlock.js +4 -4
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +5 -3
- package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js +1 -2
- package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/mobile/src/components/ExchangeRateTile/renderButton.tsx +10 -0
- package/mobile/src/components/StepsBlock/StepsBlock.example.json +15 -0
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +4 -4
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +5 -3
- package/mobile/src/components/StepsBlock/StepsBlockStyleMaps.ts +1 -3
- package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +1 -1
- package/package.json +1 -1
- package/src/components/ExchangeRateTile/renderButton.tsx +10 -0
- package/src/components/ProductBlock/ProductBlock.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.example.json +15 -0
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +4 -3
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +4 -4
- package/src/components/StepsBlock/StepsBlock.tsx +73 -38
- package/src/components/StepsBlock/StepsBlockContent.ts +5 -3
- package/src/components/StepsBlock/StepsBlockStyleMaps.ts +1 -3
- 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;
|
|
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 {
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
@@ -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: 'Войти в интернет-банк'
|
|
47
|
+
button: { text: 'Войти в интернет-банк' },
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
label: 'Через Госуслуги',
|
|
50
51
|
description: 'При наличии данных в Единой биометрической системе',
|
|
51
52
|
icon: { icon: 'ClockIcon' },
|
|
52
|
-
button: { text: 'Оформить'
|
|
53
|
+
button: { text: 'Оформить' },
|
|
53
54
|
},
|
|
54
55
|
{
|
|
55
56
|
label: 'В офисах Россельхозбанка',
|
|
56
57
|
description: 'Откройте вклад',
|
|
57
58
|
icon: { icon: 'ComfortableCompIcon' },
|
|
58
|
-
button: { text: 'Офисы на карте'
|
|
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 {
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 {
|
|
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
|
|
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
|
|
29
|
-
const
|
|
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=
|
|
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
|
|
59
|
-
{steps.map(
|
|
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
|
|
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
|
|
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 =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
104
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
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 "
|