@redneckz/wildless-cms-uni-blocks 0.3.58 → 0.3.60

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 (181) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +55 -24
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/Blocks.d.ts +1 -0
  5. package/dist/components/Blocks.js +2 -0
  6. package/dist/components/Blocks.js.map +1 -1
  7. package/dist/components/GroupBlock/GroupBlock.js +1 -1
  8. package/dist/components/GroupBlock/GroupBlock.js.map +1 -1
  9. package/dist/components/GroupBlock/GroupBlockTabs.js +4 -4
  10. package/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  11. package/dist/components/Header/Header.js +2 -2
  12. package/dist/components/Header/Header.js.map +1 -1
  13. package/dist/components/Header/HeaderContent.d.ts +6 -0
  14. package/dist/components/Header/HeaderSubMenu.js +7 -4
  15. package/dist/components/Header/HeaderSubMenu.js.map +1 -1
  16. package/dist/components/Insurance/Insurance.d.ts +5 -0
  17. package/dist/components/Insurance/Insurance.js +22 -0
  18. package/dist/components/Insurance/Insurance.js.map +1 -0
  19. package/dist/components/Insurance/InsuranceContent.d.ts +13 -0
  20. package/dist/components/Insurance/InsuranceContent.js +2 -0
  21. package/dist/components/Insurance/InsuranceContent.js.map +1 -0
  22. package/dist/components/ProductTile/ProductTile.js +14 -2
  23. package/dist/components/ProductTile/ProductTile.js.map +1 -1
  24. package/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
  25. package/dist/components/Tile/Tile.js +1 -1
  26. package/dist/components/Tile/Tile.js.map +1 -1
  27. package/dist/types.d.ts +0 -5
  28. package/dist/ui-kit/Button/Button.js +2 -2
  29. package/dist/ui-kit/Button/Button.js.map +1 -1
  30. package/dist/ui-kit/Button/ButtonInner.js +2 -2
  31. package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
  32. package/dist/ui-kit/Button/ButtonProps.d.ts +2 -0
  33. package/dist/ui-kit/Button/ButtonSection.js +1 -1
  34. package/dist/ui-kit/Button/ButtonSection.js.map +1 -1
  35. package/dist/ui-kit/Icon/Icon.js +1 -1
  36. package/dist/ui-kit/Icon/Icon.js.map +1 -1
  37. package/lib/common.css +1 -1
  38. package/lib/components/Blocks.d.ts +1 -0
  39. package/lib/components/Blocks.js +2 -0
  40. package/lib/components/Blocks.js.map +1 -1
  41. package/lib/components/GroupBlock/GroupBlock.js +1 -1
  42. package/lib/components/GroupBlock/GroupBlock.js.map +1 -1
  43. package/lib/components/GroupBlock/GroupBlockTabs.js +4 -4
  44. package/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  45. package/lib/components/Header/Header.fixture.d.ts +1 -0
  46. package/lib/components/Header/Header.js +2 -2
  47. package/lib/components/Header/Header.js.map +1 -1
  48. package/lib/components/Header/HeaderContent.d.ts +6 -0
  49. package/lib/components/Header/HeaderSubMenu.js +7 -4
  50. package/lib/components/Header/HeaderSubMenu.js.map +1 -1
  51. package/lib/components/Insurance/Insurance.d.ts +5 -0
  52. package/lib/components/Insurance/Insurance.fixture.d.ts +4 -0
  53. package/lib/components/Insurance/Insurance.js +20 -0
  54. package/lib/components/Insurance/Insurance.js.map +1 -0
  55. package/lib/components/Insurance/InsuranceContent.d.ts +13 -0
  56. package/lib/components/Insurance/InsuranceContent.js +2 -0
  57. package/lib/components/Insurance/InsuranceContent.js.map +1 -0
  58. package/lib/components/ProductTile/ProductTile.fixture.d.ts +1 -0
  59. package/lib/components/ProductTile/ProductTile.js +14 -2
  60. package/lib/components/ProductTile/ProductTile.js.map +1 -1
  61. package/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
  62. package/lib/components/Tile/Tile.js +1 -1
  63. package/lib/components/Tile/Tile.js.map +1 -1
  64. package/lib/types.d.ts +0 -5
  65. package/lib/ui-kit/Button/Button.js +2 -2
  66. package/lib/ui-kit/Button/Button.js.map +1 -1
  67. package/lib/ui-kit/Button/ButtonInner.js +2 -2
  68. package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
  69. package/lib/ui-kit/Button/ButtonProps.d.ts +2 -0
  70. package/lib/ui-kit/Button/ButtonSection.js +1 -1
  71. package/lib/ui-kit/Button/ButtonSection.js.map +1 -1
  72. package/lib/ui-kit/Icon/Icon.js +1 -1
  73. package/lib/ui-kit/Icon/Icon.js.map +1 -1
  74. package/mobile/bundle/bundle.umd.js +4 -4
  75. package/mobile/bundle/bundle.umd.min.js +1 -1
  76. package/mobile/dist/components/GroupBlock/GroupBlock.js +1 -1
  77. package/mobile/dist/components/GroupBlock/GroupBlock.js.map +1 -1
  78. package/mobile/dist/components/GroupBlock/GroupBlockTabs.js +4 -4
  79. package/mobile/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  80. package/mobile/dist/components/Header/HeaderContent.d.ts +6 -0
  81. package/mobile/dist/components/Header/HeaderSubMenu.js +7 -4
  82. package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
  83. package/mobile/dist/components/Insurance/Insurance.d.ts +5 -0
  84. package/mobile/dist/components/Insurance/Insurance.js +22 -0
  85. package/mobile/dist/components/Insurance/Insurance.js.map +1 -0
  86. package/mobile/dist/components/Insurance/InsuranceContent.d.ts +13 -0
  87. package/mobile/dist/components/Insurance/InsuranceContent.js +2 -0
  88. package/mobile/dist/components/Insurance/InsuranceContent.js.map +1 -0
  89. package/mobile/dist/components/ProductTile/ProductTile.js +14 -2
  90. package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
  91. package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
  92. package/mobile/dist/components/Tile/Tile.js +1 -1
  93. package/mobile/dist/components/Tile/Tile.js.map +1 -1
  94. package/mobile/dist/types.d.ts +0 -5
  95. package/mobile/dist/ui-kit/Button/ButtonInner.js +2 -2
  96. package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
  97. package/mobile/dist/ui-kit/Button/ButtonProps.d.ts +2 -0
  98. package/mobile/dist/ui-kit/Button/ButtonSection.js +1 -1
  99. package/mobile/dist/ui-kit/Button/ButtonSection.js.map +1 -1
  100. package/mobile/dist/ui-kit/Icon/Icon.js +1 -1
  101. package/mobile/dist/ui-kit/Icon/Icon.js.map +1 -1
  102. package/mobile/lib/components/GroupBlock/GroupBlock.js +1 -1
  103. package/mobile/lib/components/GroupBlock/GroupBlock.js.map +1 -1
  104. package/mobile/lib/components/GroupBlock/GroupBlockTabs.js +4 -4
  105. package/mobile/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  106. package/mobile/lib/components/Header/HeaderContent.d.ts +6 -0
  107. package/mobile/lib/components/Header/HeaderSubMenu.js +7 -4
  108. package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
  109. package/mobile/lib/components/Insurance/Insurance.d.ts +5 -0
  110. package/mobile/lib/components/Insurance/Insurance.js +20 -0
  111. package/mobile/lib/components/Insurance/Insurance.js.map +1 -0
  112. package/mobile/lib/components/Insurance/InsuranceContent.d.ts +13 -0
  113. package/mobile/lib/components/Insurance/InsuranceContent.js +2 -0
  114. package/mobile/lib/components/Insurance/InsuranceContent.js.map +1 -0
  115. package/mobile/lib/components/ProductTile/ProductTile.js +14 -2
  116. package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
  117. package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
  118. package/mobile/lib/components/Tile/Tile.js +1 -1
  119. package/mobile/lib/components/Tile/Tile.js.map +1 -1
  120. package/mobile/lib/types.d.ts +0 -5
  121. package/mobile/lib/ui-kit/Button/ButtonInner.js +2 -2
  122. package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
  123. package/mobile/lib/ui-kit/Button/ButtonProps.d.ts +2 -0
  124. package/mobile/lib/ui-kit/Button/ButtonSection.js +1 -1
  125. package/mobile/lib/ui-kit/Button/ButtonSection.js.map +1 -1
  126. package/mobile/lib/ui-kit/Icon/Icon.js +1 -1
  127. package/mobile/lib/ui-kit/Icon/Icon.js.map +1 -1
  128. package/mobile/src/components/ContentPage/ContentPage.page.json +39 -0
  129. package/mobile/src/components/GroupBlock/GroupBlock.tsx +1 -3
  130. package/mobile/src/components/GroupBlock/GroupBlockTabs.tsx +4 -4
  131. package/mobile/src/components/Header/HeaderContent.ts +6 -0
  132. package/mobile/src/components/Header/HeaderSubMenu.tsx +10 -5
  133. package/mobile/src/components/Insurance/Insurance.tsx +68 -0
  134. package/mobile/src/components/Insurance/InsuranceContent.ts +14 -0
  135. package/mobile/src/components/Insurance/Insuranse.example.json +36 -0
  136. package/mobile/src/components/ProductTile/ProductTile.tsx +30 -13
  137. package/mobile/src/components/ProductTile/ProductTileContent.ts +2 -0
  138. package/mobile/src/components/Tile/Tile.tsx +5 -1
  139. package/mobile/src/types.ts +0 -6
  140. package/mobile/src/ui-kit/Button/ButtonInner.tsx +2 -1
  141. package/mobile/src/ui-kit/Button/ButtonProps.ts +2 -0
  142. package/mobile/src/ui-kit/Button/ButtonSection.tsx +1 -1
  143. package/mobile/src/ui-kit/Icon/Icon.tsx +1 -1
  144. package/package.json +1 -1
  145. package/src/components/Blocks.ts +2 -0
  146. package/src/components/ContentPage/ContentPage.page.json +39 -0
  147. package/src/components/GroupBlock/GroupBlock.tsx +1 -3
  148. package/src/components/GroupBlock/GroupBlockTabs.tsx +4 -4
  149. package/src/components/Header/Header.fixture.tsx +1 -0
  150. package/src/components/Header/Header.tsx +4 -1
  151. package/src/components/Header/HeaderContent.ts +6 -0
  152. package/src/components/Header/HeaderSubMenu.tsx +10 -5
  153. package/src/components/Insurance/Insurance.fixture.tsx +65 -0
  154. package/src/components/Insurance/Insurance.tsx +68 -0
  155. package/src/components/Insurance/InsuranceContent.ts +14 -0
  156. package/src/components/Insurance/Insuranse.example.json +36 -0
  157. package/src/components/ProductTile/ProductTile.fixture.tsx +50 -5
  158. package/src/components/ProductTile/ProductTile.tsx +30 -13
  159. package/src/components/ProductTile/ProductTileContent.ts +2 -0
  160. package/src/components/Tile/Tile.tsx +5 -1
  161. package/src/types.ts +0 -6
  162. package/src/ui-kit/Button/Button.fixture.tsx +12 -0
  163. package/src/ui-kit/Button/Button.tsx +8 -2
  164. package/src/ui-kit/Button/ButtonInner.tsx +2 -1
  165. package/src/ui-kit/Button/ButtonProps.ts +2 -0
  166. package/src/ui-kit/Button/ButtonSection.tsx +1 -1
  167. package/src/ui-kit/Icon/Icon.tsx +1 -1
  168. package/dist/components/ContentPage/CustomContentPage.d.ts +0 -30
  169. package/dist/components/ContentPage/CustomContentPage.js +0 -33
  170. package/dist/components/ContentPage/CustomContentPage.js.map +0 -1
  171. package/lib/components/ContentPage/CustomContentPage.d.ts +0 -30
  172. package/lib/components/ContentPage/CustomContentPage.js +0 -31
  173. package/lib/components/ContentPage/CustomContentPage.js.map +0 -1
  174. package/mobile/dist/components/ContentPage/CustomContentPage.d.ts +0 -30
  175. package/mobile/dist/components/ContentPage/CustomContentPage.js +0 -33
  176. package/mobile/dist/components/ContentPage/CustomContentPage.js.map +0 -1
  177. package/mobile/lib/components/ContentPage/CustomContentPage.d.ts +0 -30
  178. package/mobile/lib/components/ContentPage/CustomContentPage.js +0 -31
  179. package/mobile/lib/components/ContentPage/CustomContentPage.js.map +0 -1
  180. package/mobile/src/components/ContentPage/CustomContentPage.tsx +0 -82
  181. package/src/components/ContentPage/CustomContentPage.tsx +0 -82
