@redneckz/wildless-cms-uni-blocks 0.2.96 → 0.2.99
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 +180 -163
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/BaseTile/BaseTile.js +4 -19
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
- package/dist/components/Footer/Sitemap.js +1 -1
- package/dist/components/Footer/Sitemap.js.map +1 -1
- package/dist/components/Headline/Headline.js +9 -3
- package/dist/components/Headline/Headline.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocs.js +1 -1
- package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +3 -3
- package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/dist/components/ProductBlock/ProductBlock.js +12 -4
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +13 -2
- package/dist/components/ProductBlock/ProductBlockInner.js +16 -4
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +2 -2
- package/dist/components/TextBlock/TextBlockContent.d.ts +1 -0
- package/dist/components/Tile/TileContent.d.ts +1 -1
- package/dist/model/ButtonVersion.d.ts +1 -0
- package/dist/model/LinkProps.d.ts +2 -1
- package/dist/model/SitemapProps.d.ts +2 -2
- package/dist/ui-kit/Button/ButtonProps.d.ts +6 -1
- package/dist/ui-kit/Icon/Icon.js +1 -1
- package/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/dist/ui-kit/Icon/IconProps.d.ts +49 -41
- package/dist/ui-kit/Icon/IconProps.js +45 -41
- package/dist/ui-kit/Icon/IconProps.js.map +1 -1
- package/dist/ui-kit/Img.js +9 -3
- package/dist/ui-kit/Img.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BaseTile/BaseTile.js +4 -19
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
- package/lib/components/Footer/Sitemap.js +1 -1
- package/lib/components/Footer/Sitemap.js.map +1 -1
- package/lib/components/Headline/Headline.js +10 -4
- package/lib/components/Headline/Headline.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocs.js +1 -1
- package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +3 -3
- package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
- package/lib/components/ProductBlock/ProductBlock.js +12 -4
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +13 -2
- package/lib/components/ProductBlock/ProductBlockInner.js +16 -4
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +2 -2
- package/lib/components/TextBlock/TextBlockContent.d.ts +1 -0
- package/lib/components/Tile/TileContent.d.ts +1 -1
- package/lib/model/ButtonVersion.d.ts +1 -0
- package/lib/model/LinkProps.d.ts +2 -1
- package/lib/model/SitemapProps.d.ts +2 -2
- package/lib/ui-kit/Button/ButtonProps.d.ts +6 -1
- package/lib/ui-kit/Icon/Icon.js +1 -1
- package/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/lib/ui-kit/Icon/IconProps.d.ts +49 -41
- package/lib/ui-kit/Icon/IconProps.js +45 -41
- package/lib/ui-kit/Icon/IconProps.js.map +1 -1
- package/lib/ui-kit/Img.js +9 -3
- package/lib/ui-kit/Img.js.map +1 -1
- package/package.json +3 -2
- package/src/components/Accordion/Accordion.example.json +4 -4
- package/src/components/BaseTile/BaseTile.tsx +11 -26
- package/src/components/ComparisonTable/ComparisonTable.example.json +1 -1
- package/src/components/ComparisonTable/ComparisonTableContent.ts +2 -3
- package/src/components/Footer/Sitemap.tsx +1 -1
- package/src/components/Headline/Headline.tsx +25 -8
- package/src/components/LinkDocs/LinkDocs.tsx +1 -1
- package/src/components/LinkDocs/LinkDocsContent.ts +3 -3
- package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +2 -0
- package/src/components/PictureText/PictureText.example.json +1 -1
- package/src/components/ProductBlock/ProductBlock.example.json +1 -1
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +58 -1
- package/src/components/ProductBlock/ProductBlock.tsx +19 -8
- package/src/components/ProductBlock/ProductBlockContent.ts +14 -2
- package/src/components/ProductBlock/ProductBlockInner.tsx +38 -6
- package/src/components/ProductTile/ProductTile.example.json +1 -1
- package/src/components/ProductTile/ProductTileContent.ts +2 -2
- package/src/components/TextBlock/TextBlockContent.ts +1 -0
- package/src/components/Tile/Tile.example.json +1 -1
- package/src/components/Tile/TileContent.ts +1 -1
- package/src/icons/AppleIcon.svg +1 -1
- package/src/icons/CalendarWhiteIcon.svg +17 -0
- package/src/icons/EmptyWalletWhiteIcon.svg +16 -0
- package/src/icons/GridIcon.svg +2 -2
- package/src/icons/PercentageSquareWhiteIcon.svg +16 -0
- package/src/icons/PlayMarketIcon.svg +1 -1
- package/src/model/ButtonVersion.ts +1 -0
- package/src/model/LinkProps.ts +2 -1
- package/src/model/SitemapProps.ts +2 -2
- package/src/ui-kit/Button/ButtonProps.ts +6 -1
- package/src/ui-kit/Icon/Icon.tsx +1 -1
- package/src/ui-kit/Icon/IconProps.ts +8 -0
- package/src/ui-kit/Img.tsx +23 -10
|
@@ -8,23 +8,7 @@ import { Icon } from '../../ui-kit/Icon/Icon';
|
|
|
8
8
|
import { Img } from '../../ui-kit/Img';
|
|
9
9
|
import { Title } from '../../ui-kit/Title/Title';
|
|
10
10
|
import { getColSpan } from '../../utils/getColSpan';
|
|
11
|
-
import type {
|
|
12
|
-
|
|
13
|
-
const alignFlex: Record<AlignType, string> = {
|
|
14
|
-
left: 'justify-between',
|
|
15
|
-
center: 'justify-center',
|
|
16
|
-
right: 'justify-end',
|
|
17
|
-
};
|
|
18
|
-
const alignBlock: Record<AlignType, string> = {
|
|
19
|
-
left: 'items-start',
|
|
20
|
-
center: 'items-center',
|
|
21
|
-
right: 'items-end',
|
|
22
|
-
};
|
|
23
|
-
const alignText: Record<AlignType, string> = {
|
|
24
|
-
left: 'text-left',
|
|
25
|
-
center: 'text-center',
|
|
26
|
-
right: 'text-right',
|
|
27
|
-
};
|
|
11
|
+
import type { BaseTileCommonProps, BaseTileIconButton } from './BaseTileProps';
|
|
28
12
|
|
|
29
13
|
export interface BaseTileProps extends BaseTileCommonProps, UniBlockProps {}
|
|
30
14
|
|
|
@@ -42,12 +26,11 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
42
26
|
image,
|
|
43
27
|
items,
|
|
44
28
|
version = 'primary',
|
|
45
|
-
align = 'left',
|
|
46
29
|
}) => {
|
|
47
30
|
const router = context.useRouter();
|
|
48
31
|
const { handlerDecorator } = context;
|
|
49
32
|
return (
|
|
50
|
-
<div className={`font-sans flex flex-col grow h-full
|
|
33
|
+
<div className={`font-sans flex flex-col grow h-full items-start`}>
|
|
51
34
|
{title && (
|
|
52
35
|
<Title
|
|
53
36
|
size={titleSize || getTitleSizeByClassName(className)}
|
|
@@ -56,13 +39,11 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
56
39
|
{title}
|
|
57
40
|
</Title>
|
|
58
41
|
)}
|
|
59
|
-
<div className={`flex grow w-full
|
|
60
|
-
<div className={`flex flex-col justify-between
|
|
42
|
+
<div className={`flex grow w-full justify-between`}>
|
|
43
|
+
<div className={`flex flex-col justify-between items-start`}>
|
|
61
44
|
<div>
|
|
62
45
|
{description ? (
|
|
63
|
-
<div className={`font-normal text-base mt-4 max-w-[600px]
|
|
64
|
-
{description}
|
|
65
|
-
</div>
|
|
46
|
+
<div className={`font-normal text-base mt-4 max-w-[600px]`}>{description}</div>
|
|
66
47
|
) : null}
|
|
67
48
|
{children}
|
|
68
49
|
{items?.length ? renderItems(items, version) : null}
|
|
@@ -103,11 +84,15 @@ function renderItems(items: string[] = [], version?: BlockVersion) {
|
|
|
103
84
|
);
|
|
104
85
|
}
|
|
105
86
|
|
|
106
|
-
function renderButton({ icon, ...button }: BaseTileIconButton, i: number) {
|
|
87
|
+
function renderButton({ icon, asSVG, ...button }: BaseTileIconButton, i: number) {
|
|
107
88
|
if (!button?.text) return;
|
|
108
89
|
|
|
109
90
|
return icon ? (
|
|
110
|
-
<Button
|
|
91
|
+
<Button
|
|
92
|
+
key={String(i)}
|
|
93
|
+
appendLeft={<Icon name={icon} asSVG width="24" height="24" />}
|
|
94
|
+
{...button}
|
|
95
|
+
/>
|
|
111
96
|
) : (
|
|
112
97
|
<Button key={String(i)} {...button} />
|
|
113
98
|
);
|
|
@@ -27,7 +27,6 @@ export interface ColumnHeader {
|
|
|
27
27
|
/** @title Заголовок */
|
|
28
28
|
title?: string;
|
|
29
29
|
icon?: IconName;
|
|
30
|
-
/** @hidden */
|
|
31
30
|
image?: Picture;
|
|
32
31
|
link?: LinkProps;
|
|
33
32
|
}
|
|
@@ -58,8 +57,8 @@ export interface ComparisonTableContent {
|
|
|
58
57
|
rowHeaders?: RowHeader[];
|
|
59
58
|
/** @title Продукты */
|
|
60
59
|
columns?: Column[];
|
|
61
|
-
/** @title Отображать заданное количество строк */
|
|
62
|
-
visibleRowLength?: number;
|
|
63
60
|
/** @title Закрасить первую колонку */
|
|
64
61
|
isColoredFirstColumn?: boolean;
|
|
62
|
+
/** @title Отображать заданное количество строк */
|
|
63
|
+
visibleRowLength?: number;
|
|
65
64
|
}
|
|
@@ -37,7 +37,7 @@ const renderColumn = (c: TopMenuItem, index: number, { router, handlerDecorator
|
|
|
37
37
|
{text || `Раздел ${index}`}
|
|
38
38
|
</a>
|
|
39
39
|
{items?.map((_, i) => (
|
|
40
|
-
<ColumnItem key={String(i)} {...useLink({ router, handlerDecorator }, _)} />
|
|
40
|
+
<ColumnItem key={String(i)} {...useLink({ router, handlerDecorator }, _)} index={i} />
|
|
41
41
|
))}
|
|
42
42
|
</div>
|
|
43
43
|
);
|
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
|
|
3
3
|
import type { UniBlockProps } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { Title } from '../../ui-kit/Title/Title';
|
|
5
5
|
import type { HeadlineContent } from './HeadlineContent';
|
|
6
|
+
import { AlignType } from '../BaseTile/BaseTileProps';
|
|
6
7
|
|
|
7
8
|
export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const alignText: Record<AlignType, string> = {
|
|
11
|
+
left: 'text-left',
|
|
12
|
+
center: 'text-center',
|
|
13
|
+
right: 'text-right',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Headline = JSX<HeadlineProps>(
|
|
17
|
+
({ bgColor = 'transparent', align = 'left', className, title, description }) => {
|
|
18
|
+
const textClasses = alignText[align];
|
|
19
|
+
return (
|
|
20
|
+
<section className={`p-[50px] ${bgColor} ${className || ''} `}>
|
|
21
|
+
{title && (
|
|
22
|
+
<Title size="L" className={`text-primary-text mt-0 font-medium ${textClasses}`}>
|
|
23
|
+
{title}
|
|
24
|
+
</Title>
|
|
25
|
+
)}
|
|
26
|
+
{description && (
|
|
27
|
+
<p className={`font-normal text-base mt-4 ${textClasses}`}>{description}</p>
|
|
28
|
+
)}
|
|
29
|
+
</section>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
);
|
|
@@ -49,7 +49,7 @@ export const LinkDocs = JSX<LinkDocsProps>(
|
|
|
49
49
|
role="listitem"
|
|
50
50
|
{...linkProps}
|
|
51
51
|
>
|
|
52
|
-
{icon && <Icon className="mr-2.5" name={icon} width="24px" height="24px" />}
|
|
52
|
+
{icon && <Icon className="mr-2.5 h-fit" name={icon} width="24px" height="24px" />}
|
|
53
53
|
<span className="self-center">
|
|
54
54
|
{text}
|
|
55
55
|
<span className="text-secondary-text group-hover:text-primary-main">
|
|
@@ -16,11 +16,11 @@ export interface LinkDocsItem extends LinkProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* @title Список документов
|
|
18
18
|
*/
|
|
19
|
-
export interface LinkDocsContent extends Pick<BaseTileCommonProps, '
|
|
19
|
+
export interface LinkDocsContent extends Pick<BaseTileCommonProps, 'title' | 'align'> {
|
|
20
|
+
/** @title Отображение списка */
|
|
21
|
+
columnsMode?: LinkColumnsMode;
|
|
20
22
|
/** @title Название иконки */
|
|
21
23
|
icon?: IconName;
|
|
22
24
|
/** @title Список */
|
|
23
25
|
documents?: LinkDocsItem[];
|
|
24
|
-
/** @title Отображение списка */
|
|
25
|
-
columnsMode?: LinkColumnsMode;
|
|
26
26
|
}
|
|
@@ -18,6 +18,7 @@ export default {
|
|
|
18
18
|
text: 'App Store',
|
|
19
19
|
icon: 'AppleIcon',
|
|
20
20
|
href: '#',
|
|
21
|
+
asSVG: true,
|
|
21
22
|
version: 'secondary',
|
|
22
23
|
},
|
|
23
24
|
{
|
|
@@ -25,6 +26,7 @@ export default {
|
|
|
25
26
|
text: 'Google Play',
|
|
26
27
|
icon: 'PlayMarketIcon',
|
|
27
28
|
href: '#',
|
|
29
|
+
asSVG: true,
|
|
28
30
|
version: 'secondary',
|
|
29
31
|
},
|
|
30
32
|
]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { context } from '../../setup-fixture';
|
|
2
2
|
|
|
3
|
-
import { ProductBlock } from './ProductBlock';
|
|
4
3
|
import type { Picture } from '../../model/Picture';
|
|
4
|
+
import { ProductBlock } from './ProductBlock';
|
|
5
5
|
|
|
6
6
|
const image: Picture = {
|
|
7
7
|
src: 'money-1.png',
|
|
@@ -69,6 +69,63 @@ export default {
|
|
|
69
69
|
/>
|
|
70
70
|
</div>
|
|
71
71
|
),
|
|
72
|
+
secondary: (
|
|
73
|
+
<div className="container grid grid-cols-12">
|
|
74
|
+
<ProductBlock
|
|
75
|
+
context={context}
|
|
76
|
+
className="col-span-12"
|
|
77
|
+
title={'Потребительский кредит наличными'}
|
|
78
|
+
version={'secondary'}
|
|
79
|
+
description="Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт."
|
|
80
|
+
breadcrumbs={[
|
|
81
|
+
{
|
|
82
|
+
text: 'Главная',
|
|
83
|
+
href: '/',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
text: 'Кредитные карты',
|
|
87
|
+
href: '/credit',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
text: 'Кредитная карта Своя Union Pay',
|
|
91
|
+
href: '#',
|
|
92
|
+
},
|
|
93
|
+
]}
|
|
94
|
+
benefits={[
|
|
95
|
+
{
|
|
96
|
+
label: 'До 5 млн ₽',
|
|
97
|
+
description: 'Кредитный лимит',
|
|
98
|
+
icon: 'EmptyWalletWhiteIcon',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: 'От 16,9%',
|
|
102
|
+
description: 'Ставка по кредиту',
|
|
103
|
+
icon: 'PercentageSquareWhiteIcon',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: 'До 5 лет',
|
|
107
|
+
description: 'Срок кредитования',
|
|
108
|
+
icon: 'CalendarWhiteIcon',
|
|
109
|
+
},
|
|
110
|
+
]}
|
|
111
|
+
buttons={[
|
|
112
|
+
{
|
|
113
|
+
href: 'https://rshb.ru',
|
|
114
|
+
text: 'Оформить карту',
|
|
115
|
+
target: '_blank',
|
|
116
|
+
version: 'secondary',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
href: 'https://rshb.ru',
|
|
120
|
+
text: 'Подробнее',
|
|
121
|
+
target: '_blank',
|
|
122
|
+
version: 'primary',
|
|
123
|
+
},
|
|
124
|
+
]}
|
|
125
|
+
image={image}
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
128
|
+
),
|
|
72
129
|
'with items': (
|
|
73
130
|
<div className="container grid grid-cols-12">
|
|
74
131
|
<ProductBlock
|
|
@@ -1,32 +1,43 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { useLink } from '../../hooks/useLink';
|
|
3
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
4
4
|
import type { UniBlockProps } from '../../types';
|
|
5
5
|
import { Breadcrumb } from '../../ui-kit/Breadcrumb';
|
|
6
|
-
import { useLink } from '../../hooks/useLink';
|
|
7
6
|
import { joinList } from '../../utils/joinList';
|
|
7
|
+
import type { ProductBlockContent } from './ProductBlockContent';
|
|
8
|
+
import { ProductBlockInner } from './ProductBlockInner';
|
|
8
9
|
|
|
9
10
|
export interface ProductBlockProps extends ProductBlockContent, UniBlockProps {}
|
|
10
11
|
|
|
12
|
+
const productBlockStyleMap: Record<BlockVersion, string> = {
|
|
13
|
+
primary: 'bg-white text-primary-text',
|
|
14
|
+
secondary: 'bg-primary-main text-white',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const breadcrumbsStyleMap: Record<BlockVersion, string> = {
|
|
18
|
+
primary: 'text-secondary-text',
|
|
19
|
+
secondary: 'text-white/80',
|
|
20
|
+
};
|
|
21
|
+
|
|
11
22
|
export const ProductBlock = JSX<ProductBlockProps>((props) => {
|
|
12
|
-
const { context, className, breadcrumbs } = props;
|
|
23
|
+
const { context, className, breadcrumbs, version = 'primary' } = props;
|
|
13
24
|
const router = context.useRouter();
|
|
14
25
|
const { handlerDecorator } = context;
|
|
15
26
|
return (
|
|
16
27
|
<section
|
|
17
|
-
className={`font-sans
|
|
28
|
+
className={`font-sans pt-10 pl-[50px] pb-[50px] pr-[7.5rem] box-border min-h-[420px] ${
|
|
18
29
|
className || ''
|
|
19
|
-
}`}
|
|
30
|
+
} ${productBlockStyleMap[version]}`}
|
|
20
31
|
>
|
|
21
32
|
{breadcrumbs?.length ? (
|
|
22
33
|
<div className="text-xs mb-6">
|
|
23
|
-
{joinList(<span className=
|
|
34
|
+
{joinList(<span className={`mx-2 ${breadcrumbsStyleMap[version]}`}>/</span>)(
|
|
24
35
|
breadcrumbs.map((breadcrumb, i) => (
|
|
25
36
|
<Breadcrumb
|
|
26
37
|
key={String(i)}
|
|
27
38
|
{...useLink(
|
|
28
39
|
{ router, handlerDecorator },
|
|
29
|
-
{ className:
|
|
40
|
+
{ className: breadcrumbsStyleMap[version], ...breadcrumb },
|
|
30
41
|
)}
|
|
31
42
|
/>
|
|
32
43
|
)),
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import type { LinkProps } from '../../model/LinkProps';
|
|
2
|
+
import type { TitleSize } from '../../ui-kit/Title/TitleProps';
|
|
2
3
|
import type { BaseTileCommonProps } from '../BaseTile/BaseTileProps';
|
|
3
4
|
import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
4
5
|
|
|
5
|
-
export interface ProductBlockInnerCommonProps
|
|
6
|
-
|
|
6
|
+
export interface ProductBlockInnerCommonProps
|
|
7
|
+
extends Omit<BaseTileCommonProps, 'align' | 'titleSize'> {
|
|
8
|
+
/**
|
|
9
|
+
* @title Размер заголовка
|
|
10
|
+
* @default M
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
titleSize?: TitleSize;
|
|
14
|
+
/**
|
|
15
|
+
* @title Преимущества
|
|
16
|
+
* @minItems 2
|
|
17
|
+
* @maxItems 3
|
|
18
|
+
*/
|
|
7
19
|
benefits?: Benefit[];
|
|
8
20
|
}
|
|
9
21
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
3
|
import type { UniBlockProps } from '../../types';
|
|
3
4
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
5
|
import { Img } from '../../ui-kit/Img';
|
|
@@ -8,8 +9,32 @@ import type { ProductBlockInnerCommonProps } from './ProductBlockContent';
|
|
|
8
9
|
|
|
9
10
|
export interface ProductBlockInnerProps extends ProductBlockInnerCommonProps, UniBlockProps {}
|
|
10
11
|
|
|
12
|
+
const benefitIconBgStyleMap: Record<BlockVersion, string> = {
|
|
13
|
+
primary: 'bg-main',
|
|
14
|
+
secondary: 'bg-white/30',
|
|
15
|
+
};
|
|
16
|
+
const benefitTitleStyleMap: Record<BlockVersion, string> = {
|
|
17
|
+
primary: 'text-primary-text',
|
|
18
|
+
secondary: 'text-white',
|
|
19
|
+
};
|
|
20
|
+
const benefitDescStyleMap: Record<BlockVersion, string> = {
|
|
21
|
+
primary: 'text-secondary-text',
|
|
22
|
+
secondary: 'text-white',
|
|
23
|
+
};
|
|
24
|
+
|
|
11
25
|
export const ProductBlockInner = JSX<ProductBlockInnerProps>(
|
|
12
|
-
({
|
|
26
|
+
({
|
|
27
|
+
className,
|
|
28
|
+
context,
|
|
29
|
+
title,
|
|
30
|
+
titleSize,
|
|
31
|
+
description,
|
|
32
|
+
benefits,
|
|
33
|
+
buttons,
|
|
34
|
+
image,
|
|
35
|
+
items,
|
|
36
|
+
version = 'primary',
|
|
37
|
+
}) => {
|
|
13
38
|
return (
|
|
14
39
|
<div className={`flex grow justify-between items-stretch ${className || ''}`}>
|
|
15
40
|
<div className={'flex flex-col'}>
|
|
@@ -20,9 +45,12 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
|
|
|
20
45
|
description={description}
|
|
21
46
|
items={items}
|
|
22
47
|
buttons={buttons}
|
|
48
|
+
version={version}
|
|
23
49
|
>
|
|
24
50
|
{benefits?.length ? (
|
|
25
|
-
<div className="flex gap-6 mt-6 mb-3.5">
|
|
51
|
+
<div className="flex gap-6 mt-6 mb-3.5">
|
|
52
|
+
{benefits.map((_, i) => renderBenefit(_, i, version))}
|
|
53
|
+
</div>
|
|
26
54
|
) : null}
|
|
27
55
|
</BaseTile>
|
|
28
56
|
</div>
|
|
@@ -32,21 +60,25 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
|
|
|
32
60
|
},
|
|
33
61
|
);
|
|
34
62
|
|
|
35
|
-
function renderBenefit(benefit: Benefit, i: number) {
|
|
63
|
+
function renderBenefit(benefit: Benefit, i: number, version: string) {
|
|
36
64
|
return (
|
|
37
65
|
<div key={String(i)} className="flex gap-4 items-center">
|
|
38
66
|
{benefit.icon && (
|
|
39
67
|
<Icon
|
|
40
|
-
className=
|
|
68
|
+
className={`w-[50px] h-[50px] min-w-[50px] min-h-[50px] rounded-full p-[10px] box-border ${benefitIconBgStyleMap[version]}`}
|
|
41
69
|
name={benefit.icon}
|
|
42
70
|
width="24"
|
|
43
71
|
height="24"
|
|
44
72
|
/>
|
|
45
73
|
)}
|
|
46
74
|
<div className="flex gap-1 flex-col h-full max-w-[149px]">
|
|
47
|
-
<h4 className=
|
|
75
|
+
<h4 className={`font-medium text-xl m-0 ${benefitTitleStyleMap[version]}`}>
|
|
76
|
+
{benefit.label}
|
|
77
|
+
</h4>
|
|
48
78
|
{benefit.description && (
|
|
49
|
-
<div className=
|
|
79
|
+
<div className={`font-normal text-sm ${benefitDescStyleMap[version]}`}>
|
|
80
|
+
{benefit.description}
|
|
81
|
+
</div>
|
|
50
82
|
)}
|
|
51
83
|
</div>
|
|
52
84
|
</div>
|
|
@@ -4,7 +4,7 @@ import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
|
4
4
|
/**
|
|
5
5
|
* @title Продуктовая плитка
|
|
6
6
|
*/
|
|
7
|
-
export interface ProductTileContent extends BaseTileCommonProps {
|
|
7
|
+
export interface ProductTileContent extends Omit<BaseTileCommonProps, 'align'> {
|
|
8
8
|
/** @title Преимущества */
|
|
9
|
-
benefits?: Benefit[];
|
|
9
|
+
benefits?: Omit<Benefit, 'icon'>[];
|
|
10
10
|
}
|
package/src/icons/AppleIcon.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg id="icon" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 24"><path d="M18.406 12.761c-.023-3.028 2.793-4.511 2.93-4.572-1.603-2.073-4.075-2.357-4.968-2.377-2.083-.204-4.098 1.117-5.174 1.117-1.076 0-2.725-1.097-4.488-1.056-2.266.04-4.395 1.198-5.563 3.007-2.404 3.698-.618 9.124 1.694 12.09 1.145 1.464 2.496 3.09 4.259 3.028 1.717-.06 2.358-.975 4.441-.975 2.06 0 2.656.975 4.465.935 1.854-.02 3.022-1.463 4.12-2.947 1.329-1.666 1.855-3.332 1.878-3.413 0 0-3.549-1.2-3.594-4.837Zm-3.389-8.92c.916-1.037 1.557-2.419 1.374-3.841-1.35.061-3.022.833-3.984 1.829-.847.894-1.625 2.337-1.42 3.698 1.512.102 3.069-.67 4.03-1.686Z" fill="
|
|
1
|
+
<svg id="icon" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 24"><path d="M18.406 12.761c-.023-3.028 2.793-4.511 2.93-4.572-1.603-2.073-4.075-2.357-4.968-2.377-2.083-.204-4.098 1.117-5.174 1.117-1.076 0-2.725-1.097-4.488-1.056-2.266.04-4.395 1.198-5.563 3.007-2.404 3.698-.618 9.124 1.694 12.09 1.145 1.464 2.496 3.09 4.259 3.028 1.717-.06 2.358-.975 4.441-.975 2.06 0 2.656.975 4.465.935 1.854-.02 3.022-1.463 4.12-2.947 1.329-1.666 1.855-3.332 1.878-3.413 0 0-3.549-1.2-3.594-4.837Zm-3.389-8.92c.916-1.037 1.557-2.419 1.374-3.841-1.35.061-3.022.833-3.984 1.829-.847.894-1.625 2.337-1.42 3.698 1.512.102 3.069-.67 4.03-1.686Z" fill="currentColor"/></svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path
|
|
3
|
+
stroke="#fff"
|
|
4
|
+
stroke-width="2"
|
|
5
|
+
stroke-miterlimit="10"
|
|
6
|
+
stroke-linecap="round"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
d="M8 2v3M16 2v3M3.5 9.09h17M3 13.01V8.5c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5V17c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5"
|
|
9
|
+
/>
|
|
10
|
+
<path
|
|
11
|
+
stroke="#fff"
|
|
12
|
+
stroke-width="3"
|
|
13
|
+
stroke-linecap="round"
|
|
14
|
+
stroke-linejoin="round"
|
|
15
|
+
d="M15.991 13h.018M15.991 17.006h.018M11.991 13h.018M11.991 17.006h.018M7.991 13h.018M7.991 17.006h.018"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path
|
|
3
|
+
stroke="#fff"
|
|
4
|
+
stroke-width="2"
|
|
5
|
+
stroke-linecap="round"
|
|
6
|
+
stroke-linejoin="round"
|
|
7
|
+
d="M2.5 14.07v-2.56c0-2.07 1.69-3.76 3.76-3.76h11.48c2.07 0 3.76 1.69 3.76 3.76v1.44h-2.02c-.56 0-1.07.22-1.44.6-.42.41-.66 1-.6 1.63.09 1.08 1.08 1.87 2.16 1.87h1.9v1.19c0 2.07-1.69 3.76-3.76 3.76H6.26c-2.07 0-3.76-1.69-3.76-3.76M12.28 2.17a1.9 1.9 0 0 1 2.57 1.78v3.8"
|
|
8
|
+
/>
|
|
9
|
+
<path
|
|
10
|
+
stroke="#fff"
|
|
11
|
+
stroke-width="2"
|
|
12
|
+
stroke-linecap="round"
|
|
13
|
+
stroke-linejoin="round"
|
|
14
|
+
d="M2.5 12.41V7.84c0-1.19.73-2.25 1.84-2.67l3.97-1.5M22.56 13.97v2.06c0 .55-.44 1-1 1.02H19.6c-1.08 0-2.07-.79-2.16-1.87-.06-.63.18-1.22.6-1.63.37-.38.88-.6 1.44-.6h2.08c.56.02 1 .47 1 1.02ZM7 12h7"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
package/src/icons/GridIcon.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg id="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 33">
|
|
2
|
-
<rect width="32" height="32" y=".5" rx="16"/>
|
|
2
|
+
<rect fill="#F5F7F9" width="32" height="32" y=".5" rx="16"/>
|
|
3
3
|
<path fill="#1C1C1C" 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
|
-
</svg>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path
|
|
3
|
+
stroke="#fff"
|
|
4
|
+
stroke-width="2"
|
|
5
|
+
stroke-linecap="round"
|
|
6
|
+
stroke-linejoin="round"
|
|
7
|
+
d="M2 13.05V15c0 5 2 7 7 7h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9M8.32 15.27l6.54-6.54"
|
|
8
|
+
/>
|
|
9
|
+
<path
|
|
10
|
+
stroke="#fff"
|
|
11
|
+
stroke-width="2"
|
|
12
|
+
stroke-linecap="round"
|
|
13
|
+
stroke-linejoin="round"
|
|
14
|
+
d="M8.73 10.37a1.23 1.23 0 1 0 0-2.46 1.23 1.23 0 0 0 0 2.46ZM15.27 16.09a1.23 1.23 0 1 0 0-2.46 1.23 1.23 0 0 0 0 2.46Z"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg id="icon" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 23"><path d="M0 21.427V1.576C0 .883.447.284 1.094 0L13.85 11.498 1.089 23a1.89 1.89 0 0 1-.795-.646A1.625 1.625 0 0 1 0 21.427Zm17.899-6.282-13.95 7.259 11.002-9.915 2.948 2.656Zm4.335-5.035c.237.162.428.37.561.61.133.239.203.502.205.77.002.267-.064.53-.193.771s-.317.452-.551.617l-2.964 1.542-3.241-2.922 3.24-2.92 2.944 1.532ZM3.959.598l13.938 7.253-2.945 2.654L3.958.598Z" fill="
|
|
1
|
+
<svg id="icon" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 23"><path d="M0 21.427V1.576C0 .883.447.284 1.094 0L13.85 11.498 1.089 23a1.89 1.89 0 0 1-.795-.646A1.625 1.625 0 0 1 0 21.427Zm17.899-6.282-13.95 7.259 11.002-9.915 2.948 2.656Zm4.335-5.035c.237.162.428.37.561.61.133.239.203.502.205.77.002.267-.064.53-.193.771s-.317.452-.551.617l-2.964 1.542-3.241-2.922 3.24-2.92 2.944 1.532ZM3.959.598l13.938 7.253-2.945 2.654L3.958.598Z" fill="currentColor"/></svg>
|
package/src/model/LinkProps.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @title Таргет (target)
|
|
3
3
|
* @enumNames [
|
|
4
|
+
* "",
|
|
4
5
|
* "self (текущее окно или фрейм)",
|
|
5
6
|
* "blank (новое окно)",
|
|
6
7
|
* "parent (фрейм-родитель)",
|
|
7
8
|
* "top (текущее окно)"
|
|
8
9
|
* ]
|
|
9
10
|
*/
|
|
10
|
-
export type Target = '
|
|
11
|
+
export type Target = '' | '_self' | '_blank' | '_parent' | '_top';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* @title Ссылка
|
|
@@ -13,7 +13,10 @@ export interface ButtonAdditionalProps {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export interface ButtonProps extends ButtonAdditionalProps, LinkProps {
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title Текст
|
|
18
|
+
* @default Кнопка
|
|
19
|
+
*/
|
|
17
20
|
text?: string;
|
|
18
21
|
version?: ButtonVersion;
|
|
19
22
|
}
|
|
@@ -25,4 +28,6 @@ export interface ButtonWithIconProps extends ButtonProps {
|
|
|
25
28
|
appendLeft?: any;
|
|
26
29
|
/** @hidden */
|
|
27
30
|
rounded?: boolean;
|
|
31
|
+
/** @hidden */
|
|
32
|
+
asSVG?: boolean;
|
|
28
33
|
}
|
package/src/ui-kit/Icon/Icon.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { projectSettings } from '../../ProjectSettings';
|
|
|
3
3
|
import type { IconProps } from './IconProps';
|
|
4
4
|
|
|
5
5
|
export const Icon = JSX<IconProps>(
|
|
6
|
-
({ className, name, alt = `Icon ${name}`, title = alt, asSVG, ...imgProps }) => {
|
|
6
|
+
({ className = '', name, alt = `Icon ${name}`, title = alt, asSVG, ...imgProps }) => {
|
|
7
7
|
const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
|
|
8
8
|
|
|
9
9
|
if (asSVG) {
|