@redneckz/wildless-cms-uni-blocks 0.14.533 → 0.14.534
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 +1 -1
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/dist/components/StepsBlock/renderStep.js.map +1 -1
- package/dist/components/StepsBlock/renderStepMobile.js +6 -19
- package/dist/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/lib/components/StepsBlock/renderStep.js.map +1 -1
- package/lib/components/StepsBlock/renderStepMobile.js +6 -19
- package/lib/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +7 -20
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -1
- package/mobile/dist/components/StepsBlock/renderStepMobile.js +6 -19
- package/mobile/dist/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -1
- package/mobile/lib/components/StepsBlock/renderStepMobile.js +6 -19
- package/mobile/lib/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +0 -2
- package/mobile/src/components/StepsBlock/renderStep.tsx +1 -2
- package/mobile/src/components/StepsBlock/renderStepMobile.tsx +16 -38
- package/package.json +1 -1
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +0 -8
- package/src/components/StepsBlock/StepsBlockContent.ts +0 -2
- package/src/components/StepsBlock/renderStep.tsx +1 -2
- package/src/components/StepsBlock/renderStepMobile.tsx +16 -38
|
@@ -2,7 +2,6 @@ import { type BlockVersion } from '../../model/BlockVersion';
|
|
|
2
2
|
import { type BulletsProps } from '../../model/Bullets';
|
|
3
3
|
import { type DescriptionProps, type LabelProps, type TitleProps } from '../../model/HeadlineType';
|
|
4
4
|
import { type IconProps } from '../../model/Picture';
|
|
5
|
-
import { type ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
6
5
|
import { type ButtonsSectionContent } from '../../ui-kit/LinkButton/ButtonsSectionContent';
|
|
7
6
|
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
8
7
|
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
@@ -10,7 +9,7 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
|
10
9
|
/**
|
|
11
10
|
* @title Шаг
|
|
12
11
|
*/
|
|
13
|
-
export declare type StepProps = DescriptionProps &
|
|
12
|
+
export declare type StepProps = DescriptionProps & LabelProps & RichTextProps & IconProps & BulletsProps & {
|
|
14
13
|
button?: LinkButtonContent;
|
|
15
14
|
};
|
|
16
15
|
/**
|
|
@@ -2,7 +2,6 @@ import { type BlockVersion } from '../../model/BlockVersion';
|
|
|
2
2
|
import { type BulletsProps } from '../../model/Bullets';
|
|
3
3
|
import { type DescriptionProps, type LabelProps, type TitleProps } from '../../model/HeadlineType';
|
|
4
4
|
import { type IconProps } from '../../model/Picture';
|
|
5
|
-
import { type ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
6
5
|
import { type ButtonsSectionContent } from '../../ui-kit/LinkButton/ButtonsSectionContent';
|
|
7
6
|
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
8
7
|
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
@@ -10,7 +9,7 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
|
10
9
|
/**
|
|
11
10
|
* @title Шаг
|
|
12
11
|
*/
|
|
13
|
-
export declare type StepProps = DescriptionProps &
|
|
12
|
+
export declare type StepProps = DescriptionProps & LabelProps & RichTextProps & IconProps & BulletsProps & {
|
|
14
13
|
button?: LinkButtonContent;
|
|
15
14
|
};
|
|
16
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStep.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStep.tsx"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"renderStep.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStep.tsx"],"names":[],"mappings":";;;AAEA,mEAAgE;AAChE,6DAA0D;AAC1D,iDAA8C;AAC9C,6CAA0C;AAI7B,QAAA,eAAe,GAAG,CAAC,CAAC;AAMjC,gDAAgD;AACzC,MAAM,UAAU,GACrB,CAAC,KAAsB,EAAE,EAAE,CAC3B,CAAC,IAAe,EAAE,CAAS,EAAE,GAAgB,EAAS,EAAE;IACtD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAEtD,OAAO,CACL,iCAEE,SAAS,EAAE,IAAA,aAAK,EACd,iHAAiH,EACjH,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAC9B,aAED,iCAAK,SAAS,EAAC,YAAY,aACxB,KAAK,CAAC,CAAC,CAAC,CACP,uBAAC,WAAI,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,aAAa,YACrC,KAAK,GACD,CACR,CAAC,CAAC,CAAC,IAAI,EACR,iCAAK,SAAS,EAAC,oCAAoC,aAChD,WAAW,CAAC,CAAC,CAAC,gCAAK,SAAS,EAAE,QAAQ,CAAC,WAAW,YAAG,WAAW,GAAO,CAAC,CAAC,CAAC,IAAI,EAC/E,uBAAC,mBAAQ,IAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,GAAI,IACnE,IACF,EACL,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CACd,uBAAC,uBAAU,IACT,SAAS,EAAC,yCAAyC,EACnD,OAAO,EAAE,OAAO,KACZ,MAAM,YAET,MAAM,EAAE,IAAI,GACF,CACd,CAAC,CAAC,CAAC,IAAI,KAzBH,MAAM,CAAC,CAAC,CAAC,CA0BV,CACP,CAAC;AACJ,CAAC,CAAC;AApCS,QAAA,UAAU,cAoCnB;AAEJ,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,GAAG,uBAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -12,11 +12,10 @@ const getIconTextStyle_1 = require("./getIconTextStyle");
|
|
|
12
12
|
const StepsBlockStyleMaps_1 = require("./StepsBlockStyleMaps");
|
|
13
13
|
const styleMap = StepsBlockStyleMaps_1.STEPS_BLOCK_STYLE;
|
|
14
14
|
const renderStepMobile = (stepsSize, version, stepVersion) => (step, i) => {
|
|
15
|
-
const { button
|
|
16
|
-
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "contents", children: (0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('flex items-center relative', image?.src ? 'flex-col' : 'flex-row'), children: [image?.src ? renderText(step) : null, (0, jsx_runtime_1.jsx)("div", { className: "overflow-hidden flex flex-shrink-0 items-center", children: renderIconArea(stepsSize, stepVersion)(step, i) }), (0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('flex flex-col justify-center h-fit w-full', {
|
|
15
|
+
const { button } = step;
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "contents", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center relative flex-row", children: [(0, jsx_runtime_1.jsx)("div", { className: "overflow-hidden flex flex-shrink-0 items-center", children: renderIconArea(stepsSize, stepVersion)(step, i) }), (0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('flex flex-col justify-center h-fit w-full', {
|
|
18
17
|
'min-h-6xl': stepsSize,
|
|
19
|
-
}), children: [
|
|
18
|
+
}), children: [renderText(step), button?.text ? ((0, jsx_runtime_1.jsx)(LinkButton_1.LinkButton, { className: "box-border py-s w-full max-w-60 mt-lg", version: version, ...button, children: button?.text })) : null] })] }) }, String(i)));
|
|
20
19
|
};
|
|
21
20
|
exports.renderStepMobile = renderStepMobile;
|
|
22
21
|
const renderIconArea = (stepsSize, stepVersion) => (step, i) => {
|
|
@@ -24,25 +23,13 @@ const renderIconArea = (stepsSize, stepVersion) => (step, i) => {
|
|
|
24
23
|
const isImg = Boolean(step?.icon?.src);
|
|
25
24
|
const iconAreaSize = getIconAreaSize(stepsSize, isImg);
|
|
26
25
|
const containerVersion = isImg ? stepVersion === 'transparent' : stepVersion;
|
|
27
|
-
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)({ 'w-32': Boolean(isImgSrc) }, 'z-10 mr-s flex justify-center content-center rounded-md', !isImgSrc && iconAreaSize), defaultPadding: "", version: containerVersion, children: (0, jsx_runtime_1.jsx)("div", { className: "flex max-w-full max-h-full items-center justify-center", children: renderIcon({ step, iconVersion, i, stepVersion }) }) }));
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)('z-10 mr-s flex justify-center content-center rounded-md', iconAreaSize), defaultPadding: "", version: containerVersion, children: (0, jsx_runtime_1.jsx)("div", { className: "flex max-w-full max-h-full items-center justify-center", children: renderIcon({ step, iconVersion, i, stepVersion }) }) }));
|
|
29
27
|
};
|
|
30
28
|
const renderText = (step) => {
|
|
31
|
-
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)({
|
|
33
|
-
'mb-lg w-full': visibleStyle,
|
|
34
|
-
}), children: [step?.label ? ((0, jsx_runtime_1.jsx)(Paragraph_1.Paragraph, { size: "text-l", align: "text-left", children: step.label })) : null, step?.description ? ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.style)('text-s font-light text-left', styleMap.description), children: step.description })) : null, (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: step.__html })] }));
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [step?.label ? ((0, jsx_runtime_1.jsx)(Paragraph_1.Paragraph, { size: "text-l", align: "text-left", children: step.label })) : null, step?.description ? ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.style)('text-s font-light text-left', styleMap.description), children: step.description })) : null, (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: step.__html })] }));
|
|
35
30
|
};
|
|
36
31
|
const getIconAreaSize = (stepsSize, isImg) => {
|
|
37
32
|
return stepsSize && isImg ? 'h-14 w-14' : 'h-11 w-11';
|
|
38
33
|
};
|
|
39
|
-
const renderIcon = ({ step, iconVersion, i, stepVersion, }) => {
|
|
40
|
-
if ((0, isIcon_1.isIcon)(step?.icon)) {
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(Img_1.Img, { image: { ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }, imageClassName: "max-w-full max-h-full", width: "24", height: "24" }));
|
|
42
|
-
}
|
|
43
|
-
else if ((0, isIcon_1.isIcon)(step.image)) {
|
|
44
|
-
return (0, jsx_runtime_1.jsx)(Img_1.Img, { image: { ...step.image, size: { width: 120, height: 120 } } });
|
|
45
|
-
}
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)("span", { className: (0, style_1.style)('text-h4', stepVersion === 'transparent' ? styleMap.iconText : (0, getIconTextStyle_1.getIconTextStyle)(stepVersion)), children: i + 1 }));
|
|
47
|
-
};
|
|
34
|
+
const renderIcon = ({ step, iconVersion, i, stepVersion, }) => (0, isIcon_1.isIcon)(step?.icon) ? ((0, jsx_runtime_1.jsx)(Img_1.Img, { image: { ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }, imageClassName: "max-w-full max-h-full", width: "24", height: "24" })) : ((0, jsx_runtime_1.jsx)("span", { className: (0, style_1.style)('text-h4', stepVersion === 'transparent' ? styleMap.iconText : (0, getIconTextStyle_1.getIconTextStyle)(stepVersion)), children: i + 1 }));
|
|
48
35
|
//# sourceMappingURL=renderStepMobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStepMobile.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStepMobile.tsx"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"renderStepMobile.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStepMobile.tsx"],"names":[],"mappings":";;;AAEA,4DAAyD;AACzD,8CAA2C;AAC3C,mEAAgE;AAChE,gEAA6D;AAC7D,6DAA0D;AAC1D,+CAA4C;AAC5C,6CAA0C;AAC1C,yDAAsD;AAEtD,+DAA0D;AAE1D,MAAM,QAAQ,GAAG,uCAAiB,CAAC;AAE5B,MAAM,gBAAgB,GAC3B,CAAC,SAAkB,EAAE,OAAqB,EAAE,WAAyB,EAAE,EAAE,CACzE,CAAC,IAAe,EAAE,CAAS,EAAE,EAAE;IAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,OAAO,CACL,gCAAqB,SAAS,EAAC,UAAU,YACvC,iCAAK,SAAS,EAAC,qCAAqC,aAClD,gCAAK,SAAS,EAAC,iDAAiD,YAC7D,cAAc,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAC5C,EACN,iCACE,SAAS,EAAE,IAAA,aAAK,EAAC,2CAA2C,EAAE;wBAC5D,WAAW,EAAE,SAAS;qBACvB,CAAC,aAED,UAAU,CAAC,IAAI,CAAC,EAChB,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CACd,uBAAC,uBAAU,IACT,SAAS,EAAC,uCAAuC,EACjD,OAAO,EAAE,OAAO,KACZ,MAAM,YAET,M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AAE,QAAQ,CAAC,WAAW,CAAC,YACvE,IAAI,CAAC,WAAW,GACb,CACP,CAAC,CAAC,CAAC,IAAI,EACR,uBAAC,mBAAQ,IAAC,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,IAC7B,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,SAAkB,EAAE,KAAc,EAAE,EAAE;IAC7D,OAAO,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,EAClB,IAAI,EACJ,WAAW,EACX,CAAC,EACD,WAAW,GAMZ,EAAE,EAAE,CACH,IAAA,eAAM,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CACnB,uBAAC,SAAG,IACF,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,IAAI,WAAW,EAAE,EAC3E,cAAc,EAAC,uBAAuB,EACtC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,GACX,CACH,CAAC,CAAC,CAAC,CACF,iCACE,SAAS,EAAE,IAAA,aAAK,EACd,SAAS,EACT,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,mCAAgB,EAAC,WAAW,CAAC,CAClF,YAEA,CAAC,GAAG,CAAC,GACD,CACR,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { type BlockVersion } from '../../model/BlockVersion';
|
|
|
2
2
|
import { type BulletsProps } from '../../model/Bullets';
|
|
3
3
|
import { type DescriptionProps, type LabelProps, type TitleProps } from '../../model/HeadlineType';
|
|
4
4
|
import { type IconProps } from '../../model/Picture';
|
|
5
|
-
import { type ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
6
5
|
import { type ButtonsSectionContent } from '../../ui-kit/LinkButton/ButtonsSectionContent';
|
|
7
6
|
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
8
7
|
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
@@ -10,7 +9,7 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
|
10
9
|
/**
|
|
11
10
|
* @title Шаг
|
|
12
11
|
*/
|
|
13
|
-
export declare type StepProps = DescriptionProps &
|
|
12
|
+
export declare type StepProps = DescriptionProps & LabelProps & RichTextProps & IconProps & BulletsProps & {
|
|
14
13
|
button?: LinkButtonContent;
|
|
15
14
|
};
|
|
16
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStep.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStep.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"renderStep.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStep.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI1C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAMjC,gDAAgD;AAChD,MAAM,CAAC,MAAM,UAAU,GACrB,CAAC,KAAsB,EAAE,EAAE,CAC3B,CAAC,IAAe,EAAE,CAAS,EAAE,GAAgB,EAAS,EAAE;IACtD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAEtD,OAAO,CACL,eAEE,SAAS,EAAE,KAAK,CACd,iHAAiH,EACjH,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAC9B,aAED,eAAK,SAAS,EAAC,YAAY,aACxB,KAAK,CAAC,CAAC,CAAC,CACP,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,aAAa,YACrC,KAAK,GACD,CACR,CAAC,CAAC,CAAC,IAAI,EACR,eAAK,SAAS,EAAC,oCAAoC,aAChD,WAAW,CAAC,CAAC,CAAC,cAAK,SAAS,EAAE,QAAQ,CAAC,WAAW,YAAG,WAAW,GAAO,CAAC,CAAC,CAAC,IAAI,EAC/E,KAAC,QAAQ,IAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,GAAI,IACnE,IACF,EACL,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CACd,KAAC,UAAU,IACT,SAAS,EAAC,yCAAyC,EACnD,OAAO,EAAE,OAAO,KACZ,MAAM,YAET,MAAM,EAAE,IAAI,GACF,CACd,CAAC,CAAC,CAAC,IAAI,KAzBH,MAAM,CAAC,CAAC,CAAC,CA0BV,CACP,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -10,36 +10,23 @@ import { getIconTextStyle } from './getIconTextStyle.js';
|
|
|
10
10
|
import { STEPS_BLOCK_STYLE } from './StepsBlockStyleMaps.js';
|
|
11
11
|
const styleMap = STEPS_BLOCK_STYLE;
|
|
12
12
|
export const renderStepMobile = (stepsSize, version, stepVersion) => (step, i) => {
|
|
13
|
-
const { button
|
|
14
|
-
|
|
15
|
-
return (_jsx("div", { className: "contents", children: _jsxs("div", { className: style('flex items-center relative', image?.src ? 'flex-col' : 'flex-row'), children: [image?.src ? renderText(step) : null, _jsx("div", { className: "overflow-hidden flex flex-shrink-0 items-center", children: renderIconArea(stepsSize, stepVersion)(step, i) }), _jsxs("div", { className: style('flex flex-col justify-center h-fit w-full', {
|
|
13
|
+
const { button } = step;
|
|
14
|
+
return (_jsx("div", { className: "contents", children: _jsxs("div", { className: "flex items-center relative flex-row", children: [_jsx("div", { className: "overflow-hidden flex flex-shrink-0 items-center", children: renderIconArea(stepsSize, stepVersion)(step, i) }), _jsxs("div", { className: style('flex flex-col justify-center h-fit w-full', {
|
|
16
15
|
'min-h-6xl': stepsSize,
|
|
17
|
-
}), children: [
|
|
16
|
+
}), children: [renderText(step), button?.text ? (_jsx(LinkButton, { className: "box-border py-s w-full max-w-60 mt-lg", version: version, ...button, children: button?.text })) : null] })] }) }, String(i)));
|
|
18
17
|
};
|
|
19
18
|
const renderIconArea = (stepsSize, stepVersion) => (step, i) => {
|
|
20
19
|
const iconVersion = stepVersion === 'secondary' ? 'white' : 'color';
|
|
21
20
|
const isImg = Boolean(step?.icon?.src);
|
|
22
21
|
const iconAreaSize = getIconAreaSize(stepsSize, isImg);
|
|
23
22
|
const containerVersion = isImg ? stepVersion === 'transparent' : stepVersion;
|
|
24
|
-
|
|
25
|
-
return (_jsx(BlockWrapper, { className: style({ 'w-32': Boolean(isImgSrc) }, 'z-10 mr-s flex justify-center content-center rounded-md', !isImgSrc && iconAreaSize), defaultPadding: "", version: containerVersion, children: _jsx("div", { className: "flex max-w-full max-h-full items-center justify-center", children: renderIcon({ step, iconVersion, i, stepVersion }) }) }));
|
|
23
|
+
return (_jsx(BlockWrapper, { className: style('z-10 mr-s flex justify-center content-center rounded-md', iconAreaSize), defaultPadding: "", version: containerVersion, children: _jsx("div", { className: "flex max-w-full max-h-full items-center justify-center", children: renderIcon({ step, iconVersion, i, stepVersion }) }) }));
|
|
26
24
|
};
|
|
27
25
|
const renderText = (step) => {
|
|
28
|
-
|
|
29
|
-
return (_jsxs("div", { className: style({
|
|
30
|
-
'mb-lg w-full': visibleStyle,
|
|
31
|
-
}), children: [step?.label ? (_jsx(Paragraph, { size: "text-l", align: "text-left", children: step.label })) : null, step?.description ? (_jsx("div", { className: style('text-s font-light text-left', styleMap.description), children: step.description })) : null, _jsx(RichText, { __html: step.__html })] }));
|
|
26
|
+
return (_jsxs("div", { children: [step?.label ? (_jsx(Paragraph, { size: "text-l", align: "text-left", children: step.label })) : null, step?.description ? (_jsx("div", { className: style('text-s font-light text-left', styleMap.description), children: step.description })) : null, _jsx(RichText, { __html: step.__html })] }));
|
|
32
27
|
};
|
|
33
28
|
const getIconAreaSize = (stepsSize, isImg) => {
|
|
34
29
|
return stepsSize && isImg ? 'h-14 w-14' : 'h-11 w-11';
|
|
35
30
|
};
|
|
36
|
-
const renderIcon = ({ step, iconVersion, i, stepVersion, }) => {
|
|
37
|
-
if (isIcon(step?.icon)) {
|
|
38
|
-
return (_jsx(Img, { image: { ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }, imageClassName: "max-w-full max-h-full", width: "24", height: "24" }));
|
|
39
|
-
}
|
|
40
|
-
else if (isIcon(step.image)) {
|
|
41
|
-
return _jsx(Img, { image: { ...step.image, size: { width: 120, height: 120 } } });
|
|
42
|
-
}
|
|
43
|
-
return (_jsx("span", { className: style('text-h4', stepVersion === 'transparent' ? styleMap.iconText : getIconTextStyle(stepVersion)), children: i + 1 }));
|
|
44
|
-
};
|
|
31
|
+
const renderIcon = ({ step, iconVersion, i, stepVersion, }) => isIcon(step?.icon) ? (_jsx(Img, { image: { ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }, imageClassName: "max-w-full max-h-full", width: "24", height: "24" })) : (_jsx("span", { className: style('text-h4', stepVersion === 'transparent' ? styleMap.iconText : getIconTextStyle(stepVersion)), children: i + 1 }));
|
|
45
32
|
//# sourceMappingURL=renderStepMobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStepMobile.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStepMobile.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"renderStepMobile.js","sourceRoot":"","sources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,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,IAC7B,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,SAAkB,EAAE,KAAc,EAAE,EAAE;IAC7D,OAAO,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,EAClB,IAAI,EACJ,WAAW,EACX,CAAC,EACD,WAAW,GAMZ,EAAE,EAAE,CACH,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CACnB,KAAC,GAAG,IACF,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,IAAI,WAAW,EAAE,EAC3E,cAAc,EAAC,uBAAuB,EACtC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,GACX,CACH,CAAC,CAAC,CAAC,CACF,eACE,SAAS,EAAE,KAAK,CACd,SAAS,EACT,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAClF,YAEA,CAAC,GAAG,CAAC,GACD,CACR,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { type BlockVersion } from '../../model/BlockVersion';
|
|
|
2
2
|
import { type BulletsProps } from '../../model/Bullets';
|
|
3
3
|
import { type DescriptionProps, type LabelProps, type TitleProps } from '../../model/HeadlineType';
|
|
4
4
|
import { type IconProps } from '../../model/Picture';
|
|
5
|
-
import { type ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
6
5
|
import { type ButtonsSectionContent } from '../../ui-kit/LinkButton/ButtonsSectionContent';
|
|
7
6
|
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
8
7
|
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
@@ -12,7 +11,6 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
|
12
11
|
* @title Шаг
|
|
13
12
|
*/
|
|
14
13
|
export type StepProps = DescriptionProps &
|
|
15
|
-
ImageContent &
|
|
16
14
|
LabelProps &
|
|
17
15
|
RichTextProps &
|
|
18
16
|
IconProps &
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type BlockVersion } from '../../model/BlockVersion';
|
|
2
|
-
import { type LinkButtonVersion } from '../../model/LinkButtonVersion';
|
|
3
2
|
import { type VNode } from '../../model/VNode';
|
|
4
3
|
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
5
4
|
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
@@ -43,7 +42,7 @@ export const renderStep =
|
|
|
43
42
|
{button?.text ? (
|
|
44
43
|
<LinkButton
|
|
45
44
|
className="box-border py-s w-full max-w-60 mt-auto"
|
|
46
|
-
version={version
|
|
45
|
+
version={version}
|
|
47
46
|
{...button}
|
|
48
47
|
>
|
|
49
48
|
{button?.text}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type BlockVersion } from '../../model/BlockVersion';
|
|
2
2
|
import { type IconVersion } from '../../model/IconVersion';
|
|
3
|
-
import { type LinkButtonVersion } from '../../model/LinkButtonVersion';
|
|
4
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
5
|
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
@@ -17,14 +16,11 @@ const styleMap = STEPS_BLOCK_STYLE;
|
|
|
17
16
|
export const renderStepMobile =
|
|
18
17
|
(stepsSize: boolean, version: BlockVersion, stepVersion: BlockVersion) =>
|
|
19
18
|
(step: StepProps, i: number) => {
|
|
20
|
-
const { button
|
|
21
|
-
|
|
22
|
-
const styleStepMobile = button?.text && image?.src;
|
|
19
|
+
const { button } = step;
|
|
23
20
|
|
|
24
21
|
return (
|
|
25
22
|
<div key={String(i)} className="contents">
|
|
26
|
-
<div className=
|
|
27
|
-
{image?.src ? renderText(step) : null}
|
|
23
|
+
<div className="flex items-center relative flex-row">
|
|
28
24
|
<div className="overflow-hidden flex flex-shrink-0 items-center">
|
|
29
25
|
{renderIconArea(stepsSize, stepVersion)(step, i)}
|
|
30
26
|
</div>
|
|
@@ -33,11 +29,11 @@ export const renderStepMobile =
|
|
|
33
29
|
'min-h-6xl': stepsSize,
|
|
34
30
|
})}
|
|
35
31
|
>
|
|
36
|
-
{
|
|
37
|
-
{
|
|
32
|
+
{renderText(step)}
|
|
33
|
+
{button?.text ? (
|
|
38
34
|
<LinkButton
|
|
39
35
|
className="box-border py-s w-full max-w-60 mt-lg"
|
|
40
|
-
version={version
|
|
36
|
+
version={version}
|
|
41
37
|
{...button}
|
|
42
38
|
>
|
|
43
39
|
{button?.text}
|
|
@@ -55,15 +51,10 @@ const renderIconArea =
|
|
|
55
51
|
const isImg = Boolean(step?.icon?.src);
|
|
56
52
|
const iconAreaSize = getIconAreaSize(stepsSize, isImg);
|
|
57
53
|
const containerVersion = isImg ? stepVersion === 'transparent' : stepVersion;
|
|
58
|
-
const isImgSrc = step.image?.src;
|
|
59
54
|
|
|
60
55
|
return (
|
|
61
56
|
<BlockWrapper
|
|
62
|
-
className={style(
|
|
63
|
-
{ 'w-32': Boolean(isImgSrc) },
|
|
64
|
-
'z-10 mr-s flex justify-center content-center rounded-md',
|
|
65
|
-
!isImgSrc && iconAreaSize,
|
|
66
|
-
)}
|
|
57
|
+
className={style('z-10 mr-s flex justify-center content-center rounded-md', iconAreaSize)}
|
|
67
58
|
defaultPadding=""
|
|
68
59
|
version={containerVersion as BlockVersion}
|
|
69
60
|
>
|
|
@@ -75,14 +66,8 @@ const renderIconArea =
|
|
|
75
66
|
};
|
|
76
67
|
|
|
77
68
|
const renderText = (step: StepProps) => {
|
|
78
|
-
const visibleStyle = Boolean(step.button?.text && step.image?.src);
|
|
79
|
-
|
|
80
69
|
return (
|
|
81
|
-
<div
|
|
82
|
-
className={style({
|
|
83
|
-
'mb-lg w-full': visibleStyle,
|
|
84
|
-
})}
|
|
85
|
-
>
|
|
70
|
+
<div>
|
|
86
71
|
{step?.label ? (
|
|
87
72
|
<Paragraph size="text-l" align="text-left">
|
|
88
73
|
{step.label}
|
|
@@ -112,21 +97,15 @@ const renderIcon = ({
|
|
|
112
97
|
iconVersion: IconVersion;
|
|
113
98
|
i: number;
|
|
114
99
|
stepVersion: BlockVersion;
|
|
115
|
-
}) =>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
);
|
|
125
|
-
} else if (isIcon(step.image)) {
|
|
126
|
-
return <Img image={{ ...step.image, size: { width: 120, height: 120 } }} />;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return (
|
|
100
|
+
}) =>
|
|
101
|
+
isIcon(step?.icon) ? (
|
|
102
|
+
<Img
|
|
103
|
+
image={{ ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }}
|
|
104
|
+
imageClassName="max-w-full max-h-full"
|
|
105
|
+
width="24"
|
|
106
|
+
height="24"
|
|
107
|
+
/>
|
|
108
|
+
) : (
|
|
130
109
|
<span
|
|
131
110
|
className={style(
|
|
132
111
|
'text-h4',
|
|
@@ -136,4 +115,3 @@ const renderIcon = ({
|
|
|
136
115
|
{i + 1}
|
|
137
116
|
</span>
|
|
138
117
|
);
|
|
139
|
-
};
|
package/package.json
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import { type Picture } from '../../model/Picture';
|
|
2
1
|
import '../../setup-fixture';
|
|
3
2
|
|
|
4
3
|
import { StepsBlock } from './StepsBlock';
|
|
5
4
|
import { type StepProps } from './StepsBlockContent';
|
|
6
5
|
|
|
7
|
-
const percentImage: Picture = {
|
|
8
|
-
src: '3-6-percent.png',
|
|
9
|
-
format: 'webp',
|
|
10
|
-
alt: 'Ставка от 3,6% годовых',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
6
|
const steps: StepProps[] = [
|
|
14
7
|
{
|
|
15
8
|
label: 'Заявка на кредит',
|
|
@@ -41,7 +34,6 @@ const STEPS_WITH_ICONS: StepProps[] = [
|
|
|
41
34
|
{
|
|
42
35
|
label: 'В офисах Россельхозбанка',
|
|
43
36
|
description: 'Откройте вклад',
|
|
44
|
-
image: percentImage,
|
|
45
37
|
},
|
|
46
38
|
];
|
|
47
39
|
|
|
@@ -2,7 +2,6 @@ import { type BlockVersion } from '../../model/BlockVersion';
|
|
|
2
2
|
import { type BulletsProps } from '../../model/Bullets';
|
|
3
3
|
import { type DescriptionProps, type LabelProps, type TitleProps } from '../../model/HeadlineType';
|
|
4
4
|
import { type IconProps } from '../../model/Picture';
|
|
5
|
-
import { type ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
6
5
|
import { type ButtonsSectionContent } from '../../ui-kit/LinkButton/ButtonsSectionContent';
|
|
7
6
|
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
8
7
|
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
@@ -12,7 +11,6 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
|
12
11
|
* @title Шаг
|
|
13
12
|
*/
|
|
14
13
|
export type StepProps = DescriptionProps &
|
|
15
|
-
ImageContent &
|
|
16
14
|
LabelProps &
|
|
17
15
|
RichTextProps &
|
|
18
16
|
IconProps &
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type BlockVersion } from '../../model/BlockVersion';
|
|
2
|
-
import { type LinkButtonVersion } from '../../model/LinkButtonVersion';
|
|
3
2
|
import { type VNode } from '../../model/VNode';
|
|
4
3
|
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
5
4
|
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
@@ -43,7 +42,7 @@ export const renderStep =
|
|
|
43
42
|
{button?.text ? (
|
|
44
43
|
<LinkButton
|
|
45
44
|
className="box-border py-s w-full max-w-60 mt-auto"
|
|
46
|
-
version={version
|
|
45
|
+
version={version}
|
|
47
46
|
{...button}
|
|
48
47
|
>
|
|
49
48
|
{button?.text}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type BlockVersion } from '../../model/BlockVersion';
|
|
2
2
|
import { type IconVersion } from '../../model/IconVersion';
|
|
3
|
-
import { type LinkButtonVersion } from '../../model/LinkButtonVersion';
|
|
4
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
5
|
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
@@ -17,14 +16,11 @@ const styleMap = STEPS_BLOCK_STYLE;
|
|
|
17
16
|
export const renderStepMobile =
|
|
18
17
|
(stepsSize: boolean, version: BlockVersion, stepVersion: BlockVersion) =>
|
|
19
18
|
(step: StepProps, i: number) => {
|
|
20
|
-
const { button
|
|
21
|
-
|
|
22
|
-
const styleStepMobile = button?.text && image?.src;
|
|
19
|
+
const { button } = step;
|
|
23
20
|
|
|
24
21
|
return (
|
|
25
22
|
<div key={String(i)} className="contents">
|
|
26
|
-
<div className=
|
|
27
|
-
{image?.src ? renderText(step) : null}
|
|
23
|
+
<div className="flex items-center relative flex-row">
|
|
28
24
|
<div className="overflow-hidden flex flex-shrink-0 items-center">
|
|
29
25
|
{renderIconArea(stepsSize, stepVersion)(step, i)}
|
|
30
26
|
</div>
|
|
@@ -33,11 +29,11 @@ export const renderStepMobile =
|
|
|
33
29
|
'min-h-6xl': stepsSize,
|
|
34
30
|
})}
|
|
35
31
|
>
|
|
36
|
-
{
|
|
37
|
-
{
|
|
32
|
+
{renderText(step)}
|
|
33
|
+
{button?.text ? (
|
|
38
34
|
<LinkButton
|
|
39
35
|
className="box-border py-s w-full max-w-60 mt-lg"
|
|
40
|
-
version={version
|
|
36
|
+
version={version}
|
|
41
37
|
{...button}
|
|
42
38
|
>
|
|
43
39
|
{button?.text}
|
|
@@ -55,15 +51,10 @@ const renderIconArea =
|
|
|
55
51
|
const isImg = Boolean(step?.icon?.src);
|
|
56
52
|
const iconAreaSize = getIconAreaSize(stepsSize, isImg);
|
|
57
53
|
const containerVersion = isImg ? stepVersion === 'transparent' : stepVersion;
|
|
58
|
-
const isImgSrc = step.image?.src;
|
|
59
54
|
|
|
60
55
|
return (
|
|
61
56
|
<BlockWrapper
|
|
62
|
-
className={style(
|
|
63
|
-
{ 'w-32': Boolean(isImgSrc) },
|
|
64
|
-
'z-10 mr-s flex justify-center content-center rounded-md',
|
|
65
|
-
!isImgSrc && iconAreaSize,
|
|
66
|
-
)}
|
|
57
|
+
className={style('z-10 mr-s flex justify-center content-center rounded-md', iconAreaSize)}
|
|
67
58
|
defaultPadding=""
|
|
68
59
|
version={containerVersion as BlockVersion}
|
|
69
60
|
>
|
|
@@ -75,14 +66,8 @@ const renderIconArea =
|
|
|
75
66
|
};
|
|
76
67
|
|
|
77
68
|
const renderText = (step: StepProps) => {
|
|
78
|
-
const visibleStyle = Boolean(step.button?.text && step.image?.src);
|
|
79
|
-
|
|
80
69
|
return (
|
|
81
|
-
<div
|
|
82
|
-
className={style({
|
|
83
|
-
'mb-lg w-full': visibleStyle,
|
|
84
|
-
})}
|
|
85
|
-
>
|
|
70
|
+
<div>
|
|
86
71
|
{step?.label ? (
|
|
87
72
|
<Paragraph size="text-l" align="text-left">
|
|
88
73
|
{step.label}
|
|
@@ -112,21 +97,15 @@ const renderIcon = ({
|
|
|
112
97
|
iconVersion: IconVersion;
|
|
113
98
|
i: number;
|
|
114
99
|
stepVersion: BlockVersion;
|
|
115
|
-
}) =>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
);
|
|
125
|
-
} else if (isIcon(step.image)) {
|
|
126
|
-
return <Img image={{ ...step.image, size: { width: 120, height: 120 } }} />;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return (
|
|
100
|
+
}) =>
|
|
101
|
+
isIcon(step?.icon) ? (
|
|
102
|
+
<Img
|
|
103
|
+
image={{ ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }}
|
|
104
|
+
imageClassName="max-w-full max-h-full"
|
|
105
|
+
width="24"
|
|
106
|
+
height="24"
|
|
107
|
+
/>
|
|
108
|
+
) : (
|
|
130
109
|
<span
|
|
131
110
|
className={style(
|
|
132
111
|
'text-h4',
|
|
@@ -136,4 +115,3 @@ const renderIcon = ({
|
|
|
136
115
|
{i + 1}
|
|
137
116
|
</span>
|
|
138
117
|
);
|
|
139
|
-
};
|