@@ -0,0 +1,68 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { UniBlockProps } from '../../types';
3
+ import type { InsuranceContent } from './InsuranceContent';
4
+ import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
5
+ import { Heading } from '../../ui-kit/Heading/Heading';
6
+ import { Img } from '../../ui-kit/Img/Img';
7
+ import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
8
+
9
+ export interface InsuranceProps extends InsuranceContent, UniBlockProps {}
10
+
11
+ export const Insurance = JSX<InsuranceProps>(
12
+ ({ className = '', title, description, image, benefits, insuranceSum, monthLimit }) => {
13
+ return (
14
+ <section className={`px-[100px] py-[50px] bg-white text-primary-text ${className}`}>
15
+ {title ? <Heading headingType="h3" title={title} className="text-center" /> : null}
16
+ {description ? <div className="text-center text-md mt-3">{description}</div> : null}
17
+ <div>
18
+ <div className="mt-5 mx-auto flex justify-center gap-[120px] mt-[30px]">
19
+ {image?.src ? <Img image={image} /> : null}
20
+ <div className="w-[558px] m-auto">
21
+ {benefits ? (
22
+ <div className="flex flex-col gap-4">{benefits.map(renderBenefit)}</div>
23
+ ) : null}
24
+
25
+ <div className="bg-secondary-light h-15 flex mt-7 gap-6 px-5 py-4">
26
+ {insuranceSum
27
+ ? renderValueBlock('Страховая сумма:', insuranceSum, Boolean(monthLimit))
28
+ : null}
29
+ {monthLimit
30
+ ? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(insuranceSum))
31
+ : null}
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </section>
37
+ );
38
+ },
39
+ );
40
+
41
+ function renderBenefit(benefit: Benefit, i: number) {
42
+ return (
43
+ <div key={String(i)} className="flex items-center gap-5">
44
+ {benefit?.icon ? (
45
+ <Img
46
+ className="w-[50px] h-[50px] min-w-[50px] p-3 rounded-full bg-secondary-light"
47
+ image={benefit.icon}
48
+ width="24"
49
+ height="24"
50
+ asSVG
51
+ />
52
+ ) : null}
53
+ <div className="flex">
54
+ <div className="text-title-2xs">{benefit.label}</div>
55
+ </div>
56
+ </div>
57
+ );
58
+ }
59
+
60
+ function renderValueBlock(title, sum, isAnotherBlock) {
61
+ const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
62
+ return (
63
+ <div className={`flex justify-between items-center gap-2 w-full ${widthStyle}`}>
64
+ <span className="text-secondary-text text-base">{title}</span>
65
+ <span className="text-primary-main text-title-2xs">{addSpacesBetweenNumbers(sum)} ₽</span>
66
+ </div>
67
+ );
68
+ }
@@ -0,0 +1,14 @@
1
+ import type { Picture } from '../../model/Picture';
2
+ import type { BenefitsBlockContent } from '../BenefitsBlock/BenefitsBlockContent';
3
+
4
+ export type InsuranceContent = BenefitsBlockContent & {
5
+ /** @title Заголовок */
6
+ title?: string;
7
+ /** @title Описание */
8
+ description?: string;
9
+ /** @title Ежемесячный лимит */
10
+ monthLimit?: number;
11
+ /** @title Страховая сумма */
12
+ insuranceSum?: number;
13
+ image?: Picture;
14
+ };
@@ -0,0 +1,36 @@
1
+ {
2
+ "title": "Страховые риски и продукты",
3
+ "description": "Описание",
4
+ "insurance": 500000,
5
+ "limit": null,
6
+ "image": {
7
+ "src": "insurance.png",
8
+ "title": "страхование",
9
+ "format": "webp",
10
+ "alt": "страхование",
11
+ "size": {
12
+ "width": 400,
13
+ "height": 300
14
+ },
15
+ "sources": [
16
+ {
17
+ "src": "insurance.png 1x, insurance-2x.png 2x",
18
+ "format": "png"
19
+ }
20
+ ]
21
+ },
22
+ "benefits": [
23
+ {
24
+ "label": "Пункт 1",
25
+ "icon": {
26
+ "icon": "ShieldTickIcon"
27
+ }
28
+ },
29
+ {
30
+ "label": "Пункт 2",
31
+ "icon": {
32
+ "icon": "ShieldTickIcon"
33
+ }
34
+ }
35
+ ]
36
+ }
@@ -8,7 +8,7 @@ import { Img } from '../../ui-kit/Img/Img';
8
8
  import { BaseTile } from '../BaseTile/BaseTile';
