@redneckz/wildless-cms-uni-blocks 0.14.531 → 0.14.532

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.
Files changed (53) hide show
  1. package/bin/migration-scripts/0.14.519.js +13 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +7 -10
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/StepsBlock/StepsBlockContent.d.ts +3 -7
  6. package/bundle/components/StepsBlock/renderStepMobile.d.ts +4 -0
  7. package/dist/components/StepsBlock/StepsBlock.js +6 -9
  8. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  9. package/dist/components/StepsBlock/StepsBlock.mobile.js +5 -26
  10. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  11. package/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -7
  12. package/dist/components/StepsBlock/renderStepMobile.d.ts +4 -0
  13. package/dist/components/StepsBlock/renderStepMobile.js +48 -0
  14. package/dist/components/StepsBlock/renderStepMobile.js.map +1 -0
  15. package/lib/common.css +1 -1
  16. package/lib/components/StepsBlock/StepsBlock.fixture.mobile.d.ts +1 -0
  17. package/lib/components/StepsBlock/StepsBlock.js +7 -10
  18. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  19. package/lib/components/StepsBlock/StepsBlock.mobile.js +5 -26
  20. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  21. package/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -7
  22. package/lib/components/StepsBlock/renderStepMobile.d.ts +3 -0
  23. package/lib/components/StepsBlock/renderStepMobile.js +45 -0
  24. package/lib/components/StepsBlock/renderStepMobile.js.map +1 -0
  25. package/mobile/bundle/bundle.umd.js +41 -22
  26. package/mobile/bundle/bundle.umd.min.js +1 -1
  27. package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +3 -7
  28. package/mobile/bundle/components/StepsBlock/renderStepMobile.d.ts +4 -0
  29. package/mobile/dist/components/StepsBlock/StepsBlock.js +5 -26
  30. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  31. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -7
  32. package/mobile/dist/components/StepsBlock/renderStepMobile.d.ts +4 -0
  33. package/mobile/dist/components/StepsBlock/renderStepMobile.js +48 -0
  34. package/mobile/dist/components/StepsBlock/renderStepMobile.js.map +1 -0
  35. package/mobile/lib/common.css +1 -1
  36. package/mobile/lib/components/StepsBlock/StepsBlock.js +5 -26
  37. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  38. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -7
  39. package/mobile/lib/components/StepsBlock/renderStepMobile.d.ts +4 -0
  40. package/mobile/lib/components/StepsBlock/renderStepMobile.js +45 -0
  41. package/mobile/lib/components/StepsBlock/renderStepMobile.js.map +1 -0
  42. package/mobile/src/components/StepsBlock/StepsBlock.tsx +24 -112
  43. package/mobile/src/components/StepsBlock/StepsBlock.ui.json +3 -0
  44. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +3 -6
  45. package/mobile/src/components/StepsBlock/renderStepMobile.tsx +139 -0
  46. package/package.json +1 -1
  47. package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +44 -8
  48. package/src/components/StepsBlock/StepsBlock.fixture.tsx +0 -1
  49. package/src/components/StepsBlock/StepsBlock.mobile.tsx +24 -112
  50. package/src/components/StepsBlock/StepsBlock.tsx +8 -19
  51. package/src/components/StepsBlock/StepsBlock.ui.json +3 -0
  52. package/src/components/StepsBlock/StepsBlockContent.ts +3 -6
  53. package/src/components/StepsBlock/renderStepMobile.tsx +139 -0
@@ -1,33 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
3
  import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
4
- import { Img } from '../../ui-kit/Img/Img.js';
5
4
  import { renderButtonsSection } from '../../ui-kit/LinkButton/renderButtonsSection.js';
6
- import { Paragraph } from '../../ui-kit/Paragraph/Paragraph.js';
7
- import { RichText } from '../../ui-kit/RichText/RichText.js';
8
- import { isIcon } from '../../utils/isIcon.js';
9
5
  import { style } from '../../utils/style.js';
