@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.
- package/bin/migration-scripts/0.8.10.js +31 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +82 -48
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
- package/bundle/components/Tile/TileContent.d.ts +2 -2
- package/dist/components/Calculator/Rate.js +1 -1
- package/dist/components/Calculator/Rate.js.map +1 -1
- package/dist/components/Calculator/constants.js +2 -2
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/rangeHelpers.d.ts +4 -0
- package/dist/components/Calculator/rangeHelpers.js +12 -0
- package/dist/components/Calculator/rangeHelpers.js.map +1 -0
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/Carousel/Carousel.js +6 -4
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/PictureText/renderBenefit.js +1 -0
- package/dist/components/PictureText/renderBenefit.js.map +1 -1
- package/dist/components/ProductTile/renderBenefit.js +1 -0
- package/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +7 -13
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +24 -4
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
- package/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/{lib/components/StepsBlock/renderStepContent.d.ts → dist/components/StepsBlock/renderStep.d.ts} +5 -5
- package/dist/components/StepsBlock/renderStep.js +34 -0
- package/dist/components/StepsBlock/renderStep.js.map +1 -0
- package/dist/components/Tile/Tile.js +3 -3
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/components/Tile/TileContent.d.ts +2 -2
- package/lib/components/Calculator/Rate.js +1 -1
- package/lib/components/Calculator/Rate.js.map +1 -1
- package/lib/components/Calculator/constants.js +2 -2
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/rangeHelpers.d.ts +4 -0
- package/lib/components/Calculator/rangeHelpers.js +8 -0
- package/lib/components/Calculator/rangeHelpers.js.map +1 -0
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/Carousel/Carousel.js +6 -4
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/PictureText/renderBenefit.js +1 -0
- package/lib/components/PictureText/renderBenefit.js.map +1 -1
- package/lib/components/ProductTile/renderBenefit.js +1 -0
- package/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.js +7 -13
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +24 -4
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
- package/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/{dist/components/StepsBlock/renderStepContent.d.ts → lib/components/StepsBlock/renderStep.d.ts} +5 -5
- package/lib/components/StepsBlock/renderStep.js +31 -0
- package/lib/components/StepsBlock/renderStep.js.map +1 -0
- package/lib/components/Tile/Tile.js +3 -3
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/components/Tile/TileContent.d.ts +2 -2
- package/mobile/bundle/bundle.umd.js +32 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/mobile/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
- package/mobile/bundle/components/Tile/TileContent.d.ts +2 -2
- package/mobile/dist/components/Calculator/Rate.js +1 -1
- package/mobile/dist/components/Calculator/Rate.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.js +2 -2
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/dist/components/Calculator/rangeHelpers.js +12 -0
- package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -0
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Carousel/Carousel.js +6 -4
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/PictureText/renderBenefit.js +1 -0
- package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -1
- package/mobile/dist/components/ProductTile/renderBenefit.js +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +24 -4
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/mobile/dist/components/StepsBlock/renderStep.d.ts +11 -0
- package/mobile/dist/components/StepsBlock/renderStep.js +34 -0
- package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -0
- package/mobile/dist/components/Tile/Tile.js +3 -3
- package/mobile/dist/components/Tile/Tile.js.map +1 -1
- package/mobile/dist/components/Tile/TileContent.d.ts +2 -2
- package/mobile/lib/components/Calculator/Rate.js +1 -1
- package/mobile/lib/components/Calculator/Rate.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.js +2 -2
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js +8 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -0
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +6 -4
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/PictureText/renderBenefit.js +1 -0
- package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -1
- package/mobile/lib/components/ProductTile/renderBenefit.js +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +24 -4
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/mobile/lib/components/StepsBlock/renderStep.d.ts +11 -0
- package/mobile/lib/components/StepsBlock/renderStep.js +31 -0
- package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -0
- package/mobile/lib/components/Tile/Tile.js +3 -3
- package/mobile/lib/components/Tile/Tile.js.map +1 -1
- package/mobile/lib/components/Tile/TileContent.d.ts +2 -2
- package/mobile/src/components/Calculator/Rate.tsx +1 -1
- package/mobile/src/components/Calculator/constants.ts +2 -2
- package/mobile/src/components/Calculator/rangeHelpers.ts +24 -0
- package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
- package/mobile/src/components/Carousel/Carousel.tsx +6 -4
- package/mobile/src/components/PictureText/renderBenefit.tsx +1 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +1 -0
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +29 -5
- package/mobile/src/components/StepsBlock/StepsBlock.ui.json +6 -0
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +13 -1
- package/mobile/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
- package/mobile/src/components/StepsBlock/renderStep.tsx +83 -0
- package/mobile/src/components/Tile/Tile.example.json +1 -1
- package/mobile/src/components/Tile/Tile.tsx +4 -4
- package/mobile/src/components/Tile/Tile.ui.json +7 -1
- package/mobile/src/components/Tile/TileContent.ts +2 -2
- package/package.json +1 -1
- package/src/components/Calculator/Rate.tsx +1 -1
- package/src/components/Calculator/constants.ts +2 -2
- package/src/components/Calculator/rangeHelpers.ts +24 -0
- package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
- package/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
- package/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
- package/src/components/Carousel/Carousel.tsx +6 -4
- package/src/components/PictureText/renderBenefit.tsx +1 -0
- package/src/components/ProductTile/renderBenefit.tsx +1 -0
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +19 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +10 -3
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +29 -5
- package/src/components/StepsBlock/StepsBlock.tsx +28 -16
- package/src/components/StepsBlock/StepsBlock.ui.json +6 -0
- package/src/components/StepsBlock/StepsBlockContent.ts +13 -1
- package/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
- package/src/components/StepsBlock/renderStep.tsx +83 -0
- package/src/components/Tile/Tile.example.json +1 -1
- package/src/components/Tile/Tile.fixture.tsx +2 -2
- package/src/components/Tile/Tile.tsx +4 -4
- package/src/components/Tile/Tile.ui.json +7 -1
- package/src/components/Tile/TileContent.ts +2 -2
- package/bundle/utils/checkIsIconRenderable.d.ts +0 -2
- package/dist/components/StepsBlock/renderStepContent.js +0 -19
- package/dist/components/StepsBlock/renderStepContent.js.map +0 -1
- package/dist/utils/checkIsIconRenderable.d.ts +0 -2
- package/dist/utils/checkIsIconRenderable.js +0 -5
- package/dist/utils/checkIsIconRenderable.js.map +0 -1
- package/lib/components/StepsBlock/renderStepContent.js +0 -16
- package/lib/components/StepsBlock/renderStepContent.js.map +0 -1
- package/lib/utils/checkIsIconRenderable.d.ts +0 -2
- package/lib/utils/checkIsIconRenderable.js +0 -2
- package/lib/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/bundle/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/dist/components/StepsBlock/renderStepContent.d.ts +0 -11
- package/mobile/dist/components/StepsBlock/renderStepContent.js +0 -19
- package/mobile/dist/components/StepsBlock/renderStepContent.js.map +0 -1
- package/mobile/dist/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/dist/utils/checkIsIconRenderable.js +0 -5
- package/mobile/dist/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/lib/components/StepsBlock/renderStepContent.d.ts +0 -11
- package/mobile/lib/components/StepsBlock/renderStepContent.js +0 -16
- package/mobile/lib/components/StepsBlock/renderStepContent.js.map +0 -1
- package/mobile/lib/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/lib/utils/checkIsIconRenderable.js +0 -2
- package/mobile/lib/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/src/components/StepsBlock/renderStepContent.tsx +0 -83
- package/mobile/src/utils/checkIsIconRenderable.tsx +0 -3
- package/src/components/StepsBlock/renderStepContent.tsx +0 -83
- 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 {
|
|
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
|
-
({
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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=
|
|
47
|
-
<div className={
|
|
48
|
-
{joinList(<div className={
|
|
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
|
|
53
|
-
{
|
|
54
|
-
|
|
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
|
-
{
|
|
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>
|
|
@@ -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 =
|
|
34
|
+
export type Step = DefaultStep | RichTextStep;
|
|
23
35
|
|
|
24
36
|
/**
|
|
25
37
|
* @title Блок шаги
|
|
@@ -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]');
|
|
@@ -46,8 +46,8 @@ export const TILE: TileContent = {
|
|
|
46
46
|
export const TILE_PREMIUM: TileContent = {
|
|
47
47
|
title: 'Премиальные продукты',
|
|
48
48
|
headingType: 'h4',
|
|
49
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
-
{
|
|
55
|
+
{__html ? (
|
|
56
56
|
<div className="max-w-[600px] mt-2.5">
|
|
57
|
-
<
|
|
57
|
+
<RichText __html={__html} />
|
|
58
58
|
</div>
|
|
59
59
|
) : null}
|
|
60
60
|
{children}
|
|
@@ -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
|
-
|
|
14
|
+
RichTextProps &
|
|
15
15
|
ListContent &
|
|
16
16
|
ButtonContent &
|
|
17
17
|
TagsContent & {
|
|
@@ -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,KAA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f,EAAS,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,gCAAK,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,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,EAA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AAC,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 +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,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,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,KAAK,CAAC,EACvB,iCAAK,SAAS,EAAE,GAAG,kBAAkB,6BAA6B,aAC/D,qBAAqB,CAAC;gCACrB,WAAW;gCACX,SAAS,EAAE,QAAQ,CAAC,WAAW;6BAChC,CAAC,EACF,uBAAC,WAAI,IACH,SAAS,EAAE,eAAe,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAC7E,KAAK,EAAE,KAAK,EACZ,YAAY,EAAC,GAAG,EAChB,QAAQ,EAAE,QAAQ,GAClB,IACE,IACF,EACL,MAAM,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAC/B,uBAAC,eAAM,IACL,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,OAAwB,KAC7B,MAAM,YAET,MAAM,EAAE,IAAI,GACN,CACV,CAAC,CAAC,CAAC,IAAI,KA5BH,MAAM,CAAC,CAAC,CAAC,CA6BV,CACP,CAAC;AACJ,CAAC,CAAC;AAhDS,QAAA,iBAAiB,qBAgD1B;AAEJ,MAAM,eAAe,GAAG,CAAC,KAAc,EAAS,EAAE,CAChD,KAAK,CAAC,CAAC,CAAC,gCAAK,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,gCAAK,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,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,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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W,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 +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]');
|