@redneckz/wildless-cms-uni-blocks 0.3.72 → 0.3.73

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 (86) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +25 -7
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/BenefitsBlock/BenefitsBlock.js +21 -3
  5. package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  6. package/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +39 -12
  7. package/dist/components/Bonus/BonusContent.d.ts +1 -1
  8. package/dist/components/Insurance/Insurance.js.map +1 -1
  9. package/dist/components/Insurance/InsuranceContent.d.ts +16 -2
  10. package/dist/components/PictureText/PictureText.js +1 -1
  11. package/dist/components/PictureText/PictureText.js.map +1 -1
  12. package/dist/components/PictureText/PictureTextContent.d.ts +9 -2
  13. package/dist/components/ProductBlock/ProductBlockContent.d.ts +10 -3
  14. package/dist/components/ProductBlock/renderBenefit.js +1 -1
  15. package/dist/components/ProductBlock/renderBenefit.js.map +1 -1
  16. package/dist/components/ProductTile/ProductTile.js.map +1 -1
  17. package/dist/components/ProductTile/ProductTileContent.d.ts +6 -1
  18. package/lib/common.css +1 -1
  19. package/lib/components/BenefitsBlock/BenefitsBlock.fixture.d.ts +2 -1
  20. package/lib/components/BenefitsBlock/BenefitsBlock.js +21 -3
  21. package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  22. package/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +39 -12
  23. package/lib/components/Bonus/BonusContent.d.ts +1 -1
  24. package/lib/components/Insurance/Insurance.js.map +1 -1
  25. package/lib/components/Insurance/InsuranceContent.d.ts +16 -2
  26. package/lib/components/PictureText/PictureText.js +1 -1
  27. package/lib/components/PictureText/PictureText.js.map +1 -1
  28. package/lib/components/PictureText/PictureTextContent.d.ts +9 -2
  29. package/lib/components/ProductBlock/ProductBlockContent.d.ts +10 -3
  30. package/lib/components/ProductBlock/renderBenefit.js +1 -1
  31. package/lib/components/ProductBlock/renderBenefit.js.map +1 -1
  32. package/lib/components/ProductTile/ProductTile.js.map +1 -1
  33. package/lib/components/ProductTile/ProductTileContent.d.ts +6 -1
  34. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +21 -3
  35. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  36. package/mobile/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +39 -12
  37. package/mobile/dist/components/Bonus/BonusContent.d.ts +1 -1
  38. package/mobile/dist/components/Insurance/Insurance.js.map +1 -1
  39. package/mobile/dist/components/Insurance/InsuranceContent.d.ts +16 -2
  40. package/mobile/dist/components/PictureText/PictureText.js +1 -1
  41. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  42. package/mobile/dist/components/PictureText/PictureTextContent.d.ts +9 -2
  43. package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +10 -3
  44. package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
  45. package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +6 -1
  46. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +21 -3
  47. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  48. package/mobile/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +39 -12
  49. package/mobile/lib/components/Bonus/BonusContent.d.ts +1 -1
  50. package/mobile/lib/components/Insurance/Insurance.js.map +1 -1
  51. package/mobile/lib/components/Insurance/InsuranceContent.d.ts +16 -2
  52. package/mobile/lib/components/PictureText/PictureText.js +1 -1
  53. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  54. package/mobile/lib/components/PictureText/PictureTextContent.d.ts +9 -2
  55. package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +10 -3
  56. package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
  57. package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +6 -1
  58. package/mobile/src/components/BenefitsBlock/BenefitsBlock.example.json +9 -1
  59. package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +48 -12
  60. package/mobile/src/components/BenefitsBlock/BenefitsBlockContent.ts +46 -16
  61. package/mobile/src/components/Bonus/BonusContent.ts +1 -1
  62. package/mobile/src/components/Insurance/Insurance.tsx +2 -3
  63. package/mobile/src/components/Insurance/InsuranceContent.ts +23 -9
  64. package/mobile/src/components/PictureText/PictureText.tsx +6 -7
  65. package/mobile/src/components/PictureText/PictureTextContent.ts +10 -2
  66. package/mobile/src/components/ProductBlock/ProductBlockContent.ts +11 -3
  67. package/mobile/src/components/ProductTile/ProductTile.tsx +1 -2
  68. package/mobile/src/components/ProductTile/ProductTileContent.ts +7 -1
  69. package/package.json +1 -1
  70. package/src/components/BenefitsBlock/BenefitsBlock.example.json +9 -1
  71. package/src/components/BenefitsBlock/BenefitsBlock.fixture.tsx +72 -9
  72. package/src/components/BenefitsBlock/BenefitsBlock.tsx +48 -12
  73. package/src/components/BenefitsBlock/BenefitsBlockContent.ts +46 -16
  74. package/src/components/Bonus/Bonus.fixture.tsx +3 -3
  75. package/src/components/Bonus/BonusContent.ts +1 -1
  76. package/src/components/Insurance/Insurance.fixture.tsx +2 -2
  77. package/src/components/Insurance/Insurance.tsx +2 -3
  78. package/src/components/Insurance/InsuranceContent.ts +23 -9
  79. package/src/components/PictureText/PictureText.tsx +6 -7
  80. package/src/components/PictureText/PictureTextContent.ts +10 -2
  81. package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +3 -3
  82. package/src/components/ProductBlock/ProductBlock.fixture.tsx +2 -3
  83. package/src/components/ProductBlock/ProductBlockContent.ts +11 -3
  84. package/src/components/ProductBlock/renderBenefit.tsx +3 -3
  85. package/src/components/ProductTile/ProductTile.tsx +1 -2
  86. package/src/components/ProductTile/ProductTileContent.ts +7 -1