10
6
  import { Headline } from '../Headline/Headline.js';
11
- import { getIconTextStyle } from './getIconTextStyle.js';
12
- import { STEPS_BLOCK_STYLE } from './StepsBlockStyleMaps.js';
13
- const STEPS_SIZE_MAP = {
14
- normal: { icon: 'h-11 w-11', image: 'h-14 w-14' },
15
- small: { icon: 'h-12 w-12', image: 'h-14 w-14' },
16
- };
17
- const STEPS_TILE_DESCRIPTION_HEIGHT_MAP = {
18
- normal: '',
19
- small: 'min-h-6xl',
20
- };
21
- const styleMap = STEPS_BLOCK_STYLE;
22
- export const StepsBlock = JSX(({ className = '', title, description, steps, buttons, size = 'normal', stepVersion = 'gray', version = 'primary', ...rest }) => (_jsxs(BlockWrapper, { className: style('box-border flex flex-col gap-xl', className), defaultPadding: "p-6xl", version: version, ...rest, children: [_jsx(Headline, { title: title, description: description, headlineVersion: "M", isEmbedded: true, align: "text-left" }), steps?.length ? (_jsx("div", { className: "box-border", children: _jsx("div", { className: "flex flex-col gap-6xl justify-between", children: steps.map(renderStep(size, stepVersion)) }) })) : null, renderButtonsSection(buttons, { isVertical: true })] })));
23
- // TODO: Create universal function for this case
24
- const renderStep = (size, stepVersion) => (step, i) => (_jsx("div", { className: "contents", children: _jsxs("div", { className: "flex flex-row items-center relative", children: [_jsx("div", { className: "overflow-hidden flex flex-shrink-0 items-center", children: renderIconArea(size, stepVersion)(step, i) }), _jsxs("div", { className: style('flex flex-col justify-center h-fit', STEPS_TILE_DESCRIPTION_HEIGHT_MAP[size]), 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 })] })] }) }, String(i)));
25
- const renderIconArea = (size, stepVersion) => (step, i) => {
26
- const iconVersion = stepVersion === 'secondary' ? 'white' : 'color';
27
- const isImg = Boolean(step?.icon?.src);
28
- const iconAreaSize = STEPS_SIZE_MAP[size][isImg ? 'image' : 'icon'];
29
- const containerVersion = isImg ? stepVersion === 'transparent' : stepVersion;
30
- return (_jsx(BlockWrapper, { className: style(iconAreaSize, 'z-10 mr-s flex justify-center content-center rounded-md'), defaultPadding: "", version: containerVersion, children: _jsx("span", { className: "flex max-w-full max-h-full items-center justify-center", children: isIcon(step?.icon) ? (_jsx(Img, { image: { ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }, imageClassName: "max-w-full max-h-full", width: getIconSizeStyle(size), height: getIconSizeStyle(size) })) : (_jsx("span", { className: style('text-h4', stepVersion === 'transparent' ? styleMap.iconText : getIconTextStyle(stepVersion)), children: i + 1 })) }) }));
31
- };
32
- const getIconSizeStyle = (size) => (size === 'normal' ? '38' : '24');
7
+ import { renderStepMobile } from './renderStepMobile.js';
8
+ export const StepsBlock = JSX(({ className = '', title, description, steps = [], buttons, stepVersion = 'gray', version = 'primary', ...rest }) => {
9
+ const isBigSizeSteps = steps.length > 3;
10
+ return (_jsxs(BlockWrapper, { className: style('box-border flex flex-col gap-xl', className), defaultPadding: "p-6xl", version: version, ...rest, children: [_jsx(Headline, { title: title, description: description, headlineVersion: "M", isEmbedded: true, align: "text-left" }), steps?.length ? (_jsx("div", { className: "flex flex-col gap-6xl justify-between box-border", children: steps.map(renderStepMobile(isBigSizeSteps, version, stepVersion)) })) : null, renderButtonsSection(buttons, { isVertical: true })] }));
11
+ });
33
12
  //# sourceMappingURL=StepsBlock.mobile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepsBlock.mobile.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlock.mobile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC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,GAAG,CAAC,gBAAgB,CAAC,cAAc,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,GAC9D,CACP,CAAC,CAAC,CAAC,IAAI,EACP,oBAAoB,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,IACvC,CAChB,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -2,7 +2,7 @@ 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 SizeVersion } from '../../model/SizeVersion';