9
9
  import { getTileMinHeight } from '../BaseTile/getTileMinHeight';
10
10
  import { getTileRightPadding } from '../BaseTile/getTileRightPadding';
11
- import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
11
+ import type { TextBenefit } from '../BenefitsBlock/BenefitsBlockContent';
12
12
  import type { ProductTileContent } from './ProductTileContent';
13
13
 
14
14
  export interface ProductTileProps extends ProductTileContent, UniBlockProps {}
@@ -25,6 +25,7 @@ export const ProductTile = JSX<ProductTileProps>(
25
25
  title,
26
26
  headingType = 'h3',
27
27
  description,
28
+ additionalDescription,
28
29
  benefits,
29
30
  buttons,
30
31
  image,
@@ -60,23 +61,31 @@ export const ProductTile = JSX<ProductTileProps>(
60
61
  {description ? (
61
62
  <Description className="mt-4 max-w-[600px]" description={description} />
62
63
  ) : null}
63
- <div className="flex mt-5 mb-1">
64
- {benefits?.length ? (
65
- <div className="mr-8">{benefits.map(renderBenefitLabel)}</div>
66
- ) : null}
67
- {benefits?.length ? (
68
- <div className="pt-1">
69
- {benefits.map((_, i) => renderBenefitDescription(_, i, version))}
70
- </div>
71
- ) : null}
72
- </div>
64
+ {renderBenefits(benefits, version)}
65
+
66
+ {additionalDescription
67
+ ? renderAdditionalDescription(additionalDescription, version)
68
+ : null}
73
69
  </BaseTile>
74
70
  </section>
75
71
  );
76
72
  },