@@ -6,9 +6,16 @@ import type { DescriptionContent } from '../../ui-kit/Description/DescriptionCon
6
6
  import type { HeadingContent, HeadingTypeContent } from '../../ui-kit/Heading/HeadingContent';
7
7
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
8
8
  import type { ListContent } from '../../ui-kit/List/ListContent';
9
- import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
9
+ import { Picture } from '../../model/Picture';
10
+ export interface ProductBlockBenefit {
11
+ icon?: Picture;
12
+ /** @title Название */
13
+ label?: string;
14
+ /** @title Описание */
15
+ description?: string;
16
+ }
10
17
  export declare type BenefitItemProps = {
11
- benefit: Benefit;
18
+ benefit: ProductBlockBenefit;
12
19
  version?: BlockVersion;
13
20
  benefitsVersion?: IconVersion;
14
21
  };
@@ -18,7 +25,7 @@ export declare type ProductBlockInnerContent = HeadingContent & HeadingTypeConte
18
25
  * @minItems 2
19
26
  * @maxItems 3
20
27
  */
21
- benefits?: Benefit[];
28
+ benefits?: ProductBlockBenefit[];
22
29
  benefitsVersion?: IconVersion;
23
30
  version?: BlockVersion;
24
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ProductTile.js","sourceRoot":"","sources":["../../../src/components/ProductTile/ProductTile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAMtE,MAAM,mBAAmB,GAAiC;IACxD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,W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qB;QAC9B,SAAS,EAAE,YAAY;KACxB,CAAC;IACF,OAAO,cAAK,SAAS,EAAE,kBAAkB,YAAY,CAAC,OAAO,CAAC,EAAE,YAAG,qBAAqB,GAAO,CAAC;AAClG,CAAC"}
1
+ {"version":3,"file":"ProductTile.js","sourceRoot":"","sources":["../../../src/components/ProductTile/ProductTile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAKtE,MAAM,mBAAmB,GAAiC;IACxD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAC5B,CAAC,EACC,OAAO,EACP,SAAS,GAAG,EAAE,EACd,KAAK,EACL,WAAW,GAAG,IAAI,EAClB,WAAW,EACX,qBAAqB,EACrB,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,GAAG,SAAS,EACnB,MAAM,GAAG,IAAI,GACd,EAAE,EAAE;IACH,OAAO,CACL,kBACE,SAAS,EAAE,uEAAuE,SAAS,IACzF,mBAAmB,CAAC,OAAO,CAC7B,IAAI,mBAAmB,CAAC,SAAS,CAAC,IAAI,gBAAgB,CAAC,SAAS,CAAC,GAAG,EACpE,EAAE,EAAE,MAAM,YAEV,MAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,KAAK,EACH,KAAK,CAA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P,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAoB,EAAE,CAAS;IACzD,OAAO,CACL,cAAqB,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,YACvE,OAAO,CAAC,KAAK,IADN,MAAM,CAAC,CAAC,CAAC,CAEb,CACP,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAAC,OAAoB,EAAE,CAAS,EAAE,OAAO,GAAG,SAAS;IACpF,MAAM,aAAa,GAAiC;QAClD,OAAO,EAAE,qBAAqB;QAC9B,SAAS,EAAE,YAAY;KACxB,CAAC;IACF,OAAO,CACL,cAAqB,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE,YACnF,OAAO,CAAC,WAAW,IADZ,MAAM,CAAC,CAAC,CAAC,CAEb,CACP,CAAC;AACJ,CAAC;AAED,SAAS,2BAA2B,CAAC,qBAA6B,EAAE,OAAO,GAAG,SAAS;IACrF,MAAM,YAAY,GAAiC;QACjD,OAAO,EAAE,qBAAqB;QAC9B,SAAS,EAAE,YAAY;KACxB,CAAC;IACF,OAAO,cAAK,SAAS,EAAE,kBAAkB,YAAY,CAAC,OAAO,CAAC,EAAE,YAAG,qBAAqB,GAAO,CAAC;AAClG,CAAC"}
@@ -3,7 +3,12 @@ import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
3
3
  import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
4
4
  import type { HeadingContent, HeadingTypeContent } from '../../ui-kit/Heading/HeadingContent';
5
5
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
6
- import type { TextBenefit } from '../BenefitsBlock/BenefitsBlockContent';
6
+ export interface TextBenefit {
7
+ /** @title Название */
8
+ label?: string;
9
+ /** @title Описание */
10
+ description?: string;
11
+ }
7
12
  /**
8
13
  * @title Продуктовая плитка
9
14
  */
@@ -1,14 +1,22 @@
1
1
  {
2
2
  "title": "Преимущества",
3
- "benefits": [
3
+ "benefitList": [
4
4
  {
5
5
  "label": "Преимущество №1",
6
+ "description": {
7
+ "name": "Описание 1",
8
+ "benefitType": "description"
9
+ },
6
10
  "icon": {
7
11
  "icon": "ClockIcon"
8
12
  }
9
13
  },
10
14
  {
11
15
  "label": "Преимущество №2",
16
+ "description": {
17
+ "name": "Описание 2",
18
+ "benefitType": "description"
19
+ },
12
20
  "icon": {
13
21
  "icon": "SignDocsIcon"
14
22
  }
@@ -2,34 +2,45 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { UniBlockProps } from '../../types';
3
3
  import { Heading } from '../../ui-kit/Heading/Heading';
4
4
  import { Img } from '../../ui-kit/Img/Img';
5
- import type { Benefit, BenefitsBlockContent } from './BenefitsBlockContent';
5
+ import type { BenefitItem, BenefitsBlockContent } from './BenefitsBlockContent';
6
+ import { DescriptionType, ListBenefitDef, TextBenefitDef } from './BenefitsBlockContent';
6
7
 
7
8
  export interface BenefitsBlockProps extends BenefitsBlockContent, UniBlockProps {}
8
9
 
9
10
  export const BenefitsBlock = JSX<BenefitsBlockProps>(
10
- ({ className = '', title, benefits, anchor = null }) => {
11
+ ({ className = '', headingType = 'h2', title, benefitList, anchor = null }) => {
11
12
  return (
12
13
  <section
13
14
  className={`font-sans text-primary-text bg-white p-12 flex flex-col items-center ${className}`}
14
15
  id={anchor}
15
16
  >
16
17
  {title ? (
17
- <Heading headingType="h2" className="max-w-[47rem] text-center" title={title} />
18
- ) : null}
19
- {benefits?.length ? (
20
- <div className="grid grid-cols-2 gap-8 mt-9">{benefits.map(renderStep)}</div>
18
+ <Heading
19
+ headingType={headingType}
20
+ as="h2"
21
+ className="max-w-[47rem] text-center"
22
+ title={title}
23
+ />
21
24
  ) : null}
25
+ {benefitList?.length ? renderBenefits(benefitList) : null}
22
26
  </section>
23
27
  );
24
28
  },
25
29
  );
26
30
 
27
- const renderStep = (benefit: Benefit, i: number) => {
31
+ const renderBenefits = (benefits: BenefitItem[]) => {
32
+ return (
33
+ <div className="flex flex-wrap justify-center gap-x-20 mt-9">{benefits.map(renderStep)}</div>
34
+ );
35
+ };
36
+
37
+ const renderStep = (benefit: BenefitItem, i: number) => {
38
+ const description = benefit?.description || undefined;
28
39
  return (
29
- <div key={String(i)} className="flex items-center gap-5 max-w-[500px]">
40
+ <div key={String(i)} className="flex items-center basis-1/2 max-w-[500px] mb-[46px]">
30
41
  {benefit?.icon ? (
31
42
  <Img
32
- className="h-[70px] w-[70px] min-w-[70px] min-h-[70px]"
43
+ className="h-[70px] w-[70px] min-w-[70px] min-h-[70px] mr-5"
33
44
  image={benefit.icon}
34
45
  width="70"
35
46
  height="70"
@@ -37,10 +48,35 @@ const renderStep = (benefit: Benefit, i: number) => {
37
48
  ) : null}
38
49
  <div>
39
50
  {benefit?.label ? <h3 className="font-medium text-xl m-0">{benefit.label}</h3> : null}
40
- {benefit?.description ? (
41
- <div className="font-normal text-sm mt-2">{benefit.description}</div>
42
- ) : null}
51
+ {renderDescription(description)}
43
52
  </div>
44
53
  </div>
45
54
  );
46
55
  };
56
+
57
+ const renderDescription = (description?: DescriptionType) => {
58
+ const benefitType = description ? description?.benefitType : null;
59
+ if (!benefitType) {
60
+ return null;
61
+ }
62
+ return description ? (
63
+ <div className="font-light text-base text-secondary-text mt-2">
64
+ {benefitType === 'list'
65
+ ? renderListBenefit(description as ListBenefitDef)
66
+ : renderTextBenefit(description as TextBenefitDef)}
67
+ </div>
68
+ ) : null;
69
+ };
70
+
71
+ const renderTextBenefit = (description?: TextBenefitDef) => (description ? description.name : null);
72
+
73
+ const renderListBenefit = (description?: ListBenefitDef) => {
74
+ const listStyleType = description?.bullets ? 'list-disc pl-6' : '';
75
+ return description?.items && description.items.length > 0 ? (
76
+ <ul className={listStyleType}>
77
+ {description.items.map((_, i) => (
78
+ <li key={`benefitListItem-${i}`}>{_}</li>
79
+ ))}
80
+ </ul>
81
+ ) : null;
82
+ };
@@ -1,28 +1,58 @@
1
1
  import type { Picture } from '../../model/Picture';
2
+ import type { HeadingContent, HeadingTypeContent } from '../../ui-kit/Heading/HeadingContent';
3
+ import type { EmptyOption } from '../../model/EmptyOptionType';
2
4
 
3
- export interface TextBenefit {
4
- /** @title Название */
5
- label?: string;
6
- /** @title Описание */
7
- description?: string;
8
- }
5
+ /**
6
+ * @title Пункты описания
7
+ * @default {"benefitType": "text"}
8
+ */
9
+ export type TextBenefitDef = {
10
+ /**
11
+ * @title Описание
12
+ */
13
+ name?: string;
14
+ benefitType?: 'text';
15
+ };
16
+
17
+ /**
18
+ * @title Список
19
+ * @default {"benefitType": "list"}
20
+ */
21
+ export type ListBenefitDef = {
22
+ /** @title Буллиты */
23
+ bullets?: boolean;
24
+ /**
25
+ * @title Пункты
26
+ * @example ["Пункт 1"]
27
+ */
28
+ items?: string[];
29
+ benefitType?: 'list';
30
+ };
31
+
32
+ /**
33
+ * @title Вид контента
34
+ */
35
+ export type DescriptionType = EmptyOption | TextBenefitDef | ListBenefitDef;
9
36
 
10
37
  /**
11
38
  * @title Преимущество
12
39
  */
13
- export interface Benefit extends TextBenefit {
40
+ export interface BenefitItem {
41
+ /** @title Название */
42
+ label?: string;
43
+ /** @title Описание */
44
+ description?: DescriptionType;
14
45
  icon?: Picture;
15
46
  }
16
47
 
17
48
  /**
18
49
  * @title Блок преимущества
19
50
  */
20
- export interface BenefitsBlockContent {
21
- /** @title Заголовок */
22
- title?: string;
23
- /**
24
- * @title Список преимуществ
25
- * @maxItems 6
26
- */
27
- benefits?: Benefit[];
28
- }
51
+ export type BenefitsBlockContent = HeadingContent &
52
+ HeadingTypeContent & {
53
+ /**
54
+ * @title Список преимуществ
55
+ * @maxItems 6
56
+ */
57
+ benefitList?: BenefitItem[];
58
+ };
@@ -8,7 +8,7 @@ interface BonusItems {
8
8
  /** @title Описание плитки */
9
9
  description?: string;
10
10
  /** @title Количество баллов */
11
- bonusCount?: number;
11
+ bonusCount?: string;
12
12
  /** @title Наименование */
13
13
  bonusName?: string;
14
14
  }
@@ -3,8 +3,7 @@ import type { UniBlockProps } from '../../types';
3
3
  import { Heading } from '../../ui-kit/Heading/Heading';
4
4
  import { Img } from '../../ui-kit/Img/Img';
5
5
  import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
6
- import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
7
- import type { InsuranceContent } from './InsuranceContent';
6
+ import type { InsuranceBenefit, InsuranceContent } from './InsuranceContent';
8
7
 
9
8
  export interface InsuranceProps extends InsuranceContent, UniBlockProps {}
10
9
 
@@ -36,7 +35,7 @@ export const Insurance = JSX<InsuranceProps>(
36
35
  },
37
36
  );
38
37
 
39
- function renderBenefit(benefit: Benefit, i: number) {
38
+ function renderBenefit(benefit: InsuranceBenefit, i: number) {
40
39
  return (
41
40
  <div key={String(i)} className="flex items-center gap-5">
42
41
  {benefit?.icon ? (
@@ -1,12 +1,26 @@
1
1
  import type { Picture } from '../../model/Picture';
2
- import type { BenefitsBlockContent } from '../BenefitsBlock/BenefitsBlockContent';
3
2
  import type { InsuranceProps } from '../../model/Insurance';
4
3
 
5
- export type InsuranceContent = BenefitsBlockContent &
6
- InsuranceProps & {
7
- /** @title Заголовок */
8
- title?: string;
9
- /** @title Описание */
10
- description?: string;
11
- image?: Picture;
12
- };
4
+ /**
5
+ * @title Преимущество
6
+ */
7
+ export interface InsuranceBenefit {
8
+ /** @title Название */
9
+ label?: string;
10
+ /** @title Описание */
11
+ description?: string;
12
+ icon?: Picture;
13
+ }
14
+
15
+ export type InsuranceContent = InsuranceProps & {
16
+ /** @title Заголовок */
17
+ title?: string;
18
+ /** @title Описание */
19
+ description?: string;
20
+ image?: Picture;
21
+ /**
22
+ * @title Список преимуществ
23
+ * @maxItems 6
24
+ */
25
+ benefits?: InsuranceBenefit[];
26
+ };
@@ -1,11 +1,10 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { UniBlockProps } from '../../types';
3
- import type { PictureTextContent } from './PictureTextContent';
3
+ import type { PictureTextContent, PictureTextBenefit } from './PictureTextContent';
4
4
 
5
5
  import { BlockVersion } from '../../model/BlockVersion';
6
6
  import { Heading } from '../../ui-kit/Heading/Heading';
7
7
  import { Img } from '../../ui-kit/Img/Img';
8
- import { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
9
8
 
10
9
  export interface PictureTextProps extends PictureTextContent, UniBlockProps {}
11
10
 
@@ -43,7 +42,7 @@ export const PictureText = JSX<PictureTextProps>(
43
42
  },
44
43
  );
45
44
 
46
- function renderBenefit(benefit: Benefit, i: number, version: string) {
45
+ function renderBenefit(benefit: PictureTextBenefit, i: number, version: string) {
47
46
  return (
48
47
  <div key={String(i)} className="flex flex-row mb-8">
49
48
  {benefit.icon ? (
@@ -56,7 +55,7 @@ function renderBenefit(benefit: Benefit, i: number, version: string) {
56
55
  />
57
56
  ) : null}
58
57
  <div className="flex gap-1 flex-col h-full ml-5 max-w-[490px]">
59
- {benefit.label && (
58
+ {benefit?.label ? (
60
59
  <div
61
60
  className={`font-medium text-xl m-0 ${
62
61
  version === 'primary' ? 'text-primary-text' : ''
@@ -64,14 +63,14 @@ function renderBenefit(benefit: Benefit, i: number, version: string) {
64
63
  >
65
64
  {benefit.label}
66
65
  </div>
67
- )}
68
- {benefit.description && (
66
+ ) : null}
67
+ {benefit?.description ? (
69
68
  <div
70
69
  className={`font-normal text-sm ${version === 'primary' ? 'text-secondary-text' : ''}`}
71
70
  >
72
71
  {benefit.description}
73
72
  </div>
74
- )}
73
+ ) : null}
75
74
  </div>
76
75
  </div>
77
76
  );
@@ -1,17 +1,25 @@
1
1
  import { BlockVersion } from '../../model/BlockVersion';
2
2
  import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
3
3
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
4
- import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
4
+ import type { Picture } from '../../model/Picture';
5
5
 
6
6
  export type TitleWithImageContent = HeadingContent & ImageContent;
7
7
 
8
+ export interface PictureTextBenefit {
9
+ icon?: Picture;
10
+ /** @title Название */
11
+ label?: string;
12
+ /** @title Описание */
13
+ description?: string;
14
+ }
15
+
8
16
  /**
9
17
  * @title Картинка с текстом
10
18
  */
11
19
  export interface PictureTextContent extends TitleWithImageContent {
12
20
  version?: BlockVersion;
13
21
  /** @title Список преимуществ */
14
- benefits?: Benefit[];
22
+ benefits?: PictureTextBenefit[];
15
23
  /**
16
24
  * @title Картинка справа/текст слева
17
25
  * @default false
@@ -6,10 +6,18 @@ import type { DescriptionContent } from '../../ui-kit/Description/DescriptionCon
6
6
  import type { HeadingContent, HeadingTypeContent } from '../../ui-kit/Heading/HeadingContent';
7
7
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
8
8
  import type { ListContent } from '../../ui-kit/List/ListContent';
9
- import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
9
+ import { Picture } from '../../model/Picture';
10
+
11
+ export interface ProductBlockBenefit {
12
+ icon?: Picture;
13
+ /** @title Название */
14
+ label?: string;
15
+ /** @title Описание */
16
+ description?: string;
17
+ }
10
18
 
11
19
  export type BenefitItemProps = {
12
- benefit: Benefit;
20
+ benefit: ProductBlockBenefit;
13
21
  version?: BlockVersion;
14
22
  benefitsVersion?: IconVersion;
15
23
  };
@@ -25,7 +33,7 @@ export type ProductBlockInnerContent = HeadingContent &
25
33
  * @minItems 2
26
34
  * @maxItems 3
27
35
  */
28
- benefits?: Benefit[];
36
+ benefits?: ProductBlockBenefit[];
29
37
  benefitsVersion?: IconVersion;
30
38
  version?: BlockVersion;
31
39
  /**
@@ -8,8 +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 { TextBenefit } from '../BenefitsBlock/BenefitsBlockContent';
12
- import type { ProductTileContent } from './ProductTileContent';
11
+ import type { ProductTileContent, TextBenefit } from './ProductTileContent';
13
12
 
14
13
  export interface ProductTileProps extends ProductTileContent, UniBlockProps {}
15
14
 
@@ -3,7 +3,13 @@ import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
3
3
  import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
4
4
  import type { HeadingContent, HeadingTypeContent } from '../../ui-kit/Heading/HeadingContent';
5
5
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
6
- import type { TextBenefit } from '../BenefitsBlock/BenefitsBlockContent';
6
+
7
+ export interface TextBenefit {
8
+ /** @title Название */
9
+ label?: string;
10
+ /** @title Описание */
11
+ description?: string;
12
+ }
7
13
 
8
14
  /**
9
15
  * @title Продуктовая плитка
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.3.72",
3
+ "version": "0.3.73",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,14 +1,22 @@
1
1
  {
2
2
  "title": "Преимущества",
3
- "benefits": [
3
+ "benefitList": [
4
4
  {
5
5
  "label": "Преимущество №1",
6
+ "description": {
7
+ "name": "Описание 1",
8
+ "benefitType": "description"
9
+ },
6
10
  "icon": {
7
11
  "icon": "ClockIcon"
8
12
  }
9
13
  },
10
14
  {
11
15
  "label": "Преимущество №2",
16
+ "description": {
17
+ "name": "Описание 2",
18
+ "benefitType": "description"
19
+ },
12
20
  "icon": {
13
21
  "icon": "SignDocsIcon"
14
22
  }
@@ -2,35 +2,98 @@ import { context } from '../../react/setup-fixture';
2
2
 
3
3
  import { BenefitsBlock } from './BenefitsBlock';
4
4
 
5
+ const itemsList = [
6
+ 'Комиссия за выдачу',
7
+ 'кредита не взимается',
8
+ 'Допускается полное или',
9
+ 'частичное погашение кредита',
10
+ ];
11
+
5
12
  export default {
6
- default: (
13
+ description: (
14
+ <div className="container grid grid-cols-12">
15
+ <BenefitsBlock
16
+ context={context}
17
+ className="col-span-12"
18
+ title="Преимущества кредита"
19
+ benefitList={[
20
+ {
21
+ label: 'Без комиссии',
22
+ description: {
23
+ name: 'Комиссия за выдачу кредита не взимается. Допускается полное или частичное погашение кредита',
24
+ benefitType: 'text',
25
+ },
26
+ icon: { icon: 'ClockIcon' },
27
+ },
28
+ {
29
+ label: 'Оформление по паспорту',
30
+ description: {
31
+ name: 'Обеспечение не требуется. Кредит можно получить на любые цели',
32
+ benefitType: 'text',
33
+ },
34
+ icon: { icon: 'SignDocsIcon' },
35
+ },
36
+ {
37
+ label: 'Без залога и поручительства',
38
+ description: {
39
+ name: 'Единовременное перечисление суммы кредита в полном объёме на текущий счет в Банке',
40
+ benefitType: 'text',
41
+ },
42
+ icon: { icon: 'ComfortableCompIcon' },
43
+ },
44
+ {
45
+ label: 'Деньги за 3 дня',
46
+ description: {
47
+ name: 'Рассмотрение заявки с момента предоставления полного комплекта документов',
48
+ benefitType: 'text',
49
+ },
50
+ icon: { icon: 'ActualBalanceIcon' },
51
+ },
52
+ ]}
53
+ />
54
+ </div>
55
+ ),
56
+ list: (
7
57
  <div className="container grid grid-cols-12">
8
58
  <BenefitsBlock
9
59
  context={context}
10
60
  className="col-span-12"
11
61
  title="Преимущества кредита"
12
- benefits={[
62
+ benefitList={[
13
63
  {
14
64
  label: 'Без комиссии',
15
- description:
16
- 'Комиссия за выдачу кредита не взимается. Допускается полное или частичное погашение кредита',
17
65
  icon: { icon: 'ClockIcon' },
66
+ description: {
67
+ bullets: true,
68
+ items: itemsList,
69
+ benefitType: 'list',
70
+ },
18
71
  },
19
72
  {
20
73
  label: 'Оформление по паспорту',
21
- description: 'Обеспечение не требуется. Кредит можно получить на любые цели',
74
+ description: {
75
+ bullets: true,
76
+ items: itemsList,
77
+ benefitType: 'list',
78
+ },
22
79
  icon: { icon: 'SignDocsIcon' },
23
80
  },
24
81
  {
25
82
  label: 'Без залога и поручительства',
26
- description:
27
- 'Единовременное перечисление суммы кредита в полном объёме на текущий счет в Банке',
83
+ description: {
84
+ bullets: true,
85
+ items: itemsList,
86
+ benefitType: 'list',
87
+ },
28
88
  icon: { icon: 'ComfortableCompIcon' },
29
89
  },
30
90
  {
31
91
  label: 'Деньги за 3 дня',
32
- description:
33
- 'Рассмотрение заявки с момента предоставления полного комплекта документов',
92
+ description: {
93
+ bullets: true,
94
+ items: itemsList,
95
+ benefitType: 'list',
96
+ },
34
97
  icon: { icon: 'ActualBalanceIcon' },
35
98
  },
36
99
  ]}