@redneckz/wildless-cms-uni-blocks 0.3.15 → 0.3.16
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 +18 -5
- package/bundle/bundle.umd.min.js +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/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/mobile/bundle/bundle.umd.js +46 -11
- package/mobile/bundle/bundle.umd.min.js +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/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/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/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
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { AlignType } from '../BaseTile/BaseTileProps';
|
|
2
2
|
import type { BlockVersionWithTransparent } from '../../model/BlockVersion';
|
|
3
3
|
export declare const ALIGN_TEXT: Record<AlignType, string>;
|
|
4
|
-
|
|
4
|
+
declare type StyleType = {
|
|
5
|
+
background: string;
|
|
6
|
+
text: string;
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const HEADLINE_BLOCK_STYLE_MAPS: Record<BlockVersionWithTransparent, StyleType>;
|
|
10
|
+
export {};
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.
|
|
2
|
+
exports.HEADLINE_BLOCK_STYLE_MAPS = exports.ALIGN_TEXT = void 0;
|
|
3
3
|
exports.ALIGN_TEXT = {
|
|
4
4
|
left: 'text-left',
|
|
5
5
|
center: 'text-center',
|
|
6
6
|
right: 'text-right',
|
|
7
7
|
};
|
|
8
|
-
exports.
|
|
9
|
-
transparent:
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
exports.HEADLINE_BLOCK_STYLE_MAPS = {
|
|
9
|
+
transparent: {
|
|
10
|
+
background: 'bg-transparent',
|
|
11
|
+
text: 'text-primary-text',
|
|
12
|
+
description: 'text-primary-text',
|
|
13
|
+
},
|
|
14
|
+
primary: {
|
|
15
|
+
background: 'bg-white',
|
|
16
|
+
text: 'text-primary-text',
|
|
17
|
+
description: 'text-primary-text',
|
|
18
|
+
},
|
|
19
|
+
secondary: {
|
|
20
|
+
background: 'bg-primary-main',
|
|
21
|
+
text: 'text-white',
|
|
22
|
+
description: 'text-white/80',
|
|
23
|
+
},
|
|
12
24
|
};
|
|
13
25
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/Headline/constants.ts"],"names":[],"mappings":";;AAGa,QAAA,UAAU,GAA8B;IACnD,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/Headline/constants.ts"],"names":[],"mappings":";;AAGa,QAAA,UAAU,GAA8B;IACnD,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;CACpB,CAAC;AAQW,QAAA,yBAAyB,GAAmD;IACvF,WAAW,EAAE;QACX,UAAU,EAAE,gBAAgB;QAC5B,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,mBAAmB;KACjC;IACD,OAAO,EAAE;QACP,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,mBAAmB;KACjC;IACD,SAAS,EAAE;QACT,UAAU,EAAE,iBAAiB;QAC7B,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,eAAe;KAC7B;CACF,CAAC"}
|
|
@@ -4,21 +4,43 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
5
|
const Heading_1 = require("../../ui-kit/Heading/Heading");
|
|
6
6
|
const Icon_1 = require("../../ui-kit/Icon/Icon");
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const STEPS_BLOCK_STYLE_MAPS = {
|
|
8
|
+
primary: {
|
|
9
|
+
background: 'bg-white',
|
|
10
|
+
title: 'text-primary-text',
|
|
11
|
+
description: 'text-secondary-text',
|
|
12
|
+
iconBackground: 'bg-secondary-light',
|
|
13
|
+
iconConnector: 'bg-secondary-light',
|
|
14
|
+
},
|
|
15
|
+
secondary: {
|
|
16
|
+
background: 'bg-primary-main',
|
|
17
|
+
title: 'text-white',
|
|
18
|
+
description: 'text-white/80',
|
|
19
|
+
iconBackground: 'bg-white/30',
|
|
20
|
+
iconConnector: 'bg-white',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const styleMaps = (version) => STEPS_BLOCK_STYLE_MAPS[version];
|
|
24
|
+
exports.StepsBlock = (0, uni_jsx_1.JSX)(({ className, title, description, steps, size = 'normal', version = 'primary' }) => {
|
|
25
|
+
const style = styleMaps(version);
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)("section", { className: `box-border font-sans bg-white px-4 py-6 flex flex-col
|
|
27
|
+
${style.background} ${style.title} ${className || ''}`, children: [title && ((0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: "h3", className: `text-center ${style.title}`, title: title })), description && ((0, jsx_runtime_1.jsx)("p", { className: `text-m-md text-center ${style.description} ${title && 'mt-2'}`, children: description })), steps?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map((step, i) => renderStepTitle({ step, size, i, length: steps.length, version: version })) }) })) : null] }));
|
|
9
28
|
});
|
|
10
29
|
const renderStepTitle = (params) => {
|
|
11
|
-
const { step, size, i, length } = params;
|
|
30
|
+
const { step, size, i, length, version } = params;
|
|
12
31
|
const isLastStep = length - 1 === i;
|
|
13
32
|
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-[24px]';
|
|
14
|
-
|
|
33
|
+
const style = styleMaps(version);
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-row text-center relative", children: [(0, jsx_runtime_1.jsxs)("div", { className: "overflow-hidden", children: [renderIconArea(params), !isLastStep && ((0, jsx_runtime_1.jsx)("div", { className: `min-h-8 h-full w-[2px] ${style.iconConnector} ${margin}` }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col justify-start relative", children: [step.label && ((0, jsx_runtime_1.jsx)("div", { className: "font-medium text-m-title-xs m-0 text-left", children: step.label })), step.description && ((0, jsx_runtime_1.jsx)("div", { className: `font-normal text-sm ${style.description} text-left ${step.label ? 'mt-1' : ''}`, children: step.description }))] })] }, String(i)) }, String(i)));
|
|
15
35
|
};
|
|
16
|
-
const renderIconArea = (
|
|
36
|
+
const renderIconArea = (params) => {
|
|
37
|
+
const { step, size, i, version } = params;
|
|
38
|
+
const style = styleMaps(version);
|
|
17
39
|
const iconAreaSize = size === 'normal'
|
|
18
40
|
? 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]'
|
|
19
41
|
: 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]';
|
|
20
42
|
const iconSize = size === 'normal' ? '38' : '27';
|
|
21
43
|
const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: `${iconAreaSize}
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `${iconAreaSize} ${style.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: (0, jsx_runtime_1.jsx)("span", { className: `font-medium flex self-center ${style.title} ${iconTextSize}`, children: (step.icon && (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: step.icon, width: iconSize, height: iconSize, asSVG: true })) || i + 1 }) }));
|
|
23
45
|
};
|
|
24
46
|
//# sourceMappingURL=StepsBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepsBlock.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlock.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;
|
|
1
|
+
{"version":3,"file":"StepsBlock.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlock.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,0DAAuD;AACvD,iDAA8C;AAgB9C,MAAM,sBAAsB,GAAoC;IAC9D,OAAO,EAAE;QACP,UAAU,EAAE,UAAU;QACtB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,qBAAqB;QAClC,cAAc,EAAE,oBAAoB;QACpC,aAAa,EAAE,oBAAoB;KACpC;IACD,SAAS,EAAE;QACT,UAAU,EAAE,iBAAiB;QAC7B,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,eAAe;QAC5B,cAAc,EAAE,aAAa;QAC7B,aAAa,EAAE,UAAU;KAC1B;CACF,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,OAAqB,EAAa,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAE3E,QAAA,UAAU,GAAG,IAAA,aAAG,EAC3B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,GAAG,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,EAAE,EAAE;IACjF,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,CACL,qCACE,SAAS,EAAE;UACT,KA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AAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,SAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GACtF,GACH,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IconName } from '../../ui-kit/Icon/IconProps';
|
|
2
2
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
3
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
4
|
/**
|
|
4
5
|
* @title Шаг
|
|
5
6
|
*/
|
|
@@ -27,4 +28,5 @@ export interface StepsBlockContent {
|
|
|
27
28
|
*/
|
|
28
29
|
steps?: Step[];
|
|
29
30
|
size?: SizeVersion;
|
|
31
|
+
version?: BlockVersion;
|
|
30
32
|
}
|
|
@@ -2,8 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
5
|
-
import { ALIGN_TEXT,
|
|
5
|
+
import { ALIGN_TEXT, HEADLINE_BLOCK_STYLE_MAPS } from './constants.js';
|
|
6
6
|
export const Headline = JSX(({ bgColorHeadline = 'transparent', className = '', title, description, image, align = 'left', }) => {
|
|
7
|
-
|
|
7
|
+
const STYLE_MAPS = HEADLINE_BLOCK_STYLE_MAPS[bgColorHeadline];
|
|
8
|
+
return (_jsxs("section", { className: `px-4 py-6 ${STYLE_MAPS.background} ${className}`, children: [title && (_jsx(Heading, { headingType: "h2", className: `${STYLE_MAPS.text} ${ALIGN_TEXT[align]}`, title: title })), description && (_jsx("p", { className: `font-normal text-m-md ${STYLE_MAPS.description} ${ALIGN_TEXT[align]} ${title ? 'mt-2.5' : ''}`, children: description })), image?.src && (_jsx("div", { className: "mt-5 mx-auto flex justify-center", children: _jsx(Img, { image: image }) }))] }));
|
|
8
9
|
});
|
|
9
10
|
//# sourceMappingURL=Headline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Headline.js","sourceRoot":"","sources":["../../../src/components/Headline/Headline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"Headline.js","sourceRoot":"","sources":["../../../src/components/Headline/Headline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAKpE,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CACzB,CAAC,EACC,eAAe,GAAG,aAAa,EAC/B,SAAS,GAAG,EAAE,EACd,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,GAAG,MAAM,GACf,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,yBAAyB,CAAC,eAAe,CAAC,CAAC;IAC9D,OAAO,CACL,mBAAS,SAAS,EAAE,aAAa,UAAU,CAAC,UAAU,IAAI,SAAS,EAAE,aAClE,KAAK,IAAI,CACR,KAAC,OAAO,IACN,WAAW,EAAC,IAAI,EAChB,SAAS,EAAE,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,EACpD,KAAK,EAAE,KAAK,GACZ,CACH,EACA,WAAW,IAAI,CACd,YACE,SAAS,EAAE,yBAAyB,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,KAAK,CAAC,IAC7E,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EACrB,EAAE,YAED,WAAW,GACV,CACL,EACA,KAAK,EAAE,GAAG,IAAI,CACb,cAAK,SAAS,EAAC,kCAAkC,YAC/C,KAAC,GAAG,IAAC,KAAK,EAAE,KAAK,GAAI,GACjB,CACP,IACO,CACX,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { AlignType } from '../BaseTile/BaseTileProps';
|
|
2
2
|
import type { BlockVersionWithTransparent } from '../../model/BlockVersion';
|
|
3
3
|
export declare const ALIGN_TEXT: Record<AlignType, string>;
|
|
4
|
-
|
|
4
|
+
declare type StyleType = {
|
|
5
|
+
background: string;
|
|
6
|
+
text: string;
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const HEADLINE_BLOCK_STYLE_MAPS: Record<BlockVersionWithTransparent, StyleType>;
|
|
10
|
+
export {};
|
|
@@ -3,9 +3,21 @@ export const ALIGN_TEXT = {
|
|
|
3
3
|
center: 'text-center',
|
|
4
4
|
right: 'text-right',
|
|
5
5
|
};
|
|
6
|
-
export const
|
|
7
|
-
transparent:
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export const HEADLINE_BLOCK_STYLE_MAPS = {
|
|
7
|
+
transparent: {
|
|
8
|
+
background: 'bg-transparent',
|
|
9
|
+
text: 'text-primary-text',
|
|
10
|
+
description: 'text-primary-text',
|
|
11
|
+
},
|
|
12
|
+
primary: {
|
|
13
|
+
background: 'bg-white',
|
|
14
|
+
text: 'text-primary-text',
|
|
15
|
+
description: 'text-primary-text',
|
|
16
|
+
},
|
|
17
|
+
secondary: {
|
|
18
|
+
background: 'bg-primary-main',
|
|
19
|
+
text: 'text-white',
|
|
20
|
+
description: 'text-white/80',
|
|
21
|
+
},
|
|
10
22
|
};
|
|
11
23
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/Headline/constants.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAA8B;IACnD,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/Headline/constants.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAA8B;IACnD,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;CACpB,CAAC;AAQF,MAAM,CAAC,MAAM,yBAAyB,GAAmD;IACvF,WAAW,EAAE;QACX,UAAU,EAAE,gBAAgB;QAC5B,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,mBAAmB;KACjC;IACD,OAAO,EAAE;QACP,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,mBAAmB;KACjC;IACD,SAAS,EAAE;QACT,UAAU,EAAE,iBAAiB;QAC7B,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,eAAe;KAC7B;CACF,CAAC"}
|
|
@@ -2,21 +2,43 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
4
4
|
import { Icon } from '../../ui-kit/Icon/Icon.js';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const STEPS_BLOCK_STYLE_MAPS = {
|
|
6
|
+
primary: {
|
|
7
|
+
background: 'bg-white',
|
|
8
|
+
title: 'text-primary-text',
|
|
9
|
+
description: 'text-secondary-text',
|
|
10
|
+
iconBackground: 'bg-secondary-light',
|
|
11
|
+
iconConnector: 'bg-secondary-light',
|
|
12
|
+
},
|
|
13
|
+
secondary: {
|
|
14
|
+
background: 'bg-primary-main',
|
|
15
|
+
title: 'text-white',
|
|
16
|
+
description: 'text-white/80',
|
|
17
|
+
iconBackground: 'bg-white/30',
|
|
18
|
+
iconConnector: 'bg-white',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
const styleMaps = (version) => STEPS_BLOCK_STYLE_MAPS[version];
|
|
22
|
+
export const StepsBlock = JSX(({ className, title, description, steps, size = 'normal', version = 'primary' }) => {
|
|
23
|
+
const style = styleMaps(version);
|
|
24
|
+
return (_jsxs("section", { className: `box-border font-sans bg-white px-4 py-6 flex flex-col
|
|
25
|
+
${style.background} ${style.title} ${className || ''}`, children: [title && (_jsx(Heading, { headingType: "h3", className: `text-center ${style.title}`, title: title })), description && (_jsx("p", { className: `text-m-md text-center ${style.description} ${title && 'mt-2'}`, children: description })), steps?.length ? (_jsx("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: _jsx("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map((step, i) => renderStepTitle({ step, size, i, length: steps.length, version: version })) }) })) : null] }));
|
|
7
26
|
});
|
|
8
27
|
const renderStepTitle = (params) => {
|
|
9
|
-
const { step, size, i, length } = params;
|
|
28
|
+
const { step, size, i, length, version } = params;
|
|
10
29
|
const isLastStep = length - 1 === i;
|
|
11
30
|
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-[24px]';
|
|
12
|
-
|
|
31
|
+
const style = styleMaps(version);
|
|
32
|
+
return (_jsx("div", { children: _jsxs("div", { className: "flex flex-row text-center relative", children: [_jsxs("div", { className: "overflow-hidden", children: [renderIconArea(params), !isLastStep && (_jsx("div", { className: `min-h-8 h-full w-[2px] ${style.iconConnector} ${margin}` }))] }), _jsxs("div", { className: "flex flex-col justify-start relative", children: [step.label && (_jsx("div", { className: "font-medium text-m-title-xs m-0 text-left", children: step.label })), step.description && (_jsx("div", { className: `font-normal text-sm ${style.description} text-left ${step.label ? 'mt-1' : ''}`, children: step.description }))] })] }, String(i)) }, String(i)));
|
|
13
33
|
};
|
|
14
|
-
const renderIconArea = (
|
|
34
|
+
const renderIconArea = (params) => {
|
|
35
|
+
const { step, size, i, version } = params;
|
|
36
|
+
const style = styleMaps(version);
|
|
15
37
|
const iconAreaSize = size === 'normal'
|
|
16
38
|
? 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]'
|
|
17
39
|
: 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]';
|
|
18
40
|
const iconSize = size === 'normal' ? '38' : '27';
|
|
19
41
|
const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
|
|
20
|
-
return (_jsx("div", { className: `${iconAreaSize}
|
|
42
|
+
return (_jsx("div", { className: `${iconAreaSize} ${style.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: _jsx("span", { className: `font-medium flex self-center ${style.title} ${iconTextSize}`, children: (step.icon && _jsx(Icon, { name: step.icon, width: iconSize, height: iconSize, asSVG: true })) || i + 1 }) }));
|
|
21
43
|
};
|
|
22
44
|
//# sourceMappingURL=StepsBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepsBlock.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"StepsBlock.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAgB9C,MAAM,sBAAsB,GAAoC;IAC9D,OAAO,EAAE;QACP,UAAU,EAAE,UAAU;QACtB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,qBAAqB;QAClC,cAAc,EAAE,oBAAoB;QACpC,aAAa,EAAE,oBAAoB;KACpC;IACD,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AQ;QACf,CAAC,CAAC,6CAA6C;QAC/C,CAAC,CAAC,6CAA6C,CAAC;IAEpD,MAAM,QAAQ,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACjD,MAAM,YAAY,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAE5E,OAAO,CACL,cACE,SAAS,EAAE,GAAG,YAAY,IAAI,KAAK,CAAC,cAAc,4DAA4D,YAE9G,eAAM,SAAS,EAAE,gCAAgC,KAAK,CAAC,KAAK,IAAI,YAAY,EAAE,YAC3E,CAAC,IAAI,CAAC,IAAI,IAAI,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,SAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GACtF,GACH,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IconName } from '../../ui-kit/Icon/IconProps';
|
|
2
2
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
3
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
4
|
/**
|
|
4
5
|
* @title Шаг
|
|
5
6
|
*/
|
|
@@ -27,4 +28,5 @@ export interface StepsBlockContent {
|
|
|
27
28
|
*/
|
|
28
29
|
steps?: Step[];
|
|
29
30
|
size?: SizeVersion;
|
|
31
|
+
version?: BlockVersion;
|
|
30
32
|
}
|
|
@@ -3,7 +3,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import type { UniBlockProps } from '../../types';
|
|
4
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
-
import { ALIGN_TEXT,
|
|
6
|
+
import { ALIGN_TEXT, HEADLINE_BLOCK_STYLE_MAPS } from './constants';
|
|
7
7
|
import type { HeadlineContent } from './HeadlineContent';
|
|
8
8
|
|
|
9
9
|
export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
|
|
@@ -17,17 +17,22 @@ export const Headline = JSX<HeadlineProps>(
|
|
|
17
17
|
image,
|
|
18
18
|
align = 'left',
|
|
19
19
|
}) => {
|
|
20
|
+
const STYLE_MAPS = HEADLINE_BLOCK_STYLE_MAPS[bgColorHeadline];
|
|
20
21
|
return (
|
|
21
|
-
<section className={`px-4 py-6 ${
|
|
22
|
+
<section className={`px-4 py-6 ${STYLE_MAPS.background} ${className}`}>
|
|
22
23
|
{title && (
|
|
23
24
|
<Heading
|
|
24
25
|
headingType="h2"
|
|
25
|
-
className={
|
|
26
|
+
className={`${STYLE_MAPS.text} ${ALIGN_TEXT[align]}`}
|
|
26
27
|
title={title}
|
|
27
28
|
/>
|
|
28
29
|
)}
|
|
29
30
|
{description && (
|
|
30
|
-
<p
|
|
31
|
+
<p
|
|
32
|
+
className={`font-normal text-m-md ${STYLE_MAPS.description} ${ALIGN_TEXT[align]} ${
|
|
33
|
+
title ? 'mt-2.5' : ''
|
|
34
|
+
}`}
|
|
35
|
+
>
|
|
31
36
|
{description}
|
|
32
37
|
</p>
|
|
33
38
|
)}
|
|
@@ -7,8 +7,26 @@ export const ALIGN_TEXT: Record<AlignType, string> = {
|
|
|
7
7
|
right: 'text-right',
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
type StyleType = {
|
|
11
|
+
background: string;
|
|
12
|
+
text: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const HEADLINE_BLOCK_STYLE_MAPS: Record<BlockVersionWithTransparent, StyleType> = {
|
|
17
|
+
transparent: {
|
|
18
|
+
background: 'bg-transparent',
|
|
19
|
+
text: 'text-primary-text',
|
|
20
|
+
description: 'text-primary-text',
|
|
21
|
+
},
|
|
22
|
+
primary: {
|
|
23
|
+
background: 'bg-white',
|
|
24
|
+
text: 'text-primary-text',
|
|
25
|
+
description: 'text-primary-text',
|
|
26
|
+
},
|
|
27
|
+
secondary: {
|
|
28
|
+
background: 'bg-primary-main',
|
|
29
|
+
text: 'text-white',
|
|
30
|
+
description: 'text-white/80',
|
|
31
|
+
},
|
|
14
32
|
};
|
|
@@ -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
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import type { UniBlockProps } from '../../types';
|
|
4
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
-
import { ALIGN_TEXT,
|
|
6
|
+
import { ALIGN_TEXT, HEADLINE_BLOCK_STYLE_MAPS } from './constants';
|
|
7
7
|
import type { HeadlineContent } from './HeadlineContent';
|
|
8
8
|
|
|
9
9
|
export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
|
|
@@ -17,17 +17,22 @@ export const Headline = JSX<HeadlineProps>(
|
|
|
17
17
|
image,
|
|
18
18
|
align = 'left',
|
|
19
19
|
}) => {
|
|
20
|
+
const STYLE_MAPS = HEADLINE_BLOCK_STYLE_MAPS[bgColorHeadline];
|
|
20
21
|
return (
|
|
21
|
-
<section className={`px-4 py-6 ${
|
|
22
|
+
<section className={`px-4 py-6 ${STYLE_MAPS.background} ${className}`}>
|
|
22
23
|
{title && (
|
|
23
24
|
<Heading
|
|
24
25
|
headingType="h2"
|
|
25
|
-
className={
|
|
26
|
+
className={`${STYLE_MAPS.text} ${ALIGN_TEXT[align]}`}
|
|
26
27
|
title={title}
|
|
27
28
|
/>
|
|
28
29
|
)}
|
|
29
30
|
{description && (
|
|
30
|
-
<p
|
|
31
|
+
<p
|
|
32
|
+
className={`font-normal text-m-md ${STYLE_MAPS.description} ${ALIGN_TEXT[align]} ${
|
|
33
|
+
title ? 'mt-2.5' : ''
|
|
34
|
+
}`}
|
|
35
|
+
>
|
|
31
36
|
{description}
|
|
32
37
|
</p>
|
|
33
38
|
)}
|
|
@@ -2,15 +2,16 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
|
|
3
3
|
import type { UniBlockProps } from '../../types';
|
|
4
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
|
-
import { ALIGN_TEXT,
|
|
5
|
+
import { ALIGN_TEXT, HEADLINE_BLOCK_STYLE_MAPS } from './constants';
|
|
6
6
|
import type { HeadlineContent } from './HeadlineContent';
|
|
7
7
|
|
|
8
8
|
export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
|
|
9
9
|
|
|
10
10
|
export const Headline = JSX<HeadlineProps>(
|
|
11
11
|
({ bgColorHeadline = 'transparent', align = 'left', className = '', title, description }) => {
|
|
12
|
+
const STYLE_MAPS = HEADLINE_BLOCK_STYLE_MAPS[bgColorHeadline];
|
|
12
13
|
return (
|
|
13
|
-
<section className={`p-[50px] ${
|
|
14
|
+
<section className={`p-[50px] ${STYLE_MAPS.background} ${className}`}>
|
|
14
15
|
{title && (
|
|
15
16
|
<Heading
|
|
16
17
|
headingType="h2"
|
|
@@ -7,8 +7,26 @@ export const ALIGN_TEXT: Record<AlignType, string> = {
|
|
|
7
7
|
right: 'text-right',
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
type StyleType = {
|
|
11
|
+
background: string;
|
|
12
|
+
text: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const HEADLINE_BLOCK_STYLE_MAPS: Record<BlockVersionWithTransparent, StyleType> = {
|
|
17
|
+
transparent: {
|
|
18
|
+
background: 'bg-transparent',
|
|
19
|
+
text: 'text-primary-text',
|
|
20
|
+
description: 'text-primary-text',
|
|
21
|
+
},
|
|
22
|
+
primary: {
|
|
23
|
+
background: 'bg-white',
|
|
24
|
+
text: 'text-primary-text',
|
|
25
|
+
description: 'text-primary-text',
|
|
26
|
+
},
|
|
27
|
+
secondary: {
|
|
28
|
+
background: 'bg-primary-main',
|
|
29
|
+
text: 'text-white',
|
|
30
|
+
description: 'text-white/80',
|
|
31
|
+
},
|
|
14
32
|
};
|