@redneckz/wildless-cms-uni-blocks 0.2.107 → 0.2.111
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 +52 -77
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/BaseTile/BaseTile.js +7 -4
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/Blocks.d.ts +1 -1
- package/dist/components/{MobileBlocks.d.ts → Blocks.mobile.d.ts} +5 -4
- package/dist/components/{MobileBlocks.js → Blocks.mobile.js} +11 -9
- package/dist/components/Blocks.mobile.js.map +1 -0
- package/dist/components/CreditCalculator/CreditCalculator.js +1 -1
- package/dist/components/Gallery/Gallery.d.ts +1 -4
- package/dist/components/Gallery/Gallery.js.map +1 -1
- package/dist/components/Gallery/Gallery.mobile.d.ts +1 -1
- package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
- package/dist/components/Gallery/GalleryCardInner.js +1 -1
- package/dist/components/Gallery/GalleryContent.d.ts +6 -6
- package/dist/components/Gallery/GalleryProps.d.ts +4 -0
- package/dist/components/Gallery/GalleryProps.js +2 -0
- package/dist/components/Gallery/GalleryProps.js.map +1 -0
- package/dist/components/ProductBlock/ProductBlock.mobile.d.ts +2 -2
- package/dist/components/ProductTile/ProductTile.d.ts +1 -1
- package/dist/components/ProductTile/ProductTile.js +6 -6
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +4 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.d.ts +5 -0
- package/dist/components/StepsBlock/StepsBlock.mobile.js +20 -0
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -0
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -0
- package/dist/components/TariffsTable/TariffsTableCell.js +1 -1
- package/dist/components/TariffsTable/TariffsTableCell.js.map +1 -1
- package/dist/components/Tile/Tile.js +2 -2
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/model/SizeVersion.d.ts +8 -0
- package/dist/model/SizeVersion.js +2 -0
- package/dist/model/SizeVersion.js.map +1 -0
- package/dist/ui-kit/BlockItem/BlockItem.js +16 -8
- package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/dist/ui-kit/BlockItem/BlockItemProps.d.ts +1 -0
- package/dist/ui-kit/Button/Button.js +1 -1
- package/dist/ui-kit/Icon/IconProps.d.ts +2 -2
- package/dist/ui-kit/Icon/IconProps.js +2 -2
- package/dist/ui-kit/Icon/IconProps.js.map +1 -1
- package/dist/ui-kit/Img.d.ts +2 -2
- package/dist/ui-kit/Img.js.map +1 -1
- package/dist/ui-kit/Title/Title.d.ts +2 -1
- package/dist/ui-kit/Title/Title.js +10 -3
- package/dist/ui-kit/Title/Title.js.map +1 -1
- package/dist/ui-kit/Title/Title.mobile.d.ts +3 -0
- package/dist/ui-kit/Title/Title.mobile.js +18 -0
- package/dist/ui-kit/Title/Title.mobile.js.map +1 -0
- package/dist/ui-kit/Title/TitleProps.d.ts +1 -7
- package/dist/ui-kit/Title/TitleProps.js +0 -8
- package/dist/ui-kit/Title/TitleProps.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BaseTile/BaseTile.js +7 -4
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/Blocks.d.ts +1 -1
- package/lib/components/{MobileBlocks.d.ts → Blocks.mobile.d.ts} +5 -4
- package/lib/components/{MobileBlocks.js → Blocks.mobile.js} +7 -5
- package/lib/components/Blocks.mobile.js.map +1 -0
- package/lib/components/ContentPage/ContentPage.fixture.d.ts +0 -1
- package/lib/components/ContentPage/ContentPage.fixture.mobile.d.ts +4 -0
- package/lib/components/CreditCalculator/CreditCalculator.js +1 -1
- package/lib/components/Gallery/Gallery.d.ts +1 -4
- package/lib/components/Gallery/Gallery.fixture.d.ts +0 -1
- package/lib/components/Gallery/Gallery.js.map +1 -1
- package/lib/components/Gallery/Gallery.mobile.d.ts +1 -1
- package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
- package/lib/components/Gallery/GalleryCardInner.js +1 -1
- package/lib/components/Gallery/GalleryContent.d.ts +6 -6
- package/lib/components/Gallery/GalleryProps.d.ts +4 -0
- package/lib/components/Gallery/GalleryProps.js +2 -0
- package/lib/components/Gallery/GalleryProps.js.map +1 -0
- package/lib/components/ProductBlock/ProductBlock.mobile.d.ts +2 -2
- package/lib/components/ProductTile/ProductTile.d.ts +1 -1
- package/lib/components/ProductTile/ProductTile.js +6 -6
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +4 -1
- package/lib/components/StepsBlock/StepsBlock.fixture.d.ts +3 -1
- package/lib/components/StepsBlock/StepsBlock.fixture.mobile.d.ts +8 -0
- package/lib/components/StepsBlock/StepsBlock.mobile.d.ts +5 -0
- package/lib/components/StepsBlock/StepsBlock.mobile.js +18 -0
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -0
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -0
- package/lib/components/TariffsTable/TariffsTableCell.js +1 -1
- package/lib/components/TariffsTable/TariffsTableCell.js.map +1 -1
- package/lib/components/Tile/Tile.js +2 -2
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/model/SizeVersion.d.ts +8 -0
- package/lib/model/SizeVersion.js +2 -0
- package/lib/model/SizeVersion.js.map +1 -0
- package/lib/ui-kit/BlockItem/BlockItem.js +16 -8
- package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/lib/ui-kit/BlockItem/BlockItemProps.d.ts +1 -0
- package/lib/ui-kit/Button/Button.js +1 -1
- package/lib/ui-kit/Icon/IconProps.d.ts +2 -2
- package/lib/ui-kit/Icon/IconProps.js +2 -2
- package/lib/ui-kit/Icon/IconProps.js.map +1 -1
- package/lib/ui-kit/Img.d.ts +2 -2
- package/lib/ui-kit/Img.js.map +1 -1
- package/lib/ui-kit/Title/Title.d.ts +2 -1
- package/lib/ui-kit/Title/Title.js +8 -1
- package/lib/ui-kit/Title/Title.js.map +1 -1
- package/lib/ui-kit/Title/Title.mobile.d.ts +3 -0
- package/lib/ui-kit/Title/Title.mobile.js +16 -0
- package/lib/ui-kit/Title/Title.mobile.js.map +1 -0
- package/lib/ui-kit/Title/TitleProps.d.ts +1 -7
- package/lib/ui-kit/Title/TitleProps.js +1 -7
- package/lib/ui-kit/Title/TitleProps.js.map +1 -1
- package/package.json +32 -7
- package/src/components/BaseTile/BaseTile.tsx +17 -8
- package/src/components/{MobileBlocks.ts → Blocks.mobile.ts} +6 -4
- package/src/components/ContentPage/ContentPage.fixture.mobile.tsx +19 -0
- package/src/components/ContentPage/ContentPage.fixture.tsx +1 -11
- package/src/components/CreditCalculator/CreditCalculator.tsx +1 -1
- package/src/components/Gallery/Gallery.example.json +0 -13
- package/src/components/Gallery/Gallery.fixture.tsx +2 -7
- package/src/components/Gallery/Gallery.mobile.tsx +2 -2
- package/src/components/Gallery/Gallery.tsx +1 -4
- package/src/components/Gallery/GalleryCardInner.tsx +1 -1
- package/src/components/Gallery/GalleryContent.ts +6 -6
- package/src/components/Gallery/GalleryProps.ts +4 -0
- package/src/components/MiniGallery/MiniGallery.example.json +0 -11
- package/src/components/ProductBlock/ProductBlock.mobile.tsx +2 -2
- package/src/components/ProductTile/ProductTile.fixture.tsx +25 -25
- package/src/components/ProductTile/ProductTile.tsx +16 -15
- package/src/components/ProductTile/ProductTileContent.ts +4 -1
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +96 -0
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +27 -23
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +72 -0
- package/src/components/StepsBlock/StepsBlockContent.ts +4 -0
- package/src/components/TariffsTable/TariffsTable.fixture.tsx +0 -1
- package/src/components/TariffsTable/TariffsTableCell.tsx +1 -1
- package/src/components/Tile/Tile.tsx +2 -2
- package/src/index.ts +0 -1
- package/src/model/SizeVersion.ts +8 -0
- package/src/ui-kit/BlockItem/BlockItem.tsx +23 -12
- package/src/ui-kit/BlockItem/BlockItemProps.ts +1 -0
- package/src/ui-kit/Button/Button.tsx +1 -1
- package/src/ui-kit/Icon/IconProps.ts +2 -2
- package/src/ui-kit/Img.tsx +2 -2
- package/src/ui-kit/Title/Title.mobile.tsx +22 -0
- package/src/ui-kit/Title/Title.tsx +10 -1
- package/src/ui-kit/Title/TitleProps.ts +1 -8
- package/dist/components/MobileBlocks.js.map +0 -1
- package/lib/components/MobileBlocks.js.map +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { context } from '../../setup-fixture';
|
|
2
|
+
import { StepsBlock } from './StepsBlock';
|
|
3
|
+
|
|
4
|
+
const steps = [
|
|
5
|
+
{
|
|
6
|
+
label: 'Заявка на кредит',
|
|
7
|
+
description: 'Оставьте онлайн-заявку на потребительский кредит',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
label: 'В случае одобрения',
|
|
11
|
+
description: 'Менеджер свяжется с вами и согласует встречу',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: 'Получение наличных',
|
|
15
|
+
description: 'Получите наличные в отделении банка',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
default: (
|
|
21
|
+
<StepsBlock
|
|
22
|
+
context={context}
|
|
23
|
+
title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
|
|
24
|
+
description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
|
|
25
|
+
size="normal"
|
|
26
|
+
steps={steps}
|
|
27
|
+
/>
|
|
28
|
+
),
|
|
29
|
+
'only desc': (
|
|
30
|
+
<StepsBlock
|
|
31
|
+
context={context}
|
|
32
|
+
description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
|
|
33
|
+
size="normal"
|
|
34
|
+
steps={steps}
|
|
35
|
+
/>
|
|
36
|
+
),
|
|
37
|
+
|
|
38
|
+
small: (
|
|
39
|
+
<StepsBlock
|
|
40
|
+
context={context}
|
|
41
|
+
title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
|
|
42
|
+
size="small"
|
|
43
|
+
steps={steps}
|
|
44
|
+
/>
|
|
45
|
+
),
|
|
46
|
+
|
|
47
|
+
'small multi-options': (
|
|
48
|
+
<StepsBlock
|
|
49
|
+
context={context}
|
|
50
|
+
title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
|
|
51
|
+
description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
|
|
52
|
+
size="small"
|
|
53
|
+
steps={[
|
|
54
|
+
{
|
|
55
|
+
description: 'Оставьте онлайн-заявку на потребительский кредит',
|
|
56
|
+
icon: 'ClockIcon',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: 'В случае одобрения',
|
|
60
|
+
icon: 'SignDocsIcon',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: 'Заявка на кредит',
|
|
64
|
+
description: 'Оставьте онлайн-заявку на потребительский кредит',
|
|
65
|
+
icon: 'ComfortableCompIcon',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: 'Получение наличных',
|
|
69
|
+
icon: 'ClockIcon',
|
|
70
|
+
},
|
|
71
|
+
]}
|
|
72
|
+
/>
|
|
73
|
+
),
|
|
74
|
+
|
|
75
|
+
'small icons': (
|
|
76
|
+
<StepsBlock
|
|
77
|
+
context={context}
|
|
78
|
+
title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
|
|
79
|
+
size="small"
|
|
80
|
+
steps={[
|
|
81
|
+
{
|
|
82
|
+
label: 'Заявка на кредит',
|
|
83
|
+
icon: 'EmptyWalletIcon',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
label: 'В случае одобрения',
|
|
87
|
+
icon: 'PercentageSquareIcon',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: 'Получение наличных',
|
|
91
|
+
icon: 'CalendarIcon',
|
|
92
|
+
},
|
|
93
|
+
]}
|
|
94
|
+
/>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { context } from '../../setup-fixture';
|
|
2
2
|
import { StepsBlock } from './StepsBlock';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
4
|
+
const steps = [
|
|
5
|
+
{
|
|
6
|
+
label: 'Заявка на кредит',
|
|
7
|
+
description: 'Оставьте онлайн-заявку на потребительский кредит',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
label: 'В случае одобрения',
|
|
11
|
+
description: 'Менеджер свяжется с вами и согласует встречу',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: 'Получение наличных',
|
|
15
|
+
description: 'Получите наличные в отделении банка',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
default: (
|
|
21
|
+
<div className="container grid grid-cols-12">
|
|
22
|
+
<StepsBlock
|
|
23
|
+
className="col-span-12"
|
|
24
|
+
context={context}
|
|
25
|
+
title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
|
|
26
|
+
steps={steps}
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
),
|
|
30
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
|
+
import { Title } from '../../ui-kit/Title/Title';
|
|
5
|
+
import type { Step, StepsBlockContent } from './StepsBlockContent';
|
|
6
|
+
|
|
7
|
+
export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
|
|
8
|
+
|
|
9
|
+
export const StepsBlock = JSX<StepsBlockProps>(
|
|
10
|
+
({ className, title, description, steps, size = 'normal' }) => {
|
|
11
|
+
return (
|
|
12
|
+
<section
|
|
13
|
+
className={`box-border font-sans text-primary-text bg-white px-20 py-[50px] flex flex-col ${
|
|
14
|
+
className || ''
|
|
15
|
+
}`}
|
|
16
|
+
>
|
|
17
|
+
{title && (
|
|
18
|
+
<Title size="M" className="font-medium m-0 text-center">
|
|
19
|
+
{title}
|
|
20
|
+
</Title>
|
|
21
|
+
)}
|
|
22
|
+
{description && <p className={`text-m-md text-center ${title && 'mt-2'}`}>{description}</p>}
|
|
23
|
+
{steps?.length ? (
|
|
24
|
+
<div className={`box-border py-0.5 mb-0.5 mt-5`}>
|
|
25
|
+
<div className="flex flex-col justify-between gap-x-[101px]">
|
|
26
|
+
{steps.map((step, i, array) => renderStepTitle({ step, size }, i, array))}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
) : null}
|
|
30
|
+
</section>
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const renderStepTitle = ({ step, size }, i: number, array: Step[]) => {
|
|
36
|
+
const isLastStep = array.length - 1 === i;
|
|
37
|
+
const iconAreaSize =
|
|
38
|
+
size === 'normal'
|
|
39
|
+
? 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]'
|
|
40
|
+
: 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]';
|
|
41
|
+
const iconSize = size === 'normal' ? '38' : '27';
|
|
42
|
+
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-[24px]';
|
|
43
|
+
const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
|
|
44
|
+
return (
|
|
45
|
+
<div>
|
|
46
|
+
<div key={String(i)} className="flex flex-row text-center relative">
|
|
47
|
+
<div
|
|
48
|
+
className={`${iconAreaSize} bg-secondary-light rounded-full z-10 mr-3 flex justify-center content-center`}
|
|
49
|
+
>
|
|
50
|
+
<span className={`font-medium text-secondary-text self-center ${iconTextSize}`}>
|
|
51
|
+
{(step.icon && <Icon name={step.icon} width={iconSize} height={iconSize} />) || i + 1}
|
|
52
|
+
</span>
|
|
53
|
+
</div>
|
|
54
|
+
<div className="flex flex-col justify-center relative">
|
|
55
|
+
{step.label && (
|
|
56
|
+
<div className="font-medium text-m-title-xs m-0 text-left">{step.label}</div>
|
|
57
|
+
)}
|
|
58
|
+
{step.description && (
|
|
59
|
+
<div
|
|
60
|
+
className={`font-normal text-sm text-secondary-text text-left ${
|
|
61
|
+
step.label ? 'mt-1' : ''
|
|
62
|
+
}`}
|
|
63
|
+
>
|
|
64
|
+
{step.description}
|
|
65
|
+
</div>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
{!isLastStep && <div className={`h-8 w-[2px] bg-secondary-light ${margin}`} />}
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { IconName } from '../../ui-kit/Icon/IconProps';
|
|
2
2
|
|
|
3
|
+
import type { SizeVersion } from '../../model/SizeVersion';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* @title Шаг
|
|
5
7
|
*/
|
|
@@ -17,6 +19,7 @@ export interface Step {
|
|
|
17
19
|
export interface StepsBlockContent {
|
|
18
20
|
/** @title Заголовок */
|
|
19
21
|
title?: string;
|
|
22
|
+
description?: string; // TODO: mobile content
|
|
20
23
|
/** @title Линии */
|
|
21
24
|
showLines?: boolean;
|
|
22
25
|
/**
|
|
@@ -25,4 +28,5 @@ export interface StepsBlockContent {
|
|
|
25
28
|
* @maxItems 3
|
|
26
29
|
*/
|
|
27
30
|
steps?: Step[];
|
|
31
|
+
size?: SizeVersion; // TODO: mobile content
|
|
28
32
|
}
|
|
@@ -15,11 +15,11 @@ const tileStyleMap: Record<BlockVersion, string> = {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const Tile = JSX<TileProps>((props) => {
|
|
18
|
-
const { children, className, version = 'primary', role } = props;
|
|
18
|
+
const { children, className = '', version = 'primary', role } = props;
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<section
|
|
22
|
-
className={`font-sans p-9 box-border ${className
|
|
22
|
+
className={`font-sans p-9 box-border ${className} ${
|
|
23
23
|
tileStyleMap[version]
|
|
24
24
|
} ${getContainerPaddingRight(className)} ${getContainerMinHeight(className)} `}
|
|
25
25
|
role={role}
|
package/src/index.ts
CHANGED
|
@@ -17,7 +17,6 @@ export type {
|
|
|
17
17
|
export { ContentPageHead } from './components/ContentPage/ContentPageHead';
|
|
18
18
|
export { toMobilePage } from './components/ContentPage/toMobilePage';
|
|
19
19
|
export { Header } from './components/Header/Header';
|
|
20
|
-
export { MobileBlocks } from './components/MobileBlocks';
|
|
21
20
|
export type { Img, ImgSource, Picture } from './model/Picture';
|
|
22
21
|
export { projectSettings } from './ProjectSettings';
|
|
23
22
|
export type { ProjectSettings } from './ProjectSettings';
|
|
@@ -1,25 +1,36 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
3
|
import { BlockItemProps, BlockItemVersion } from './BlockItemProps';
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const LIST_STYLE_CLASSES = 'rounded-full inline-block mr-3';
|
|
6
|
+
|
|
7
|
+
const TEXT_STYLE_MAP: Record<BlockItemVersion, string> = {
|
|
8
|
+
primary: 'text-primary-text',
|
|
9
|
+
secondary: 'text-secondary-text',
|
|
7
10
|
};
|
|
8
11
|
|
|
9
|
-
const
|
|
10
|
-
primary: '
|
|
11
|
-
secondary: '',
|
|
12
|
+
const LIST_STYLE_MAP: Record<BlockItemVersion, string> = {
|
|
13
|
+
primary: 'bg-primary-main',
|
|
14
|
+
secondary: 'bg-secondary-text',
|
|
12
15
|
};
|
|
13
16
|
|
|
14
17
|
export const BlockItem = JSX<BlockItemProps>(
|
|
15
|
-
({ className, isDotted = true, text, children, version = 'primary' }) => {
|
|
18
|
+
({ className = '', isDotted = true, text, children, version = 'primary', white }) => {
|
|
16
19
|
return (
|
|
17
|
-
<div className={`inline-block flex ${className
|
|
18
|
-
{isDotted && <div className={
|
|
19
|
-
<span className={
|
|
20
|
-
{text || children}
|
|
21
|
-
</span>
|
|
20
|
+
<div className={`font-sans inline-block flex items-baseline ${className}`} role="listitem">
|
|
21
|
+
{isDotted && <div className={getListStyle(version, white)} />}
|
|
22
|
+
<span className={white ? 'text-white' : TEXT_STYLE_MAP[version]}>{text || children}</span>
|
|
22
23
|
</div>
|
|
23
24
|
);
|
|
24
25
|
},
|
|
25
26
|
);
|
|
27
|
+
|
|
28
|
+
const getListStyle = (version: BlockVersion, white?: boolean) => {
|
|
29
|
+
const color = white ? 'bg-white' : LIST_STYLE_MAP[version];
|
|
30
|
+
const size =
|
|
31
|
+
version === 'primary'
|
|
32
|
+
? 'w-[8px] h-[8px] min-w-[8px] min-h-[8px] mt-2'
|
|
33
|
+
: 'w-[6px] h-[6px] min-w-[6px] min-h-[6px] mt-2.5';
|
|
34
|
+
|
|
35
|
+
return `${LIST_STYLE_CLASSES} ${color} ${size}`;
|
|
36
|
+
};
|
|
@@ -85,7 +85,7 @@ export const ButtonInner = JSX<ButtonInner>(({ text, aboveText, appendLeft, roun
|
|
|
85
85
|
{appendLeft ? appendLeft : null}
|
|
86
86
|
{!withoutText ? (
|
|
87
87
|
<div>
|
|
88
|
-
<div className="text-
|
|
88
|
+
<div className="text-2xs text-left">{aboveText}</div>
|
|
89
89
|
<div className="text-sm font-medium text-left">{text}</div>
|
|
90
90
|
</div>
|
|
91
91
|
) : null}
|
package/src/ui-kit/Img.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { ImgSource, Picture } from '../model/Picture';
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface ImageProps {
|
|
5
5
|
className?: string;
|
|
6
6
|
image: Picture;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const Img = JSX<
|
|
9
|
+
export const Img = JSX<ImageProps>(({ className, image: { size, ...image } }) => {
|
|
10
10
|
const style = {
|
|
11
11
|
width: size?.width ? `${size?.width}px` : '100%',
|
|
12
12
|
height: size?.height ? `${size?.height}px` : '100%',
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { TitleSize, TitleProps } from './TitleProps';
|
|
3
|
+
|
|
4
|
+
export const SizeTableClass: Record<TitleSize, string> = {
|
|
5
|
+
XL: 'text-m-title',
|
|
6
|
+
L: 'text-m-title',
|
|
7
|
+
M: 'text-m-title-md',
|
|
8
|
+
S: 'text-m-title-xs',
|
|
9
|
+
'2XS': 'text-m-title-xs',
|
|
10
|
+
'3XS': 'text-m-title-xs',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Title = JSX<TitleProps>(({ size = 'L', className, children, ...rest }) => {
|
|
14
|
+
const Tag = size === 'XL' || size === 'L' ? 'h1' : 'h2';
|
|
15
|
+
return (
|
|
16
|
+
<Tag className={getClasses(SizeTableClass[size], className)} {...rest}>
|
|
17
|
+
{children}
|
|
18
|
+
</Tag>
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const getClasses = (...classes: (string | undefined)[]) => classes.filter(Boolean).join(' ');
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { TitleSize, TitleProps } from './TitleProps';
|
|
3
|
+
|
|
4
|
+
export const SizeTableClass: Record<TitleSize, string> = {
|
|
5
|
+
XL: 'text-title-lg',
|
|
6
|
+
L: 'text-title',
|
|
7
|
+
M: 'text-title-sm',
|
|
8
|
+
S: 'text-title-xs',
|
|
9
|
+
'2XS': 'text-title-2xs',
|
|
10
|
+
'3XS': 'text-title-2xs',
|
|
11
|
+
};
|
|
3
12
|
|
|
4
13
|
export const Title = JSX<TitleProps>(({ size = 'L', className, children, ...rest }) => {
|
|
5
14
|
const Tag = size === 'XL' ? 'h1' : 'h2';
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
'XL' = 'text-title-lg',
|
|
3
|
-
'L' = 'text-title',
|
|
4
|
-
'M' = 'text-title-sm',
|
|
5
|
-
'S' = 'text-title-xs',
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export type TitleSize = keyof typeof SizeTableClass;
|
|
1
|
+
export type TitleSize = 'XL' | 'L' | 'M' | 'S' | '2XS' | '3XS';
|
|
9
2
|
|
|
10
3
|
export interface TitleProps extends Partial<HTMLHeadingElement> {
|
|
11
4
|
size?: TitleSize;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MobileBlocks.js","sourceRoot":"","sources":["../../src/components/MobileBlocks.ts"],"names":[],"mappings":";;AAAA,0EAAuE;AACvE,0DAAgD;AAChD,6DAAmD;AACnD,4CAAyC;AACzC,kDAA+C;AAC/C,iEAA8D;AAC9D,wDAAqD;AACrD,2DAAwD;AACxD,2DAAwD;AACxD,4EAAkE;AAClE,2DAAwD;AACxD,qDAAkD;AAClD,sCAAmC;AAEtB,QAAA,YAAY,GAAG;IAC1B,gBAAgB,EAAhB,mCAAgB;IAChB,MAAM,EAAN,sBAAM;IACN,OAAO,EAAP,wBAAO;IACP,MAAM,EAAN,eAAM;IACN,QAAQ,EAAR,mBAAQ;IACR,aAAa,EAAb,6BAAa;IACb,WAAW,EAAX,yBAAW;IACX,WAAW,EAAX,yBAAW;IACX,YAAY,EAAZ,kCAAY;IACZ,WAAW,EAAX,yBAAW;IACX,SAAS,EAAT,qBAAS;IACT,IAAI,EAAJ,WAAI;IACJ,UAAU,EAAV,uBAAU;CACX,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MobileBlocks.js","sourceRoot":"","sources":["../../src/components/MobileBlocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,gBAAgB;IAChB,MAAM;IACN,OAAO;IACP,MAAM;IACN,QAAQ;IACR,aAAa;IACb,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,SAAS;IACT,IAAI;IACJ,UAAU;CACX,CAAC"}
|