@redneckz/wildless-cms-uni-blocks 0.3.15 → 0.3.18
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 +19 -6
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/ComparisonTable/TableColumn.js +1 -1
- package/dist/components/ComparisonTable/TableColumn.js.map +1 -1
- package/dist/components/Headline/Headline.js +2 -1
- package/dist/components/Headline/Headline.js.map +1 -1
- package/dist/components/Headline/Headline.mobile.js +2 -1
- package/dist/components/Headline/Headline.mobile.js.map +1 -1
- package/dist/components/Headline/constants.d.ts +7 -1
- package/dist/components/Headline/constants.js +17 -5
- package/dist/components/Headline/constants.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +28 -6
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +2 -0
- package/dist/components/TariffsTable/TariffsTable.js +3 -3
- package/dist/components/TariffsTable/TariffsTable.js.map +1 -1
- package/lib/components/ComparisonTable/TableColumn.js +1 -1
- package/lib/components/ComparisonTable/TableColumn.js.map +1 -1
- package/lib/components/Headline/Headline.js +3 -2
- package/lib/components/Headline/Headline.js.map +1 -1
- package/lib/components/Headline/Headline.mobile.js +3 -2
- package/lib/components/Headline/Headline.mobile.js.map +1 -1
- package/lib/components/Headline/constants.d.ts +7 -1
- package/lib/components/Headline/constants.js +16 -4
- package/lib/components/Headline/constants.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.fixture.mobile.d.ts +1 -4
- package/lib/components/StepsBlock/StepsBlock.mobile.js +28 -6
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +2 -0
- package/lib/components/TariffsTable/TariffsTable.js +3 -3
- package/lib/components/TariffsTable/TariffsTable.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +47 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ComparisonTable/TableColumn.js +1 -1
- package/mobile/dist/components/ComparisonTable/TableColumn.js.map +1 -1
- package/mobile/dist/components/Headline/Headline.js +2 -1
- package/mobile/dist/components/Headline/Headline.js.map +1 -1
- package/mobile/dist/components/Headline/constants.d.ts +7 -1
- package/mobile/dist/components/Headline/constants.js +17 -5
- package/mobile/dist/components/Headline/constants.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +28 -6
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +2 -0
- package/mobile/lib/components/ComparisonTable/TableColumn.js +1 -1
- package/mobile/lib/components/ComparisonTable/TableColumn.js.map +1 -1
- package/mobile/lib/components/Headline/Headline.js +3 -2
- package/mobile/lib/components/Headline/Headline.js.map +1 -1
- package/mobile/lib/components/Headline/constants.d.ts +7 -1
- package/mobile/lib/components/Headline/constants.js +16 -4
- package/mobile/lib/components/Headline/constants.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +28 -6
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +2 -0
- package/mobile/src/components/ComparisonTable/TableColumn.tsx +1 -1
- package/mobile/src/components/Headline/Headline.tsx +9 -4
- package/mobile/src/components/Headline/constants.ts +22 -4
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +60 -19
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +2 -1
- package/package.json +1 -1
- package/src/components/ComparisonTable/TableColumn.tsx +1 -1
- package/src/components/Headline/Headline.mobile.tsx +9 -4
- package/src/components/Headline/Headline.tsx +3 -2
- package/src/components/Headline/constants.ts +22 -4
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +127 -72
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +60 -19
- package/src/components/StepsBlock/StepsBlockContent.ts +2 -1
- package/src/components/TariffsTable/TariffsTable.tsx +5 -5
|
@@ -1,26 +1,62 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { SizeVersion } from '../../model/SizeVersion';
|
|
3
|
-
import type { UniBlockProps } from '../../types';
|
|
4
2
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
3
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
|
+
import type { SizeVersion } from '../../model/SizeVersion';
|
|
5
|
+
import type { UniBlockProps } from '../../types';
|
|
6
6
|
import type { Step, StepsBlockContent } from './StepsBlockContent';
|
|
7
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
7
8
|
|
|
8
9
|
export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
|
|
9
10
|
|
|
11
|
+
type StyleType = {
|
|
12
|
+
background: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
iconBackground: string;
|
|
16
|
+
iconConnector: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
|
|
20
|
+
primary: {
|
|
21
|
+
background: 'bg-white',
|
|
22
|
+
title: 'text-primary-text',
|
|
23
|
+
description: 'text-secondary-text',
|
|
24
|
+
iconBackground: 'bg-secondary-light',
|
|
25
|
+
iconConnector: 'bg-secondary-light',
|
|
26
|
+
},
|
|
27
|
+
secondary: {
|
|
28
|
+
background: 'bg-primary-main',
|
|
29
|
+
title: 'text-white',
|
|
30
|
+
description: 'text-white/80',
|
|
31
|
+
iconBackground: 'bg-white/30',
|
|
32
|
+
iconConnector: 'bg-white',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const styleMaps = (version: BlockVersion): StyleType => STEPS_BLOCK_STYLE_MAPS[version];
|
|
37
|
+
|
|
10
38
|
export const StepsBlock = JSX<StepsBlockProps>(
|
|
11
|
-
({ className, title, description, steps, size = 'normal' }) => {
|
|
39
|
+
({ className, title, description, steps, size = 'normal', version = 'primary' }) => {
|
|
40
|
+
const style = styleMaps(version);
|
|
12
41
|
return (
|
|
13
42
|
<section
|
|
14
|
-
className={`box-border font-sans
|
|
15
|
-
|
|
16
|
-
}`}
|
|
43
|
+
className={`box-border font-sans bg-white px-4 py-6 flex flex-col
|
|
44
|
+
${style.background} ${style.title} ${className || ''}`}
|
|
17
45
|
>
|
|
18
|
-
{title &&
|
|
19
|
-
|
|
46
|
+
{title && (
|
|
47
|
+
<Heading headingType="h3" className={`text-center ${style.title}`} title={title} />
|
|
48
|
+
)}
|
|
49
|
+
{description && (
|
|
50
|
+
<p className={`text-m-md text-center ${style.description} ${title && 'mt-2'}`}>
|
|
51
|
+
{description}
|
|
52
|
+
</p>
|
|
53
|
+
)}
|
|
20
54
|
{steps?.length ? (
|
|
21
55
|
<div className={`box-border py-0.5 mb-0.5 mt-5`}>
|
|
22
56
|
<div className="flex flex-col justify-between gap-x-[101px]">
|
|
23
|
-
{steps.map((step, i) =>
|
|
57
|
+
{steps.map((step, i) =>
|
|
58
|
+
renderStepTitle({ step, size, i, length: steps.length, version: version }),
|
|
59
|
+
)}
|
|
24
60
|
</div>
|
|
25
61
|
</div>
|
|
26
62
|
) : null}
|
|
@@ -34,20 +70,23 @@ interface RenderStepTitleParams {
|
|
|
34
70
|
size: SizeVersion;
|
|
35
71
|
i: number;
|
|
36
72
|
length: number;
|
|
73
|
+
version: BlockVersion;
|
|
37
74
|
}
|
|
38
75
|
|
|
39
76
|
const renderStepTitle = (params: RenderStepTitleParams) => {
|
|
40
|
-
const { step, size, i, length } = params;
|
|
41
|
-
|
|
77
|
+
const { step, size, i, length, version } = params;
|
|
42
78
|
const isLastStep = length - 1 === i;
|
|
43
79
|
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-[24px]';
|
|
80
|
+
const style = styleMaps(version);
|
|
44
81
|
|
|
45
82
|
return (
|
|
46
83
|
<div key={String(i)}>
|
|
47
84
|
<div key={String(i)} className="flex flex-row text-center relative">
|
|
48
|
-
<div>
|
|
49
|
-
{renderIconArea(
|
|
50
|
-
{!isLastStep &&
|
|
85
|
+
<div className="overflow-hidden">
|
|
86
|
+
{renderIconArea(params)}
|
|
87
|
+
{!isLastStep && (
|
|
88
|
+
<div className={`min-h-8 h-full w-[2px] ${style.iconConnector} ${margin}`} />
|
|
89
|
+
)}
|
|
51
90
|
</div>
|
|
52
91
|
<div className="flex flex-col justify-start relative">
|
|
53
92
|
{step.label && (
|
|
@@ -55,7 +94,7 @@ const renderStepTitle = (params: RenderStepTitleParams) => {
|
|
|
55
94
|
)}
|
|
56
95
|
{step.description && (
|
|
57
96
|
<div
|
|
58
|
-
className={`font-normal text-sm
|
|
97
|
+
className={`font-normal text-sm ${style.description} text-left ${
|
|
59
98
|
step.label ? 'mt-1' : ''
|
|
60
99
|
}`}
|
|
61
100
|
>
|
|
@@ -68,7 +107,9 @@ const renderStepTitle = (params: RenderStepTitleParams) => {
|
|
|
68
107
|
);
|
|
69
108
|
};
|
|
70
109
|
|
|
71
|
-
const renderIconArea = (
|
|
110
|
+
const renderIconArea = (params: RenderStepTitleParams) => {
|
|
111
|
+
const { step, size, i, version } = params;
|
|
112
|
+
const style = styleMaps(version);
|
|
72
113
|
const iconAreaSize =
|
|
73
114
|
size === 'normal'
|
|
74
115
|
? 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]'
|
|
@@ -79,10 +120,10 @@ const renderIconArea = (step: Step, size: SizeVersion, i: number) => {
|
|
|
79
120
|
|
|
80
121
|
return (
|
|
81
122
|
<div
|
|
82
|
-
className={`${iconAreaSize}
|
|
123
|
+
className={`${iconAreaSize} ${style.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`}
|
|
83
124
|
>
|
|
84
|
-
<span className={`font-medium
|
|
85
|
-
{(step.icon && <Icon name={step.icon} width={iconSize} height={iconSize} />) || i + 1}
|
|
125
|
+
<span className={`font-medium flex self-center ${style.title} ${iconTextSize}`}>
|
|
126
|
+
{(step.icon && <Icon name={step.icon} width={iconSize} height={iconSize} asSVG />) || i + 1}
|
|
86
127
|
</span>
|
|
87
128
|
</div>
|
|
88
129
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IconName } from '../../ui-kit/Icon/IconProps';
|
|
2
|
-
|
|
3
2
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
3
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @title Шаг
|
|
@@ -30,4 +30,5 @@ export interface StepsBlockContent {
|
|
|
30
30
|
*/
|
|
31
31
|
steps?: Step[];
|
|
32
32
|
size?: SizeVersion; // TODO: mobile content
|
|
33
|
+
version?: BlockVersion; // TODO: mobile content
|
|
33
34
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useTableArrowScrollControl } from '../../hooks/useTableArrowScrollControl';
|
|
3
|
+
import type { UniBlockProps } from '../../types';
|
|
2
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
3
|
-
import { COLS_LENGTH_FOR_SCROLL } from './constants';
|
|
4
|
-
import { TariffsTableRow } from './TariffsTableRow';
|
|
5
5
|
import { TableArrowScrollControl } from '../../ui-kit/TableArrowScrollControl/TableArrowScrollControl';
|
|
6
|
-
import
|
|
6
|
+
import { COLS_LENGTH_FOR_SCROLL } from './constants';
|
|
7
7
|
import type {
|
|
8
8
|
TariffsTableCellData,
|
|
9
9
|
TariffsTableColumn,
|
|
10
10
|
TariffsTableContent,
|
|
11
11
|
TariffsTableRowHeader,
|
|
12
12
|
} from './TariffsTableContent';
|
|
13
|
-
import {
|
|
13
|
+
import { TariffsTableRow } from './TariffsTableRow';
|
|
14
14
|
|
|
15
15
|
export interface TariffsTableProps extends TariffsTableContent, UniBlockProps {}
|
|
16
16
|
|
|
@@ -46,7 +46,7 @@ export const TariffsTable = JSX<TariffsTableProps>(
|
|
|
46
46
|
{rowData?.length ? (
|
|
47
47
|
<div role="table">
|
|
48
48
|
<div className="relative">
|
|
49
|
-
{rowData.map((row, i) => (
|
|
49
|
+
{rowData.map((row, i, { length }) => (
|
|
50
50
|
<TariffsTableRow
|
|
51
51
|
key={String(i)}
|
|
52
52
|
row={row}
|