@redneckz/wildless-cms-uni-blocks 0.3.68 → 0.3.70
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 +108 -41
- package/bundle/bundle.umd.min.js +1 -1
- package/cosmos-static/icons/ArrowDownIcon.svg +1 -1
- package/cosmos-static/icons/ArrowUpIcon.svg +1 -1
- package/cosmos-static/icons/DoneIcon.svg +1 -0
- package/cosmos-static/icons/GridIcon.svg +1 -1
- package/dist/components/BlockContent.d.ts +3 -1
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Footer/MediaButton.js +5 -4
- package/dist/components/Footer/MediaButton.js.map +1 -1
- package/dist/components/GracePeriod/GracePeriodContent.d.ts +2 -3
- package/dist/components/Header/HeaderSecondaryMenu.js +4 -4
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Header/HeaderTop.js +1 -1
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/Insurance/Insurance.js +4 -6
- package/dist/components/Insurance/Insurance.js.map +1 -1
- package/dist/components/Insurance/InsuranceContent.d.ts +2 -5
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.d.ts +5 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.js +34 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.js.map +1 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +30 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js +2 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js.map +1 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +5 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +51 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -0
- package/dist/components/ProductBlock/renderBackwardButton.js +3 -1
- package/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +1 -1
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/icons/IconName.d.ts +5 -15
- package/dist/icons/IconName.js +3 -13
- package/dist/icons/IconName.js.map +1 -1
- package/dist/model/IconVersion.d.ts +3 -2
- package/dist/model/Insurance.d.ts +6 -0
- package/dist/model/Insurance.js +2 -0
- package/dist/model/Insurance.js.map +1 -0
- package/dist/model/Picture.d.ts +0 -1
- package/dist/ui-kit/Button/ArrowButton.js +1 -1
- package/dist/ui-kit/Button/ArrowButton.js.map +1 -1
- package/dist/ui-kit/Foldable/Foldable.js +1 -1
- package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
- package/dist/ui-kit/Icon/Icon.js +7 -3
- package/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/dist/ui-kit/Icon/IconProps.d.ts +1 -0
- package/dist/ui-kit/Img/Img.js +1 -1
- package/dist/ui-kit/Img/Img.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BlockContent.d.ts +3 -1
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Footer/MediaButton.js +5 -4
- package/lib/components/Footer/MediaButton.js.map +1 -1
- package/lib/components/GracePeriod/GracePeriodContent.d.ts +2 -3
- package/lib/components/Header/HeaderSecondaryMenu.js +4 -4
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Header/HeaderTop.js +1 -1
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/Insurance/Insurance.js +4 -6
- package/lib/components/Insurance/Insurance.js.map +1 -1
- package/lib/components/Insurance/InsuranceContent.d.ts +2 -5
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.d.ts +5 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.fixture.d.ts +4 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.js +32 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.js.map +1 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +30 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js +2 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js.map +1 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +5 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +49 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -0
- package/lib/components/ProductBlock/renderBackwardButton.js +3 -1
- package/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.js +1 -1
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/icons/IconName.d.ts +5 -15
- package/lib/icons/IconName.js +3 -13
- package/lib/icons/IconName.js.map +1 -1
- package/lib/model/IconVersion.d.ts +3 -2
- package/lib/model/Insurance.d.ts +6 -0
- package/lib/model/Insurance.js +2 -0
- package/lib/model/Insurance.js.map +1 -0
- package/lib/model/Picture.d.ts +0 -1
- package/lib/ui-kit/Button/ArrowButton.js +1 -1
- package/lib/ui-kit/Button/ArrowButton.js.map +1 -1
- package/lib/ui-kit/Foldable/Foldable.js +1 -1
- package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
- package/lib/ui-kit/Icon/Icon.fixture.d.ts +2 -0
- package/lib/ui-kit/Icon/Icon.js +7 -3
- package/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/lib/ui-kit/Icon/IconProps.d.ts +1 -0
- package/lib/ui-kit/Img/Img.js +1 -1
- package/lib/ui-kit/Img/Img.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +16 -21
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/BlockContent.d.ts +3 -1
- package/mobile/dist/components/Footer/MediaButton.js +5 -4
- package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
- package/mobile/dist/components/GracePeriod/GracePeriodContent.d.ts +2 -3
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +4 -4
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderTop.js +1 -1
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/components/Insurance/Insurance.js +4 -6
- package/mobile/dist/components/Insurance/Insurance.js.map +1 -1
- package/mobile/dist/components/Insurance/InsuranceContent.d.ts +2 -5
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.d.ts +5 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.js +34 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.js.map +1 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +30 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js +2 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js.map +1 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +5 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +51 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -0
- package/mobile/dist/components/ProductBlock/renderBackwardButton.js +3 -1
- package/mobile/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +5 -15
- package/mobile/dist/icons/IconName.js +3 -13
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/model/IconVersion.d.ts +3 -2
- package/mobile/dist/model/Insurance.d.ts +6 -0
- package/mobile/dist/model/Insurance.js +2 -0
- package/mobile/dist/model/Insurance.js.map +1 -0
- package/mobile/dist/model/Picture.d.ts +0 -1
- package/mobile/dist/ui-kit/Button/ArrowButton.js +1 -1
- package/mobile/dist/ui-kit/Button/ArrowButton.js.map +1 -1
- package/mobile/dist/ui-kit/Foldable/Foldable.js +1 -1
- package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
- package/mobile/dist/ui-kit/Icon/Icon.js +7 -3
- package/mobile/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/mobile/dist/ui-kit/Icon/IconProps.d.ts +1 -0
- package/mobile/lib/components/BlockContent.d.ts +3 -1
- package/mobile/lib/components/Footer/MediaButton.js +5 -4
- package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
- package/mobile/lib/components/GracePeriod/GracePeriodContent.d.ts +2 -3
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +4 -4
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderTop.js +1 -1
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/components/Insurance/Insurance.js +4 -6
- package/mobile/lib/components/Insurance/Insurance.js.map +1 -1
- package/mobile/lib/components/Insurance/InsuranceContent.d.ts +2 -5
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.d.ts +5 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.js +32 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.js.map +1 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +30 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js +2 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js.map +1 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +5 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +49 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -0
- package/mobile/lib/components/ProductBlock/renderBackwardButton.js +3 -1
- package/mobile/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +5 -15
- package/mobile/lib/icons/IconName.js +3 -13
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/model/IconVersion.d.ts +3 -2
- package/mobile/lib/model/Insurance.d.ts +6 -0
- package/mobile/lib/model/Insurance.js +2 -0
- package/mobile/lib/model/Insurance.js.map +1 -0
- package/mobile/lib/model/Picture.d.ts +0 -1
- package/mobile/lib/ui-kit/Button/ArrowButton.js +1 -1
- package/mobile/lib/ui-kit/Button/ArrowButton.js.map +1 -1
- package/mobile/lib/ui-kit/Foldable/Foldable.js +1 -1
- package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
- package/mobile/lib/ui-kit/Icon/Icon.js +7 -3
- package/mobile/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/mobile/lib/ui-kit/Icon/IconProps.d.ts +1 -0
- package/mobile/src/components/BlockContent.ts +5 -1
- package/mobile/src/components/ContentPage/ContentPage.page.json +50 -1
- package/mobile/src/components/Footer/MediaButton.tsx +17 -5
- package/mobile/src/components/GracePeriod/GracePeriodContent.ts +2 -3
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +14 -6
- package/mobile/src/components/Header/HeaderTop.tsx +1 -1
- package/mobile/src/components/Insurance/Insurance.example.json +21 -0
- package/mobile/src/components/Insurance/Insurance.tsx +10 -9
- package/mobile/src/components/Insurance/InsuranceContent.ts +9 -11
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlock.example.json +44 -0
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlock.tsx +84 -0
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlockContent.ts +33 -0
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlockInner.tsx +157 -0
- package/mobile/src/components/ProductBlock/renderBackwardButton.tsx +4 -1
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/mobile/src/icons/ArrowDownIcon.svg +2 -2
- package/mobile/src/icons/ArrowUpIcon.svg +2 -2
- package/mobile/src/icons/DoneIcon.svg +4 -0
- package/mobile/src/icons/GridIcon.svg +2 -3
- package/mobile/src/icons/IconName.ts +4 -4
- package/mobile/src/model/IconVersion.ts +3 -2
- package/mobile/src/model/Insurance.ts +6 -0
- package/mobile/src/model/Picture.ts +0 -1
- package/mobile/src/ui-kit/Button/ArrowButton.tsx +1 -1
- package/mobile/src/ui-kit/Foldable/Foldable.tsx +1 -1
- package/mobile/src/ui-kit/Icon/Icon.tsx +14 -3
- package/mobile/src/ui-kit/Icon/IconProps.ts +1 -0
- package/package.json +2 -2
- package/src/components/BlockContent.ts +5 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContentPage/ContentPage.page.json +50 -1
- package/src/components/Footer/MediaButton.tsx +17 -5
- package/src/components/GracePeriod/GracePeriodContent.ts +2 -3
- package/src/components/Header/HeaderSecondaryMenu.tsx +14 -6
- package/src/components/Header/HeaderTop.tsx +1 -1
- package/src/components/Insurance/Insurance.example.json +21 -0
- package/src/components/Insurance/Insurance.fixture.tsx +5 -4
- package/src/components/Insurance/Insurance.tsx +10 -9
- package/src/components/Insurance/InsuranceContent.ts +9 -11
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlock.example.json +44 -0
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlock.fixture.tsx +52 -0
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlock.tsx +84 -0
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlockContent.ts +33 -0
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlockInner.tsx +157 -0
- package/src/components/ProductBlock/renderBackwardButton.tsx +4 -1
- package/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +3 -3
- package/src/components/StepsBlock/StepsBlock.tsx +1 -1
- package/src/icons/ArrowDownIcon.svg +2 -2
- package/src/icons/ArrowUpIcon.svg +2 -2
- package/src/icons/DoneIcon.svg +4 -0
- package/src/icons/GridIcon.svg +2 -3
- package/src/icons/IconName.ts +240 -5
- package/src/model/IconVersion.ts +3 -2
- package/src/model/Insurance.ts +6 -0
- package/src/model/Picture.ts +0 -1
- package/src/ui-kit/Button/ArrowButton.tsx +1 -1
- package/src/ui-kit/Foldable/Foldable.tsx +1 -1
- package/src/ui-kit/Icon/Icon.fixture.tsx +24 -0
- package/src/ui-kit/Icon/Icon.tsx +14 -3
- package/src/ui-kit/Icon/IconProps.ts +1 -0
- package/src/ui-kit/Img/Img.tsx +2 -1
- package/cosmos-static/icons/ArrowsRewindRight.svg +0 -1
- package/cosmos-static/icons/BurgerIconWhite.svg +0 -1
- package/cosmos-static/icons/CalendarWhiteIcon.svg +0 -1
- package/cosmos-static/icons/EmptyWalletWhiteIcon.svg +0 -1
- package/cosmos-static/icons/GridIconWhite.svg +0 -1
- package/cosmos-static/icons/PercentageSquareWhiteIcon.svg +0 -1
- package/mobile/src/components/Insurance/Insuranse.example.json +0 -36
- package/mobile/src/icons/ArrowsRewindRight.svg +0 -16
- package/mobile/src/icons/BurgerIconWhite.svg +0 -6
- package/mobile/src/icons/CalendarWhiteIcon.svg +0 -17
- package/mobile/src/icons/EmptyWalletWhiteIcon.svg +0 -16
- package/mobile/src/icons/GridIconWhite.svg +0 -4
- package/mobile/src/icons/PercentageSquareWhiteIcon.svg +0 -16
- package/src/components/Insurance/Insuranse.example.json +0 -36
- package/src/icons/ArrowsRewindRight.svg +0 -16
- package/src/icons/BurgerIconWhite.svg +0 -6
- package/src/icons/CalendarWhiteIcon.svg +0 -17
- package/src/icons/EmptyWalletWhiteIcon.svg +0 -16
- package/src/icons/GridIconWhite.svg +0 -4
- package/src/icons/PercentageSquareWhiteIcon.svg +0 -16
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import type { InsuranceAmountBlockContent } from './InsuranceAmountBlockContent';
|
|
4
|
+
import { InsuranceAmountBlockInner } from './InsuranceAmountBlockInner';
|
|
5
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
7
|
+
|
|
8
|
+
export interface InsuranceAmountBlockProps extends InsuranceAmountBlockContent, UniBlockProps {}
|
|
9
|
+
|
|
10
|
+
export const InsuranceAmountBlock = JSX<InsuranceAmountBlockProps>(
|
|
11
|
+
({ className = '', context, title, insuranceTabs = [], button, anchor = null }) => {
|
|
12
|
+
const insuranceGalleries = insuranceTabs.map((_) => _.cards);
|
|
13
|
+
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<section
|
|
17
|
+
id={anchor}
|
|
18
|
+
className={`box-border py-[50px] overflow-hidden relative font-sans w-100 bg-white ${className}`}
|
|
19
|
+
>
|
|
20
|
+
{title ? <Heading className="text-center" title={title} headingType="h3" /> : null}
|
|
21
|
+
<div className="p-1.5 bg-secondary-light w-fit m-auto rounded-md mt-[34px]">
|
|
22
|
+
{insuranceTabs.map((item, i) =>
|
|
23
|
+
renderNavButton({
|
|
24
|
+
title: item?.title,
|
|
25
|
+
i,
|
|
26
|
+
activeSlideIndex,
|
|
27
|
+
onClick: () => setActiveSlideIndex(i),
|
|
28
|
+
}),
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
className="flex"
|
|
33
|
+
style={{ transform: `translateX(-${activeSlideIndex}00%)` }}
|
|
34
|
+
role="list"
|
|
35
|
+
>
|
|
36
|
+
{renderInsuranceGalleries({
|
|
37
|
+
context,
|
|
38
|
+
className,
|
|
39
|
+
insuranceGalleries,
|
|
40
|
+
})}
|
|
41
|
+
</div>
|
|
42
|
+
{button?.text ? (
|
|
43
|
+
<div className="flex justify-center">
|
|
44
|
+
<Button
|
|
45
|
+
className="box-border p-4 h-14 w-full max-w-[240px]"
|
|
46
|
+
version={button?.version || 'primary'}
|
|
47
|
+
href={button.href}
|
|
48
|
+
>
|
|
49
|
+
{button.text}
|
|
50
|
+
</Button>
|
|
51
|
+
</div>
|
|
52
|
+
) : null}
|
|
53
|
+
</section>
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const renderInsuranceGalleries = ({ insuranceGalleries, context, className }: any) => {
|
|
59
|
+
return insuranceGalleries?.length
|
|
60
|
+
? insuranceGalleries.map((cards) => (
|
|
61
|
+
<InsuranceAmountBlockInner context={context} className={className} cards={cards} />
|
|
62
|
+
))
|
|
63
|
+
: null;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
function renderNavButton({ title, i, activeSlideIndex, onClick }) {
|
|
67
|
+
const isActiveBtn = i === activeSlideIndex;
|
|
68
|
+
|
|
69
|
+
const btnClassName = isActiveBtn
|
|
70
|
+
? 'bg-primary-main text-white rounded-md'
|
|
71
|
+
: `text-secondary-text`;
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<button
|
|
75
|
+
type="button"
|
|
76
|
+
key={String(i)}
|
|
77
|
+
onClick={onClick}
|
|
78
|
+
aria-label={title}
|
|
79
|
+
className={`box-border px-4 py-3 text-m-md ${btnClassName}`}
|
|
80
|
+
>
|
|
81
|
+
{title}
|
|
82
|
+
</button>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Picture } from '../../model/Picture';
|
|
2
|
+
import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
|
|
3
|
+
import type { InsuranceProps } from '../../model/Insurance';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @title Кнопка выбора программы
|
|
7
|
+
*/
|
|
8
|
+
export type cardItem = InsuranceProps & {
|
|
9
|
+
icon?: Picture;
|
|
10
|
+
/** @title Страховой взнос */
|
|
11
|
+
fee?: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @title Вкладка
|
|
16
|
+
*/
|
|
17
|
+
export interface InsuranceAmountBlockTabs {
|
|
18
|
+
/** @title Заголовок вкладки */
|
|
19
|
+
title?: string;
|
|
20
|
+
/** @title Содержимое вкладки */
|
|
21
|
+
cards?: cardItem[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @title Страховые суммы
|
|
26
|
+
*/
|
|
27
|
+
export interface InsuranceAmountBlockContent {
|
|
28
|
+
/** @title Заголовок */
|
|
29
|
+
title?: string;
|
|
30
|
+
/** @title Список вкладок */
|
|
31
|
+
insuranceTabs?: InsuranceAmountBlockTabs[];
|
|
32
|
+
button?: ButtonProps;
|
|
33
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps, FuncReturnVoid } from '../../types';
|
|
3
|
+
import type { InsuranceAmountBlockTabs, cardItem } from './InsuranceAmountBlockContent';
|
|
4
|
+
import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
|
|
5
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
+
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
|
|
7
|
+
|
|
8
|
+
export interface InsuranceAmountBlockInnerProps extends InsuranceAmountBlockTabs, UniBlockProps {}
|
|
9
|
+
|
|
10
|
+
type InsuranceGalleryProps = {
|
|
11
|
+
tabsShift: number;
|
|
12
|
+
cards: cardItem[];
|
|
13
|
+
activeSlideIndex: number;
|
|
14
|
+
isLastShift: boolean;
|
|
15
|
+
setActiveSlideIndex: FuncReturnVoid<number>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type InsuranceSlideProps = {
|
|
19
|
+
slide: cardItem;
|
|
20
|
+
i: number;
|
|
21
|
+
activeSlideIndex: number;
|
|
22
|
+
onClick: FuncReturnVoid<MouseEvent>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const arrowBtnStyle =
|
|
26
|
+
'absolute w-12 h-12 min-h-12 max-h-12 top-1 z-10 mt-[25px] bg-white rounded-full text-primary-text';
|
|
27
|
+
|
|
28
|
+
export const InsuranceAmountBlockInner = JSX<InsuranceAmountBlockInnerProps>(
|
|
29
|
+
({ className = '', context, cards = [], anchor = null }) => {
|
|
30
|
+
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
31
|
+
const [tabsShift, setTabsShift] = context.useState(0);
|
|
32
|
+
|
|
33
|
+
const handleNextClick = () => setTabsShift(tabsShift + 1);
|
|
34
|
+
const handlePrevClick = () => setTabsShift(tabsShift - 1);
|
|
35
|
+
|
|
36
|
+
const galleryLength = cards?.length;
|
|
37
|
+
|
|
38
|
+
const isGalleryScrollAvailable = cards?.length > 2;
|
|
39
|
+
const showNextButton = isGalleryScrollAvailable && galleryLength > tabsShift + 2;
|
|
40
|
+
const isLastShift = galleryLength === tabsShift + 2;
|
|
41
|
+
const showPrevButton = tabsShift > 0;
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<section id={anchor} className={`min-w-full ${className}`}>
|
|
45
|
+
<div className="relative mt-7 overflow-hidden">
|
|
46
|
+
{galleryLength > 1
|
|
47
|
+
? renderGallery({
|
|
48
|
+
tabsShift,
|
|
49
|
+
cards,
|
|
50
|
+
activeSlideIndex,
|
|
51
|
+
isLastShift,
|
|
52
|
+
setActiveSlideIndex,
|
|
53
|
+
})
|
|
54
|
+
: null}
|
|
55
|
+
{showPrevButton ? (
|
|
56
|
+
<div>
|
|
57
|
+
<ArrowButton
|
|
58
|
+
className={`${arrowBtnStyle} left-0 top-9`}
|
|
59
|
+
onClick={handlePrevClick}
|
|
60
|
+
ariaLabel="Пролистать влево"
|
|
61
|
+
data-block-control="scroll-left"
|
|
62
|
+
/>
|
|
63
|
+
<div className="absolute top-0 left-0 h-[168px] w-[84px] bg-opacity-from-white" />
|
|
64
|
+
</div>
|
|
65
|
+
) : null}
|
|
66
|
+
{showNextButton ? (
|
|
67
|
+
<div>
|
|
68
|
+
<ArrowButton
|
|
69
|
+
className={`${arrowBtnStyle} right-0 top-9 rotate-180`}
|
|
70
|
+
onClick={handleNextClick}
|
|
71
|
+
ariaLabel="Пролистать вправо"
|
|
72
|
+
data-block-control="scroll-right"
|
|
73
|
+
/>
|
|
74
|
+
<div className="absolute top-0 right-0 h-[168px] w-[100px] bg-opacity-to-white" />
|
|
75
|
+
</div>
|
|
76
|
+
) : null}
|
|
77
|
+
</div>
|
|
78
|
+
</section>
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
function renderGallery({
|
|
84
|
+
tabsShift,
|
|
85
|
+
cards,
|
|
86
|
+
activeSlideIndex,
|
|
87
|
+
isLastShift,
|
|
88
|
+
setActiveSlideIndex,
|
|
89
|
+
}: InsuranceGalleryProps) {
|
|
90
|
+
const tabsShiftWidth = isLastShift ? tabsShift * 460 - 240 : tabsShift * 460;
|
|
91
|
+
return (
|
|
92
|
+
<div style={{ transform: `translateX(-${tabsShiftWidth}px)` }} className="duration-1000">
|
|
93
|
+
<div className="w-full flex flex-nowrap gap-3.5 pb-[38px] px-[50px]">
|
|
94
|
+
{cards.map((slide, i) =>
|
|
95
|
+
renderSlide({
|
|
96
|
+
slide,
|
|
97
|
+
i,
|
|
98
|
+
activeSlideIndex,
|
|
99
|
+
onClick: () => setActiveSlideIndex(i),
|
|
100
|
+
}),
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function renderSlide({ slide, i, activeSlideIndex, onClick }: InsuranceSlideProps) {
|
|
108
|
+
const isActiveBtn = i === activeSlideIndex;
|
|
109
|
+
|
|
110
|
+
const btnClassName = isActiveBtn
|
|
111
|
+
? 'shadow-dark-blue/42 border-primary-main'
|
|
112
|
+
: `ease-in duration-300 border-main-stroke`;
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<button
|
|
116
|
+
type="button"
|
|
117
|
+
key={String(i)}
|
|
118
|
+
onClick={onClick}
|
|
119
|
+
className={`p-[30px] min-w-[460px] flex items-center bg-white border-solid border relative ${btnClassName}`}
|
|
120
|
+
>
|
|
121
|
+
{slide?.icon ? (
|
|
122
|
+
<Img
|
|
123
|
+
className={`h-[108px] w-[108px] p-3 rounded-full bg-secondary-light mr-[30px]`}
|
|
124
|
+
image={slide.icon}
|
|
125
|
+
width="24"
|
|
126
|
+
height="24"
|
|
127
|
+
/>
|
|
128
|
+
) : null}
|
|
129
|
+
|
|
130
|
+
<div className="flex gap-3.5">
|
|
131
|
+
{slide?.sum ? renderValueBlock('страховая сумма', slide.sum) : null}
|
|
132
|
+
{slide?.fee ? renderValueBlock('страховой взнос', slide.fee) : null}
|
|
133
|
+
</div>
|
|
134
|
+
{renderDoneIcon(isActiveBtn)}
|
|
135
|
+
</button>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function renderValueBlock(title, sum) {
|
|
140
|
+
return (
|
|
141
|
+
<div className="flex flex-col text-left">
|
|
142
|
+
<span className="whitespace-pre text-title-2xs">{addSpacesBetweenNumbers(sum)} ₽</span>
|
|
143
|
+
<span className="whitespace-pre text-secondary-text font-light text-base mt-1">{title}</span>
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function renderDoneIcon(isActive) {
|
|
149
|
+
return isActive ? (
|
|
150
|
+
<Img
|
|
151
|
+
className={`h-[24px] w-[24px] min-w-[24px] min-h-[24px] absolute right-4 top-4`}
|
|
152
|
+
image="DoneIcon"
|
|
153
|
+
width="24"
|
|
154
|
+
height="24"
|
|
155
|
+
/>
|
|
156
|
+
) : null;
|
|
157
|
+
}
|
|
@@ -8,6 +8,9 @@ export function renderBackwardButton(
|
|
|
8
8
|
version: BlockVersion,
|
|
9
9
|
className: string,
|
|
10
10
|
) {
|
|
11
|
+
const iconVersion = version === 'primary' ? 'white' : 'black';
|
|
12
|
+
const backwardIcon = button?.icon || { icon: 'ArrowLeftIcon' };
|
|
13
|
+
|
|
11
14
|
return (
|
|
12
15
|
<div className={`flex items-center ${className}`}>
|
|
13
16
|
<Button
|
|
@@ -17,7 +20,7 @@ export function renderBackwardButton(
|
|
|
17
20
|
ariaLabel={button?.text}
|
|
18
21
|
href={button?.href}
|
|
19
22
|
>
|
|
20
|
-
<Img className="w-4 h-4" image={
|
|
23
|
+
<Img className="w-4 h-4" image={{ ...backwardIcon, iconVersion }} asSVG />
|
|
21
24
|
</Button>
|
|
22
25
|
{button?.text ? <span className="text-m-md font-light">{button.text}</span> : null}
|
|
23
26
|
</div>
|
|
@@ -17,7 +17,7 @@ export const RecommendationCard = JSX<RecommendationCardProps>(
|
|
|
17
17
|
({ context, className = '', title, description, items, image, version, socialMedia }) => {
|
|
18
18
|
return (
|
|
19
19
|
<section
|
|
20
|
-
className={`border border-solid box-border p-[30px] w-[524px] ${className}`}
|
|
20
|
+
className={`border border-solid box-border p-[30px] min-w-[524px] ${className}`}
|
|
21
21
|
role="listitem"
|
|
22
22
|
>
|
|
23
23
|
<BaseTile
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg title="Стрелка 'Вниз'" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M13.8416 10.709L11.6582 12.8923C11.0166 13.534 9.96657 13.534 9.3249 12.8923L3.8999 7.45898" stroke="
|
|
3
|
-
<path d="M17.1001 7.45898L16.2334 8.32565" stroke="
|
|
2
|
+
<path d="M13.8416 10.709L11.6582 12.8923C11.0166 13.534 9.96657 13.534 9.3249 12.8923L3.8999 7.45898" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M17.1001 7.45898L16.2334 8.32565" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
4
|
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg title="Стрелка вверх" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M13.3416 9.29163L11.1582 7.10829C10.5166 6.46662 9.46657 6.46662 8.8249 7.10829L3.3999 12.5416" stroke="
|
|
3
|
-
<path d="M16.6001 12.5416L15.7334 11.675" stroke="
|
|
2
|
+
<path d="M13.3416 9.29163L11.1582 7.10829C10.5166 6.46662 9.46657 6.46662 8.8249 7.10829L3.3999 12.5416" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M16.6001 12.5416L15.7334 11.675" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
4
|
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg title="Зелёная 'галочка'" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="24" height="24" rx="12" fill="#42AB44"/>
|
|
3
|
+
<path d="M7 13.0047L9.7242 16L17 8" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<svg title="Сетка" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 33">
|
|
2
|
-
|
|
3
|
-
<path fill="#000000" d="M13 11.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM13 16.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM11.5 23a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM18 11.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM16.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM18 21.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM21.5 13a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM23 16.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM21.5 23a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"/>
|
|
1
|
+
<svg title="Сетка (белая)" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 33">
|
|
2
|
+
<path fill="currentColor" d="M13 11.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM13 16.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM11.5 23a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM18 11.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM16.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM18 21.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM21.5 13a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM23 16.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM21.5 23a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"/>
|
|
4
3
|
</svg>
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
/* eslint-disable max-lines */
|
|
4
4
|
|
|
5
5
|
export enum IconMap {
|
|
6
|
-
ActualBalanceIcon = 'ActualBalanceIcon', AirPlane = 'AirPlane', AppleIcon = 'AppleIcon', ArrowDownIcon = 'ArrowDownIcon', ArrowLeftIcon = 'ArrowLeftIcon',
|
|
6
|
+
ActualBalanceIcon = 'ActualBalanceIcon', AirPlane = 'AirPlane', AppleIcon = 'AppleIcon', ArrowDownIcon = 'ArrowDownIcon', ArrowLeftIcon = 'ArrowLeftIcon', ArrowUpIcon = 'ArrowUpIcon', AtmIcon = 'AtmIcon', BankIcon = 'BankIcon', BurgerIcon = 'BurgerIcon', Calendar2Icon = 'Calendar2Icon', CalendarCircleIcon = 'CalendarCircleIcon', CalendarIcon = 'CalendarIcon', CalendarTickIcon = 'CalendarTickIcon', CardIcon = 'CardIcon', CardPosIcon = 'CardPosIcon', CardTickIcon = 'CardTickIcon', CardWithGemIcon = 'CardWithGemIcon', CarIcon = 'CarIcon', ChartSquareIcon = 'ChartSquareIcon', CinemaIcon = 'CinemaIcon', ClockIcon = 'ClockIcon', CloseIcon = 'CloseIcon', ComfortableCompIcon = 'ComfortableCompIcon', CreditCardsIcon = 'CreditCardsIcon', DiscountShapeIcon = 'DiscountShapeIcon', DocIcon = 'DocIcon', DocIconMonoColor = 'DocIconMonoColor', DocsIcon = 'DocsIcon', DocumentTextIcon = 'DocumentTextIcon', DollarIcon = 'DollarIcon', DoneIcon = 'DoneIcon', EarthIcon = 'EarthIcon', EmptyWalletChangeIcon = 'EmptyWalletChangeIcon', EmptyWalletIcon = 'EmptyWalletIcon', EuroIcon = 'EuroIcon', GeolocationIcon = 'GeolocationIcon', GlassIcon = 'GlassIcon', GlobalIcon = 'GlobalIcon', GpsIcon = 'GpsIcon', GridIcon = 'GridIcon', InterestGrowthIcon = 'InterestGrowthIcon', InterestIcon = 'InterestIcon', JCBIcon = 'JCBIcon', LoupeIcon = 'LoupeIcon', MasterCardIcon = 'MasterCardIcon', MinusIcon = 'MinusIcon', MirIcon = 'MirIcon', MoneyIcon = 'MoneyIcon', MoneyInsuranceIcon = 'MoneyInsuranceIcon', MonitorMobileIcon = 'MonitorMobileIcon', NewDocIcon = 'NewDocIcon', OfficeIcon = 'OfficeIcon', OkIcon = 'OkIcon', PassSendIcon = 'PassSendIcon', PercentageRoundIcon = 'PercentageRoundIcon', PercentageSquareIcon = 'PercentageSquareIcon', PersonalCardIcon = 'PersonalCardIcon', PlayMarketIcon = 'PlayMarketIcon', PlusIcon = 'PlusIcon', PowerIcon = 'PowerIcon', Profile2UserIcon = 'Profile2UserIcon', ProfileIcon = 'ProfileIcon', PumpkinIcon = 'PumpkinIcon', RoundRubleIcon = 'RoundRubleIcon', SafeIcon = 'SafeIcon', ShieldTickIcon = 'ShieldTickIcon', SignDocsIcon = 'SignDocsIcon', SmallClockIcon = 'SmallClockIcon', SoundIcon = 'SoundIcon', TelegramIcon = 'TelegramIcon', UnionPayIcon = 'UnionPayIcon', UserTickIcon = 'UserTickIcon', VisaIcon = 'VisaIcon', VKIcon = 'VKIcon', WalletAdd2Icon = 'WalletAdd2Icon', WalletAddIcon = 'WalletAddIcon', WalletIcon = 'WalletIcon', WalletWithMoneyIcon = 'WalletWithMoneyIcon', WateringCan = 'WateringCan'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export enum IconTitleMap {
|
|
10
|
-
ActualBalanceIcon = 'Деньги', AirPlane = 'Самолет', AppleIcon = 'Лого «Apple»', ArrowDownIcon = 'Стрелка \'Вниз\'', ArrowLeftIcon = 'Стрелка',
|
|
10
|
+
ActualBalanceIcon = 'Деньги', AirPlane = 'Самолет', AppleIcon = 'Лого «Apple»', ArrowDownIcon = 'Стрелка \'Вниз\'', ArrowLeftIcon = 'Стрелка', ArrowUpIcon = 'Стрелка вверх', AtmIcon = 'Банкомат', BankIcon = 'Банк', BurgerIcon = 'Бургер', Calendar2Icon = 'Календарь 2', CalendarCircleIcon = 'Скруглённый календарь', CalendarIcon = 'Календарь', CalendarTickIcon = 'Календарь с галочкой', CardIcon = 'Кред. карта', CardPosIcon = 'Кред. карта под наклоном', CardTickIcon = 'Кред. карта с галочкой', CardWithGemIcon = 'Карта с драгоценностями', CarIcon = 'Машина', ChartSquareIcon = 'Деньги внутри кошелька', CinemaIcon = 'Кино', ClockIcon = 'Часы', CloseIcon = 'Крестик', ComfortableCompIcon = 'Кресло', CreditCardsIcon = 'Кредитные карты', DiscountShapeIcon = 'Скидка', DocIcon = 'Документ', DocIconMonoColor = 'Документ (одноцветный)', DocsIcon = 'Документы', DocumentTextIcon = 'Документ с текстом', DollarIcon = 'Доллар', DoneIcon = 'Зелёная \'галочка\'', EarthIcon = 'Земля', EmptyWalletChangeIcon = 'Пустой кошелёк с возвратом', EmptyWalletIcon = 'Пустой кошелёк', EuroIcon = 'Евро', GeolocationIcon = 'Геолокация', GlassIcon = 'Зеркало', GlobalIcon = 'Глобус', GpsIcon = 'Gps', GridIcon = 'Сетка (белая)', InterestGrowthIcon = 'Диаграмма роста', InterestIcon = 'Скидка', JCBIcon = 'JCB', LoupeIcon = 'Лупа', MasterCardIcon = 'MasterCard', MinusIcon = 'Минус', MirIcon = 'МИР', MoneyIcon = 'Деньги', MoneyInsuranceIcon = 'Денежное страхование', MonitorMobileIcon = 'Монитор и мобильный', NewDocIcon = 'Новый документ', OfficeIcon = 'Офис', OkIcon = 'Лого «Одноклассники»', PassSendIcon = 'Бизнес', PercentageRoundIcon = 'Проценты (круг.)', PercentageSquareIcon = 'Проценты', PersonalCardIcon = 'Персональная карта', PlayMarketIcon = 'Лого «PlayMarket»', PlusIcon = 'Плюс', PowerIcon = 'Щит', Profile2UserIcon = 'Профиль, 2 персоны', ProfileIcon = 'Профиль', PumpkinIcon = 'Тыква', RoundRubleIcon = 'Рубль (круг.)', SafeIcon = 'Сейф', ShieldTickIcon = 'Безопасность', SignDocsIcon = 'Подписанные документы', SmallClockIcon = 'Маленькие часы', SoundIcon = 'Звук', TelegramIcon = 'Лого «Telegram»', UnionPayIcon = 'UnionPay', UserTickIcon = 'Пользователь', VisaIcon = 'Visa', VKIcon = 'Лого «VK»', WalletAdd2Icon = 'Пополнение карты', WalletAddIcon = 'Кошелёк с плюсом', WalletIcon = 'Кошелёк', WalletWithMoneyIcon = 'Кошелёк с деньгами', WateringCan = 'Добавить продукт'
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -15,7 +15,7 @@ export enum IconTitleMap {
|
|
|
15
15
|
* @title Иконка
|
|
16
16
|
* @enumNames [
|
|
17
17
|
* "",
|
|
18
|
-
* 'Деньги', 'Самолет', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка', 'Стрелка
|
|
18
|
+
* 'Деньги', 'Самолет', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка', 'Стрелка вверх', 'Банкомат', 'Банк', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Деньги внутри кошелька', 'Кино', 'Часы', 'Крестик', 'Кресло', 'Кредитные карты', 'Скидка', 'Документ', 'Документ (одноцветный)', 'Документы', 'Документ с текстом', 'Доллар', 'Зелёная \'галочка\'', 'Земля', 'Пустой кошелёк с возвратом', 'Пустой кошелёк', 'Евро', 'Геолокация', 'Зеркало', 'Глобус', 'Gps', 'Сетка (белая)', 'Диаграмма роста', 'Скидка', 'JCB', 'Лупа', 'MasterCard', 'Минус', 'МИР', 'Деньги', 'Денежное страхование', 'Монитор и мобильный', 'Новый документ', 'Офис', 'Лого «Одноклассники»', 'Бизнес', 'Проценты (круг.)', 'Проценты', 'Персональная карта', 'Лого «PlayMarket»', 'Плюс', 'Щит', 'Профиль, 2 персоны', 'Профиль', 'Тыква', 'Рубль (круг.)', 'Сейф', 'Безопасность', 'Подписанные документы', 'Маленькие часы', 'Звук', 'Лого «Telegram»', 'UnionPay', 'Пользователь', 'Visa', 'Лого «VK»', 'Пополнение карты', 'Кошелёк с плюсом', 'Кошелёк', 'Кошелёк с деньгами', 'Добавить продукт'
|
|
19
19
|
* ]
|
|
20
20
|
*/
|
|
21
|
-
export type IconName = '' | 'ActualBalanceIcon' | 'AirPlane' | 'AppleIcon' | 'ArrowDownIcon' | 'ArrowLeftIcon' | '
|
|
21
|
+
export type IconName = '' | 'ActualBalanceIcon' | 'AirPlane' | 'AppleIcon' | 'ArrowDownIcon' | 'ArrowLeftIcon' | 'ArrowUpIcon' | 'AtmIcon' | 'BankIcon' | 'BurgerIcon' | 'Calendar2Icon' | 'CalendarCircleIcon' | 'CalendarIcon' | 'CalendarTickIcon' | 'CardIcon' | 'CardPosIcon' | 'CardTickIcon' | 'CardWithGemIcon' | 'CarIcon' | 'ChartSquareIcon' | 'CinemaIcon' | 'ClockIcon' | 'CloseIcon' | 'ComfortableCompIcon' | 'CreditCardsIcon' | 'DiscountShapeIcon' | 'DocIcon' | 'DocIconMonoColor' | 'DocsIcon' | 'DocumentTextIcon' | 'DollarIcon' | 'DoneIcon' | 'EarthIcon' | 'EmptyWalletChangeIcon' | 'EmptyWalletIcon' | 'EuroIcon' | 'GeolocationIcon' | 'GlassIcon' | 'GlobalIcon' | 'GpsIcon' | 'GridIcon' | 'InterestGrowthIcon' | 'InterestIcon' | 'JCBIcon' | 'LoupeIcon' | 'MasterCardIcon' | 'MinusIcon' | 'MirIcon' | 'MoneyIcon' | 'MoneyInsuranceIcon' | 'MonitorMobileIcon' | 'NewDocIcon' | 'OfficeIcon' | 'OkIcon' | 'PassSendIcon' | 'PercentageRoundIcon' | 'PercentageSquareIcon' | 'PersonalCardIcon' | 'PlayMarketIcon' | 'PlusIcon' | 'PowerIcon' | 'Profile2UserIcon' | 'ProfileIcon' | 'PumpkinIcon' | 'RoundRubleIcon' | 'SafeIcon' | 'ShieldTickIcon' | 'SignDocsIcon' | 'SmallClockIcon' | 'SoundIcon' | 'TelegramIcon' | 'UnionPayIcon' | 'UserTickIcon' | 'VisaIcon' | 'VKIcon' | 'WalletAdd2Icon' | 'WalletAddIcon' | 'WalletIcon' | 'WalletWithMoneyIcon' | 'WateringCan';
|
|
@@ -16,7 +16,7 @@ export const ArrowButton = JSX<ButtonProps>(({ className, disabled, ...rest }) =
|
|
|
16
16
|
>
|
|
17
17
|
<Img
|
|
18
18
|
className="w-4 h-4 min-w-4 min-h-4 rounded-full box-border"
|
|
19
|
-
image={{ icon: 'ArrowLeftIcon' }}
|
|
19
|
+
image={{ icon: 'ArrowLeftIcon', iconVersion: 'black' }}
|
|
20
20
|
width="16"
|
|
21
21
|
height="16"
|
|
22
22
|
asSVG
|
|
@@ -55,7 +55,7 @@ export const Foldable = JSX<FoldableProps>(
|
|
|
55
55
|
onClick={handleToggle}
|
|
56
56
|
>
|
|
57
57
|
<span className="pr-3">{isActive ? 'Скрыть' : foldButtonLabel}</span>
|
|
58
|
-
<Icon name={icon} width="20" height="20" asSVG />
|
|
58
|
+
<Icon name={icon} iconVersion="white" width="20" height="20" asSVG />
|
|
59
59
|
</button>
|
|
60
60
|
) : null}
|
|
61
61
|
</div>
|
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { IconTitleMap } from '../../icons/IconName';
|
|
3
|
+
import type { IconVersion } from '../../model/IconVersion';
|
|
3
4
|
import { projectSettings } from '../../ProjectSettings';
|
|
4
5
|
import type { IconProps } from './IconProps';
|
|
5
6
|
|
|
7
|
+
const svgUseStyleMap: Record<IconVersion, string> = {
|
|
8
|
+
normal: 'text-primary-main',
|
|
9
|
+
black: 'text-black',
|
|
10
|
+
white: 'text-black invert',
|
|
11
|
+
};
|
|
12
|
+
|
|
6
13
|
export const Icon = JSX<IconProps>(
|
|
7
14
|
({
|
|
8
15
|
className = '',
|
|
16
|
+
imageClassName = '',
|
|
9
17
|
name = '',
|
|
10
18
|
alt = `Иконка ${IconTitleMap[name] || name}`,
|
|
11
19
|
title = alt,
|
|
12
|
-
iconVersion,
|
|
20
|
+
iconVersion = 'normal',
|
|
13
21
|
asSVG,
|
|
14
22
|
...imgProps
|
|
15
23
|
}) => {
|
|
16
24
|
const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
|
|
17
|
-
const svgUseStyle = iconVersion === 'white' ? 'text-black invert' : 'text-primary-main';
|
|
18
25
|
|
|
19
26
|
if (asSVG) {
|
|
20
27
|
return (
|
|
21
28
|
<svg className={className} {...imgProps} aria-hidden="true">
|
|
22
29
|
{title ? <title>{title}</title> : null}
|
|
23
30
|
{alt ? <desc>{alt}</desc> : null}
|
|
24
|
-
<use
|
|
31
|
+
<use
|
|
32
|
+
className={`${svgUseStyleMap[iconVersion]} ${imageClassName}`}
|
|
33
|
+
href={`${href}#icon`}
|
|
34
|
+
xlinkHref={`${href}#icon`}
|
|
35
|
+
/>
|
|
25
36
|
</svg>
|
|
26
37
|
);
|
|
27
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.70",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ЦК",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"path": "lib/common.css"
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
|
-
"limit": "
|
|
166
|
+
"limit": "45 kB",
|
|
167
167
|
"path": "bundle/bundle.umd.min.js"
|
|
168
168
|
}
|
|
169
169
|
],
|
|
@@ -7,6 +7,7 @@ import type { GalleryContent } from './Gallery/GalleryContent';
|
|
|
7
7
|
import type { GracePeriodContent } from './GracePeriod/GracePeriodContent';
|
|
8
8
|
import type { GroupBlockContent } from './GroupBlock/GroupBlockContent';
|
|
9
9
|
import type { HeaderContent } from './Header/HeaderContent';
|
|
10
|
+
import type { InsuranceAmountBlockContent } from './InsuranceAmountBlock/InsuranceAmountBlockContent';
|
|
10
11
|
import type { LinkDocsContent } from './LinkDocs/LinkDocsContent';
|
|
11
12
|
import type { LinkListContent } from './LinkList/LinkListContent';
|
|
12
13
|
import type { MobileAppTileContent } from './MobileAppTile/MobileAppTileContent';
|
|
@@ -23,6 +24,7 @@ import type { TariffsTableContent } from './TariffsTable/TariffsTableContent';
|
|
|
23
24
|
import type { TextBlockContent } from './TextBlock/TextBlockContent';
|
|
24
25
|
import type { TileContent } from './Tile/TileContent';
|
|
25
26
|
import type { BonusBenefitsBlockContent } from './BonusBenefitsBlock/BonusBenefitsBlockContent';
|
|
27
|
+
import type { InsuranceContent } from './Insurance/InsuranceContent';
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
* @hidden
|
|
@@ -36,6 +38,7 @@ export type BlockContent =
|
|
|
36
38
|
| GalleryContent
|
|
37
39
|
| GracePeriodContent
|
|
38
40
|
| HeaderContent
|
|
41
|
+
| InsuranceAmountBlockContent
|
|
39
42
|
| LinkDocsContent
|
|
40
43
|
| MobileAppTileContent
|
|
41
44
|
| NavigatorTabsContent
|
|
@@ -52,4 +55,5 @@ export type BlockContent =
|
|
|
52
55
|
| NavigationContent
|
|
53
56
|
| LinkListContent
|
|
54
57
|
| GroupBlockContent
|
|
55
|
-
| BonusBenefitsBlockContent
|
|
58
|
+
| BonusBenefitsBlockContent
|
|
59
|
+
| InsuranceContent;
|
package/src/components/Blocks.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { GracePeriod } from './GracePeriod/GracePeriod';
|
|
|
11
11
|
import { Header } from './Header/Header';
|
|
12
12
|
import { Headline } from './Headline/Headline';
|
|
13
13
|
import { Insurance } from './Insurance/Insurance';
|
|
14
|
+
import { InsuranceAmountBlock } from './InsuranceAmountBlock/InsuranceAmountBlock';
|
|
14
15
|
import { LinkDocs } from './LinkDocs/LinkDocs';
|
|
15
16
|
import { MiniGallery } from './MiniGallery/MiniGallery';
|
|
16
17
|
import { MobileAppTile } from './MobileAppTile/MobileAppTile';
|
|
@@ -45,6 +46,7 @@ export const Blocks = {
|
|
|
45
46
|
Header,
|
|
46
47
|
Headline,
|
|
47
48
|
Insurance,
|
|
49
|
+
InsuranceAmountBlock,
|
|
48
50
|
LinkDocs,
|
|
49
51
|
MiniGallery,
|
|
50
52
|
MobileAppTile,
|
|
@@ -2155,7 +2155,7 @@
|
|
|
2155
2155
|
"content": {
|
|
2156
2156
|
"title": "Страховые риски и продукты",
|
|
2157
2157
|
"description": "Описание",
|
|
2158
|
-
"
|
|
2158
|
+
"sum": 500000,
|
|
2159
2159
|
"image": {
|
|
2160
2160
|
"src": "insurance.png",
|
|
2161
2161
|
"title": "страхование",
|
|
@@ -2188,6 +2188,55 @@
|
|
|
2188
2188
|
]
|
|
2189
2189
|
}
|
|
2190
2190
|
},
|
|
2191
|
+
{
|
|
2192
|
+
"type": "InsuranceAmountBlock",
|
|
2193
|
+
"style": ["col-span-12"],
|
|
2194
|
+
"content": {
|
|
2195
|
+
"title": "Выбор страховой суммы",
|
|
2196
|
+
"button": {
|
|
2197
|
+
"href": "https://rshb.ru",
|
|
2198
|
+
"text": "Выбрать программу"
|
|
2199
|
+
},
|
|
2200
|
+
"insuranceTabs": [
|
|
2201
|
+
{
|
|
2202
|
+
"title": "Индивидуальный",
|
|
2203
|
+
"cards": [
|
|
2204
|
+
{
|
|
2205
|
+
"sum": 200000,
|
|
2206
|
+
"fee": 2100,
|
|
2207
|
+
"icon": { "icon": "ActualBalanceIcon" }
|
|
2208
|
+
},
|
|
2209
|
+
{
|
|
2210
|
+
"sum": 200000,
|
|
2211
|
+
"fee": 2100,
|
|
2212
|
+
"icon": { "icon": "ActualBalanceIcon" }
|
|
2213
|
+
},
|
|
2214
|
+
{
|
|
2215
|
+
"sum": 200000,
|
|
2216
|
+
"fee": 2100,
|
|
2217
|
+
"icon": { "icon": "ActualBalanceIcon" }
|
|
2218
|
+
}
|
|
2219
|
+
]
|
|
2220
|
+
},
|
|
2221
|
+
{
|
|
2222
|
+
"title": "Семейный",
|
|
2223
|
+
"cards": [
|
|
2224
|
+
{
|
|
2225
|
+
"sum": 400000,
|
|
2226
|
+
"fee": 3600,
|
|
2227
|
+
"icon": { "icon": "ActualBalanceIcon" }
|
|
2228
|
+
},
|
|
2229
|
+
{
|
|
2230
|
+
"sum": 400000,
|
|
2231
|
+
"fee": 3600,
|
|
2232
|
+
"icon": { "icon": "ActualBalanceIcon" }
|
|
2233
|
+
}
|
|
2234
|
+
]
|
|
2235
|
+
}
|
|
2236
|
+
]
|
|
2237
|
+
}
|
|
2238
|
+
},
|
|
2239
|
+
|
|
2191
2240
|
{
|
|
2192
2241
|
"type": "Footer",
|
|
2193
2242
|
"style": ["col-span-12"],
|