@redneckz/wildless-cms-uni-blocks 0.2.91 → 0.2.92
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 +61 -22
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/BlockContent.d.ts +2 -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/ComparisonTable/ComparisonTable.js +3 -6
- package/dist/components/ComparisonTable/ComparisonTable.js.map +1 -1
- package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +0 -18
- package/dist/components/ComparisonTable/TableCarouselContainer.d.ts +3 -0
- package/dist/components/ComparisonTable/TableCarouselContainer.js +5 -2
- package/dist/components/ComparisonTable/TableCarouselContainer.js.map +1 -1
- package/dist/components/ComparisonTable/TableRow.js +1 -1
- package/dist/components/ComparisonTable/TableRow.js.map +1 -1
- package/dist/components/TariffsTable/TariffsTable.d.ts +5 -0
- package/dist/components/TariffsTable/TariffsTable.js +20 -0
- package/dist/components/TariffsTable/TariffsTable.js.map +1 -0
- package/dist/components/TariffsTable/TariffsTableCell.d.ts +6 -0
- package/dist/components/TariffsTable/TariffsTableCell.js +18 -0
- package/dist/components/TariffsTable/TariffsTableCell.js.map +1 -0
- package/dist/components/TariffsTable/TariffsTableContent.d.ts +55 -0
- package/dist/components/TariffsTable/TariffsTableContent.js +2 -0
- package/dist/components/TariffsTable/TariffsTableContent.js.map +1 -0
- package/dist/components/TariffsTable/TariffsTableRow.d.ts +8 -0
- package/dist/components/TariffsTable/TariffsTableRow.js +13 -0
- package/dist/components/TariffsTable/TariffsTableRow.js.map +1 -0
- package/dist/components/TariffsTable/constants.d.ts +4 -0
- package/dist/components/TariffsTable/constants.js +7 -0
- package/dist/components/TariffsTable/constants.js.map +1 -0
- package/dist/components/TextBlock/TextBlock.d.ts +1 -1
- package/dist/components/TextBlock/TextBlock.js +1 -1
- package/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/dist/hooks/useComparisonTableScroll.d.ts +7 -0
- package/dist/hooks/useComparisonTableScroll.js +12 -0
- package/dist/hooks/useComparisonTableScroll.js.map +1 -0
- package/dist/model/TableVersion.d.ts +1 -0
- package/dist/model/TableVersion.js +2 -0
- package/dist/model/TableVersion.js.map +1 -0
- package/dist/ui-kit/BlockItem/BlockItem.d.ts +1 -9
- package/dist/ui-kit/BlockItem/BlockItem.js +5 -5
- package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/dist/ui-kit/BlockItem/BlockItemProps.d.ts +20 -0
- package/dist/ui-kit/BlockItem/BlockItemProps.js +2 -0
- package/dist/ui-kit/BlockItem/BlockItemProps.js.map +1 -0
- package/dist/ui-kit/Icon/IconProps.d.ts +57 -25
- package/dist/ui-kit/Icon/IconProps.js +39 -23
- package/dist/ui-kit/Icon/IconProps.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BlockContent.d.ts +2 -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/ComparisonTable/ComparisonTable.js +4 -7
- package/lib/components/ComparisonTable/ComparisonTable.js.map +1 -1
- package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +0 -18
- package/lib/components/ComparisonTable/TableCarouselContainer.d.ts +3 -0
- package/lib/components/ComparisonTable/TableCarouselContainer.js +5 -2
- package/lib/components/ComparisonTable/TableCarouselContainer.js.map +1 -1
- package/lib/components/ComparisonTable/TableRow.js +2 -2
- package/lib/components/ComparisonTable/TableRow.js.map +1 -1
- package/lib/components/TariffsTable/TariffsTable.d.ts +5 -0
- package/lib/components/TariffsTable/TariffsTable.fixture.d.ts +7 -0
- package/lib/components/TariffsTable/TariffsTable.js +18 -0
- package/lib/components/TariffsTable/TariffsTable.js.map +1 -0
- package/lib/components/TariffsTable/TariffsTableCell.d.ts +6 -0
- package/lib/components/TariffsTable/TariffsTableCell.js +16 -0
- package/lib/components/TariffsTable/TariffsTableCell.js.map +1 -0
- package/lib/components/TariffsTable/TariffsTableContent.d.ts +55 -0
- package/lib/components/TariffsTable/TariffsTableContent.js +2 -0
- package/lib/components/TariffsTable/TariffsTableContent.js.map +1 -0
- package/lib/components/TariffsTable/TariffsTableRow.d.ts +8 -0
- package/lib/components/TariffsTable/TariffsTableRow.js +11 -0
- package/lib/components/TariffsTable/TariffsTableRow.js.map +1 -0
- package/lib/components/TariffsTable/constants.d.ts +4 -0
- package/lib/components/TariffsTable/constants.js +5 -0
- package/lib/components/TariffsTable/constants.js.map +1 -0
- package/lib/components/TextBlock/TextBlock.d.ts +1 -1
- package/lib/components/TextBlock/TextBlock.js +1 -1
- package/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/lib/hooks/useComparisonTableScroll.d.ts +7 -0
- package/lib/hooks/useComparisonTableScroll.js +9 -0
- package/lib/hooks/useComparisonTableScroll.js.map +1 -0
- package/lib/model/TableVersion.d.ts +1 -0
- package/lib/model/TableVersion.js +2 -0
- package/lib/model/TableVersion.js.map +1 -0
- package/lib/ui-kit/BlockItem/BlockItem.d.ts +1 -9
- package/lib/ui-kit/BlockItem/BlockItem.fixture.d.ts +6 -1
- package/lib/ui-kit/BlockItem/BlockItem.js +5 -5
- package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/lib/ui-kit/BlockItem/BlockItemProps.d.ts +20 -0
- package/lib/ui-kit/BlockItem/BlockItemProps.js +2 -0
- package/lib/ui-kit/BlockItem/BlockItemProps.js.map +1 -0
- package/lib/ui-kit/Icon/IconProps.d.ts +57 -25
- package/lib/ui-kit/Icon/IconProps.js +39 -23
- package/lib/ui-kit/Icon/IconProps.js.map +1 -1
- package/package.json +1 -1
- package/src/Icons/CalendarCircleIcon.svg +14 -0
- package/src/Icons/CardIcon.svg +11 -0
- package/src/Icons/CardPosIcon.svg +12 -0
- package/src/Icons/CardTickIcon.svg +13 -0
- package/src/Icons/EmptyWalletChangeIcon.svg +21 -0
- package/src/Icons/JCBIcon.svg +42 -0
- package/src/Icons/MastercardIcon.svg +6 -0
- package/src/Icons/MinusIcon.svg +1 -0
- package/src/Icons/MirIcon.svg +13 -0
- package/src/Icons/MoneyIcon.svg +13 -0
- package/src/Icons/MonitorMobileIcon.svg +14 -0
- package/src/Icons/PlusIcon.svg +1 -0
- package/src/Icons/Profile2UserIcon.svg +14 -0
- package/src/Icons/ShieldTickIcon.svg +7 -0
- package/src/Icons/UnionPayIcon.svg +7 -0
- package/src/Icons/UserIcon.svg +11 -0
- package/src/Icons/VisaIcon.svg +7 -0
- package/src/Icons/WalletIcon.svg +19 -0
- package/src/components/BlockContent.ts +2 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/ComparisonTable/ComparisonTable.tsx +14 -11
- package/src/components/ComparisonTable/ComparisonTableContent.ts +0 -19
- package/src/components/ComparisonTable/TableCarouselContainer.tsx +11 -4
- package/src/components/ComparisonTable/TableRow.tsx +2 -2
- package/src/components/ContentPage/ContentPage.page.json +415 -0
- package/src/components/TariffsTable/TariffsTable.example.json +85 -0
- package/src/components/TariffsTable/TariffsTable.fixture.tsx +192 -0
- package/src/components/TariffsTable/TariffsTable.tsx +72 -0
- package/src/components/TariffsTable/TariffsTableCell.tsx +64 -0
- package/src/components/TariffsTable/TariffsTableContent.ts +61 -0
- package/src/components/TariffsTable/TariffsTableRow.tsx +46 -0
- package/src/components/TariffsTable/constants.ts +4 -0
- package/src/components/TextBlock/TextBlock.tsx +2 -2
- package/src/hooks/useComparisonTableScroll.ts +16 -0
- package/src/model/TableVersion.ts +1 -0
- package/src/ui-kit/BlockItem/BlockItem.fixture.tsx +8 -1
- package/src/ui-kit/BlockItem/BlockItem.tsx +7 -18
- package/src/ui-kit/BlockItem/BlockItemProps.ts +22 -0
- package/src/ui-kit/Icon/IconProps.ts +34 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
|
|
3
|
+
import { Title } from '../../ui-kit/Title/Title';
|
|
4
|
+
import { COLS_LENGTH_FOR_SCROLL } from './constants';
|
|
5
|
+
import { TariffsTableRow } from './TariffsTableRow';
|
|
6
|
+
import type { UniBlockProps } from '../../types';
|
|
7
|
+
import type { TariffsTableContent } from './TariffsTableContent';
|
|
8
|
+
import { useComparisonTableScroll } from '../../hooks/useComparisonTableScroll';
|
|
9
|
+
|
|
10
|
+
export interface TariffsTableProps extends TariffsTableContent, UniBlockProps {}
|
|
11
|
+
|
|
12
|
+
export const TariffsTable = JSX<TariffsTableProps>(
|
|
13
|
+
({ className, context, title, rowHeaders, columns }) => {
|
|
14
|
+
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
15
|
+
|
|
16
|
+
const colData = columns?.map(({ data }) => data) || [];
|
|
17
|
+
const rowData = rowHeaders?.map((header, i) => ({
|
|
18
|
+
header,
|
|
19
|
+
data: colData.map((col) => col?.[i] || [{}]),
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
const { nextClick, prevClick, isScrollAvailable, showNextButton, showPrevButton } =
|
|
23
|
+
useComparisonTableScroll(
|
|
24
|
+
colData,
|
|
25
|
+
COLS_LENGTH_FOR_SCROLL,
|
|
26
|
+
activeCardIndex,
|
|
27
|
+
setActiveCardIndex,
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<section
|
|
32
|
+
className={`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${
|
|
33
|
+
className || ''
|
|
34
|
+
}`}
|
|
35
|
+
>
|
|
36
|
+
<Title className="font-medium m-0 max-w-[47rem] text-center mb-9 mx-auto">{title}</Title>
|
|
37
|
+
{rowData?.length ? (
|
|
38
|
+
<div className="relative">
|
|
39
|
+
{rowData.map((row, i, { length }) => (
|
|
40
|
+
<TariffsTableRow
|
|
41
|
+
key={String(i)}
|
|
42
|
+
row={row}
|
|
43
|
+
isLastRow={i + 1 === length}
|
|
44
|
+
activeCardIndex={activeCardIndex}
|
|
45
|
+
/>
|
|
46
|
+
))}
|
|
47
|
+
{isScrollAvailable ? (
|
|
48
|
+
<div>
|
|
49
|
+
<div className="absolute top-7 right-7 z-10">
|
|
50
|
+
<ArrowButton
|
|
51
|
+
onClick={nextClick}
|
|
52
|
+
disabled={!showNextButton}
|
|
53
|
+
ariaLabel="Пролистать вправо"
|
|
54
|
+
/>
|
|
55
|
+
<ArrowButton
|
|
56
|
+
className="mt-4 rotate-180"
|
|
57
|
+
onClick={prevClick}
|
|
58
|
+
disabled={!showPrevButton}
|
|
59
|
+
ariaLabel="Пролистать влево"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
) : null}
|
|
64
|
+
</div>
|
|
65
|
+
) : null}
|
|
66
|
+
{isScrollAvailable ? (
|
|
67
|
+
<div className="absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white" />
|
|
68
|
+
) : null}
|
|
69
|
+
</section>
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { DIVIDER_CLASSES } from './constants';
|
|
3
|
+
import { BlockItem } from '../../ui-kit/BlockItem/BlockItem';
|
|
4
|
+
import { Img } from '../../ui-kit/Img';
|
|
5
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
6
|
+
import type { TariffsTableCellData } from './TariffsTableContent';
|
|
7
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
8
|
+
|
|
9
|
+
export interface TariffsTableCellProps {
|
|
10
|
+
cell: TariffsTableCellData[];
|
|
11
|
+
isLastRow: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const TariffsTableCell = JSX<TariffsTableCellProps>(({ cell, isLastRow }) => {
|
|
15
|
+
const cellWrapperClasses = `first:pl-0 pl-10 w-80 flex-grow flex flex-col border-solid border-main-divider border border-t-0 border-x-0 ${
|
|
16
|
+
isLastRow ? 'border-t-0 rounded-b-md' : ''
|
|
17
|
+
}`;
|
|
18
|
+
|
|
19
|
+
const cellClasses = `h-full ${DIVIDER_CLASSES}`;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className={cellWrapperClasses}>
|
|
23
|
+
<div className={cellClasses}>{cell.map((item, i) => renderCellInner(item, i))}</div>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const renderCellInner = (
|
|
29
|
+
{ label, description, list, image, buttons }: TariffsTableCellData,
|
|
30
|
+
i: number,
|
|
31
|
+
) => (
|
|
32
|
+
<div className="first:pt-5 last:pb-5">
|
|
33
|
+
{i > 0 && (
|
|
34
|
+
<div className="border-main-divider border border-solid border-t-0 border-x-0 my-4" />
|
|
35
|
+
)}
|
|
36
|
+
{label && <h5 className="text-xl font-medium m-0">{label}</h5>}
|
|
37
|
+
{description && <div className="text-sm text-secondary-text">{description}</div>}
|
|
38
|
+
{list?.items?.length ? (
|
|
39
|
+
<div className="flex flex-col justify-between items-start">
|
|
40
|
+
<div>
|
|
41
|
+
{list.items.map((text, idx) => (
|
|
42
|
+
<BlockItem
|
|
43
|
+
key={String(idx)}
|
|
44
|
+
text={text}
|
|
45
|
+
version={list.version ?? 'secondary'}
|
|
46
|
+
isDotted={list.isDotted ?? true}
|
|
47
|
+
/>
|
|
48
|
+
))}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
) : null}
|
|
52
|
+
{image && <Img image={image} />}
|
|
53
|
+
{buttons?.length
|
|
54
|
+
? buttons.map(({ icon, ...buttonProps }, idx) => (
|
|
55
|
+
<Button
|
|
56
|
+
className={`${idx > 0 ? 'ml-3' : ''} w-12 h-12`}
|
|
57
|
+
key={String(idx)}
|
|
58
|
+
appendLeft={icon && <Icon name={icon} width="24px" height="24px" />}
|
|
59
|
+
{...buttonProps}
|
|
60
|
+
/>
|
|
61
|
+
))
|
|
62
|
+
: null}
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CellData, RowHeader } from '../ComparisonTable/ComparisonTableContent';
|
|
2
|
+
import type { IconName } from '../../ui-kit/Icon/IconProps';
|
|
3
|
+
import type { Picture } from '../../model/Picture';
|
|
4
|
+
import type { BlockItemVersion } from '../../ui-kit/BlockItem/BlockItemProps';
|
|
5
|
+
import type { BaseTileIconButton } from '../BaseTile/BaseTileProps';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title Ряд
|
|
9
|
+
*/
|
|
10
|
+
export type TariffsTableRowData = {
|
|
11
|
+
header: TariffsTableRowHeader;
|
|
12
|
+
data: TariffsTableCellData[][];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @title Колонка
|
|
17
|
+
*/
|
|
18
|
+
export interface TariffsTableColumn {
|
|
19
|
+
/** @title Данные */
|
|
20
|
+
data?: TariffsTableCellData[][];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @title Список
|
|
25
|
+
*/
|
|
26
|
+
export interface TariffsTableList {
|
|
27
|
+
version?: BlockItemVersion;
|
|
28
|
+
/** @title Маркеры */
|
|
29
|
+
isDotted?: boolean;
|
|
30
|
+
/** @title Элементы списка */
|
|
31
|
+
items?: string[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @title Ячейка
|
|
36
|
+
*/
|
|
37
|
+
export interface TariffsTableCellData extends CellData {
|
|
38
|
+
list?: TariffsTableList;
|
|
39
|
+
image?: Picture;
|
|
40
|
+
/** @title Кнопки */
|
|
41
|
+
buttons?: BaseTileIconButton[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @title Параметр
|
|
46
|
+
*/
|
|
47
|
+
export interface TariffsTableRowHeader extends RowHeader {
|
|
48
|
+
icon?: IconName;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @title Таблица тарифов
|
|
53
|
+
*/
|
|
54
|
+
export interface TariffsTableContent {
|
|
55
|
+
/** @title Заголовок */
|
|
56
|
+
title?: string;
|
|
57
|
+
/** @title Колонки */
|
|
58
|
+
columns?: TariffsTableColumn[];
|
|
59
|
+
/** @title Параметры */
|
|
60
|
+
rowHeaders?: TariffsTableRowHeader[];
|
|
61
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { COLUMN_WIDTH, DIVIDER_CLASSES, FIRST_CELL_CLASSES } from './constants';
|
|
3
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
|
+
import { TariffsTableCell } from './TariffsTableCell';
|
|
5
|
+
import { TableRowContainer } from '../ComparisonTable/TableRowContainer';
|
|
6
|
+
import { TableCarouselContainer } from '../ComparisonTable/TableCarouselContainer';
|
|
7
|
+
import type { TariffsTableRowData } from './TariffsTableContent';
|
|
8
|
+
|
|
9
|
+
export interface TariffsTableRowProps {
|
|
10
|
+
className?: string;
|
|
11
|
+
row: TariffsTableRowData;
|
|
12
|
+
activeCardIndex: number;
|
|
13
|
+
isLastRow: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const TariffsTableRow = JSX<TariffsTableRowProps>(
|
|
17
|
+
({ row: { header, data }, activeCardIndex, isLastRow }) => {
|
|
18
|
+
return (
|
|
19
|
+
<TableRowContainer>
|
|
20
|
+
<div
|
|
21
|
+
className={`text-sm py-5 ${FIRST_CELL_CLASSES} ${DIVIDER_CLASSES} ${
|
|
22
|
+
!isLastRow ? 'border-solid' : ''
|
|
23
|
+
}`}
|
|
24
|
+
>
|
|
25
|
+
<div className="flex items-center text-primary-text">
|
|
26
|
+
{header?.icon && (
|
|
27
|
+
<Icon className="pr-[14px]" name={header.icon} width="24px" height="24px" />
|
|
28
|
+
)}
|
|
29
|
+
{header?.title}
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
{data?.length ? (
|
|
33
|
+
<TableCarouselContainer
|
|
34
|
+
activeCardIndex={activeCardIndex}
|
|
35
|
+
columnWidth={COLUMN_WIDTH}
|
|
36
|
+
version="tariff"
|
|
37
|
+
>
|
|
38
|
+
{data.map((cell, i) => (
|
|
39
|
+
<TariffsTableCell key={String(i)} cell={cell} isLastRow={isLastRow} />
|
|
40
|
+
))}
|
|
41
|
+
</TableCarouselContainer>
|
|
42
|
+
) : null}
|
|
43
|
+
</TableRowContainer>
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { Picture } from '../../model/Picture';
|
|
3
|
-
import type { TextBlockContent, TextBlockVersion } from './TextBlockContent';
|
|
4
3
|
import type { UniBlockProps } from '../../types';
|
|
5
4
|
import { Img } from '../../ui-kit/Img';
|
|
5
|
+
import type { TextBlockContent, TextBlockVersion } from './TextBlockContent';
|
|
6
6
|
|
|
7
7
|
export interface TextBlockProps extends TextBlockContent, UniBlockProps {}
|
|
8
8
|
|
|
@@ -54,7 +54,7 @@ export const TextBlock = JSX<TextBlockProps>(
|
|
|
54
54
|
|
|
55
55
|
function renderIcon(className: string) {
|
|
56
56
|
return (
|
|
57
|
-
<div className={`pt-1.5 pr-4`}>
|
|
57
|
+
<div className={`pt-1.5 pl-1 pr-4`}>
|
|
58
58
|
<div className={`rounded-full h-4 w-4 text-center text-xs ${className}`}>i</div>
|
|
59
59
|
</div>
|
|
60
60
|
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const useComparisonTableScroll = <COL_DATA>(
|
|
2
|
+
colData: COL_DATA[],
|
|
3
|
+
colsLengthForScroll: number,
|
|
4
|
+
activeCardIndex: number,
|
|
5
|
+
setActiveCardIndex: (_: number) => void,
|
|
6
|
+
) => {
|
|
7
|
+
const nextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
8
|
+
const prevClick = () => setActiveCardIndex(activeCardIndex - 1);
|
|
9
|
+
|
|
10
|
+
const isScrollAvailable = colData?.length && colData.length > colsLengthForScroll;
|
|
11
|
+
const showNextButton =
|
|
12
|
+
isScrollAvailable && colData?.length - activeCardIndex > colsLengthForScroll;
|
|
13
|
+
const showPrevButton = isScrollAvailable && activeCardIndex > 0;
|
|
14
|
+
|
|
15
|
+
return { nextClick, prevClick, isScrollAvailable, showNextButton, showPrevButton };
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TableVersion = 'comparison' | 'tariff';
|
|
@@ -2,4 +2,11 @@ import '../../setup-fixture';
|
|
|
2
2
|
|
|
3
3
|
import { BlockItem } from './BlockItem';
|
|
4
4
|
|
|
5
|
-
export default
|
|
5
|
+
export default {
|
|
6
|
+
primary: <BlockItem text="Совершайте любые личные покупки" />,
|
|
7
|
+
'primary without dot': <BlockItem text="Совершайте любые личные покупки" isDotted={false} />,
|
|
8
|
+
secondary: <BlockItem text="Совершайте любые личные покупки" version="secondary" />,
|
|
9
|
+
'secondary without dot': (
|
|
10
|
+
<BlockItem text="Совершайте любые личные покупки" isDotted={false} version="secondary" />
|
|
11
|
+
),
|
|
12
|
+
};
|
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
|
|
3
|
-
type BlockItemVersion = 'primary' | 'secondary';
|
|
4
|
-
export interface BlockItemContent {
|
|
5
|
-
text?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface BlockItemProps extends BlockItemContent {
|
|
9
|
-
className?: string;
|
|
10
|
-
version?: BlockItemVersion;
|
|
11
|
-
}
|
|
2
|
+
import { BlockItemProps, BlockItemVersion } from './BlockItemProps';
|
|
12
3
|
|
|
13
4
|
const listStyleMap: Record<BlockItemVersion, string> = {
|
|
14
|
-
primary: 'bg-primary-main',
|
|
15
|
-
secondary: 'bg-
|
|
5
|
+
primary: 'bg-primary-main w-[8px] h-[8px] min-w-[8px] min-h-[8px] mt-2 rounded-full',
|
|
6
|
+
secondary: 'bg-secondary-text w-[6px] h-[6px] min-w-[6px] min-h-[6px] mt-2.5 rounded-full',
|
|
16
7
|
};
|
|
17
8
|
|
|
18
9
|
const textStyleMap: Record<BlockItemVersion, string> = {
|
|
19
10
|
primary: 'text-primary-text',
|
|
20
|
-
secondary: 'text-
|
|
11
|
+
secondary: 'text-secondary-text',
|
|
21
12
|
};
|
|
22
13
|
|
|
23
14
|
export const BlockItem = JSX<BlockItemProps>(
|
|
24
|
-
({ className, text, children, version = 'primary' }) => {
|
|
15
|
+
({ className, isDotted = true, text, children, version = 'primary' }) => {
|
|
25
16
|
return (
|
|
26
17
|
<div className={`inline-block flex ${className || ''}`} role="listitem">
|
|
27
|
-
<div
|
|
28
|
-
|
|
29
|
-
></div>
|
|
30
|
-
<span className={`text-base font-normal font-sans mx-3 ${textStyleMap[version]}`}>
|
|
18
|
+
{isDotted && <div className={`inline-block mr-3 ${listStyleMap[version]}`} />}
|
|
19
|
+
<span className={`text-base font-normal font-sans mr-3 ${textStyleMap[version]}`}>
|
|
31
20
|
{text || children}
|
|
32
21
|
</span>
|
|
33
22
|
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title Версия списка
|
|
3
|
+
*/
|
|
4
|
+
export type BlockItemVersion = 'primary' | 'secondary';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @title Содержимое элемента блока
|
|
8
|
+
*/
|
|
9
|
+
export interface BlockItemContent {
|
|
10
|
+
/** @title Текст */
|
|
11
|
+
text?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @title Параметры элемента блока
|
|
16
|
+
*/
|
|
17
|
+
export interface BlockItemProps extends BlockItemContent {
|
|
18
|
+
className?: string;
|
|
19
|
+
version?: BlockItemVersion;
|
|
20
|
+
/** @title Маркер */
|
|
21
|
+
isDotted?: boolean;
|
|
22
|
+
}
|
|
@@ -4,29 +4,45 @@
|
|
|
4
4
|
export enum IconMap {
|
|
5
5
|
'ActualBalanceIcon',
|
|
6
6
|
'AppleIcon',
|
|
7
|
+
'CalendarCircleIcon',
|
|
7
8
|
'CalendarIcon',
|
|
9
|
+
'CardIcon',
|
|
10
|
+
'CardPosIcon',
|
|
11
|
+
'CardTickIcon',
|
|
8
12
|
'ClockIcon',
|
|
9
13
|
'ComfortableCompIcon',
|
|
10
14
|
'DiscountShape',
|
|
11
15
|
'DocIcon',
|
|
12
16
|
'DocumentText',
|
|
13
17
|
'DollarIcon',
|
|
18
|
+
'EmptyWalletChangeIcon',
|
|
14
19
|
'EmptyWalletIcon',
|
|
15
20
|
'EuroIcon',
|
|
16
21
|
'GlassIcon',
|
|
17
22
|
'GridIcon',
|
|
23
|
+
'JCBIcon',
|
|
18
24
|
'LoupeIcon',
|
|
25
|
+
'MasterCardIcon',
|
|
19
26
|
'MinusIcon',
|
|
27
|
+
'MirIcon',
|
|
28
|
+
'MoneyIcon',
|
|
29
|
+
'MonitorMobileIcon',
|
|
20
30
|
'NewDocIcon',
|
|
21
31
|
'OkIcon',
|
|
22
32
|
'PassSendIcon',
|
|
23
33
|
'PercentageSquareIcon',
|
|
24
34
|
'PlayMarketIcon',
|
|
25
35
|
'PlusIcon',
|
|
36
|
+
'Profile2UserIcon',
|
|
26
37
|
'ProfileIcon',
|
|
38
|
+
'ShieldTickIcon',
|
|
27
39
|
'SignDocsIcon',
|
|
28
40
|
'TelegramIcon',
|
|
41
|
+
'UnionPayIcon',
|
|
42
|
+
'UserIcon',
|
|
43
|
+
'VisaIcon',
|
|
29
44
|
'VKIcon',
|
|
45
|
+
'WalletIcon',
|
|
30
46
|
}
|
|
31
47
|
|
|
32
48
|
/**
|
|
@@ -34,29 +50,45 @@ export enum IconMap {
|
|
|
34
50
|
* @enumNames [
|
|
35
51
|
* "Деньги",
|
|
36
52
|
* "Лого «Apple»",
|
|
53
|
+
* "Скруглённый календарь",
|
|
37
54
|
* "Календарь",
|
|
55
|
+
* "Кред. карта",
|
|
56
|
+
* "Кред. карта под наклоном",
|
|
57
|
+
* "Кред. карта с галочкой",
|
|
38
58
|
* "Часы",
|
|
39
59
|
* "Кресло",
|
|
40
60
|
* "Скидка",
|
|
41
61
|
* "Документ",
|
|
42
62
|
* "Документ с текстом",
|
|
43
63
|
* "Доллар",
|
|
44
|
-
* "
|
|
64
|
+
* "Пустой кошелёк с возвратом",
|
|
65
|
+
* "Пустой кошелёк",
|
|
45
66
|
* "Евро",
|
|
46
67
|
* "Зеркало",
|
|
47
68
|
* "Сетка",
|
|
69
|
+
* "JCB",
|
|
48
70
|
* "Лупа",
|
|
71
|
+
* "MasterCard",
|
|
49
72
|
* "Минус",
|
|
73
|
+
* "МИР",
|
|
74
|
+
* "Деньги",
|
|
75
|
+
* "Монитор и мобильный",
|
|
50
76
|
* "Новый документ",
|
|
51
77
|
* "Лого «Одноклассники»",
|
|
52
78
|
* "Бизнес",
|
|
53
79
|
* "Проценты",
|
|
54
80
|
* "Лого «PlayMarket»",
|
|
55
81
|
* "Плюс",
|
|
82
|
+
* "Профиль, 2 персоны",
|
|
56
83
|
* "Профиль",
|
|
84
|
+
* "Безопасность",
|
|
57
85
|
* "Подписанные документы",
|
|
58
86
|
* "Лого «Telegram»",
|
|
59
|
-
* "
|
|
87
|
+
* "UnionPay",
|
|
88
|
+
* "Пользователь",
|
|
89
|
+
* "Visa",
|
|
90
|
+
* "Лого «VK»",
|
|
91
|
+
* "Кошелёк",
|
|
60
92
|
* ]
|
|
61
93
|
*/
|
|
62
94
|
export type IconName = keyof typeof IconMap;
|