5
+ import { type ImageContent } from '../../ui-kit/Img/ImgProps';
6
6
  import { type ButtonsSectionContent } from '../../ui-kit/LinkButton/ButtonsSectionContent';
7
7
  import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
8
8
  import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
@@ -10,7 +10,7 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
10
10
  /**
11
11
  * @title Шаг
12
12
  */
13
- export declare type StepProps = DescriptionProps & LabelProps & RichTextProps & IconProps & BulletsProps & {
13
+ export declare type StepProps = DescriptionProps & ImageContent & LabelProps & RichTextProps & IconProps & BulletsProps & {
14
14
  button?: LinkButtonContent;
15
15
  };
16
16
  /**
@@ -25,10 +25,6 @@ export declare type StepsBlockContent = UniBlockContent & TitleProps & Descripti
25
25
  * @maxItems 5
26
26
  */
27
27
  steps?: StepProps[];
28
- /**
29
- * @title Тема шагов
30
- */
28
+ /** @title Тема шагов */
31
29
  stepVersion?: BlockVersion;
32
- /** @title Размер шагов */
33
- size?: SizeVersion;
34
30
  };
@@ -0,0 +1,3 @@
1
+ import { type BlockVersion } from '../../model/BlockVersion';
2
+ import { type StepProps } from './StepsBlockContent';
3
+ export declare const renderStepMobile: (stepsSize: boolean, version: BlockVersion, stepVersion: BlockVersion) => (step: StepProps, i: number) => JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
+ import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
3
+ import { Img } from '../../ui-kit/Img/Img.js';
4
+ import { LinkButton } from '../../ui-kit/LinkButton/LinkButton.js';
5
+ import { Paragraph } from '../../ui-kit/Paragraph/Paragraph.js';
6
+ import { RichText } from '../../ui-kit/RichText/RichText.js';
7
+ import { isIcon } from '../../utils/isIcon.js';
8
+ import { style } from '../../utils/style.js';
9
+ import { getIconTextStyle } from './getIconTextStyle.js';
10
+ import { STEPS_BLOCK_STYLE } from './StepsBlockStyleMaps.js';
11
+ const styleMap = STEPS_BLOCK_STYLE;
12
+ export const renderStepMobile = (stepsSize, version, stepVersion) => (step, i) => {
13
+ const { button, image } = step;
14
+ const styleStepMobile = button?.text && image?.src;
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', {
16
+ 'min-h-6xl': stepsSize,
17
+ }), children: [image?.src ? null : renderText(step), styleStepMobile ? (_jsx(LinkButton, { className: "box-border py-s w-full max-w-60 mt-lg", version: version, ...button, children: button?.text })) : null] })] }) }, String(i)));
18
+ };
19
+ const renderIconArea = (stepsSize, stepVersion) => (step, i) => {
20
+ const iconVersion = stepVersion === 'secondary' ? 'white' : 'color';
21
+ const isImg = Boolean(step?.icon?.src);
22
+ const iconAreaSize = getIconAreaSize(stepsSize, isImg);
23
+ const containerVersion = isImg ? stepVersion === 'transparent' : stepVersion;
24
+ const isImgSrc = step.image?.src;
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 }) }) }));
26
+ };
27
+ const renderText = (step) => {
28
+ const visibleStyle = Boolean(step.button?.text && step.image?.src);
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 })] }));
32
+ };
33
+ const getIconAreaSize = (stepsSize, isImg) => {
34
+ return stepsSize && isImg ? 'h-14 w-14' : 'h-11 w-11';
35
+ };
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
+ };
45
+ //# sourceMappingURL=renderStepMobile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderStepMobile.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStepMobile.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAA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C,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAClF,YAEA,CAAC,GAAG,CAAC,GACD,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -1179,9 +1179,9 @@
1179
1179
  onChange && onChange(!value);
