@redneckz/wildless-cms-uni-blocks 0.9.9 → 0.9.11

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 (144) hide show
  1. package/bin/migration-scripts/0.9.9.js +0 -1
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +30 -24
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
  6. package/bundle/components/Filtration/FiltrationContent.d.ts +18 -8
  7. package/bundle/components/Footer/SocialMedia.d.ts +1 -1
  8. package/bundle/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
  9. package/dist/components/ApplicationForm/ApplicationFormCredit.js +1 -1
  10. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
  11. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
  12. package/dist/components/CarouselEventCard/CarouselEventCard.js +1 -1
  13. package/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
  14. package/dist/components/CarouselProductCard/CarouselProductCard.js +5 -2
  15. package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  16. package/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
  17. package/dist/components/Filtration/Filtration.js +1 -1
  18. package/dist/components/Filtration/Filtration.js.map +1 -1
  19. package/dist/components/Filtration/FiltrationContent.d.ts +18 -8
  20. package/dist/components/Filtration/FiltrationInner.js +9 -5
  21. package/dist/components/Filtration/FiltrationInner.js.map +1 -1
  22. package/dist/components/Filtration/renderFormItem.js +6 -5
  23. package/dist/components/Filtration/renderFormItem.js.map +1 -1
  24. package/dist/components/Footer/MediaButton.js +6 -7
  25. package/dist/components/Footer/MediaButton.js.map +1 -1
  26. package/dist/components/Footer/SocialMedia.d.ts +1 -1
  27. package/dist/components/Footer/SocialMedia.js +2 -2
  28. package/dist/components/Footer/SocialMedia.js.map +1 -1
  29. package/dist/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
  30. package/lib/common.css +1 -1
  31. package/lib/components/ApplicationForm/ApplicationFormCredit.js +1 -1
  32. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.d.ts +2 -10
  33. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
  34. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
  35. package/lib/components/CarouselEventCard/CarouselEventCard.js +1 -1
  36. package/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
  37. package/lib/components/CarouselProductCard/CarouselProductCard.fixture.d.ts +2 -0
  38. package/lib/components/CarouselProductCard/CarouselProductCard.js +5 -2
  39. package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  40. package/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
  41. package/lib/components/Filtration/Filtration.js +1 -1
  42. package/lib/components/Filtration/Filtration.js.map +1 -1
  43. package/lib/components/Filtration/FiltrationContent.d.ts +18 -8
  44. package/lib/components/Filtration/FiltrationInner.js +9 -5
  45. package/lib/components/Filtration/FiltrationInner.js.map +1 -1
  46. package/lib/components/Filtration/renderFormItem.js +6 -5
  47. package/lib/components/Filtration/renderFormItem.js.map +1 -1
  48. package/lib/components/Footer/MediaButton.js +6 -7
  49. package/lib/components/Footer/MediaButton.js.map +1 -1
  50. package/lib/components/Footer/SocialMedia.d.ts +1 -1
  51. package/lib/components/Footer/SocialMedia.js +2 -2
  52. package/lib/components/Footer/SocialMedia.js.map +1 -1
  53. package/lib/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
  54. package/mobile/bundle/bundle.umd.js +7 -8
  55. package/mobile/bundle/bundle.umd.min.js +1 -1
  56. package/mobile/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
  57. package/mobile/bundle/components/Filtration/FiltrationContent.d.ts +18 -8
  58. package/mobile/bundle/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
  59. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +1 -1
  60. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
  61. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
  62. package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js +1 -1
  63. package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
  64. package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +5 -2
  65. package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  66. package/mobile/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
  67. package/mobile/dist/components/Filtration/Filtration.js +1 -1
  68. package/mobile/dist/components/Filtration/Filtration.js.map +1 -1
  69. package/mobile/dist/components/Filtration/FiltrationContent.d.ts +18 -8
  70. package/mobile/dist/components/Filtration/FiltrationInner.js +9 -5
  71. package/mobile/dist/components/Filtration/FiltrationInner.js.map +1 -1
  72. package/mobile/dist/components/Filtration/renderFormItem.js +6 -5
  73. package/mobile/dist/components/Filtration/renderFormItem.js.map +1 -1
  74. package/mobile/dist/components/Footer/MediaButton.js +6 -7
  75. package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
  76. package/mobile/dist/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
  77. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +1 -1
  78. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
  79. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
  80. package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js +1 -1
  81. package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
  82. package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +5 -2
  83. package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  84. package/mobile/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +4 -0
  85. package/mobile/lib/components/Filtration/Filtration.js +1 -1
  86. package/mobile/lib/components/Filtration/Filtration.js.map +1 -1
  87. package/mobile/lib/components/Filtration/FiltrationContent.d.ts +18 -8
  88. package/mobile/lib/components/Filtration/FiltrationInner.js +9 -5
  89. package/mobile/lib/components/Filtration/FiltrationInner.js.map +1 -1
  90. package/mobile/lib/components/Filtration/renderFormItem.js +6 -5
  91. package/mobile/lib/components/Filtration/renderFormItem.js.map +1 -1
  92. package/mobile/lib/components/Footer/MediaButton.js +6 -7
  93. package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
  94. package/mobile/lib/components/VerticalLayout/VerticalLayoutContent.d.ts +0 -2
  95. package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +1 -1
  96. package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +2 -4
  97. package/mobile/src/components/CarouselEventCard/CarouselEventCard.tsx +2 -2
  98. package/mobile/src/components/CarouselInvestmentCard/CarouselInvestmentCard.example.json +3 -1
  99. package/mobile/src/components/CarouselProductCard/CarouselProductCard.example.json +3 -1
  100. package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +5 -1
  101. package/mobile/src/components/CarouselProductCard/CarouselProductCardContent.ts +4 -0
  102. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +4 -2
  103. package/mobile/src/components/ErrorBlock/ErrorBlock.example.json +3 -1
  104. package/mobile/src/components/Filtration/Filtration.example.json +39 -19
  105. package/mobile/src/components/Filtration/Filtration.tsx +3 -8
  106. package/mobile/src/components/Filtration/FiltrationContent.ts +19 -8
  107. package/mobile/src/components/Filtration/FiltrationInner.tsx +31 -12
  108. package/mobile/src/components/Filtration/renderFormItem.tsx +20 -20
  109. package/mobile/src/components/Footer/MediaButton.tsx +7 -10
  110. package/mobile/src/components/MobileAppTile/MobileAppTile.example.json +3 -1
  111. package/mobile/src/components/PictureText/PictureText.example.json +3 -1
  112. package/mobile/src/components/ProductBlock/ProductBlock.example.json +3 -1
  113. package/mobile/src/components/ProductTile/ProductTile.example.json +3 -1
  114. package/mobile/src/components/RichTextBlock/RichTextBlock.example.json +1 -1
  115. package/mobile/src/components/Tile/Tile.example.json +3 -1
  116. package/mobile/src/components/VerticalLayout/VerticalLayoutContent.ts +0 -2
  117. package/package.json +1 -1
  118. package/src/components/ApplicationForm/ApplicationFormCredit.tsx +1 -1
  119. package/src/components/Carousel/Carousel.fixture.tsx +18 -5
  120. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.tsx +2 -9
  121. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +2 -4
  122. package/src/components/CarouselEventCard/CarouselEventCard.tsx +2 -2
  123. package/src/components/CarouselInvestmentCard/CarouselInvestmentCard.example.json +3 -1
  124. package/src/components/CarouselProductCard/CarouselProductCard.example.json +3 -1
  125. package/src/components/CarouselProductCard/CarouselProductCard.fixture.tsx +10 -0
  126. package/src/components/CarouselProductCard/CarouselProductCard.tsx +5 -1
  127. package/src/components/CarouselProductCard/CarouselProductCardContent.ts +4 -0
  128. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +4 -2
  129. package/src/components/ErrorBlock/ErrorBlock.example.json +3 -1
  130. package/src/components/Filtration/Filtration.example.json +39 -19
  131. package/src/components/Filtration/Filtration.fixture.tsx +36 -20
  132. package/src/components/Filtration/Filtration.tsx +3 -8
  133. package/src/components/Filtration/FiltrationContent.ts +19 -8
  134. package/src/components/Filtration/FiltrationInner.tsx +31 -12
  135. package/src/components/Filtration/renderFormItem.tsx +20 -20
  136. package/src/components/Footer/MediaButton.tsx +7 -10
  137. package/src/components/Footer/SocialMedia.tsx +3 -11
  138. package/src/components/MobileAppTile/MobileAppTile.example.json +3 -1
  139. package/src/components/PictureText/PictureText.example.json +3 -1
  140. package/src/components/ProductBlock/ProductBlock.example.json +3 -1
  141. package/src/components/ProductTile/ProductTile.example.json +3 -1
  142. package/src/components/RichTextBlock/RichTextBlock.example.json +1 -1
  143. package/src/components/Tile/Tile.example.json +3 -1
  144. package/src/components/VerticalLayout/VerticalLayoutContent.ts +0 -2
