@redneckz/wildless-cms-uni-blocks 0.3.15 → 0.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +19 -6
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/ComparisonTable/TableColumn.js +1 -1
  5. package/dist/components/ComparisonTable/TableColumn.js.map +1 -1
  6. package/dist/components/Headline/Headline.js +2 -1
  7. package/dist/components/Headline/Headline.js.map +1 -1
  8. package/dist/components/Headline/Headline.mobile.js +2 -1
  9. package/dist/components/Headline/Headline.mobile.js.map +1 -1
  10. package/dist/components/Headline/constants.d.ts +7 -1
  11. package/dist/components/Headline/constants.js +17 -5
  12. package/dist/components/Headline/constants.js.map +1 -1
  13. package/dist/components/StepsBlock/StepsBlock.mobile.js +28 -6
  14. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  15. package/dist/components/StepsBlock/StepsBlockContent.d.ts +2 -0
  16. package/dist/components/TariffsTable/TariffsTable.js +3 -3
  17. package/dist/components/TariffsTable/TariffsTable.js.map +1 -1
  18. package/lib/components/ComparisonTable/TableColumn.js +1 -1
  19. package/lib/components/ComparisonTable/TableColumn.js.map +1 -1
  20. package/lib/components/Headline/Headline.js +3 -2
  21. package/lib/components/Headline/Headline.js.map +1 -1
  22. package/lib/components/Headline/Headline.mobile.js +3 -2
  23. package/lib/components/Headline/Headline.mobile.js.map +1 -1
  24. package/lib/components/Headline/constants.d.ts +7 -1
  25. package/lib/components/Headline/constants.js +16 -4
  26. package/lib/components/Headline/constants.js.map +1 -1
  27. package/lib/components/StepsBlock/StepsBlock.fixture.mobile.d.ts +1 -4
  28. package/lib/components/StepsBlock/StepsBlock.mobile.js +28 -6
  29. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  30. package/lib/components/StepsBlock/StepsBlockContent.d.ts +2 -0
  31. package/lib/components/TariffsTable/TariffsTable.js +3 -3
  32. package/lib/components/TariffsTable/TariffsTable.js.map +1 -1
  33. package/mobile/bundle/bundle.umd.js +47 -12
  34. package/mobile/bundle/bundle.umd.min.js +1 -1
  35. package/mobile/dist/components/ComparisonTable/TableColumn.js +1 -1
  36. package/mobile/dist/components/ComparisonTable/TableColumn.js.map +1 -1
  37. package/mobile/dist/components/Headline/Headline.js +2 -1
  38. package/mobile/dist/components/Headline/Headline.js.map +1 -1
  39. package/mobile/dist/components/Headline/constants.d.ts +7 -1
  40. package/mobile/dist/components/Headline/constants.js +17 -5
  41. package/mobile/dist/components/Headline/constants.js.map +1 -1
  42. package/mobile/dist/components/StepsBlock/StepsBlock.js +28 -6
  43. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  44. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +2 -0
  45. package/mobile/lib/components/ComparisonTable/TableColumn.js +1 -1
  46. package/mobile/lib/components/ComparisonTable/TableColumn.js.map +1 -1
  47. package/mobile/lib/components/Headline/Headline.js +3 -2
  48. package/mobile/lib/components/Headline/Headline.js.map +1 -1
  49. package/mobile/lib/components/Headline/constants.d.ts +7 -1
  50. package/mobile/lib/components/Headline/constants.js +16 -4
  51. package/mobile/lib/components/Headline/constants.js.map +1 -1
  52. package/mobile/lib/components/StepsBlock/StepsBlock.js +28 -6
  53. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  54. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +2 -0
  55. package/mobile/src/components/ComparisonTable/TableColumn.tsx +1 -1
  56. package/mobile/src/components/Headline/Headline.tsx +9 -4
  57. package/mobile/src/components/Headline/constants.ts +22 -4
  58. package/mobile/src/components/StepsBlock/StepsBlock.tsx +60 -19
  59. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +2 -1
  60. package/package.json +1 -1
  61. package/src/components/ComparisonTable/TableColumn.tsx +1 -1
  62. package/src/components/Headline/Headline.mobile.tsx +9 -4
  63. package/src/components/Headline/Headline.tsx +3 -2
  64. package/src/components/Headline/constants.ts +22 -4
  65. package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +127 -72
  66. package/src/components/StepsBlock/StepsBlock.mobile.tsx +60 -19
  67. package/src/components/StepsBlock/StepsBlockContent.ts +2 -1
  68. package/src/components/TariffsTable/TariffsTable.tsx +5 -5
