@redneckz/wildless-cms-uni-blocks 0.14.530 → 0.14.532
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/bin/migration-scripts/0.14.519.js +13 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +8 -11
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +3 -7
- package/bundle/components/StepsBlock/renderStepMobile.d.ts +4 -0
- package/dist/components/ContactsBlock/ContactsBlock.js +2 -2
- package/dist/components/ContactsBlock/ContactsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +6 -9
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +5 -26
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -7
- package/dist/components/StepsBlock/renderStepMobile.d.ts +4 -0
- package/dist/components/StepsBlock/renderStepMobile.js +48 -0
- package/dist/components/StepsBlock/renderStepMobile.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ContactsBlock/ContactsBlock.js +2 -2
- package/lib/components/ContactsBlock/ContactsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.fixture.mobile.d.ts +1 -0
- package/lib/components/StepsBlock/StepsBlock.js +7 -10
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +5 -26
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -7
- package/lib/components/StepsBlock/renderStepMobile.d.ts +3 -0
- package/lib/components/StepsBlock/renderStepMobile.js +45 -0
- package/lib/components/StepsBlock/renderStepMobile.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +41 -22
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +3 -7
- package/mobile/bundle/components/StepsBlock/renderStepMobile.d.ts +4 -0
- package/mobile/dist/components/ContactsBlock/ContactsBlock.js +2 -2
- package/mobile/dist/components/ContactsBlock/ContactsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +5 -26
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -7
- package/mobile/dist/components/StepsBlock/renderStepMobile.d.ts +4 -0
- package/mobile/dist/components/StepsBlock/renderStepMobile.js +48 -0
- package/mobile/dist/components/StepsBlock/renderStepMobile.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ContactsBlock/ContactsBlock.js +2 -2
- package/mobile/lib/components/ContactsBlock/ContactsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +5 -26
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -7
- package/mobile/lib/components/StepsBlock/renderStepMobile.d.ts +4 -0
- package/mobile/lib/components/StepsBlock/renderStepMobile.js +45 -0
- package/mobile/lib/components/StepsBlock/renderStepMobile.js.map +1 -0
- package/mobile/src/components/ContactsBlock/ContactsBlock.tsx +4 -2
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +24 -112
- package/mobile/src/components/StepsBlock/StepsBlock.ui.json +3 -0
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +3 -6
- package/mobile/src/components/StepsBlock/renderStepMobile.tsx +139 -0
- package/package.json +1 -1
- package/src/components/ContactsBlock/ContactsBlock.tsx +4 -2
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +44 -8
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +0 -1
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +24 -112
- package/src/components/StepsBlock/StepsBlock.tsx +8 -19
- package/src/components/StepsBlock/StepsBlock.ui.json +3 -0
- package/src/components/StepsBlock/StepsBlockContent.ts +3 -6
- package/src/components/StepsBlock/renderStepMobile.tsx +139 -0
|
@@ -1,32 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { type BlockVersion } from '../../model/BlockVersion';
|
|
3
|
-
import { type SizeVersion } from '../../model/SizeVersion';
|
|
4
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
|
-
import { Img } from '../../ui-kit/Img/Img';
|
|
6
3
|
import { renderButtonsSection } from '../../ui-kit/LinkButton/renderButtonsSection';
|
|
7
|
-
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
8
|
-
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
9
4
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
10
|
-
import { isIcon } from '../../utils/isIcon';
|
|
11
5
|
import { style } from '../../utils/style';
|
|
12
6
|
import { Headline } from '../Headline/Headline';
|
|
13
|
-
import {
|
|
14
|
-
import { type
|
|
15
|
-
import { STEPS_BLOCK_STYLE } from './StepsBlockStyleMaps';
|
|
16
|
-
|
|
17
|
-
type StepIconVersion = Record<'icon' | 'image', string>;
|
|
18
|
-
|
|
19
|
-
const STEPS_SIZE_MAP: Record<SizeVersion, StepIconVersion> = {
|
|
20
|
-
normal: { icon: 'h-11 w-11', image: 'h-14 w-14' },
|
|
21
|
-
small: { icon: 'h-12 w-12', image: 'h-14 w-14' },
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const STEPS_TILE_DESCRIPTION_HEIGHT_MAP: Record<SizeVersion, string> = {
|
|
25
|
-
normal: '',
|
|
26
|
-
small: 'min-h-6xl',
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const styleMap = STEPS_BLOCK_STYLE;
|
|
7
|
+
import { renderStepMobile } from './renderStepMobile';
|
|
8
|
+
import { type StepsBlockContent } from './StepsBlockContent';
|
|
30
9
|
|
|
31
10
|
export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
|
|
32
11
|
|
|
@@ -35,102 +14,35 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
35
14
|
className = '',
|
|
36
15
|
title,
|
|
37
16
|
description,
|
|
38
|
-
steps,
|
|
17
|
+
steps = [],
|
|
39
18
|
buttons,
|
|
40
|
-
size = 'normal',
|
|
41
19
|
stepVersion = 'gray',
|
|
42
20
|
version = 'primary',
|
|
43
21
|
...rest
|
|
44
|
-
}) =>
|
|
45
|
-
|
|
46
|
-
className={style('box-border flex flex-col gap-xl', className)}
|
|
47
|
-
defaultPadding="p-6xl"
|
|
48
|
-
version={version}
|
|
49
|
-
{...rest}
|
|
50
|
-
>
|
|
51
|
-
<Headline
|
|
52
|
-
title={title}
|
|
53
|
-
description={description}
|
|
54
|
-
headlineVersion="M"
|
|
55
|
-
isEmbedded={true}
|
|
56
|
-
align="text-left"
|
|
57
|
-
/>
|
|
58
|
-
{steps?.length ? (
|
|
59
|
-
<div className="box-border">
|
|
60
|
-
<div className="flex flex-col gap-6xl justify-between">
|
|
61
|
-
{steps.map(renderStep(size, stepVersion))}
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
) : null}
|
|
65
|
-
{renderButtonsSection(buttons, { isVertical: true })}
|
|
66
|
-
</BlockWrapper>
|
|
67
|
-
),
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
// TODO: Create universal function for this case
|
|
71
|
-
const renderStep = (size: SizeVersion, stepVersion: BlockVersion) => (step: StepProps, i: number) =>
|
|
72
|
-
(
|
|
73
|
-
<div key={String(i)} className="contents">
|
|
74
|
-
<div className="flex flex-row items-center relative">
|
|
75
|
-
<div className="overflow-hidden flex flex-shrink-0 items-center">
|
|
76
|
-
{renderIconArea(size, stepVersion)(step, i)}
|
|
77
|
-
</div>
|
|
78
|
-
<div
|
|
79
|
-
className={style(
|
|
80
|
-
'flex flex-col justify-center h-fit',
|
|
81
|
-
STEPS_TILE_DESCRIPTION_HEIGHT_MAP[size],
|
|
82
|
-
)}
|
|
83
|
-
>
|
|
84
|
-
{step.label ? (
|
|
85
|
-
<Paragraph size="text-l" align="text-left">
|
|
86
|
-
{step.label}
|
|
87
|
-
</Paragraph>
|
|
88
|
-
) : null}
|
|
89
|
-
{step.description ? (
|
|
90
|
-
<div className={style('text-s font-light text-left', styleMap.description)}>
|
|
91
|
-
{step.description}
|
|
92
|
-
</div>
|
|
93
|
-
) : null}
|
|
94
|
-
<RichText __html={step.__html} />
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
const renderIconArea =
|
|
101
|
-
(size: SizeVersion, stepVersion: BlockVersion) => (step: StepProps, i: number) => {
|
|
102
|
-
const iconVersion = stepVersion === 'secondary' ? 'white' : 'color';
|
|
103
|
-
const isImg = Boolean(step?.icon?.src);
|
|
104
|
-
const iconAreaSize = STEPS_SIZE_MAP[size][isImg ? 'image' : 'icon'];
|
|
105
|
-
const containerVersion = isImg ? stepVersion === 'transparent' : stepVersion;
|
|
22
|
+
}) => {
|
|
23
|
+
const isBigSizeSteps = steps.length > 3;
|
|
106
24
|
|
|
107
25
|
return (
|
|
108
26
|
<BlockWrapper
|
|
109
|
-
className={style(
|
|
110
|
-
defaultPadding=""
|
|
111
|
-
version={
|
|
27
|
+
className={style('box-border flex flex-col gap-xl', className)}
|
|
28
|
+
defaultPadding="p-6xl"
|
|
29
|
+
version={version}
|
|
30
|
+
{...rest}
|
|
112
31
|
>
|
|
113
|
-
<
|
|
114
|
-
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
)}
|
|
127
|
-
>
|
|
128
|
-
{i + 1}
|
|
129
|
-
</span>
|
|
130
|
-
)}
|
|
131
|
-
</span>
|
|
32
|
+
<Headline
|
|
33
|
+
title={title}
|
|
34
|
+
description={description}
|
|
35
|
+
headlineVersion="M"
|
|
36
|
+
isEmbedded={true}
|
|
37
|
+
align="text-left"
|
|
38
|
+
/>
|
|
39
|
+
{steps?.length ? (
|
|
40
|
+
<div className="flex flex-col gap-6xl justify-between box-border">
|
|
41
|
+
{steps.map(renderStepMobile(isBigSizeSteps, version, stepVersion))}
|
|
42
|
+
</div>
|
|
43
|
+
) : null}
|
|
44
|
+
{renderButtonsSection(buttons, { isVertical: true })}
|
|
132
45
|
</BlockWrapper>
|
|
133
46
|
);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const getIconSizeStyle = (size: string) => (size === 'normal' ? '38' : '24');
|
|
47
|
+
},
|
|
48
|
+
);
|
|
@@ -11,7 +11,7 @@ import { joinList } from '../../utils/joinList';
|
|
|
11
11
|
import { style } from '../../utils/style';
|
|
12
12
|
import { Headline } from '../Headline/Headline';
|
|
13
13
|
import { getIconTextStyle } from './getIconTextStyle';
|
|
14
|
-
import { renderStep
|
|
14
|
+
import { renderStep } from './renderStep';
|
|
15
15
|
import { type StepProps, type StepsBlockContent } from './StepsBlockContent';
|
|
16
16
|
import { STEPS_BLOCK_STYLE, type StyleType } from './StepsBlockStyleMaps';
|
|
17
17
|
|
|
@@ -25,16 +25,13 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
25
25
|
className = '',
|
|
26
26
|
description,
|
|
27
27
|
showLines = true,
|
|
28
|
-
size = 'normal',
|
|
29
28
|
steps = [],
|
|
30
29
|
stepVersion = 'gray',
|
|
31
30
|
title,
|
|
32
31
|
version = 'primary',
|
|
33
32
|
...rest
|
|
34
33
|
}) => {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const shortGaps = stepsLength > 3;
|
|
34
|
+
const isBigSizeSteps = steps.length > 3;
|
|
38
35
|
|
|
39
36
|
const styleMap = STEPS_BLOCK_STYLE;
|
|
40
37
|
|
|
@@ -42,9 +39,6 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
42
39
|
|
|
43
40
|
const isMobileMode = useMobileMode();
|
|
44
41
|
|
|
45
|
-
const paddingXNormal = stepsLength < STEP_BREAKPOINT ? 'px-24' : 'px-16';
|
|
46
|
-
const paddingXSmall = stepsLength < STEP_BREAKPOINT ? 'px-28' : 'px-20';
|
|
47
|
-
|
|
48
42
|
return (
|
|
49
43
|
<BlockWrapper
|
|
50
44
|
className={style(
|
|
@@ -65,17 +59,12 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
65
59
|
/>
|
|
66
60
|
{steps?.length ? (
|
|
67
61
|
<div className="box-border space-y-lg flex flex-col justify-center">
|
|
68
|
-
<div
|
|
69
|
-
className={style(
|
|
70
|
-
'flex items-center',
|
|
71
|
-
size === 'normal' ? paddingXNormal : paddingXSmall,
|
|
72
|
-
)}
|
|
73
|
-
>
|
|
62
|
+
<div className={style('flex items-center', isBigSizeSteps ? 'px-16' : 'px-24')}>
|
|
74
63
|
{joinList(
|
|
75
64
|
<div className={style('h-0.5 w-full bg-secondary-light flex-1', lineOpacity)} />,
|
|
76
|
-
)(steps.map(renderStepIcon(styleMap,
|
|
65
|
+
)(steps.map(renderStepIcon(styleMap, isBigSizeSteps, stepVersion)))}
|
|
77
66
|
</div>
|
|
78
|
-
<div className={style('flex justify-between',
|
|
67
|
+
<div className={style('flex justify-between', isBigSizeSteps ? 'gap-x-s' : 'gap-x-20')}>
|
|
79
68
|
{steps.map(renderStep({ styleMap, version }))}
|
|
80
69
|
</div>
|
|
81
70
|
</div>
|
|
@@ -87,7 +76,7 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
87
76
|
);
|
|
88
77
|
|
|
89
78
|
const renderStepIcon =
|
|
90
|
-
(styleMap: StyleType,
|
|
79
|
+
(styleMap: StyleType, stepsSize: boolean, stepVersion: BlockVersion) =>
|
|
91
80
|
({ icon }: StepProps, i: number) => {
|
|
92
81
|
const iconVersion = stepVersion === 'secondary' ? 'white' : 'color';
|
|
93
82
|
|
|
@@ -96,7 +85,7 @@ const renderStepIcon =
|
|
|
96
85
|
key={String(i)}
|
|
97
86
|
defaultPadding=""
|
|
98
87
|
className={`${getIconSizeStyle(
|
|
99
|
-
|
|
88
|
+
stepsSize,
|
|
100
89
|
)} flex justify-center items-center text-center rounded-full box-border z-10`}
|
|
101
90
|
version={stepVersion}
|
|
102
91
|
>
|
|
@@ -120,4 +109,4 @@ const renderStepIcon =
|
|
|
120
109
|
);
|
|
121
110
|
};
|
|
122
111
|
|
|
123
|
-
const getIconSizeStyle = (
|
|
112
|
+
const getIconSizeStyle = (stepsSize: boolean) => (stepsSize ? 'h-16 w-16' : 'h-24 w-24');
|
|
@@ -2,7 +2,7 @@ import { type BlockVersion } from '../../model/BlockVersion';
|
|
|
2
2
|
import { type BulletsProps } from '../../model/Bullets';
|
|
3
3
|
import { type DescriptionProps, type LabelProps, type TitleProps } from '../../model/HeadlineType';
|
|
4
4
|
import { type IconProps } from '../../model/Picture';
|
|
5
|
-
import { type
|
|
5
|
+
import { type ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
6
6
|
import { type ButtonsSectionContent } from '../../ui-kit/LinkButton/ButtonsSectionContent';
|
|
7
7
|
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
8
8
|
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
@@ -12,6 +12,7 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
|
12
12
|
* @title Шаг
|
|
13
13
|
*/
|
|
14
14
|
export type StepProps = DescriptionProps &
|
|
15
|
+
ImageContent &
|
|
15
16
|
LabelProps &
|
|
16
17
|
RichTextProps &
|
|
17
18
|
IconProps &
|
|
@@ -34,10 +35,6 @@ export type StepsBlockContent = UniBlockContent &
|
|
|
34
35
|
* @maxItems 5
|
|
35
36
|
*/
|
|
36
37
|
steps?: StepProps[];
|
|
37
|
-
/**
|
|
38
|
-
* @title Тема шагов
|
|
39
|
-
*/
|
|
38
|
+
/** @title Тема шагов */
|
|
40
39
|
stepVersion?: BlockVersion;
|
|
41
|
-
/** @title Размер шагов */
|
|
42
|
-
size?: SizeVersion; // TODO: mobile content
|
|
43
40
|
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { type BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import { type IconVersion } from '../../model/IconVersion';
|
|
3
|
+
import { type LinkButtonVersion } from '../../model/LinkButtonVersion';
|
|
4
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
+
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
7
|
+
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
8
|
+
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
9
|
+
import { isIcon } from '../../utils/isIcon';
|
|
10
|
+
import { style } from '../../utils/style';
|
|
11
|
+
import { getIconTextStyle } from './getIconTextStyle';
|
|
12
|
+
import { type StepProps } from './StepsBlockContent';
|
|
13
|
+
import { STEPS_BLOCK_STYLE } from './StepsBlockStyleMaps';
|
|
14
|
+
|
|
15
|
+
const styleMap = STEPS_BLOCK_STYLE;
|
|
16
|
+
|
|
17
|
+
export const renderStepMobile =
|
|
18
|
+
(stepsSize: boolean, version: BlockVersion, stepVersion: BlockVersion) =>
|
|
19
|
+
(step: StepProps, i: number) => {
|
|
20
|
+
const { button, image } = step;
|
|
21
|
+
|
|
22
|
+
const styleStepMobile = button?.text && image?.src;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div key={String(i)} className="contents">
|
|
26
|
+
<div className={style('flex items-center relative', image?.src ? 'flex-col' : 'flex-row')}>
|
|
27
|
+
{image?.src ? renderText(step) : null}
|
|
28
|
+
<div className="overflow-hidden flex flex-shrink-0 items-center">
|
|
29
|
+
{renderIconArea(stepsSize, stepVersion)(step, i)}
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
className={style('flex flex-col justify-center h-fit w-full', {
|
|
33
|
+
'min-h-6xl': stepsSize,
|
|
34
|
+
})}
|
|
35
|
+
>
|
|
36
|
+
{image?.src ? null : renderText(step)}
|
|
37
|
+
{styleStepMobile ? (
|
|
38
|
+
<LinkButton
|
|
39
|
+
className="box-border py-s w-full max-w-60 mt-lg"
|
|
40
|
+
version={version as LinkButtonVersion}
|
|
41
|
+
{...button}
|
|
42
|
+
>
|
|
43
|
+
{button?.text}
|
|
44
|
+
</LinkButton>
|
|
45
|
+
) : null}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const renderIconArea =
|
|
53
|
+
(stepsSize: boolean, stepVersion: BlockVersion) => (step: StepProps, i: number) => {
|
|
54
|
+
const iconVersion = stepVersion === 'secondary' ? 'white' : 'color';
|
|
55
|
+
const isImg = Boolean(step?.icon?.src);
|
|
56
|
+
const iconAreaSize = getIconAreaSize(stepsSize, isImg);
|
|
57
|
+
const containerVersion = isImg ? stepVersion === 'transparent' : stepVersion;
|
|
58
|
+
const isImgSrc = step.image?.src;
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<BlockWrapper
|
|
62
|
+
className={style(
|
|
63
|
+
{ 'w-32': Boolean(isImgSrc) },
|
|
64
|
+
'z-10 mr-s flex justify-center content-center rounded-md',
|
|
65
|
+
!isImgSrc && iconAreaSize,
|
|
66
|
+
)}
|
|
67
|
+
defaultPadding=""
|
|
68
|
+
version={containerVersion as BlockVersion}
|
|
69
|
+
>
|
|
70
|
+
<div className="flex max-w-full max-h-full items-center justify-center">
|
|
71
|
+
{renderIcon({ step, iconVersion, i, stepVersion })}
|
|
72
|
+
</div>
|
|
73
|
+
</BlockWrapper>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const renderText = (step: StepProps) => {
|
|
78
|
+
const visibleStyle = Boolean(step.button?.text && step.image?.src);
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<div
|
|
82
|
+
className={style({
|
|
83
|
+
'mb-lg w-full': visibleStyle,
|
|
84
|
+
})}
|
|
85
|
+
>
|
|
86
|
+
{step?.label ? (
|
|
87
|
+
<Paragraph size="text-l" align="text-left">
|
|
88
|
+
{step.label}
|
|
89
|
+
</Paragraph>
|
|
90
|
+
) : null}
|
|
91
|
+
{step?.description ? (
|
|
92
|
+
<div className={style('text-s font-light text-left', styleMap.description)}>
|
|
93
|
+
{step.description}
|
|
94
|
+
</div>
|
|
95
|
+
) : null}
|
|
96
|
+
<RichText __html={step.__html} />
|
|
97
|
+
</div>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const getIconAreaSize = (stepsSize: boolean, isImg: boolean) => {
|
|
102
|
+
return stepsSize && isImg ? 'h-14 w-14' : 'h-11 w-11';
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const renderIcon = ({
|
|
106
|
+
step,
|
|
107
|
+
iconVersion,
|
|
108
|
+
i,
|
|
109
|
+
stepVersion,
|
|
110
|
+
}: {
|
|
111
|
+
step: StepProps;
|
|
112
|
+
iconVersion: IconVersion;
|
|
113
|
+
i: number;
|
|
114
|
+
stepVersion: BlockVersion;
|
|
115
|
+
}) => {
|
|
116
|
+
if (isIcon(step?.icon)) {
|
|
117
|
+
return (
|
|
118
|
+
<Img
|
|
119
|
+
image={{ ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }}
|
|
120
|
+
imageClassName="max-w-full max-h-full"
|
|
121
|
+
width="24"
|
|
122
|
+
height="24"
|
|
123
|
+
/>
|
|
124
|
+
);
|
|
125
|
+
} else if (isIcon(step.image)) {
|
|
126
|
+
return <Img image={{ ...step.image, size: { width: 120, height: 120 } }} />;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<span
|
|
131
|
+
className={style(
|
|
132
|
+
'text-h4',
|
|
133
|
+
stepVersion === 'transparent' ? styleMap.iconText : getIconTextStyle(stepVersion),
|
|
134
|
+
)}
|
|
135
|
+
>
|
|
136
|
+
{i + 1}
|
|
137
|
+
</span>
|
|
138
|
+
);
|
|
139
|
+
};
|