@redneckz/wildless-cms-uni-blocks 0.6.50 → 0.7.1
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 +71 -19
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/bundle/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/bundle/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/bundle/utils/style.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CarouselCard/CarouselCard.js +2 -2
- package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +14 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/dist/ui-kit/BlockWrapper.js +1 -1
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/dist/utils/style.d.ts +1 -0
- package/dist/utils/style.js +5 -0
- package/dist/utils/style.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/CarouselCard/CarouselCard.js +2 -2
- package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.d.ts +5 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +12 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/lib/ui-kit/BlockWrapper.js +1 -1
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/lib/utils/style.d.ts +1 -0
- package/lib/utils/style.js +2 -0
- package/lib/utils/style.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +25 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/bundle/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/bundle/utils/style.d.ts +1 -0
- package/mobile/dist/components/CarouselCard/CarouselCard.js +2 -2
- package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +14 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/mobile/dist/ui-kit/BlockWrapper.js +1 -1
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/dist/utils/style.d.ts +1 -0
- package/mobile/dist/utils/style.js +5 -0
- package/mobile/dist/utils/style.js.map +1 -0
- package/mobile/lib/components/CarouselCard/CarouselCard.js +2 -2
- package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +12 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/mobile/lib/ui-kit/BlockWrapper.js +1 -1
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/lib/utils/style.d.ts +1 -0
- package/mobile/lib/utils/style.js +2 -0
- package/mobile/lib/utils/style.js.map +1 -0
- package/mobile/src/common.css +11 -0
- package/mobile/src/components/Carousel/Carousel.ui.json +8 -0
- package/mobile/src/components/CarouselCard/CarouselCard.tsx +11 -5
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +1 -1
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +11 -3
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +29 -17
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +1 -1
- package/mobile/src/components/LinkDocs/LinkDocsContent.ts +4 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +18 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +23 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.ui.json +1 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +6 -0
- package/mobile/src/ui-kit/BlockWrapper.tsx +1 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +19 -10
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +6 -2
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +20 -4
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +8 -0
- package/mobile/src/utils/style.ts +2 -0
- package/package.json +2 -2
- package/src/common.css +11 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/Carousel/Carousel.ui.json +8 -0
- package/src/components/CarouselCard/CarouselCard.tsx +11 -5
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +1 -1
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +11 -3
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +3 -3
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +29 -17
- package/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +1 -1
- package/src/components/LinkDocs/LinkDocsContent.ts +4 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +18 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +27 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +23 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.ui.json +1 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +6 -0
- package/src/icons/IconName.ts +333 -6
- package/src/ui-kit/BlockWrapper.tsx +1 -1
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +19 -10
- package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +6 -1
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +6 -2
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +20 -4
- package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +8 -0
- package/src/utils/style.ts +2 -0
package/src/components/Blocks.ts
CHANGED
|
@@ -50,6 +50,7 @@ import { RichTextBlock } from './RichTextBlock/RichTextBlock';
|
|
|
50
50
|
import { RollupItem } from './RollupItem/RollupItem';
|
|
51
51
|
import { SafeDepositRental } from './SafeDepositRental/SafeDepositRental';
|
|
52
52
|
import { StepsBlock } from './StepsBlock/StepsBlock';
|
|
53
|
+
import { SwipeListControlBlock } from './SwipeListControlBlock/SwipeListControlBlock';
|
|
53
54
|
import { Tabs } from './Tabs/Tabs';
|
|
54
55
|
import { TariffsTable } from './TariffsTable/TariffsTable';
|
|
55
56
|
import { TextBlock } from './TextBlock/TextBlock';
|
|
@@ -109,6 +110,7 @@ export const Blocks: BlocksRegistry = {
|
|
|
109
110
|
RollupItem,
|
|
110
111
|
SafeDepositRental,
|
|
111
112
|
StepsBlock,
|
|
113
|
+
SwipeListControlBlock,
|
|
112
114
|
Tabs,
|
|
113
115
|
TariffsTable,
|
|
114
116
|
TextBlock,
|
|
@@ -10,20 +10,26 @@ export interface CarouselCardProps extends CarouselCardContent, UniBlockProps {}
|
|
|
10
10
|
const BLOCK_CLASSES = 'absolute border border-solid border-gray w-full h-full';
|
|
11
11
|
|
|
12
12
|
const CARD_WIDTH_MAP: Record<CarouselCardVersion, string> = {
|
|
13
|
-
normal: 'min-w-[
|
|
13
|
+
normal: 'min-w-[970px]',
|
|
14
14
|
mini: 'min-w-[355px]',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const CarouselCard = JSX<CarouselCardProps>(
|
|
18
18
|
({ className = '', button, description, title, version = 'normal' }) => (
|
|
19
|
-
<section className={`flex pb-9 pl-12 ${CARD_WIDTH_MAP[version]} ${className}`}>
|
|
19
|
+
<section className={`flex pb-9 pl-12 border-box ${CARD_WIDTH_MAP[version]} ${className}`}>
|
|
20
20
|
<div className="relative w-full">
|
|
21
21
|
<div className={`${BLOCK_CLASSES} z-10 top-9 right-12 bg-green-dark`} />
|
|
22
22
|
<div className={`${BLOCK_CLASSES} z-10 top-6 right-8 bg-green`} />
|
|
23
23
|
<div className={`${BLOCK_CLASSES} z-10 top-3 right-4 bg-green-light`} />
|
|
24
|
-
<div className="relative bg-white z-10
|
|
25
|
-
<Headline
|
|
26
|
-
|
|
24
|
+
<div className="relative bg-white z-10 p-10 border border-solid border-green-light">
|
|
25
|
+
<Headline
|
|
26
|
+
className="!p-0"
|
|
27
|
+
title={title}
|
|
28
|
+
description={description}
|
|
29
|
+
headlineVersion="L"
|
|
30
|
+
align="text-left"
|
|
31
|
+
/>
|
|
32
|
+
{button ? <div className="mt-14">{renderButton({ button })}</div> : null}
|
|
27
33
|
</div>
|
|
28
34
|
</div>
|
|
29
35
|
</section>
|
|
@@ -16,7 +16,7 @@ export const CarouselProgramsCard = JSX<CarouselTariffsCardProps>(
|
|
|
16
16
|
className={`font-sans border border-gray flex min-w-[536px] ${VersionStyleMap[version]} ${className}`}
|
|
17
17
|
{...rest}
|
|
18
18
|
>
|
|
19
|
-
<div className="w-[200px] min-w-[200px] self-
|
|
19
|
+
<div className="w-[200px] min-w-[200px] self-center">
|
|
20
20
|
{icon?.icon ? <Img image={getIconWithVersion(icon)} asSVG /> : null}
|
|
21
21
|
{icon?.src ? <Img image={icon} /> : null}
|
|
22
22
|
</div>
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "Заголовок",
|
|
2
|
+
"title": "Заголовок карточки",
|
|
3
3
|
"button": {
|
|
4
4
|
"href": "",
|
|
5
5
|
"text": "Кнопка",
|
|
6
6
|
"target": "_self",
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "secondary"
|
|
8
|
+
},
|
|
9
|
+
"icon": {
|
|
10
|
+
"icon": "",
|
|
11
|
+
"format": "webp",
|
|
12
|
+
"size": {
|
|
13
|
+
"width": 267,
|
|
14
|
+
"height": 73
|
|
15
|
+
}
|
|
8
16
|
},
|
|
9
17
|
"isHighlighting": false,
|
|
10
|
-
"
|
|
18
|
+
"cardCells": [
|
|
11
19
|
{
|
|
12
20
|
"title": "Ячейка 1-1",
|
|
13
21
|
"description": "Описание 1-1"
|
|
@@ -27,7 +27,7 @@ const buttonSecondary: ButtonProps = {
|
|
|
27
27
|
version: 'secondary',
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const cardCells = [
|
|
31
31
|
{ title: 'Открытие расчетного счета', description: 'Бесплатно' },
|
|
32
32
|
{ title: 'Внутрибанковские платежи', description: '0 ₽' },
|
|
33
33
|
{ title: 'Внешние платежи, до 10 шт.', description: '0 ₽' },
|
|
@@ -43,14 +43,14 @@ export const TARIFFS_CARD: CarouselTariffsCardContent = {
|
|
|
43
43
|
title: 'Расчётный эконом',
|
|
44
44
|
icon: imageMonth,
|
|
45
45
|
button: buttonSecondary,
|
|
46
|
-
|
|
46
|
+
cardCells,
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
export const TARIFFS_CARD_HIT: CarouselTariffsCardContent = {
|
|
50
50
|
icon: imageMonth,
|
|
51
51
|
title: 'Расчётный эконом',
|
|
52
52
|
button,
|
|
53
|
-
|
|
53
|
+
cardCells,
|
|
54
54
|
isHighlighting: true,
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -1,49 +1,52 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
3
|
-
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
|
-
import { VNode } from '../../model/VNode';
|
|
5
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
3
|
import { Button } from '../../ui-kit/Button/Button';
|
|
7
4
|
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
8
5
|
import { FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps';
|
|
9
6
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
7
|
+
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
10
8
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
11
9
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
12
10
|
import { Img } from '../../ui-kit/Img/Img';
|
|
11
|
+
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
13
12
|
import type { CarouselTariffsCardContent } from './CarouselTariffsCardContent';
|
|
13
|
+
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
14
|
+
import type { Picture } from '../../model/Picture';
|
|
15
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
16
|
+
import type { VNode } from '../../model/VNode';
|
|
14
17
|
|
|
15
18
|
export interface CarouselTariffsCardProps extends CarouselTariffsCardContent, UniBlockProps {}
|
|
16
19
|
|
|
17
|
-
const
|
|
20
|
+
const VISIBLE_CELLS_COUNT = 1;
|
|
18
21
|
|
|
19
22
|
export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
|
|
20
|
-
({ className = '', title, icon, isHighlighting, button,
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
23
|
+
({ className = '', title, icon, isHighlighting, button, cardCells = [], ...rest }) => {
|
|
24
|
+
const cellsNode = cardCells.map(renderCardInfo);
|
|
25
|
+
const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
|
|
26
|
+
const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
|
|
24
27
|
|
|
25
28
|
return (
|
|
26
29
|
<BlockWrapper
|
|
27
|
-
className={`font-sans relative bg-white border border-gray min-w-[322px] p-8
|
|
30
|
+
className={`font-sans relative bg-white border border-gray min-w-[322px] p-8 flex flex-col
|
|
28
31
|
${getHitStyle(isHighlighting)}
|
|
29
32
|
${className}`}
|
|
30
33
|
{...rest}
|
|
31
34
|
>
|
|
32
35
|
{isHighlighting ? renderHitIcon() : null}
|
|
33
|
-
{icon
|
|
36
|
+
{renderIconBlock(icon)}
|
|
34
37
|
{title ? (
|
|
35
38
|
<Heading className="text-primary-text text-center pt-2" headingType="h5" title={title} />
|
|
36
39
|
) : null}
|
|
37
40
|
{button ? <Button className="w-full mt-4" {...button} /> : null}
|
|
38
|
-
{
|
|
41
|
+
{cardCells.length ? (
|
|
39
42
|
<Foldable
|
|
40
43
|
renderFoldableSection={({ isUnfolded }) => (
|
|
41
44
|
<div>
|
|
42
|
-
{
|
|
43
|
-
<FoldableSection isUnfolded={isUnfolded}>{
|
|
45
|
+
{visibleCells}
|
|
46
|
+
<FoldableSection isUnfolded={isUnfolded}>{hiddenCells}</FoldableSection>
|
|
44
47
|
</div>
|
|
45
48
|
)}
|
|
46
|
-
renderFoldButton={
|
|
49
|
+
renderFoldButton={cardCells.length > 1 ? renderFoldButton : null}
|
|
47
50
|
/>
|
|
48
51
|
) : null}
|
|
49
52
|
</BlockWrapper>
|
|
@@ -51,8 +54,15 @@ export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
|
|
|
51
54
|
},
|
|
52
55
|
);
|
|
53
56
|
|
|
57
|
+
const renderIconBlock = (icon?: Picture) => (
|
|
58
|
+
<div className="w-[267px] min-w-[267px] self-center">
|
|
59
|
+
{icon?.src ? <Img image={icon} /> : null}
|
|
60
|
+
{icon?.icon ? <Img image={getIconWithVersion(icon)} asSVG /> : null}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
|
|
54
64
|
const getHitStyle = (isHighlighting?: boolean): string =>
|
|
55
|
-
isHighlighting ? 'mt-9 pt-[70px]' : 'mt-[70px] pt-
|
|
65
|
+
isHighlighting ? 'mt-9 pt-[70px]' : 'mt-[70px] pt-7';
|
|
56
66
|
|
|
57
67
|
const renderFoldButton = ({ isUnfolded, onToggle }: FoldablePartProps): VNode => (
|
|
58
68
|
<button
|
|
@@ -82,8 +92,10 @@ const renderCardInfo = (cell: HeadlineCommonProps, i: number): VNode => (
|
|
|
82
92
|
);
|
|
83
93
|
|
|
84
94
|
const renderHitIcon = (): VNode => (
|
|
85
|
-
<div className="absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center shadow-[0_4px_25px_rgba(0,0,0,0.07)]">
|
|
95
|
+
<div className="absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]">
|
|
86
96
|
<Icon iconVersion="black" name="HeartIcon" width="23" height="22" asSVG />
|
|
87
|
-
<
|
|
97
|
+
<Paragraph size="text-s" font="font-normal" align="text-center" color="text-primary-text">
|
|
98
|
+
ХИТ
|
|
99
|
+
</Paragraph>
|
|
88
100
|
</div>
|
|
89
101
|
);
|
|
@@ -43,5 +43,9 @@ export type LinkDocsContent = HeadlineCommonProps & {
|
|
|
43
43
|
orientation?: ListOrientation; // TODO: мобильный проп
|
|
44
44
|
/** @title Рамка элементов (моб.) */ // TODO: мобильный проп
|
|
45
45
|
hasBorder?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @title Выравнивание
|
|
48
|
+
* @default text-center
|
|
49
|
+
*/
|
|
46
50
|
align?: TextAlign;
|
|
47
51
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"content": {
|
|
3
|
+
"listType": "vertical-list"
|
|
4
|
+
},
|
|
5
|
+
"style": ["col-span-12", "h-96"],
|
|
6
|
+
"type": "SwipeListControlBlock",
|
|
7
|
+
"blocks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "Headline",
|
|
10
|
+
"content": {
|
|
11
|
+
"title": "Заголовок блока",
|
|
12
|
+
"description": "Описание блока",
|
|
13
|
+
"headlineVersion": "M"
|
|
14
|
+
},
|
|
15
|
+
"style": ["col-span-12"]
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BlockRendererOptions } from '../../BlockRenderer/BlockRendererOptions';
|
|
2
|
+
import { Blocks } from '../Blocks';
|
|
3
|
+
import { PRODUCT_TILE } from '../ProductTile/ProductTile.fixture';
|
|
4
|
+
import { SwipeListControlBlock } from './SwipeListControlBlock';
|
|
5
|
+
|
|
6
|
+
const options = {
|
|
7
|
+
blocksRegistry: Blocks,
|
|
8
|
+
} as BlockRendererOptions;
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
default: (
|
|
12
|
+
<div className="container grid grid-cols-12">
|
|
13
|
+
<SwipeListControlBlock
|
|
14
|
+
className="col-span-12 h-96"
|
|
15
|
+
block={{
|
|
16
|
+
type: 'SwipeListControlBlock',
|
|
17
|
+
blocks: [
|
|
18
|
+
{ type: 'ProductTile', content: PRODUCT_TILE },
|
|
19
|
+
{ type: 'ProductTile', content: PRODUCT_TILE },
|
|
20
|
+
],
|
|
21
|
+
}}
|
|
22
|
+
listType="vertical-list"
|
|
23
|
+
options={options}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
),
|
|
27
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { renderChildren } from '../../BlockRenderer/renderChildren';
|
|
3
|
+
import type { JSXBlock, UniBlockProps } from '../../model/JSXBlock';
|
|
4
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
|
+
import { SwipeListControl } from '../../ui-kit/SwipeListControl/SwipeListControl';
|
|
6
|
+
import type { SwipeListControlBlockContent } from './SwipeListControlBlockContent';
|
|
7
|
+
|
|
8
|
+
interface SwipeListControlBlockProps extends SwipeListControlBlockContent, UniBlockProps {}
|
|
9
|
+
|
|
10
|
+
export const SwipeListControlBlock: JSXBlock<SwipeListControlBlockProps> =
|
|
11
|
+
JSX<SwipeListControlBlockProps>(({ gap, listType, padding, showDots, options, ...rest }) => {
|
|
12
|
+
return (
|
|
13
|
+
<BlockWrapper {...rest}>
|
|
14
|
+
<SwipeListControl gap={gap} listType={listType} padding={padding} showDots={showDots}>
|
|
15
|
+
{renderChildren({ ...rest, options })}
|
|
16
|
+
</SwipeListControl>
|
|
17
|
+
</BlockWrapper>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
SwipeListControlBlock.childrenTypes = {
|
|
22
|
+
exclude: ['SwipeListControlBlock'],
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|