@@ -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
- export const StepsBlock = JSX(({ className, title, description, steps, size = 'normal' }) => {
6
- return (_jsxs("section", { className: `box-border font-sans text-primary-text bg-white px-4 py-6 flex flex-col ${className || ''}`, children: [title && _jsx(Heading, { headingType: "h3", className: "text-center", title: title }), description && _jsx("p", { className: `text-m-md text-center ${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 })) }) })) : null] }));
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
- return (_jsx("div", { children: _jsxs("div", { className: "flex flex-row text-center relative", children: [_jsxs("div", { children: [renderIconArea(step, size, i), !isLastStep && _jsx("div", { className: `min-h-8 h-full w-[2px] bg-secondary-light ${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 text-secondary-text text-left ${step.label ? 'mt-1' : ''}`, children: step.description }))] })] }, String(i)) }, String(i)));
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 = (step, size, i) => {
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} bg-secondary-light rounded-full z-10 mr-3 flex justify-center content-center`, children: _jsx("span", { className: `font-medium text-secondary-text self-center ${iconTextSize}`, children: (step.icon && _jsx(Icon, { name: step.icon, width: iconSize, height: iconSize })) || i + 1 }) }));
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;AAGxC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAK9C,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAC3B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,GAAG,QAAQ,EAAE,EAAE,EAAE;IAC5D,OAAO,CACL,mBACE,SAAS,EAAE,2EACT,SAAS,IAAI,EACf,EAAE,aAED,KAAK,IAAI,KAAC,OAAO,IAAC,WAAW,EAAC,IAAI,EAAC,SAAS,EAAC,aAAa,EAAC,KAAK,EAAE,KAAK,GAAI,EAC3E,WAAW,IAAI,YAAG,SAAS,EAAE,yBAAyB,KAAK,IAAI,MAAM,EAAE,YAAG,WAAW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I,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
  }
@@ -17,7 +17,7 @@ export interface TableColumnProps extends UniBlockProps {
17
17
 
18
18
  export const TableColumn = JSX<TableColumnProps>(
19
19
  ({ header, columnData, visibleRowLength = 0, isFillGradient, showRow, onToggleColumn }) => {
20
- const columnDataView = columnData.slice(0, showRow ? columnData.length : visibleRowLength);
20
+ const columnDataView = columnData?.slice(0, showRow ? columnData.length : visibleRowLength);
21
21
  const gradientClassName = isFillGradient ? GRADIENT : '';
22
22
  const buttonVersion: ButtonVersion = isFillGradient ? 'secondary' : 'primary';
23
23
  return (
@@ -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, BACKGROUND_COLOR } from './constants';
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 ${BACKGROUND_COLOR[bgColorHeadline]} ${className}`}>
22
+ <section className={`px-4 py-6 ${STYLE_MAPS.background} ${className}`}>
22
23
  {title && (
23
24
  <Heading
24
25
  headingType="h2"
25
- className={`text-primary-text ${ALIGN_TEXT[align]}`}
26
+ className={`${STYLE_MAPS.text} ${ALIGN_TEXT[align]}`}
26
27
  title={title}
27
28
  />
28
29
  )}
29
30
  {description && (
30
- <p className={`font-normal text-m-md ${ALIGN_TEXT[align]} ${title ? 'mt-2.5' : ''}`}>
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
- export const BACKGROUND_COLOR: Record<BlockVersionWithTransparent, string> = {
11
- transparent: 'bg-transparent',
12
- primary: 'bg-white',
13
- secondary: 'bg-primary-main',
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 text-primary-text bg-white px-4 py-6 flex flex-col ${
15
- className || ''
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 && <Heading headingType="h3" className="text-center" title={title} />}
19
- {description && <p className={`text-m-md text-center ${title && 'mt-2'}`}>{description}</p>}
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) => renderStepTitle({ step, size, i, length: steps.length }))}
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(step, size, i)}
50
- {!isLastStep && <div className={`min-h-8 h-full w-[2px] bg-secondary-light ${margin}`} />}
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 text-secondary-text text-left ${
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 = (step: Step, size: SizeVersion, i: number) => {
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} bg-secondary-light rounded-full z-10 mr-3 flex justify-center content-center`}
123
+ className={`${iconAreaSize} ${style.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`}
83
124
  >
84
- <span className={`font-medium text-secondary-text self-center ${iconTextSize}`}>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.3.15",
3
+ "version": "0.3.18",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -17,7 +17,7 @@ export interface TableColumnProps extends UniBlockProps {
17
17
 
18
18
  export const TableColumn = JSX<TableColumnProps>(
19
19
  ({ header, columnData, visibleRowLength = 0, isFillGradient, showRow, onToggleColumn }) => {
20
- const columnDataView = columnData.slice(0, showRow ? columnData.length : visibleRowLength);
20
+ const columnDataView = columnData?.slice(0, showRow ? columnData.length : visibleRowLength);
21
21
  const gradientClassName = isFillGradient ? GRADIENT : '';
22
22
  const buttonVersion: ButtonVersion = isFillGradient ? 'secondary' : 'primary';
23
23
  return (
@@ -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, BACKGROUND_COLOR } from './constants';
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 ${BACKGROUND_COLOR[bgColorHeadline]} ${className}`}>
22
+ <section className={`px-4 py-6 ${STYLE_MAPS.background} ${className}`}>
22
23
  {title && (
23
24
  <Heading
24
25
  headingType="h2"
25
- className={`text-primary-text ${ALIGN_TEXT[align]}`}
26
+ className={`${STYLE_MAPS.text} ${ALIGN_TEXT[align]}`}
26
27
  title={title}
27
28
  />
28
29
  )}
29
30
  {description && (
30
- <p className={`font-normal text-m-md ${ALIGN_TEXT[align]} ${title ? 'mt-2.5' : ''}`}>
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, BACKGROUND_COLOR } from './constants';
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] ${BACKGROUND_COLOR[bgColorHeadline]} ${className}`}>
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
- export const BACKGROUND_COLOR: Record<BlockVersionWithTransparent, string> = {
11
- transparent: 'bg-transparent',
12
- primary: 'bg-white',
13
- secondary: 'bg-primary-main',
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
  };
@@ -18,79 +18,134 @@ const steps = [
18
18
 
19
19
  export default {
20
20
  default: (
21
- <StepsBlock
22
- context={context}
23
- title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
24
- description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
25
- size="normal"
26
- steps={steps}
27
- />
28
- ),
29
- 'only desc': (
30
- <StepsBlock
31
- context={context}
32
- description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
33
- size="normal"
34
- steps={steps}
35
- />
36
- ),
37
-
38
- small: (
39
- <StepsBlock
40
- context={context}
41
- title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
42
- size="small"
43
- steps={steps}
44
- />
45
- ),
46
-
47
- 'small multi-options': (
48
- <StepsBlock
49
- context={context}
50
- title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
51
- description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
52
- size="small"
53
- steps={[
54
- {
55
- description: 'Оставьте онлайн-заявку на потребительский кредит',
56
- icon: 'ClockIcon',
57
- },
58
- {
59
- label: 'В случае одобрения',
60
- icon: 'SignDocsIcon',
61
- },
62
- {
63
- label: 'Заявка на кредит',
64
- description: 'Оставьте онлайн-заявку на потребительский кредит',
65
- icon: 'ComfortableCompIcon',
66
- },
67
- {
68
- label: 'Получение наличных',
69
- icon: 'ClockIcon',
70
- },
71
- ]}
72
- />
21
+ <div className="container grid grid-cols-12">
22
+ <div className="col-span-12">
23
+ <StepsBlock
24
+ context={context}
25
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
26
+ description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
27
+ size="normal"
28
+ steps={steps}
29
+ />
30
+ <StepsBlock
31
+ context={context}
32
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
33
+ size="small"
34
+ steps={steps}
35
+ />
36
+ <StepsBlock
37
+ context={context}
38
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
39
+ description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
40
+ size="small"
41
+ steps={[
42
+ {
43
+ description: 'Оставьте онлайн-заявку на потребительский кредит',
44
+ icon: 'ClockIcon',
45
+ },
46
+ {
47
+ label: 'В случае одобрения',
48
+ icon: 'SignDocsIcon',
49
+ },
50
+ {
51
+ label: 'Заявка на кредит',
52
+ description: 'Оставьте онлайн-заявку на потребительский кредит',
53
+ icon: 'ComfortableCompIcon',
54
+ },
55
+ {
56
+ label: 'Получение наличных',
57
+ icon: 'ClockIcon',
58
+ },
59
+ ]}
60
+ />
61
+ <StepsBlock
62
+ context={context}
63
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
64
+ size="small"
65
+ steps={[
66
+ {
67
+ label: 'Заявка на кредит',
68
+ icon: 'EmptyWalletIcon',
69
+ },
70
+ {
71
+ label: 'В случае одобрения',
72
+ icon: 'PercentageSquareIcon',
73
+ },
74
+ {
75
+ label: 'Получение наличных',
76
+ icon: 'CalendarIcon',
77
+ },
78
+ ]}
79
+ />
80
+ </div>
81
+ </div>
73
82
  ),
74
83
 
75
- 'small icons': (
76
- <StepsBlock
77
- context={context}
78
- title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
79
- size="small"
80
- steps={[
81
- {
82
- label: 'Заявка на кредит',
83
- icon: 'EmptyWalletIcon',
84
- },
85
- {
86
- label: 'В случае одобрения',
87
- icon: 'PercentageSquareIcon',
88
- },
89
- {
90
- label: 'Получение наличных',
91
- icon: 'CalendarIcon',
92
- },
93
- ]}
94
- />
84
+ secondary: (
85
+ <div className="container grid grid-cols-12">
86
+ <div className="col-span-12">
87
+ <StepsBlock
88
+ context={context}
89
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
90
+ description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
91
+ size="normal"
92
+ steps={steps}
93
+ version="secondary"
94
+ />
95
+ <StepsBlock
96
+ context={context}
97
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
98
+ size="small"
99
+ steps={steps}
100
+ version="secondary"
101
+ />
102
+ <StepsBlock
103
+ context={context}
104
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
105
+ description="Откройте мультивалютный вклад, чтобы распределить свои вложения"
106
+ size="small"
107
+ steps={[
108
+ {
109
+ description: 'Оставьте онлайн-заявку на потребительский кредит',
110
+ icon: 'ClockIcon',
111
+ },
112
+ {
113
+ label: 'В случае одобрения',
114
+ icon: 'SignDocsIcon',
115
+ },
116
+ {
117
+ label: 'Заявка на кредит',
118
+ description: 'Оставьте онлайн-заявку на потребительский кредит',
119
+ icon: 'ComfortableCompIcon',
120
+ },
121
+ {
122
+ label: 'Получение наличных',
123
+ icon: 'ClockIcon',
124
+ },
125
+ ]}
126
+ version="secondary"
127
+ />
128
+ <StepsBlock
129
+ context={context}
130
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
131
+ size="small"
132
+ steps={[
133
+ {
134
+ label: 'Заявка на кредит',
135
+ icon: 'EmptyWalletIcon',
136
+ },
137
+ {
138
+ label: 'В случае одобрения',
139
+ icon: 'PercentageSquareIcon',
140
+ },
141
+ {
142
+ label: 'Получение наличных',
143
+ icon: 'CalendarIcon',
144
+ },
145
+ ]}
146
+ version="secondary"
147
+ />
148
+ </div>
149
+ </div>
95
150
  ),
96
151
  };