77
73
  );
78
74
 
79
- function renderBenefitLabel(benefit: Benefit, i: number) {
75
+ function renderBenefits(benefits: TextBenefit[] = [], version: BlockVersion) {
76
+ return (
77
+ <div className="flex mt-5 mb-1">
78
+ {benefits.length ? <div className="mr-8">{benefits.map(renderBenefitLabel)}</div> : null}
79
+ {benefits.length ? (
80
+ <div className="pt-1">
81
+ {benefits.map((_, i) => renderBenefitDescription(_, i, version))}
82
+ </div>
83
+ ) : null}
84
+ </div>
85
+ );
86
+ }
87
+
88
+ function renderBenefitLabel(benefit: TextBenefit, i: number) {
80
89
  return (
81
90
  <div key={String(i)} className={`text-xl font-medium ${i ? 'mt-2.5' : ''}`}>
82
91
  {benefit.label}
@@ -84,7 +93,7 @@ function renderBenefitLabel(benefit: Benefit, i: number) {
84
93
  );
85
94
  }
86
95
 
87
- function renderBenefitDescription(benefit: Benefit, i: number, version = 'primary') {
96
+ function renderBenefitDescription(benefit: TextBenefit, i: number, version = 'primary') {
88
97
  const labelStyleMap: Record<BlockVersion, string> = {
89
98
  primary: 'text-secondary-text',
90
99
  secondary: 'text-white',
@@ -95,3 +104,11 @@ function renderBenefitDescription(benefit: Benefit, i: number, version = 'primar
95
104
  </div>
96
105
  );
97
106
  }
107
+
108
+ function renderAdditionalDescription(additionalDescription: string, version = 'primary') {
109
+ const descStyleMap: Record<BlockVersion, string> = {
110
+ primary: 'text-secondary-text',
111
+ secondary: 'text-white',
112
+ };
113
+ return <div className={`text-sm mt-2.5 ${descStyleMap[version]}`}>{additionalDescription}</div>;
114
+ }
@@ -19,4 +19,6 @@ export type ProductTileContent = HeadingContent &
19
19
  * @maxItems 7
20
20
  */
21
21
  benefits?: TextBenefit[];
22
+ /** @title Дополнительное описание */
23
+ additionalDescription?: string;
22
24
  };
@@ -59,7 +59,11 @@ export const Tile = JSX<TileProps>((props) => {
59
59
  }
60
60
  buttons={
61
61
  buttons?.length ? (
62
- <ButtonSection context={context} buttons={buttons} className="flex mt-9 gap-3" />
62
+ <ButtonSection
63
+ context={context}
64
+ buttons={buttons.map((button) => ({ ...button, className: 'w-[158px]' }))}
65
+ className="flex mt-9 gap-3"
66
+ />
63
67
  ) : null
64
68
  }
65
69
  image={image?.src && <Img className="mt-auto ml-7" image={image} />}
@@ -44,16 +44,10 @@ export interface ContentPageMeta {
44
44
  jsonLd?: string;
45
45
  }
46
46
 
47
- export interface CustomPageTemplate {
48
- content?: Record<string, any>;
49
- type?: string;
50
- }
51
-
52
47
  export interface ContentPageDef extends ContentPageMeta {
53
48
  style?: string[];
54
49
  blocks?: BlockDef[];
55
50
  slots?: SlotsMap;
56
- customPageTmpl?: CustomPageTemplate;
57
51
  likeControl?: boolean;
58
52
  colorPalette?: ColorPalette;
59
53
  }
@@ -7,7 +7,7 @@ interface ButtonInnerProps extends ButtonWithIconProps {
7
7
  }
8
8
 
9
9
  export const ButtonInner = JSX<ButtonInnerProps>((props) => {
10
- const { text, aboveText, appendLeft } = props;
10
+ const { text, aboveText, appendLeft, appendRight } = props;
11
11
  return (
12
12
  <div className={getButtonStyle(props)}>
13
13
  {appendLeft ? appendLeft : null}
@@ -17,6 +17,7 @@ export const ButtonInner = JSX<ButtonInnerProps>((props) => {
17
17
  <div className="text-button text-left">{text}</div>
18
18
  </div>
19
19
  ) : null}
20
+ {appendRight ? appendRight : null}
20
21
  </div>
21
22
  );
22
23
  });
@@ -29,6 +29,8 @@ export interface ButtonWithIconProps extends ButtonProps {
29
29
  aboveText?: string;
30
30
  /** @hidden */
31
31
  appendLeft?: any;
32
+ /** @hidden */
33
+ appendRight?: any;
32
34
  /** @title Закругленные углы */
33
35
  rounded?: boolean;
34
36
  /** @hidden */
@@ -11,7 +11,7 @@ export const ButtonSection = JSX<ButtonSectionProps>(({ context, className = '',
11
11
  const { handlerDecorator } = context;
12
12
  const router = context.useRouter();
13
13
  return buttons?.length ? (
14
- <div className={`${className}`}>
14
+ <div className={className}>
15
15
  {buttons.map((button, index) =>
16
16
  renderButton(useLink({ router, handlerDecorator }, button), index),
17
17
  )}
@@ -14,7 +14,7 @@ export const Icon = JSX<IconProps>(
14
14
  ...imgProps
15
15
  }) => {
16
16
  const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
17
- const svgUseStyle = iconVersion === 'white' ? 'text-black invert' : '';
17
+ const svgUseStyle = iconVersion === 'white' ? 'text-black invert' : 'text-primary-main';
18
18
 
19
19
  if (asSVG) {
20
20
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.3.58",
3
+ "version": "0.3.60",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -10,6 +10,7 @@ import { Gallery } from './Gallery/Gallery';
10
10
  import { GracePeriod } from './GracePeriod/GracePeriod';
11
11
  import { Header } from './Header/Header';
12
12
  import { Headline } from './Headline/Headline';
13
+ import { Insurance } from './Insurance/Insurance';
13
14
  import { LinkDocs } from './LinkDocs/LinkDocs';
14
15
  import { MiniGallery } from './MiniGallery/MiniGallery';
15
16
  import { MobileAppTile } from './MobileAppTile/MobileAppTile';
@@ -42,6 +43,7 @@ export const Blocks = {
42
43
  GracePeriod,
43
44
  Header,
44
45
  Headline,
46
+ Insurance,
45
47
  LinkDocs,
46
48
  MiniGallery,
47
49
  MobileAppTile,
@@ -2149,6 +2149,45 @@
2149
2149
  ]
2150
2150
  }
2151
2151
  },
2152
+ {
2153
+ "type": "Insurance",
2154
+ "style": ["col-span-12"],
2155
+ "content": {
2156
+ "title": "Страховые риски и продукты",
2157
+ "description": "Описание",
2158
+ "insuranceSum": 500000,
2159
+ "image": {
2160
+ "src": "insurance.png",
2161
+ "title": "страхование",
2162
+ "format": "webp",
2163
+ "alt": "Страховые риски и продукты",
2164
+ "size": {
2165
+ "width": 400,
2166
+ "height": 300
2167
+ },
2168
+ "sources": [
2169
+ {
2170
+ "src": "insurance.png 1x, insurance-2x.png 2x",
2171
+ "format": "png"
2172
+ }
2173
+ ]
2174
+ },
2175
+ "benefits": [
2176
+ {
2177
+ "label": "Ликвидация организации",
2178
+ "icon": {
2179
+ "icon": "ShieldTickIcon"
2180
+ }
2181
+ },
2182
+ {
2183
+ "label": "Сокращение численности работников организации",
2184
+ "icon": {
2185
+ "icon": "ShieldTickIcon"
2186
+ }
2187
+ }
2188
+ ]
2189
+ }
2190
+ },
2152
2191
  {
2153
2192
  "type": "Footer",
2154
2193
  "style": ["col-span-12"],
@@ -33,9 +33,7 @@ export const GroupBlock = JSX<GroupBlockProps>(
33
33
  <GroupBlockTabs currentTag={currentTag} onTabClick={setCurrentTag} tabs={tabsNewMap} />
34
34
  ) : null}
35
35
  {groupBlocks.length ? (
36
- <div className="list-none">
37
- <GroupBlocksItem context={context} groupBlocks={filteredBlocks} />
38
- </div>
36
+ <GroupBlocksItem context={context} groupBlocks={filteredBlocks} />
39
37
  ) : null}
40
38
  </section>
41
39
  );
@@ -15,13 +15,13 @@ export const GroupBlockTabs = JSX<GroupBlockTabsProps>((props) => {
15
15
  const { tabs, currentTag, onTabClick, className = '', isShowCounter = true } = props;
16
16
 
17
17
  return (
18
- <div className={`mb-2 box-border flex gap-x-1 h-12 ${className}`} role="tablist">
18
+ <div className={`mb-2 box-border flex gap-x-1 ${className}`} role="tablist">
19
19
  {tabs?.map(renderTab(onTabClick, isShowCounter, currentTag))}
20
20
  </div>
21
21
  );
22
22
  });
23
23
 
24
- const badgeStyle = 'w-[22px] h-[22px] rounded-full text-m-sm';
24
+ const badgeStyle = 'min-w-[22px] w-[22px] h-[22px] rounded-full text-m-sm';
25
25
 
26
26
  const renderTab =
27
27
  (onTabClick: TabClickHandler, isShowCounter: boolean, currentTag?: string) =>
@@ -30,12 +30,12 @@ const renderTab =
30
30
  const tabBg = isActive ? 'bg-primary-main' : 'group bg-white';
31
31
  const tabText = isActive ? 'text-white' : 'text-secondary-text group-hover:text-primary-main';
32
32
  const counterBlockStyle = `${badgeStyle}
33
- ${isActive ? 'bg-white/30 text-white' : 'bg-secondary-text/10 text-secondary-text'}`;
33
+ ${isActive ? 'bg-white/30 text-white' : 'bg-secondary-light text-secondary-text'}`;
34
34
 
35
35
  return (
36
36
  <div
37
37
  key={String(i)}
38
- className={`flex h-full w-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${tabBg}`}
38
+ className={`flex h-full w-full h-12 flex-1 cursor-pointer mr-2 last:mr-0 box-content ${tabBg}`}
39
39
  role="tab"
40
40
  onClick={() => onTabClick(tab.tag)}
41
41
  aria-selected={String(isActive)}
@@ -4,4 +4,5 @@ import { Header } from './Header';
4
4
  export default {
5
5
  default: <Header context={context} defaultLocation="Москва" />,
6
6
  transparent: <Header context={context} defaultLocation="Москва" bgColor="transparent" />,
7
+ 'no submenu': <Header context={context} defaultLocation="Москва" showSubMenu={false} />,
7
8
  };
@@ -22,6 +22,7 @@ export const Header = JSX<HeaderProps>(
22
22
  ({
23
23
  className = '',
24
24
  defaultLocation = 'Москва',
25
+ showSubMenu = true,
25
26
  bgColor = 'bg-white',
26
27
  context,
27
28
  topItems,
@@ -58,7 +59,9 @@ export const Header = JSX<HeaderProps>(
58
59
  />
59
60
  </div>
60
61
  <div className={`mt-6 h-[1px] ${BORDER_COLORS[bgColor]}`} />
61
- <HeaderSubMenu context={context} subItems={activeTopItem?.items} bgColor={bgColor} />
62
+ {showSubMenu && activeTopItem?.items?.length ? (
63
+ <HeaderSubMenu context={context} subItems={activeTopItem.items} bgColor={bgColor} />
64
+ ) : null}
62
65
  </div>
63
66
  </header>
64
67
  );
@@ -29,6 +29,12 @@ export interface HeaderContent extends SitemapProps {
29
29
  * @default Москва
30
30
  */
31
31
  defaultLocation?: string;
32
+ /**
33
+ * @title Показывать подменю
34
+ * @hidden
35
+ * @default true
36
+ */
37
+ showSubMenu?: boolean;
32
38
  /**
33
39
  * @title Фон элемента
34
40
  * @hidden
@@ -8,6 +8,11 @@ import { isSSR } from '../../utils/isSSR';
8
8
  import type { ContentPageContext } from '../ContentPage/ContentPageContext';
9
9
  import { headerSubMenuObserver } from './HeaderSubMenuObserver';
10
10
 
11
+ const DOT_BG_COLORS_MAP: Record<BgColorVersion, string> = {
12
+ 'bg-white': 'bg-primary-text',
13
+ transparent: 'bg-white',
14
+ };
15
+
11
16
  export interface HeaderSubMenuProps {
12
17
  context: ContentPageContext;
13
18
  subItems?: LinkProps[];
@@ -51,6 +56,7 @@ export const HeaderSubMenu = JSX<HeaderSubMenuProps>(({ context, subItems, bgCol
51
56
  subMenuIsShow,
52
57
  toggleSubMenu,
53
58
  subItems,
59
+ bgColor,
54
60
  router,
55
61
  handlerDecorator,
56
62
  })}
@@ -63,6 +69,7 @@ const renderDotsSubMenu = ({
63
69
  subMenuIsShow,
64
70
  toggleSubMenu,
65
71
  subItems,
72
+ bgColor,
66
73
  router,
67
74
  handlerDecorator,
68
75
  }) => (
@@ -77,9 +84,7 @@ const renderDotsSubMenu = ({
77
84
  onClick={toggleSubMenu}
78
85
  aria-label={`${subMenuIsShow ? 'Скрыть другие разделы' : 'Показать другие разделы'}`}
79
86
  >
80
- {Array(3)
81
- .fill(0)
82
- .map((_, i) => renderDot(i))}
87
+ {Array(3).fill(bgColor).map(renderDot)}
83
88
  </button>
84
89
  <div
85
90
  className={`flex flex-col rounded-md bg-white p-6 pb-2 ${subMenuIsShow ? '' : 'hidden'}`}
@@ -103,6 +108,6 @@ const renderDotsSubMenuItems = (subItems, router, handlerDecorator) =>
103
108
  </a>
104
109
  ));
105
110
 
106
- const renderDot = (i: number) => (
107
- <div key={String(i)} className="w-[3px] h-[3px] rounded bg-black mr-1" />
111
+ const renderDot = (bgColor: BgColorVersion, i: number) => (
112
+ <div key={String(i)} className={`w-[3px] h-[3px] rounded mr-1 ${DOT_BG_COLORS_MAP[bgColor]}`} />
108
113
  );
@@ -0,0 +1,65 @@
1
+ import { Insurance } from './Insurance';
2
+ import { context } from '../../setup-fixture';
3
+ import { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
4
+ import { Picture } from '../../model/Picture';
5
+
6
+ const benefits: Benefit[] = [
7
+ {
8
+ label: 'Телесное повреждение',
9
+ icon: { icon: 'ShieldTickIcon' },
10
+ },
11
+ {
12
+ label: 'Госпитализация застрахованного',
13
+ icon: { icon: 'ShieldTickIcon' },
14
+ },
15
+ {
16
+ label: 'Сокращение численности работников организации',
17
+ icon: { icon: 'ShieldTickIcon' },
18
+ },
19
+ {
20
+ label: 'Смерть застрахованного',
21
+ icon: { icon: 'ShieldTickIcon' },
22
+ },
23
+ ];
24
+
25
+ const image: Picture = {
26
+ src: 'insurance.png',
27
+ format: 'webp',
28
+ alt: 'Страховые риски и продукты',
29
+ size: {
30
+ width: 400,
31
+ height: 300,
32
+ },
33
+ sources: [
34
+ {
35
+ src: 'insurance.png 1x, insurance-2x.png 2x',
36
+ format: 'png',
37
+ },
38
+ ],
39
+ };
40
+
41
+ export default {
42
+ default: (
43
+ <div className="container grid grid-cols-12">
44
+ <Insurance
45
+ context={context}
46
+ className="col-span-12"
47
+ title="Страховые риски и продукты"
48
+ description="Покрываемые риски программы «Защита вас и ваших близких»"
49
+ benefits={benefits}
50
+ image={image}
51
+ insuranceSum={500000}
52
+ />
53
+ <Insurance
54
+ context={context}
55
+ className="col-span-12"
56
+ title="Страховые риски и продукты"
57
+ description="Покрываемые риски программы «Защита вас и ваших близких»"
58
+ benefits={benefits}
59
+ image={image}
60
+ insuranceSum={500000}
61
+ monthLimit={25000}
62
+ />
63
+ </div>
64
+ ),
65
+ };
@@ -0,0 +1,68 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { UniBlockProps } from '../../types';
3
+ import type { InsuranceContent } from './InsuranceContent';
4
+ import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
5
+ import { Heading } from '../../ui-kit/Heading/Heading';
6
+ import { Img } from '../../ui-kit/Img/Img';
7
+ import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
8
+
9
+ export interface InsuranceProps extends InsuranceContent, UniBlockProps {}
10
+
11
+ export const Insurance = JSX<InsuranceProps>(
12
+ ({ className = '', title, description, image, benefits, insuranceSum, monthLimit }) => {
13
+ return (
14
+ <section className={`px-[100px] py-[50px] bg-white text-primary-text ${className}`}>
15
+ {title ? <Heading headingType="h3" title={title} className="text-center" /> : null}
16
+ {description ? <div className="text-center text-md mt-3">{description}</div> : null}
17
+ <div>
18
+ <div className="mt-5 mx-auto flex justify-center gap-[120px] mt-[30px]">
19
+ {image?.src ? <Img image={image} /> : null}
20
+ <div className="w-[558px] m-auto">
21
+ {benefits ? (
22
+ <div className="flex flex-col gap-4">{benefits.map(renderBenefit)}</div>
23
+ ) : null}
24
+
25
+ <div className="bg-secondary-light h-15 flex mt-7 gap-6 px-5 py-4">
26
+ {insuranceSum
27
+ ? renderValueBlock('Страховая сумма:', insuranceSum, Boolean(monthLimit))
28
+ : null}
29
+ {monthLimit
30
+ ? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(insuranceSum))
31
+ : null}
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </section>
37
+ );
38
+ },
39
+ );
40
+
41
+ function renderBenefit(benefit: Benefit, i: number) {
42
+ return (
43
+ <div key={String(i)} className="flex items-center gap-5">
44
+ {benefit?.icon ? (
45
+ <Img
46
+ className="w-[50px] h-[50px] min-w-[50px] p-3 rounded-full bg-secondary-light"
47
+ image={benefit.icon}
48
+ width="24"
49
+ height="24"
50
+ asSVG
51
+ />
52
+ ) : null}
53
+ <div className="flex">
54
+ <div className="text-title-2xs">{benefit.label}</div>
55
+ </div>
56
+ </div>
57
+ );
58
+ }
59
+
60
+ function renderValueBlock(title, sum, isAnotherBlock) {
61
+ const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
62
+ return (
63
+ <div className={`flex justify-between items-center gap-2 w-full ${widthStyle}`}>
64
+ <span className="text-secondary-text text-base">{title}</span>
65
+ <span className="text-primary-main text-title-2xs">{addSpacesBetweenNumbers(sum)} ₽</span>
66
+ </div>
67
+ );
68
+ }
@@ -0,0 +1,14 @@
1
+ import type { Picture } from '../../model/Picture';
2
+ import type { BenefitsBlockContent } from '../BenefitsBlock/BenefitsBlockContent';
3
+
4
+ export type InsuranceContent = BenefitsBlockContent & {
5
+ /** @title Заголовок */
6
+ title?: string;
7
+ /** @title Описание */
8
+ description?: string;
9
+ /** @title Ежемесячный лимит */
10
+ monthLimit?: number;
11
+ /** @title Страховая сумма */
12
+ insuranceSum?: number;
13
+ image?: Picture;
14
+ };