1180
1180
  }, [onChange, disabled, value]);
1181
1181
  const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
1182
- return (jsx("div", { className: className, children: jsxs("label", { className: style('flex items-center relative group/box', getCursorStyle(disabled)), onClick: handleChange, children: [jsx("div", { className: style(defaultCheckStyle, 'm-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), !disabled && value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, renderText$1(text)] }) }));
1182
+ return (jsx("div", { className: className, children: jsxs("label", { className: style('flex items-center relative group/box', getCursorStyle(disabled)), onClick: handleChange, children: [jsx("div", { className: style(defaultCheckStyle, 'm-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), !disabled && value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, renderText$2(text)] }) }));
1183
1183
  });
1184
- const renderText$1 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
1184
+ const renderText$2 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
1185
1185
  const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
1186
1186
  const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
1187
1187
  const checkboxStyle = (value = false) => style('rounded border', value ? 'bg-primary-main' : '');
@@ -1309,9 +1309,9 @@
1309
1309
  onClose: handleClose,
1310
1310
  iconVersion,
1311
1311
  });
1312
- return (jsxs("div", { className: style('space-y-xs', className), children: [renderLabel(label), jsxs("div", { className: style('relative', hasOpen ? 'z-20' : 'z-10'), ref: inputRef, children: [jsxs("div", { className: style('h-14 [&>*]:p-m pr-8 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden', getStyle(isBorder, valid, isDisabled)), onClick: hasOpen ? handleClose : open, children: [jsx("p", { className: "line-clamp-2 text-ellipsis", children: formatOption(value) || placeholder }), renderIcon$1(hasOpen, iconVersion)] }), isSearch && hasOpen ? (jsx("div", { className: style('absolute top-0 w-full z-20'), children: jsx(Input, { type: "text", autoFocus: true, value: query, onChange: setQuery }) })) : null] })] }));
1312
+ return (jsxs("div", { className: style('space-y-xs', className), children: [renderLabel(label), jsxs("div", { className: style('relative', hasOpen ? 'z-20' : 'z-10'), ref: inputRef, children: [jsxs("div", { className: style('h-14 [&>*]:p-m pr-8 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden', getStyle(isBorder, valid, isDisabled)), onClick: hasOpen ? handleClose : open, children: [jsx("p", { className: "line-clamp-2 text-ellipsis", children: formatOption(value) || placeholder }), renderIcon$2(hasOpen, iconVersion)] }), isSearch && hasOpen ? (jsx("div", { className: style('absolute top-0 w-full z-20'), children: jsx(Input, { type: "text", autoFocus: true, value: query, onChange: setQuery }) })) : null] })] }));
1313
1313
  });
1314
- const renderIcon$1 = (isOpen, iconVersion) => (jsx(Icon, { className: style('absolute right-3 flex self-center', isOpen ? '' : 'rotate-180'), iconVersion: iconVersion, name: "ArrowUpIcon", width: "16", height: "16" }));
1314
+ const renderIcon$2 = (isOpen, iconVersion) => (jsx(Icon, { className: style('absolute right-3 flex self-center', isOpen ? '' : 'rotate-180'), iconVersion: iconVersion, name: "ArrowUpIcon", width: "16", height: "16" }));
1315
1315
  const getStyle = (isBorder, valid, disabled) => style(isBorder ? 'border rounded-md ' : '', isBorder && !disabled ? 'hover:border-primary-hover' : '', disabled ? 'bg-main-divider' : 'cursor-pointer ', valid ? 'border-gray' : 'border-error');
1316
1316
 
1317
1317
  const noop = () => {
@@ -4041,8 +4041,8 @@
4041
4041
 
4042
4042
  const Contacts = JSX(({ className = '', items = [] }) => items?.length ? (jsx("div", { className: style('space-y-m', className), children: items.map(renderContactsGroup) })) : null);
4043
4043
  const renderContactsGroup = (item, i) => (jsxs("div", { className: "space-y-m", children: [jsx("div", { children: jsx(Text, { size: "text-l", font: "font-medium", children: item?.title }) }), jsx("div", { className: "space-y-m", children: item.items?.map(renderContact) })] }, String(i)));
4044
- const renderContact = (item, i) => (jsxs("div", { className: "space-y-2xs", children: [jsx("div", { children: renderText(item.type, item.text) }), jsx(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text", children: item.description })] }, String(i)));
4045
- const renderText = (type, text = '') => {
4044
+ const renderContact = (item, i) => (jsxs("div", { className: "space-y-2xs", children: [jsx("div", { children: renderText$1(item.type, item.text) }), jsx(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text", children: item.description })] }, String(i)));
4045
+ const renderText$1 = (type, text = '') => {
4046
4046
  switch (type) {
4047
4047
  case 'tel':
4048
4048
  return (jsx("a", { className: "text-primary-text hover:text-primary-main no-underline", href: `tel:${formatTel(text)}`, children: jsx(Text, { size: "text-h6", children: text }) }));
@@ -5254,26 +5254,45 @@
5254
5254
  dot: 'bg-white/80 group-data-primary:bg-secondary-text',
5255
5255
  };
5256
5256
 
5257
- const STEPS_SIZE_MAP = {
5258
- normal: { icon: 'h-11 w-11', image: 'h-14 w-14' },
5259
- small: { icon: 'h-12 w-12', image: 'h-14 w-14' },
5260
- };
5261
- const STEPS_TILE_DESCRIPTION_HEIGHT_MAP = {
5262
- normal: '',
5263
- small: 'min-h-6xl',
5264
- };
5265
5257
  const styleMap = STEPS_BLOCK_STYLE;
5266
- const StepsBlock = JSX(({ className = '', title, description, steps, buttons, size = 'normal', stepVersion = 'gray', version = 'primary', ...rest }) => (jsxs(BlockWrapper, { className: style('box-border flex flex-col gap-xl', className), defaultPadding: "p-6xl", version: version, ...rest, children: [jsx(Headline, { title: title, description: description, headlineVersion: "M", isEmbedded: true, align: "text-left" }), steps?.length ? (jsx("div", { className: "box-border", children: jsx("div", { className: "flex flex-col gap-6xl justify-between", children: steps.map(renderStep(size, stepVersion)) }) })) : null, renderButtonsSection(buttons, { isVertical: true })] })));
5267
- // TODO: Create universal function for this case
5268
- const renderStep = (size, stepVersion) => (step, i) => (jsx("div", { className: "contents", children: jsxs("div", { className: "flex flex-row items-center relative", children: [jsx("div", { className: "overflow-hidden flex flex-shrink-0 items-center", children: renderIconArea(size, stepVersion)(step, i) }), jsxs("div", { className: style('flex flex-col justify-center h-fit', STEPS_TILE_DESCRIPTION_HEIGHT_MAP[size]), 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 })] })] }) }, String(i)));
5269
- const renderIconArea = (size, stepVersion) => (step, i) => {
5258
+ const renderStepMobile = (stepsSize, version, stepVersion) => (step, i) => {
5259
+ const { button, image } = step;
5260
+ const styleStepMobile = button?.text && image?.src;
5261
+ 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', {
5262
+ 'min-h-6xl': stepsSize,
5263
+ }), children: [image?.src ? null : renderText(step), styleStepMobile ? (jsx(LinkButton, { className: "box-border py-s w-full max-w-60 mt-lg", version: version, ...button, children: button?.text })) : null] })] }) }, String(i)));
5264
+ };
5265
+ const renderIconArea = (stepsSize, stepVersion) => (step, i) => {
5270
5266
  const iconVersion = stepVersion === 'secondary' ? 'white' : 'color';
5271
5267
  const isImg = Boolean(step?.icon?.src);
5272
- const iconAreaSize = STEPS_SIZE_MAP[size][isImg ? 'image' : 'icon'];
5268
+ const iconAreaSize = getIconAreaSize(stepsSize, isImg);
5273
5269
  const containerVersion = isImg ? stepVersion === 'transparent' : stepVersion;
5274
- return (jsx(BlockWrapper, { className: style(iconAreaSize, 'z-10 mr-s flex justify-center content-center rounded-md'), defaultPadding: "", version: containerVersion, children: jsx("span", { className: "flex max-w-full max-h-full items-center justify-center", children: isIcon(step?.icon) ? (jsx(Img, { image: { ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }, imageClassName: "max-w-full max-h-full", width: getIconSizeStyle(size), height: getIconSizeStyle(size) })) : (jsx("span", { className: style('text-h4', stepVersion === 'transparent' ? styleMap.iconText : getIconTextStyle(stepVersion)), children: i + 1 })) }) }));
5270
+ const isImgSrc = step.image?.src;
5271
+ 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$1({ step, iconVersion, i, stepVersion }) }) }));
5272
+ };
5273
+ const renderText = (step) => {
5274
+ const visibleStyle = Boolean(step.button?.text && step.image?.src);
5275
+ return (jsxs("div", { className: style({
5276
+ 'mb-lg w-full': visibleStyle,
5277
+ }), 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 })] }));
5278
+ };
5279
+ const getIconAreaSize = (stepsSize, isImg) => {
5280
+ return stepsSize && isImg ? 'h-14 w-14' : 'h-11 w-11';
5275
5281
  };
5276
- const getIconSizeStyle = (size) => (size === 'normal' ? '38' : '24');
5282
+ const renderIcon$1 = ({ step, iconVersion, i, stepVersion, }) => {
5283
+ if (isIcon(step?.icon)) {
5284
+ return (jsx(Img, { image: { ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }, imageClassName: "max-w-full max-h-full", width: "24", height: "24" }));
5285
+ }
5286
+ else if (isIcon(step.image)) {
5287
+ return jsx(Img, { image: { ...step.image, size: { width: 120, height: 120 } } });
5288
+ }
5289
+ return (jsx("span", { className: style('text-h4', stepVersion === 'transparent' ? styleMap.iconText : getIconTextStyle(stepVersion)), children: i + 1 }));
5290
+ };
5291
+
5292
+ const StepsBlock = JSX(({ className = '', title, description, steps = [], buttons, stepVersion = 'gray', version = 'primary', ...rest }) => {
5293
+ const isBigSizeSteps = steps.length > 3;
5294
+ return (jsxs(BlockWrapper, { className: style('box-border flex flex-col gap-xl', className), defaultPadding: "p-6xl", version: version, ...rest, children: [jsx(Headline, { title: title, description: description, headlineVersion: "M", isEmbedded: true, align: "text-left" }), steps?.length ? (jsx("div", { className: "flex flex-col gap-6xl justify-between box-border", children: steps.map(renderStepMobile(isBigSizeSteps, version, stepVersion)) })) : null, renderButtonsSection(buttons, { isVertical: true })] }));
5295
+ });
5277
5296
 
5278
5297
  const StickyBottomMenuItem = JSX(({ isActive, item, onClick }) => {
5279
5298
  return (jsxs("div", { className: style(isActive ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`), title: item?.title || '', onClick: onClick, children: [jsx(Icon, { className: "w-6 h-6", name: item?.icon?.icon, iconVersion: isActive ? 'color' : 'black' }), item?.title || ''] }));
@@ -6078,7 +6097,7 @@
6078
6097
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6079
6098
  });
6080
6099
 
6081
- const packageVersion = "0.14.530";
6100
+ const packageVersion = "0.14.531";
6082
6101
 
6083
6102
  exports.Blocks = Blocks;
6084
6103
  exports.ContentPage = ContentPage;