@@ -9,7 +9,9 @@
9
9
  "sources": [
10
10
  {
11
11
  "media": 1279,
12
- "width": 84,
12
+ "size": {
13
+ "width": 84
14
+ },
13
15
  "format": "webp",
14
16
  "alignment": "center"
15
17
  }
@@ -46,6 +46,13 @@ export const PRODUCT_CARD: CarouselProductCardContent = {
46
46
  additionalDescription: 'Дополнительное описание',
47
47
  };
48
48
 
49
+ export const PRODUCT_CARD_SMALL: CarouselProductCardContent = {
50
+ title: 'Более 5000 товаров Более 5000 товаров Более 5000 товаров',
51
+ icon: image,
52
+ button: buttonPrimary,
53
+ isDotted,
54
+ };
55
+
49
56
  const CAROUSEL_PRODUCT_CARD = <CarouselProductCard {...PRODUCT_CARD} />;
50
57
  const CAROUSEL_PRODUCT_CARD_SECONDARY = (
51
58
  <CarouselProductCard
@@ -53,10 +60,13 @@ const CAROUSEL_PRODUCT_CARD_SECONDARY = (
53
60
  version="secondary"
54
61
  isDotted={true}
55
62
  button={buttonPrimaryIcon}
63
+ isFullWidth={false}
56
64
  />
57
65
  );
66
+ const CAROUSEL_PRODUCT_CARD_SMALL = <CarouselProductCard {...PRODUCT_CARD_SMALL} />;
58
67
 
59
68
  export default {
60
69
  default: <div className="container grid grid-cols-12">{CAROUSEL_PRODUCT_CARD}</div>,
61
70
  secondary: <div className="container grid grid-cols-12">{CAROUSEL_PRODUCT_CARD_SECONDARY}</div>,
71
+ small: <div className="container grid grid-cols-12">{CAROUSEL_PRODUCT_CARD_SMALL}</div>,
62
72
  };
@@ -26,6 +26,7 @@ export const CarouselProductCard = JSX<CarouselProductCardProps>(
26
26
  href,
27
27
  icon,
28
28
  isDotted = true,
29
+ isFullWidth = true,
29
30
  items = [],
30
31
  target,
31
32
  title,
@@ -50,7 +51,10 @@ export const CarouselProductCard = JSX<CarouselProductCardProps>(
50
51
  {renderItems(items, isDotted, version)}
51
52
  {renderAdditionalDescription(additionalDescription)}
52
53
  </LinkWrapper>
53
- {renderButtonsSection([button], { className: 'p-6 pt-0', isVertical: true })}
54
+ {renderButtonsSection([button], {
55
+ className: style('p-6 pt-0', isFullWidth ? '' : 'justify-center'),
56
+ isVertical: isFullWidth ? true : false,
57
+ })}
54
58
  </BlockWrapper>
55
59
  );
56
60
  },
@@ -27,4 +27,8 @@ export type CarouselProductCardContent = UniBlockContent &
27
27
  /** @title Список */
28
28
  items?: ListProps[];
29
29
  align?: TextAlign;
30
+ /**
31
+ * @title По всей ширине
32
+ */
33
+ isFullWidth?: boolean;
30
34
  };
@@ -9,8 +9,10 @@
9
9
  "sources": [
10
10
  {
11
11
  "media": 1279,
12
- "width": 174,
13
- "height": 174,
12
+ "size": {
13
+ "width": 174,
14
+ "height": 174
15
+ },
14
16
  "format": "webp",
15
17
  "alignment": "southeast"
16
18
  }
@@ -13,7 +13,9 @@
13
13
  "sources": [
14
14
  {
15
15
  "media": 1279,
16
- "width": 276,
16
+ "size": {
17
+ "width": 276
18
+ },
17
19
  "format": "webp",
18
20
  "alignment": "center"
19
21
  }
@@ -3,35 +3,55 @@
3
3
  "filtrationSchema": {
4
4
  "propertyType": {
5
5
  "title": "Тип недвижимости",
6
- "type": "string",
7
- "enum": ["flat", "apartment", "house", "storeRoom", "parkingSpace"],
8
- "enumNames": ["Квартира", "Апартаменты", "Жилой дом", "Кладовая", "Машино-место"]
6
+ "type": "array",
7
+ "items": {
8
+ "type": "string",
9
+ "enum": ["flat", "apartment", "house", "storeRoom", "parkingSpace"],
10
+ "enumNames": ["Квартира", "Апартаменты", "Жилой дом", "Кладовая", "Машино-место"]
11
+ }
9
12
  },
10
13
  "stage": {
11
14
  "title": "Этап строительства",
12
- "type": "string",
13
- "enum": ["built", "inProgress"],
14
- "enumNames": ["Готовое жильё", "Строящиеся"]
15
+ "type": "array",
16
+ "items": {
17
+ "type": "string",
18
+ "enum": ["built", "inProgress"],
19
+ "enumNames": ["Готовое жильё", "Строящиеся"]
20
+ }
15
21
  },
16
22
  "categories": {
17
23
  "title": "Категории",
18
- "type": "string",
19
- "enum": ["salaryClient", "IT", "youngFamily", "military", "medicalWorker", "scientist"],
20
- "enumNames": [
21
- "Зарплатный клиент",
22
- "IT-специалист",
23
- "Молодая семья",
24
- "Военнослужащий",
25
- "Медицинский работник",
26
- "Научный сотрудник"
27
- ]
24
+ "type": "array",
25
+ "items": {
26
+ "type": "string",
27
+ "enum": ["salaryClient", "IT", "youngFamily", "military", "medicalWorker", "scientist"],
28
+ "enumNames": [
29
+ "Зарплатный клиент",
30
+ "IT-специалист",
31
+ "Молодая семья",
32
+ "Военнослужащий",
33
+ "Медицинский работник",
34
+ "Научный сотрудник"
35
+ ]
36
+ }
28
37
  },
29
38
  "extraOptions": {
30
39
  "title": "Дополнительно",
31
- "type": "string",
32
- "enum": ["preferentialMortgage", "children"],
33
- "enumNames": ["Льготная ипотека", "Дети"]
40
+ "type": "array",
41
+ "items": {
42
+ "type": "string",
43
+ "enum": ["preferentialMortgage", "children"],
44
+ "enumNames": ["Льготная ипотека", "Дети"]
45
+ }
34
46
  }
47
+ },
48
+ "resetButton": {
49
+ "text": "Очистить фильтры",
50
+ "version": "secondary"
51
+ },
52
+ "notFound": {
53
+ "title": "Нет подходящей ипотечной программы",
54
+ "description": "Попробуйте очистить фильтры"
35
55
  }
36
56
  }
37
57
  }
@@ -49,34 +49,46 @@ const generateBlock = (...presets: any[]) => ({
49
49
  const SCHEMA: FiltrationContent['filtrationSchema'] = {
50
50
  propertyType: {
51
51
  title: 'Тип недвижимости',
52
- type: 'string',
53
- enum: ['flat', 'apartment', 'house', 'storeRoom', 'parkingSpace'],
54
- enumNames: ['Квартира', 'Апартаменты', 'Жилой дом', 'Кладовая', 'Машино-место'],
52
+ type: 'array',
53
+ items: {
54
+ type: 'string',
55
+ enum: ['flat', 'apartment', 'house', 'storeRoom', 'parkingSpace'],
56
+ enumNames: ['Квартира', 'Апартаменты', 'Жилой дом', 'Кладовая', 'Машино-место'],
57
+ },
55
58
  },
56
59
  stage: {
57
60
  title: 'Этап строительства',
58
- type: 'string',
59
- enum: ['built', 'inProgress'],
60
- enumNames: ['Готовое жильё', 'Строящиеся'],
61
+ type: 'array',
62
+ items: {
63
+ type: 'string',
64
+ enum: ['built', 'inProgress'],
65
+ enumNames: ['Готовое жильё', 'Строящиеся'],
66
+ },
61
67
  },
62
68
  categories: {
63
69
  title: 'Категории',
64
- type: 'string',
65
- enum: ['salaryClient', 'IT', 'youngFamily', 'military', 'medicalWorker', 'scientist'],
66
- enumNames: [
67
- 'Зарплатный клиент',
68
- 'IT-специалист',
69
- 'Молодая семья',
70
- 'Военнослужащий',
71
- 'Медицинский работник',
72
- 'Научный сотрудник',
73
- ],
70
+ type: 'array',
71
+ items: {
72
+ type: 'string',
73
+ enum: ['salaryClient', 'IT', 'youngFamily', 'military', 'medicalWorker', 'scientist'],
74
+ enumNames: [
75
+ 'Зарплатный клиент',
76
+ 'IT-специалист',
77
+ 'Молодая семья',
78
+ 'Военнослужащий',
79
+ 'Медицинский работник',
80
+ 'Научный сотрудник',
81
+ ],
82
+ },
74
83
  },
75
84
  extraOptions: {
76
85
  title: 'Дополнительно',
77
- type: 'string',
78
- enum: ['preferentialMortgage', 'children'],
79
- enumNames: ['Льготная ипотека', 'Дети'],
86
+ type: 'array',
87
+ items: {
88
+ type: 'string',
89
+ enum: ['preferentialMortgage', 'children'],
90
+ enumNames: ['Льготная ипотека', 'Дети'],
91
+ },
80
92
  },
81
93
  };
82
94
 
@@ -92,7 +104,11 @@ export default {
92
104
  label="Другие ипотечные программы"
93
105
  filtrationSchema={SCHEMA}
94
106
  topItemsCount={2}
95
- resetButton={{ text: 'Очистить фильтры', buttonVersion: 'secondary' }}
107
+ resetButton={{ text: 'Очистить фильтры', version: 'secondary' }}
108
+ notFound={{
109
+ title: 'Нет подходящей ипотечной программы',
110
+ description: 'Попробуйте очистить фильтры',
111
+ }}
96
112
  block={{
97
113
  type: 'Filtration',
98
114
  blocks: [
@@ -15,19 +15,14 @@ export const Filtration: JSXBlock<FiltrationProps> = JSX<FiltrationProps>(
15
15
  const { formState, register, resetForm } = useForm();
16
16
 
17
17
  return (
18
- <BlockWrapper className={style('p-9', className)} {...rest}>
19
- <form className="flex justify-between">
18
+ <BlockWrapper className={style(className)} version="transparent" {...rest}>
19
+ <form className="flex justify-between bg-white p-9 mb-1">
20
20
  <div className="flex gap-11">
21
21
  {Object.keys(filtrationSchema).map(renderFormItem(filtrationSchema, register))}
22
22
  </div>
23
23
  {resetButton ? (
24
24
  <div>
25
- <Button
26
- className="w-72"
27
- text={resetButton.text}
28
- version={resetButton.buttonVersion}
29
- onClick={resetForm}
30
- />
25
+ <Button className="w-72" onClick={resetForm} {...resetButton} />
31
26
  </div>
32
27
  ) : null}
33
28
  </form>
@@ -1,4 +1,5 @@
1
1
  import type { ButtonVersion } from '../../model/ButtonVersion';
2
+ import type { DescriptionProps, TitleProps } from '../../model/HeadlineType';
2
3
 
3
4
  /**
4
5
  * @title Заголовок
@@ -33,6 +34,7 @@ export type StringArray = {
33
34
  * @hidden
34
35
  */
35
36
  type?: 'array';
37
+ /** @title */
36
38
  items?: {
37
39
  /**
38
40
  * @default string
@@ -47,13 +49,13 @@ export type StringArray = {
47
49
  // TODO: Make customizable to implement arbitrary filtration blocks
48
50
  export type FiltrationSchema = {
49
51
  /** @title Тип недвижимости */
50
- propertyType?: StringEnum;
52
+ propertyType?: StringArray;
51
53
  /** @title Этап строительства */
52
- stage?: StringEnum;
54
+ stage?: StringArray;
53
55
  /** @title Категории */
54
- categories?: StringEnum;
56
+ categories?: StringArray;
55
57
  /** @title Дополнительно */
56
- extraOptions?: StringEnum;
58
+ extraOptions?: StringArray;
57
59
  };
58
60
 
59
61
  /**
@@ -67,14 +69,24 @@ export type ResetButton = {
67
69
  /**
68
70
  * @title Цвет кнопки
69
71
  */
70
- buttonVersion: ButtonVersion;
72
+ version: ButtonVersion;
71
73
  };
72
74
 
75
+ /**
76
+ * @title Плитка "Не найдено"
77
+ */
78
+ export type NotFound = TitleProps & DescriptionProps;
79
+
73
80
  export interface FiltrationInnerContent {
74
- /** @title Название кнопки */
81
+ /** @title Название сворачивающейся кнопки */
75
82
  label?: string;
76
- /** @title Количество отображаемых предметов */
83
+ /**
84
+ * @title Количество отображаемых предметов
85
+ * @minimum 1
86
+ */
77
87
  topItemsCount?: number;
88
+ resetButton?: ResetButton;
89
+ notFound?: NotFound;
78
90
  }
79
91
 
80
92
  /**
@@ -83,5 +95,4 @@ export interface FiltrationInnerContent {
83
95
  export interface FiltrationContent extends FiltrationInnerContent {
84
96
  /** @title Параметры фильтрации */
85
97
  filtrationSchema?: FiltrationSchema;
86
- resetButton?: ResetButton;
87
98
  }
@@ -5,10 +5,11 @@ import type { UniBlockProps } from '../../model/JSXBlock';
5
5
  import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton';
6
6
  import { Foldable } from '../../ui-kit/Foldable/Foldable';
7
7
  import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
8
+ import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
9
+ import { Text } from '../../ui-kit/Text/Text';
8
10
  import { style } from '../../utils/style';
9
- import { ErrorBlock } from '../ErrorBlock/ErrorBlock';
10
11
  import { checkShouldRenderBlock } from './checkShouldRenderBlock';
11
- import type { FiltrationInnerContent } from './FiltrationContent';
12
+ import type { FiltrationInnerContent, NotFound } from './FiltrationContent';
12
13
 
13
14
  const ICONS: IconName[] = ['ArrowDownIcon', 'ArrowUpIcon'];
14
15
 
@@ -19,7 +20,7 @@ interface FiltrationInnerProps extends FiltrationInnerContent, UniBlockProps {
19
20
  }
20
21
 
21
22
  export const FiltrationInner = JSX<FiltrationInnerProps>(
22
- ({ label = '', filtrationState = {}, topItemsCount = 0, block, ...rest }) => {
23
+ ({ label = '', filtrationState = {}, topItemsCount = 0, block, notFound, ...rest }) => {
23
24
  const blocksToRender =
24
25
  block?.blocks?.filter((b) => checkShouldRenderBlock(filtrationState, b.content || {})) || [];
25
26
 
@@ -30,28 +31,27 @@ export const FiltrationInner = JSX<FiltrationInnerProps>(
30
31
 
31
32
  return (
32
33
  <div>
33
- <div className={style(blocksToRender.length ? 'hidden' : '')}>
34
- <ErrorBlock
35
- error={{ errorContentType: 'Image' }}
36
- title="Нет подходящей ипотечной программы"
37
- subtitle="Попробуйте очистить фильтры"
38
- />
34
+ <div className={style(blocksToRender.length ? 'hidden' : 'block')}>
35
+ {notFound ? renderNotFound(notFound) : null}
39
36
  </div>
40
37
  <div className={style(blocksToRender.length ? '' : 'hidden')}>
41
- <div className={resultsGridStyle}>
38
+ <div className={style('mb-1', resultsGridStyle)}>
42
39
  {renderBlocksList(visibleBlocks, { ...rest.options, parent: block })}
43
40
  </div>
44
41
  <Foldable
45
42
  renderFoldableSection={({ isUnfolded }) => {
46
43
  return (
47
- <FoldableSection className={resultsGridStyle} isUnfolded={isUnfolded}>
44
+ <FoldableSection
45
+ className={style(resultsGridStyle, isUnfolded ? 'mb-1' : '')}
46
+ isUnfolded={isUnfolded}
47
+ >
48
48
  {renderBlocksList(hiddenBlocks, { ...rest.options, parent: block })}
49
49
  </FoldableSection>
50
50
  );
51
51
  }}
52
52
  renderFoldButton={({ isUnfolded, onToggle }) => (
53
53
  <DefaultFoldButton
54
- className={style('mt-11', topItemsCount < 1 ? 'hidden' : '')}
54
+ className={style(topItemsCount < 1 ? 'hidden' : '')}
55
55
  disabled={!hiddenBlocks?.length}
56
56
  label={label}
57
57
  icon={ICONS[Number(isUnfolded)]}
@@ -65,3 +65,22 @@ export const FiltrationInner = JSX<FiltrationInnerProps>(
65
65
  );
66
66
  },
67
67
  );
68
+
69
+ function renderNotFound({ title, description }: NotFound) {
70
+ return (
71
+ <div className="bg-white py-20">
72
+ {title ? (
73
+ <div className="mb-2">
74
+ <Paragraph align="text-center">
75
+ <Text size="text-h4">{title}</Text>
76
+ </Paragraph>
77
+ </div>
78
+ ) : null}
79
+ {description ? (
80
+ <Paragraph size="text-xl" font="font-light" align="text-center">
81
+ {description}
82
+ </Paragraph>
83
+ ) : null}
84
+ </div>
85
+ );
86
+ }
@@ -1,7 +1,7 @@
1
1
  import type { FormElementRegisterer } from '../../hooks/useForm';
2
2
  import { SlideCheckboxGroup } from '../../ui-kit/SlideCheckboxGroup/SlideCheckboxGroup';
3
3
  import { Text } from '../../ui-kit/Text/Text';
4
- import type { FiltrationSchema, StringEnum } from './FiltrationContent';
4
+ import type { FiltrationSchema, StringArray } from './FiltrationContent';
5
5
 
6
6
  export const renderFormItem =
7
7
  (filtrationSchema: FiltrationSchema, register: FormElementRegisterer) => (key: string) => {
@@ -9,28 +9,28 @@ export const renderFormItem =
9
9
  const type = item?.type;
10
10
 
11
11
  switch (type) {
12
- case 'string':
13
- return renderRadioButtons(key, register)(item);
12
+ case 'array':
13
+ return renderCheckboxes(key, register)(item);
14
14
  default:
15
15
  return null;
16
16
  }
17
17
  };
18
18
 
19
- const renderRadioButtons =
20
- (key: string, register: FormElementRegisterer) => (item?: StringEnum) => {
21
- const options =
22
- item?.enum?.map((e, i) => ({ value: e, title: item?.enumNames?.[i] || '' })) || [];
19
+ const renderCheckboxes = (key: string, register: FormElementRegisterer) => (item?: StringArray) => {
20
+ const options =
21
+ item?.items?.enum?.map((e, i) => ({ value: e, title: item?.items?.enumNames?.[i] || '' })) ||
22
+ [];
23
23
 
24
- return (
25
- <div role="radiogroup" key={key}>
26
- {item?.title ? (
27
- <div className="mb-4">
28
- <Text size="text-m" font="font-light" color="text-secondary-text">
29
- {item.title}
30
- </Text>
31
- </div>
32
- ) : null}
33
- <SlideCheckboxGroup items={options} multiple={false} {...register(key)} />
34
- </div>
35
- );
36
- };
24
+ return (
25
+ <div key={key}>
26
+ {item?.title ? (
27
+ <div className="mb-4">
28
+ <Text size="text-m" font="font-light" color="text-secondary-text">
29
+ {item.title}
30
+ </Text>
31
+ </div>
32
+ ) : null}
33
+ <SlideCheckboxGroup items={options} multiple {...register(key)} />
34
+ </div>
35
+ );
36
+ };
@@ -62,17 +62,15 @@ const buttonStylesWithText = (text: string, buttonSize: string) =>
62
62
  : `group/media flex items-center justify-center box-border ${buttonSizeStyles[buttonSize]}`;
63
63
 
64
64
  export const MediaButton = JSX<MediaButtonProps>(
65
- ({ iconVersion = 'color', buttonSize = 'default', rounded = false, icon, ...rest }) => {
66
- const { href, version, text, appendLeft, appendRight, aboveText } = rest;
65
+ ({ buttonSize = 'default', rounded = false, icon, ...rest }) => {
66
+ const { href, version, text = '' } = rest;
67
67
 
68
68
  const { iconMapped, label } =
69
69
  ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
70
70
 
71
- const iconCustom = icon ?? iconMapped;
71
+ const iconCustom = getFilteredIcon(icon) ?? iconMapped;
72
72
 
73
- const iconWithVersion = iconCustom
74
- ? { ...getIconWithVersion(iconCustom), iconVersion }
75
- : undefined;
73
+ const iconWithVersion = iconCustom ? getIconWithVersion(iconCustom) : undefined;
76
74
 
77
75
  return (
78
76
  <Button
@@ -83,11 +81,8 @@ export const MediaButton = JSX<MediaButtonProps>(
83
81
  'hover:bg-primary-main hover:text-black',
84
82
  'group-data-secondary:bg-white border-main-divider group-data-secondary:hover:bg-secondary-hover',
85
83
  'group-data-gray:border-green',
86
- buttonStylesWithText(text as string, buttonSize),
84
+ buttonStylesWithText(text, buttonSize),
87
85
  )}
88
- aboveText={aboveText}
89
- appendLeft={appendLeft}
90
- appendRight={appendRight}
91
86
  aria-label={label}
92
87
  rel="noopener noreferrer"
93
88
  target="_blank"
@@ -108,3 +103,5 @@ export const MediaButton = JSX<MediaButtonProps>(
108
103
  );
109
104
  },
110
105
  );
106
+
107
+ const getFilteredIcon = (icon: Picture | undefined) => (icon?.src || icon?.icon ? icon : undefined);
@@ -1,7 +1,8 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
3
- import { MediaButton, type ButtonSize } from './MediaButton';
4
3
  import { Text } from '../../ui-kit/Text/Text';
4
+ import type { ButtonSize } from './MediaButton';
5
+ import { MediaButton } from './MediaButton';
5
6
 
6
7
  export interface SocialMediaProps {
7
8
  className?: string;
@@ -14,16 +15,7 @@ export const SocialMedia = JSX<SocialMediaProps>(
14
15
  <div className="font-sans">
15
16
  <div className={`flex gap-1 ${className}`}>
16
17
  {media?.map((_, index) => (
17
- <MediaButton
18
- key={String(index)}
19
- aboveText={_.aboveText}
20
- appendLeft={_.appendLeft}
21
- appendRight={_.appendRight}
22
- buttonSize={buttonSize}
23
- text={_.text}
24
- version={_.version}
25
- {..._}
26
- />
18
+ <MediaButton key={String(index)} buttonSize={buttonSize} {..._} />
27
19
  ))}
28
20
  </div>
29
21
  <Text size="text-s-light" color="text-secondary-text">
@@ -10,7 +10,9 @@
10
10
  "sources": [
11
11
  {
12
12
  "media": 1279,
13
- "width": 360,
13
+ "size": {
14
+ "width": 360
15
+ },
14
16
  "format": "webp",
15
17
  "alignment": "center"
16
18
  }
@@ -11,7 +11,9 @@
11
11
  "sources": [
12
12
  {
13
13
  "media": 1279,
14
- "width": 240,
14
+ "size": {
15
+ "width": 240
16
+ },
15
17
  "format": "webp",
16
18
  "alignment": "center"
17
19
  }
@@ -16,7 +16,9 @@
16
16
  "sources": [
17
17
  {
18
18
  "media": 1279,
19
- "width": 164,
19
+ "size": {
20
+ "width": 164
21
+ },
20
22
  "format": "webp",
21
23
  "alignment": "northeast"
22
24
  }
@@ -11,7 +11,9 @@
11
11
  "sources": [
12
12
  {
13
13
  "media": 1279,
14
- "width": 145,
14
+ "size": {
15
+ "width": 145
16
+ },
15
17
  "format": "webp",
16
18
  "alignment": "southeast"
17
19
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "content": {
3
- "__html": "<p class=\"h1\">Заголовок 1</p>\n<p class=\"h2\">Заголовок 2</p>\n<p class=\"h3\">Заголовок 3</p>\n<p class=\"h4\">Заголовок 4</p>\n<p class=\"h5\">Заголовок 5</p>\n<p class=\"h6\">Заголовок 6</p>\n<p>Параграф, в котором много текста и даже <a href=\"#\">ссылка</a></p>\n<p><strong>Жирный текст</strong>, <em>Наклонный текст</em></p>\n<ul>\n <li>Список с точками</li>\n <li>Список с точками</li>\n</ul>\n<ol>\n <li>Нумерованный список</li>\n <li>Нумерованный список</li>\n</ol>\n"
3
+ "__html": "<h1>Заголовок 1</h1>\n<h2>Заголовок 2</h2>\n<h3>Заголовок 3</h3>\n<h4>Заголовок 4</h4>\n<h5>Заголовок 5</h5>\n<h6>Заголовок 6</h6>\n<p>Параграф, в котором много текста и даже <a href=\"#\">ссылка</a></p>\n<p><strong>Жирный текст</strong>, <em>Наклонный текст</em></p>\n<ul>\n <li>Список с точками</li>\n <li>Список с точками</li>\n</ul>\n<ol>\n <li>Нумерованный список</li>\n <li>Нумерованный список</li>\n</ol>\n"
4
4
  }
5
5
  }
@@ -11,7 +11,9 @@
11
11
  "sources": [
12
12
  {
13
13
  "media": 1279,
14
- "width": 276,
14
+ "size": {
15
+ "width": 276
16
+ },
15
17
  "format": "webp",
16
18
  "alignment": "southeast"
17
19
  }
@@ -1,5 +1,4 @@
1
1
  import type { AlignTypeWithStretch } from '../../model/AlignType';
2
- import type { ColorPalette } from '../../model/ContentPageDef';
3
2
  import type { UniBlockContent } from '../../model/JSXBlock';
4
3
  import type { GapVersion } from '../HorizontalLayout/HorizontalLayoutContent';
5
4
 
@@ -7,7 +6,6 @@ import type { GapVersion } from '../HorizontalLayout/HorizontalLayoutContent';
7
6
  * @title Вертикальный компоновщик
8
7
  */
9
8
  export type VerticalLayoutContent = UniBlockContent & {
10
- colorPalette?: ColorPalette;
11
9
  align?: AlignTypeWithStretch;
12
10
  gap?: GapVersion;
13
11
  /** @title Внутренний отступ компоновщика */