@redneckz/wildless-cms-uni-blocks 0.3.14 → 0.3.17
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/Footer/Footer.mobile.js +1 -1
- package/dist/components/Footer/Footer.mobile.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/Footer/Footer.mobile.js +1 -1
- package/lib/components/Footer/Footer.mobile.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 +58 -23
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/Footer/Footer.js +1 -1
- package/mobile/dist/components/Footer/Footer.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/Footer/Footer.js +1 -1
- package/mobile/lib/components/Footer/Footer.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/Footer/Footer.tsx +2 -2
- 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/Footer/Footer.mobile.tsx +2 -2
- 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 +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;Q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jC,MAAM,YAAY,GAChB,IAAI,KAAK,QAAQ;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
|
}
|
|
@@ -8,11 +8,11 @@ import { HorizontalNavigation } from './HorizontalNavigation';
|
|
|
8
8
|
import { SocialMedia } from './SocialMedia';
|
|
9
9
|
import { TextInformation } from './TextInformation';
|
|
10
10
|
|
|
11
|
+
import { useSitemap } from '../../services/sitemap/useSitemap';
|
|
11
12
|
import { Button } from '../../ui-kit/Button/Button';
|
|
12
13
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
13
14
|
import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
|
|
14
15
|
import { getAccordionItems } from '../../utils/getAccordionItems';
|
|
15
|
-
import { useSitemap } from "../../services/sitemap/useSitemap";
|
|
16
16
|
|
|
17
17
|
export interface FooterProps extends FooterContent, UniBlockProps {}
|
|
18
18
|
|
|
@@ -27,7 +27,7 @@ export const Footer = JSX<FooterProps>(
|
|
|
27
27
|
horizontalNavigationTitle,
|
|
28
28
|
}) => {
|
|
29
29
|
const sitemap = useSitemap(context.useAsyncData);
|
|
30
|
-
const dispositions = sitemap?.dispositions
|
|
30
|
+
const dispositions = sitemap?.dispositions;
|
|
31
31
|
return (
|
|
32
32
|
<footer className={`px-4 py-[26px] bg-white ${className}`}>
|
|
33
33
|
<Contacts className="overflow-hidden" items={contacts} context={context} hasButton />
|
|
@@ -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
|
@@ -8,11 +8,11 @@ import { HorizontalNavigation } from './HorizontalNavigation';
|
|
|
8
8
|
import { SocialMedia } from './SocialMedia';
|
|
9
9
|
import { TextInformation } from './TextInformation';
|
|
10
10
|
|
|
11
|
+
import { useSitemap } from '../../services/sitemap/useSitemap';
|
|
11
12
|
import { Button } from '../../ui-kit/Button/Button';
|
|
12
13
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
13
14
|
import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
|
|
14
15
|
import { getAccordionItems } from '../../utils/getAccordionItems';
|
|
15
|
-
import { useSitemap } from "../../services/sitemap/useSitemap";
|
|
16
16
|
|
|
17
17
|
export interface FooterProps extends FooterContent, UniBlockProps {}
|
|
18
18
|
|
|
@@ -27,7 +27,7 @@ export const Footer = JSX<FooterProps>(
|
|
|
27
27
|
horizontalNavigationTitle,
|
|
28
28
|
}) => {
|
|
29
29
|
const sitemap = useSitemap(context.useAsyncData);
|
|
30
|
-
const dispositions = sitemap?.dispositions
|
|
30
|
+
const dispositions = sitemap?.dispositions;
|
|
31
31
|
return (
|
|
32
32
|
<footer className={`px-4 py-[26px] bg-white ${className}`}>
|
|
33
33
|
<Contacts className="overflow-hidden" items={contacts} context={context} hasButton />
|
|
@@ -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
|
};
|