@redneckz/wildless-cms-uni-blocks 0.2.93 → 0.2.97

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 (216) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +134 -78
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/Accordion/AccordionBlocks.d.ts +1 -2
  5. package/dist/components/Accordion/AccordionBlocks.js +2 -2
  6. package/dist/components/Accordion/AccordionBlocks.js.map +1 -1
  7. package/dist/components/Accordion/AccordionItem.js +3 -6
  8. package/dist/components/Accordion/AccordionItem.js.map +1 -1
  9. package/dist/components/BaseTile/BaseTile.js +9 -4
  10. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  11. package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
  12. package/dist/components/ContentPage/ContentPage.d.ts +9 -1
  13. package/dist/components/ContentPage/ContentPage.js +20 -17
  14. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  15. package/dist/components/ContentPage/toMobilePage.js +13 -2
  16. package/dist/components/ContentPage/toMobilePage.js.map +1 -1
  17. package/dist/components/CreditCalculator/CreditCalculator.js +3 -3
  18. package/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
  19. package/dist/components/Footer/Footer.js +1 -1
  20. package/dist/components/Footer/Footer.js.map +1 -1
  21. package/dist/components/Footer/Sitemap.js +1 -1
  22. package/dist/components/Footer/Sitemap.js.map +1 -1
  23. package/dist/components/Gallery/Gallery.mobile.js +1 -1
  24. package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
  25. package/dist/components/Gallery/GalleryCardInner.d.ts +2 -0
  26. package/dist/components/Gallery/GalleryCardInner.js +19 -0
  27. package/dist/components/Gallery/GalleryCardInner.js.map +1 -0
  28. package/dist/components/Gallery/GalleryContainer.d.ts +13 -0
  29. package/dist/components/Gallery/GalleryContainer.js +16 -0
  30. package/dist/components/Gallery/GalleryContainer.js.map +1 -0
  31. package/dist/components/Gallery/GalleryContent.d.ts +8 -2
  32. package/dist/components/Gallery/GalleryInner.d.ts +1 -1
  33. package/dist/components/Gallery/GalleryInner.js +8 -36
  34. package/dist/components/Gallery/GalleryInner.js.map +1 -1
  35. package/dist/components/Gallery/constants.d.ts +6 -0
  36. package/dist/components/Gallery/constants.js +19 -0
  37. package/dist/components/Gallery/constants.js.map +1 -0
  38. package/dist/components/Header/Header.js +3 -3
  39. package/dist/components/Header/Header.js.map +1 -1
  40. package/dist/components/LinkDocs/LinkDocs.js +3 -3
  41. package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
  42. package/dist/components/LinkDocs/LinkDocsContent.d.ts +3 -3
  43. package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
  44. package/dist/components/ProductBlock/ProductBlock.js +12 -4
  45. package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  46. package/dist/components/ProductBlock/ProductBlockContent.d.ts +13 -2
  47. package/dist/components/ProductBlock/ProductBlockInner.js +16 -4
  48. package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  49. package/dist/components/ProductTile/ProductTileContent.d.ts +2 -2
  50. package/dist/components/TariffsTable/TariffsTableContent.d.ts +5 -1
  51. package/dist/components/TextBlock/TextBlockContent.d.ts +1 -0
  52. package/dist/components/Tile/TileContent.d.ts +1 -1
  53. package/dist/model/ButtonVersion.d.ts +1 -0
  54. package/dist/model/LinkProps.d.ts +2 -1
  55. package/dist/types.d.ts +8 -0
  56. package/dist/ui-kit/BlockItem/BlockItem.js +4 -4
  57. package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
  58. package/dist/ui-kit/Button/ButtonProps.d.ts +6 -1
  59. package/dist/ui-kit/Checkbox/Checkbox.js +2 -2
  60. package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  61. package/dist/ui-kit/Icon/Icon.js +1 -1
  62. package/dist/ui-kit/Icon/Icon.js.map +1 -1
  63. package/dist/ui-kit/Icon/IconProps.d.ts +49 -41
  64. package/dist/ui-kit/Icon/IconProps.js +45 -41
  65. package/dist/ui-kit/Icon/IconProps.js.map +1 -1
  66. package/dist/ui-kit/Img.js +9 -3
  67. package/dist/ui-kit/Img.js.map +1 -1
  68. package/dist/ui-kit/InputRange/InputRange.js +2 -1
  69. package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  70. package/dist/ui-kit/SearchBar.js +1 -1
  71. package/dist/ui-kit/SearchBar.js.map +1 -1
  72. package/lib/common.css +1 -1
  73. package/lib/components/Accordion/AccordionBlocks.d.ts +1 -2
  74. package/lib/components/Accordion/AccordionBlocks.js +1 -2
  75. package/lib/components/Accordion/AccordionBlocks.js.map +1 -1
  76. package/lib/components/Accordion/AccordionItem.js +1 -1
  77. package/lib/components/Accordion/AccordionItem.js.map +1 -1
  78. package/lib/components/BaseTile/BaseTile.js +9 -4
  79. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  80. package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
  81. package/lib/components/ContentPage/ContentPage.d.ts +9 -1
  82. package/lib/components/ContentPage/ContentPage.js +20 -17
  83. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  84. package/lib/components/ContentPage/toMobilePage.js +13 -2
  85. package/lib/components/ContentPage/toMobilePage.js.map +1 -1
  86. package/lib/components/CreditCalculator/CreditCalculator.js +3 -3
  87. package/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
  88. package/lib/components/Footer/Footer.js +1 -1
  89. package/lib/components/Footer/Footer.js.map +1 -1
  90. package/lib/components/Footer/Sitemap.js +1 -1
  91. package/lib/components/Footer/Sitemap.js.map +1 -1
  92. package/lib/components/Gallery/Gallery.mobile.js +1 -1
  93. package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
  94. package/lib/components/Gallery/GalleryCardInner.d.ts +2 -0
  95. package/lib/components/Gallery/GalleryCardInner.js +17 -0
  96. package/lib/components/Gallery/GalleryCardInner.js.map +1 -0
  97. package/lib/components/Gallery/GalleryContainer.d.ts +13 -0
  98. package/lib/components/Gallery/GalleryContainer.js +14 -0
  99. package/lib/components/Gallery/GalleryContainer.js.map +1 -0
  100. package/lib/components/Gallery/GalleryContent.d.ts +8 -2
  101. package/lib/components/Gallery/GalleryInner.d.ts +1 -1
  102. package/lib/components/Gallery/GalleryInner.js +6 -34
  103. package/lib/components/Gallery/GalleryInner.js.map +1 -1
  104. package/lib/components/Gallery/constants.d.ts +6 -0
  105. package/lib/components/Gallery/constants.js +17 -0
  106. package/lib/components/Gallery/constants.js.map +1 -0
  107. package/lib/components/Header/Header.js +3 -3
  108. package/lib/components/Header/Header.js.map +1 -1
  109. package/lib/components/LinkDocs/LinkDocs.fixture.d.ts +3 -3
  110. package/lib/components/LinkDocs/LinkDocs.js +3 -3
  111. package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
  112. package/lib/components/LinkDocs/LinkDocsContent.d.ts +3 -3
  113. package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
  114. package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
  115. package/lib/components/ProductBlock/ProductBlock.js +12 -4
  116. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  117. package/lib/components/ProductBlock/ProductBlockContent.d.ts +13 -2
  118. package/lib/components/ProductBlock/ProductBlockInner.js +16 -4
  119. package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  120. package/lib/components/ProductTile/ProductTileContent.d.ts +2 -2
  121. package/lib/components/TariffsTable/TariffsTableContent.d.ts +5 -1
  122. package/lib/components/TextBlock/TextBlockContent.d.ts +1 -0
  123. package/lib/components/Tile/TileContent.d.ts +1 -1
  124. package/lib/model/ButtonVersion.d.ts +1 -0
  125. package/lib/model/LinkProps.d.ts +2 -1
  126. package/lib/types.d.ts +8 -0
  127. package/lib/ui-kit/BlockItem/BlockItem.js +4 -4
  128. package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
  129. package/lib/ui-kit/Button/ButtonProps.d.ts +6 -1
  130. package/lib/ui-kit/Checkbox/Checkbox.js +2 -2
  131. package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  132. package/lib/ui-kit/Icon/Icon.js +1 -1
  133. package/lib/ui-kit/Icon/Icon.js.map +1 -1
  134. package/lib/ui-kit/Icon/IconProps.d.ts +49 -41
  135. package/lib/ui-kit/Icon/IconProps.js +45 -41
  136. package/lib/ui-kit/Icon/IconProps.js.map +1 -1
  137. package/lib/ui-kit/Img.js +9 -3
  138. package/lib/ui-kit/Img.js.map +1 -1
  139. package/lib/ui-kit/InputRange/InputRange.js +2 -1
  140. package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  141. package/lib/ui-kit/SearchBar.js +1 -1
  142. package/lib/ui-kit/SearchBar.js.map +1 -1
  143. package/package.json +6 -4
  144. package/src/components/Accordion/Accordion.example.json +4 -4
  145. package/src/components/Accordion/Accordion.fixture.tsx +5 -1
  146. package/src/components/Accordion/AccordionBlocks.tsx +1 -3
  147. package/src/components/Accordion/AccordionItem.tsx +1 -1
  148. package/src/components/BaseTile/BaseTile.tsx +14 -5
  149. package/src/components/BenefitsBlock/BenefitsBlock.fixture.tsx +31 -28
  150. package/src/components/ComparisonTable/ComparisonTable.example.json +1 -1
  151. package/src/components/ComparisonTable/ComparisonTable.fixture.tsx +43 -53
  152. package/src/components/ComparisonTable/ComparisonTableContent.ts +2 -3
  153. package/src/components/ContentPage/ContentPage.page.json +31 -49
  154. package/src/components/ContentPage/ContentPage.tsx +71 -36
  155. package/src/components/ContentPage/toMobilePage.ts +19 -2
  156. package/src/components/CreditCalculator/CreditCalculator.fixture.tsx +9 -1
  157. package/src/components/CreditCalculator/CreditCalculator.tsx +11 -8
  158. package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +1 -1
  159. package/src/components/Footer/Footer.fixture.tsx +265 -258
  160. package/src/components/Footer/Footer.tsx +3 -3
  161. package/src/components/Footer/Sitemap.tsx +1 -1
  162. package/src/components/Gallery/Gallery.fixture.tsx +52 -48
  163. package/src/components/Gallery/Gallery.mobile.tsx +1 -3
  164. package/src/components/Gallery/GalleryCardInner.tsx +53 -0
  165. package/src/components/Gallery/GalleryContainer.tsx +58 -0
  166. package/src/components/Gallery/GalleryContent.ts +8 -2
  167. package/src/components/Gallery/GalleryInner.tsx +15 -94
  168. package/src/components/Gallery/constants.ts +22 -0
  169. package/src/components/Header/Header.tsx +14 -12
  170. package/src/components/Headline/Headline.fixture.tsx +25 -3
  171. package/src/components/LikeControl/LikeControl.fixture.tsx +5 -1
  172. package/src/components/LinkDocs/LinkDocs.example.json +26 -0
  173. package/src/components/LinkDocs/LinkDocs.fixture.tsx +23 -6
  174. package/src/components/LinkDocs/LinkDocs.tsx +3 -3
  175. package/src/components/LinkDocs/LinkDocsContent.ts +3 -3
  176. package/src/components/MiniGallery/MiniGallery.fixture.tsx +12 -22
  177. package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +3 -1
  178. package/src/components/PictureText/PictureText.example.json +1 -1
  179. package/src/components/PictureText/PictureText.fixture.tsx +5 -1
  180. package/src/components/Placeholder/Placeholder.fixture.tsx +5 -1
  181. package/src/components/ProductBlock/ProductBlock.example.json +1 -1
  182. package/src/components/ProductBlock/ProductBlock.fixture.tsx +141 -77
  183. package/src/components/ProductBlock/ProductBlock.tsx +20 -7
  184. package/src/components/ProductBlock/ProductBlockContent.ts +14 -2
  185. package/src/components/ProductBlock/ProductBlockInner.tsx +39 -7
  186. package/src/components/ProductGallery/ProductGallery.fixture.tsx +96 -93
  187. package/src/components/ProductTile/ProductTile.example.json +1 -1
  188. package/src/components/ProductTile/ProductTile.fixture.tsx +4 -4
  189. package/src/components/ProductTile/ProductTileContent.ts +2 -2
  190. package/src/components/PromoTile/PromoTile.fixture.tsx +1 -1
  191. package/src/components/StepsBlock/StepsBlock.fixture.tsx +21 -18
  192. package/src/components/TariffsTable/TariffsTable.fixture.tsx +5 -16
  193. package/src/components/TariffsTable/TariffsTableContent.ts +5 -1
  194. package/src/components/TextBlock/TextBlock.fixture.tsx +62 -45
  195. package/src/components/TextBlock/TextBlockContent.ts +1 -0
  196. package/src/components/Tile/Tile.example.json +1 -1
  197. package/src/components/Tile/Tile.fixture.tsx +11 -8
  198. package/src/components/Tile/TileContent.ts +1 -1
  199. package/src/icons/AppleIcon.svg +1 -1
  200. package/src/icons/CalendarWhiteIcon.svg +17 -0
  201. package/src/icons/EmptyWalletWhiteIcon.svg +16 -0
  202. package/src/icons/GridIcon.svg +2 -2
  203. package/src/icons/PercentageSquareWhiteIcon.svg +16 -0
  204. package/src/icons/PlayMarketIcon.svg +1 -1
  205. package/src/model/ButtonVersion.ts +1 -0
  206. package/src/model/LinkProps.ts +2 -1
  207. package/src/setup-fixture.ts +1 -2
  208. package/src/types.ts +11 -1
  209. package/src/ui-kit/BlockItem/BlockItem.tsx +4 -4
  210. package/src/ui-kit/Button/ButtonProps.ts +6 -1
  211. package/src/ui-kit/Checkbox/Checkbox.tsx +7 -3
  212. package/src/ui-kit/Icon/Icon.tsx +1 -1
  213. package/src/ui-kit/Icon/IconProps.ts +8 -0
  214. package/src/ui-kit/Img.tsx +23 -10
  215. package/src/ui-kit/InputRange/InputRange.tsx +7 -6
  216. package/src/ui-kit/SearchBar.tsx +3 -4
@@ -1,8 +1,8 @@
1
+ import type { Picture } from '../../model/Picture';
1
2
  import { context } from '../../setup-fixture';
2
-
3
+ import type { ButtonCommonProps } from '../../ui-kit/Button/Button';
3
4
  import { Gallery, GalleryProps } from './Gallery';
4
5
  import { Gallery as MobileGallery } from './Gallery.mobile';
5
- import type { Picture } from '../../model/Picture';
6
6
 
7
7
  const image: Picture = {
8
8
  src: 'money-1.png',
@@ -11,6 +11,14 @@ const image: Picture = {
11
11
  width: 140,
12
12
  height: 140,
13
13
  },
14
+ title: 'money',
15
+ };
16
+
17
+ const buttonPrimary: ButtonCommonProps = {
18
+ href: '/credit-cards',
19
+ text: 'Подробнее',
20
+ target: '_blank',
21
+ version: 'secondary',
14
22
  };
15
23
 
16
24
  const defaultItems = [
@@ -29,21 +37,21 @@ const defaultProps: GalleryProps = {
29
37
  description:
30
38
  'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
31
39
  image,
32
- href: '/credit-cards',
40
+ button: buttonPrimary,
33
41
  items: defaultItems,
34
42
  },
35
43
  {
36
44
  title: 'Более 1000 развлечений',
37
45
  description: 'Порядок и условия предоставления в соответствии с 106 ФЗ',
38
46
  image,
39
- href: '/credit-cards',
47
+ button: buttonPrimary,
40
48
  items: defaultItems,
41
49
  },
42
50
  {
43
51
  title: 'Фермерские продукты',
44
52
  description: 'Высокий процент даже при небольшой сумме денежных средств',
45
53
  image,
46
- href: '/credit-cards',
54
+ button: buttonPrimary,
47
55
  items: defaultItems,
48
56
  },
49
57
  {
@@ -51,14 +59,7 @@ const defaultProps: GalleryProps = {
51
59
  description:
52
60
  'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
53
61
  image,
54
- href: '/credit-cards',
55
- items: defaultItems,
56
- },
57
- {
58
- title: 'Фермерские продукты',
59
- description: 'Высокий процент даже при небольшой сумме денежных средств',
60
- image,
61
- href: '/credit-cards',
62
+ button: buttonPrimary,
62
63
  items: defaultItems,
63
64
  },
64
65
  ],
@@ -74,32 +75,26 @@ const textAndButtonProps: GalleryProps = {
74
75
  description:
75
76
  'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
76
77
  image,
77
- href: '/credit-cards',
78
+ button: buttonPrimary,
78
79
  },
79
80
  {
80
81
  title: 'Более 1000 развлечений',
81
82
  description: 'Порядок и условия предоставления в соответствии с 106 ФЗ',
82
83
  image,
83
- href: '/credit-cards',
84
+ button: buttonPrimary,
84
85
  },
85
86
  {
86
87
  title: 'Фермерские продукты',
87
88
  description: 'Высокий процент даже при небольшой сумме денежных средств',
88
89
  image,
89
- href: '/credit-cards',
90
+ button: buttonPrimary,
90
91
  },
91
92
  {
92
93
  title: '«Моя выгода»',
93
94
  description:
94
95
  'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
95
96
  image,
96
- href: '/credit-cards',
97
- },
98
- {
99
- title: 'Фермерские продукты',
100
- description: 'Высокий процент даже при небольшой сумме денежных средств',
101
- image,
102
- href: '/credit-cards',
97
+ button: buttonPrimary,
103
98
  },
104
99
  ],
105
100
  };
@@ -112,31 +107,25 @@ const listAndButtonProps: GalleryProps = {
112
107
  {
113
108
  title: 'Более 5000 товаров',
114
109
  image,
115
- href: '/credit-cards',
110
+ button: buttonPrimary,
116
111
  items: defaultItems,
117
112
  },
118
113
  {
119
114
  title: 'Более 1000 развлечений',
120
115
  image,
121
- href: '/credit-cards',
116
+ button: buttonPrimary,
122
117
  items: defaultItems,
123
118
  },
124
119
  {
125
120
  title: 'Фермерские продукты',
126
121
  image,
127
- href: '/credit-cards',
122
+ button: buttonPrimary,
128
123
  items: defaultItems,
129
124
  },
130
125
  {
131
126
  title: '«Моя выгода»',
132
127
  image,
133
- href: '/credit-cards',
134
- items: defaultItems,
135
- },
136
- {
137
- title: 'Фермерские продукты',
138
- image,
139
- href: '/credit-cards',
128
+ button: buttonPrimary,
140
129
  items: defaultItems,
141
130
  },
142
131
  ],
@@ -169,11 +158,6 @@ const textAndNoButtonProps: GalleryProps = {
169
158
  'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
170
159
  image,
171
160
  },
172
- {
173
- title: 'Фермерские продукты',
174
- description: 'Высокий процент даже при небольшой сумме денежных средств',
175
- image,
176
- },
177
161
  ],
178
162
  };
179
163
 
@@ -198,18 +182,38 @@ const onlyTitleProps: GalleryProps = {
198
182
  title: '«Моя выгода»',
199
183
  image,
200
184
  },
201
- {
202
- title: 'Фермерские продукты',
203
- image,
204
- },
205
185
  ],
206
186
  };
207
187
 
208
188
  export default {
209
- default: <Gallery {...defaultProps} />,
210
- 'text and button': <Gallery {...textAndButtonProps} />,
211
- 'list and button': <Gallery {...listAndButtonProps} />,
212
- 'text and no button': <Gallery {...textAndNoButtonProps} />,
213
- 'only title': <Gallery {...onlyTitleProps} />,
214
- mobile: <MobileGallery {...defaultProps} />,
189
+ default: (
190
+ <div className="container grid grid-cols-12">
191
+ <Gallery className="col-span-12" {...defaultProps} />
192
+ </div>
193
+ ),
194
+ 'text and button': (
195
+ <div className="container grid grid-cols-12">
196
+ <Gallery className="col-span-12" {...textAndButtonProps} />
197
+ </div>
198
+ ),
199
+ 'list and button': (
200
+ <div className="container grid grid-cols-12">
201
+ <Gallery className="col-span-12" {...listAndButtonProps} />
202
+ </div>
203
+ ),
204
+ 'text and no button': (
205
+ <div className="container grid grid-cols-12">
206
+ <Gallery className="col-span-12" {...textAndNoButtonProps} />
207
+ </div>
208
+ ),
209
+ 'only title': (
210
+ <div className="container grid grid-cols-12">
211
+ <Gallery className="col-span-12" {...onlyTitleProps} />
212
+ </div>
213
+ ),
214
+ mobile: (
215
+ <div className="container grid grid-cols-12">
216
+ <MobileGallery className="col-span-12" {...defaultProps} />
217
+ </div>
218
+ ),
215
219
  };
@@ -51,9 +51,7 @@ function renderCard(card: GalleryCard, key: number) {
51
51
  ) : null}
52
52
  {card.items?.length ? renderItems(card.items) : null}
53
53
  </div>
54
- {card.href ? (
55
- <Button className="mt-6" text="Подробнее" version="secondary" href={card.href} />
56
- ) : null}
54
+ {card?.button?.href ? <Button className="mt-6" {...card.button} /> : null}
57
55
  </div>
58
56
  );
59
57
  }
@@ -0,0 +1,53 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { BlockVersion } from '../../model/BlockVersion';
3
+ import { BlockItem } from '../../ui-kit/BlockItem/BlockItem';
4
+ import { Button } from '../../ui-kit/Button/Button';
5
+ import { Img } from '../../ui-kit/Img';
6
+ import { cardVersionMap } from './constants';
7
+ import type { GalleryCard } from './GalleryContent';
8
+
9
+ export const GalleryCardInner = JSX<GalleryCard>(
10
+ ({ title, description, image, items, button, version }) => {
11
+ const cardVersionClasses = cardVersionMap[version ?? 'primary'];
12
+
13
+ return (
14
+ <div>
15
+ <div>
16
+ {image?.src ? (
17
+ <div className="flex justify-center">
18
+ <Img className="mb-6" image={image} />
19
+ </div>
20
+ ) : null}
21
+ {title && renderCardTitle(title, description, items)}
22
+ {description && (
23
+ <div className={`font-normal text-sm mt-2 ${cardVersionClasses}`}>{description}</div>
24
+ )}
25
+ {items?.length ? (
26
+ <section className={`max-w-[308px] mt-2 ${cardVersionClasses}`} role="list">
27
+ {items.map((item, i) => renderItem(item, i, version))}
28
+ </section>
29
+ ) : null}
30
+ </div>
31
+ {button?.href && <Button className="mt-6" {...button} />}
32
+ </div>
33
+ );
34
+ },
35
+ );
36
+
37
+ function renderCardTitle(title: string, description?: string, items?: string[]) {
38
+ return (
39
+ <div
40
+ className={`font-medium text-xl m-0 ${!description && !items?.length ? 'text-center' : ''}`}
41
+ >
42
+ {title}
43
+ </div>
44
+ );
45
+ }
46
+
47
+ function renderItem(item: string, i: number, version?: BlockVersion) {
48
+ return (
49
+ <BlockItem key={String(i)} version={version ?? 'primary'}>
50
+ <span className="text-sm">{item}</span>
51
+ </BlockItem>
52
+ );
53
+ }
@@ -0,0 +1,58 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { GalleryVersion } from '../../model/GalleryVersion';
3
+ import { Title } from '../../ui-kit/Title/Title';
4
+ import type { ContentPageContext } from '../ContentPage/ContentPageContext';
5
+ import { Tile } from '../Tile/Tile';
6
+ import { cardStyleMap, cardWidthMap, galleryLengthForScrollMap } from './constants';
7
+ import { GalleryCardInner } from './GalleryCardInner';
8
+ import type { GalleryCard } from './GalleryContent';
9
+ import type { GalleryInnerProps } from './GalleryInner';
10
+
11
+ export interface GalleryContainerProps extends Omit<GalleryInnerProps, 'className'> {
12
+ activeCardIndex: number;
13
+ }
14
+
15
+ export interface GalleryCardData {
16
+ card: GalleryCard;
17
+ version: GalleryVersion;
18
+ context: ContentPageContext;
19
+ }
20
+
21
+ export const GalleryContainer = JSX<GalleryContainerProps>(
22
+ ({ context, title, description, cards = [], version = 'normal', activeCardIndex }) => {
23
+ return (
24
+ <div>
25
+ <div className="absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent" />
26
+ <div className="flex flex-col items-center mb-8">
27
+ {title ? <Title className="font-medium m-0 text-center">{title}</Title> : null}
28
+ {description ? (
29
+ <div className="font-normal text-base max-w-[600px] mt-2.5">{description}</div>
30
+ ) : null}
31
+ </div>
32
+ <div
33
+ className={`flex ${
34
+ cards?.length <= galleryLengthForScrollMap[version] ? 'justify-center' : ''
35
+ } duration-1000`}
36
+ style={{ transform: `translateX(-${activeCardIndex * cardWidthMap[version]}px)` }}
37
+ role="list"
38
+ >
39
+ {cards?.map((card, i) => renderCard({ card, version, context }, i))}
40
+ </div>
41
+ </div>
42
+ );
43
+ },
44
+ );
45
+
46
+ function renderCard({ card, version, context }: GalleryCardData, i: number) {
47
+ return (
48
+ <Tile
49
+ context={context}
50
+ className={`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between
51
+ items-stretch ${cardStyleMap[version]} w-full col-span-4`}
52
+ version={card.version}
53
+ key={String(i)}
54
+ >
55
+ <GalleryCardInner {...card} />
56
+ </Tile>
57
+ );
58
+ }
@@ -1,4 +1,6 @@
1
+ import type { BlockVersion } from '../../model/BlockVersion';
1
2
  import type { Picture } from '../../model/Picture';
3
+ import type { BaseTileIconButton } from '../BaseTile/BaseTileProps';
2
4
 
3
5
  /**
4
6
  * @title Карточка
@@ -10,9 +12,13 @@ export interface GalleryCard {
10
12
  description?: string;
11
13
  image?: Picture;
12
14
  /** @title Ссылка */
13
- href?: string;
14
- /** @title Список */
15
+ button?: BaseTileIconButton;
16
+ /**
17
+ * @title Список
18
+ * @minItems 4
19
+ */
15
20
  items?: string[];
21
+ version?: BlockVersion;
16
22
  }
17
23
 
18
24
  /**
@@ -1,43 +1,21 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { GalleryCard, GalleryContent } from './GalleryContent';
3
2
  import type { GalleryVersion } from '../../model/GalleryVersion';
4
3
  import type { UniBlockProps } from '../../types';
5
4
  import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
6
- import { BlockItem } from '../../ui-kit/BlockItem/BlockItem';
7
- import { Button } from '../../ui-kit/Button/Button';
8
- import { Img } from '../../ui-kit/Img';
9
- import { Title } from '../../ui-kit/Title/Title';
5
+ import { galleryLengthForScrollMap } from './constants';
6
+ import { GalleryContainer } from './GalleryContainer';
7
+ import type { GalleryContent } from './GalleryContent';
10
8
 
11
9
  export interface GalleryInnerProps extends GalleryContent, UniBlockProps {
12
10
  version?: GalleryVersion;
13
11
  }
14
12
 
15
- const cardStyleMap: Record<GalleryVersion, string> = {
16
- normal: 'min-w-[364px] w-[364px]',
17
- mini: 'min-w-[260px] w-[260px]',
18
- };
19
-
20
- const cardWidthMap: Record<GalleryVersion, number> = {
21
- normal: 380,
22
- mini: 276,
23
- };
24
-
25
- const galleryLengthForScrollMap: Record<GalleryVersion, number> = {
26
- normal: 3,
27
- mini: 4,
28
- };
29
-
30
13
  export const GalleryInner = JSX<GalleryInnerProps>(
31
- ({ title, description, context, cards = [], className, version = 'normal' }) => {
14
+ ({ context, cards = [], className, version = 'normal', ...rest }) => {
32
15
  const [activeCardIndex, setActiveCardIndex] = context.useState(0);
33
16
 
34
- function handleNextClick() {
35
- setActiveCardIndex(activeCardIndex + 1);
36
- }
37
-
38
- function handlePrevClick() {
39
- setActiveCardIndex(activeCardIndex - 1);
40
- }
17
+ const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
18
+ const handlePrevClick = () => setActiveCardIndex(activeCardIndex - 1);
41
19
 
42
20
  const isGalleryScrollAvailable = cards?.length > galleryLengthForScrollMap[version];
43
21
 
@@ -49,26 +27,15 @@ export const GalleryInner = JSX<GalleryInnerProps>(
49
27
 
50
28
  return (
51
29
  <section
52
- className={`relative font-sans text-primary-text bg-white p-12 py-[50px] overflow-hidden ${className}`}
30
+ className={`relative font-sans text-primary-text bg-white p-[50px] overflow-hidden ${className}`}
53
31
  >
54
- <div className="flex flex-col items-center mb-8">
55
- {title ? <Title className="font-medium m-0 text-center">{title}</Title> : null}
56
- {description ? (
57
- <div className="font-normal text-base max-w-[600px] mt-3">{description}</div>
58
- ) : null}
59
- </div>
60
- <div
61
- // Need to place all cards at the center if count of cards less than 4
62
- className={`flex ${
63
- cards?.length <= galleryLengthForScrollMap[version] ? 'justify-center' : ''
64
- } duration-1000`}
65
- // All cards has same width
66
- style={{ transform: `translateX(-${activeCardIndex * cardWidthMap[version]}px)` }}
67
- role="list"
68
- >
69
- {cards?.map((card, i) => renderCard(card, i, version))}
70
- </div>
71
- <div className="absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent"></div>
32
+ <GalleryContainer
33
+ context={context}
34
+ cards={cards}
35
+ version={version}
36
+ activeCardIndex={activeCardIndex}
37
+ {...rest}
38
+ />
72
39
  {showPrevButton && (
73
40
  <ArrowButton
74
41
  className="absolute top-1/2 left-8 rotate-180"
@@ -83,54 +50,8 @@ export const GalleryInner = JSX<GalleryInnerProps>(
83
50
  ariaLabel="Пролистать вправо"
84
51
  />
85
52
  )}
86
- <div className="absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"></div>
53
+ <div className="absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white" />
87
54
  </section>
88
55
  );
89
56
  },
90
57
  );
91
-
92
- function renderCard(card: GalleryCard, i: number, version: GalleryVersion) {
93
- return (
94
- <div
95
- className={`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch ${cardStyleMap[version]} w-full`}
96
- role="listitem"
97
- key={String(i)}
98
- >
99
- <div>
100
- {card.image?.src ? (
101
- <div className="flex justify-center">
102
- <Img className="mb-6" image={card.image} />
103
- </div>
104
- ) : null}
105
- {card.title ? (
106
- <h4
107
- className={`font-medium text-xl m-0 ${
108
- !card.description && !card.items?.length ? 'text-center' : ''
109
- }`}
110
- >
111
- {card.title}
112
- </h4>
113
- ) : null}
114
- {card.description ? (
115
- <div className="font-normal text-sm text-secondary-text mt-2">{card.description}</div>
116
- ) : null}
117
- {card.items?.length ? (
118
- <section className="max-w-[308px] mt-2" role="list">
119
- {card.items.map(renderItem)}
120
- </section>
121
- ) : null}
122
- </div>
123
- {card.href ? (
124
- <Button className="mt-6" text="Подробнее" version="secondary" href={card.href} />
125
- ) : null}
126
- </div>
127
- );
128
- }
129
-
130
- function renderItem(item: string, i: number) {
131
- return (
132
- <BlockItem key={String(i)}>
133
- <span className="text-sm text-secondary-text">{item}</span>
134
- </BlockItem>
135
- );
136
- }
@@ -0,0 +1,22 @@
1
+ import type { BlockVersion } from '../../model/BlockVersion';
2
+ import type { GalleryVersion } from '../../model/GalleryVersion';
3
+
4
+ export const cardVersionMap: Record<BlockVersion, string> = {
5
+ primary: 'text-secondary-text',
6
+ secondary: '',
7
+ };
8
+
9
+ export const galleryLengthForScrollMap: Record<GalleryVersion, number> = {
10
+ normal: 3,
11
+ mini: 4,
12
+ };
13
+
14
+ export const cardStyleMap: Record<GalleryVersion, string> = {
15
+ normal: 'min-w-[364px] w-[364px]',
16
+ mini: 'min-w-[260px] w-[260px]',
17
+ };
18
+
19
+ export const cardWidthMap: Record<GalleryVersion, number> = {
20
+ normal: 380,
21
+ mini: 276,
22
+ };
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useLink } from '../../hooks/useLink';
3
+ import { useSitemap } from '../../hooks/useSitemap';
2
4
  import { mergeTopItems } from '../../mergeTopItems';
3
5
  import type { UniBlockProps } from '../../types';
4
6
  import { HeaderItem } from '../../ui-kit/HeaderItem/HeaderItem';
5
7
  import { Logo } from '../../ui-kit/Logo/Logo';
6
8
  import { TopItem } from '../../ui-kit/TopItem/TopItem';
7
- import { useLink } from '../../hooks/useLink';
8
- import { useSitemap } from '../../hooks/useSitemap';
9
9
  import type { HeaderContent } from './HeaderContent';
10
10
  import { HeaderSecondaryMenu } from './HeaderSecondaryMenu';
11
11
  import { isSubItemActive } from './isSubItemActive';
@@ -43,17 +43,19 @@ export const Header = JSX<HeaderProps>(({ className, defaultLocation, context, t
43
43
 
44
44
  return (
45
45
  <header className={`pt-5 pb-8 px-20 bg-white ${className || ''}`}>
46
- <div className="flex items-center">
47
- <Logo className="mr-8" />
48
- {topMenu}
49
- <HeaderSecondaryMenu
50
- context={context}
51
- className="ml-auto"
52
- defaultLocation={defaultLocation}
53
- />
46
+ <div className="container">
47
+ <div className="flex items-center">
48
+ <Logo className="mr-8" />
49
+ {topMenu}
50
+ <HeaderSecondaryMenu
51
+ context={context}
52
+ className="ml-auto"
53
+ defaultLocation={defaultLocation}
54
+ />
55
+ </div>
56
+ <div className="mt-5 h-[1px] bg-main-divider" />
57
+ <nav className="mt-5">{subMenu}</nav>
54
58
  </div>
55
- <div className="mt-5 h-[1px] bg-main-divider" />
56
- <nav className="mt-5">{subMenu}</nav>
57
59
  </header>
58
60
  );
59
61
  });
@@ -11,9 +11,31 @@ export const HEADLINE: HeadlineContent = {
11
11
  };
12
12
 
13
13
  export default {
14
- default: <Headline context={context} {...HEADLINE} />,
15
- 'left white': <Headline context={context} {...HEADLINE} align="left" bgColor="bg-white" />,
14
+ default: (
15
+ <div className="container grid grid-cols-12">
16
+ <Headline className="col-span-12" context={context} {...HEADLINE} />
17
+ </div>
18
+ ),
19
+ 'left white': (
20
+ <div className="container grid grid-cols-12">
21
+ <Headline
22
+ className="col-span-12"
23
+ context={context}
24
+ {...HEADLINE}
25
+ align="left"
26
+ bgColor="bg-white"
27
+ />
28
+ </div>
29
+ ),
16
30
  'right transparent': (
17
- <Headline context={context} {...HEADLINE} align="right" bgColor="transparent" />
31
+ <div className="container grid grid-cols-12">
32
+ <Headline
33
+ className="col-span-12"
34
+ context={context}
35
+ {...HEADLINE}
36
+ align="right"
37
+ bgColor="transparent"
38
+ />
39
+ </div>
18
40
  ),
19
41
  };
@@ -2,4 +2,8 @@ import { context } from '../../setup-fixture';
2
2
 
3
3
  import { LikeControl } from './LikeControl';
4
4
 
5
- export default <LikeControl context={context} />;
5
+ export default (
6
+ <div className="container grid grid-cols-12">
7
+ <LikeControl className="col-span-12" context={context} />
8
+ </div>
9
+ );
@@ -0,0 +1,26 @@
1
+ {
2
+ "title": "Дополнительные документы",
3
+ "icon": "DocIcon",
4
+ "documents": [
5
+ {
6
+ "text": "Документ №1",
7
+ "href": "/documents/document1.doc",
8
+ "fileSize": "123КБ"
9
+ },
10
+ {
11
+ "text": "Документ №2",
12
+ "href": "/documents/document2.rtf",
13
+ "target": "_blank"
14
+ },
15
+ {
16
+ "text": "Документ №3",
17
+ "href": "/abc3/map.jpeg",
18
+ "fileSize": "2МБ"
19
+ },
20
+ {
21
+ "text": "Документ №4",
22
+ "href": "/abc/map.rar"
23
+ }
24
+ ],
25
+ "columnsMode": "double"
26
+ }
@@ -1,6 +1,7 @@
1
1
  import { context } from '../../setup-fixture';
2
2
  import { LinkDocs } from './LinkDocs';
3
3
  import type { LinkDocsContent } from './LinkDocsContent';
4
+ import { Accordion } from '../Accordion/Accordion';
4
5
 
5
6
  export const LINK_DOCS: LinkDocsContent = {
6
7
  title: 'Дополнительные документы',
@@ -27,9 +28,9 @@ export const LINK_DOCS: LinkDocsContent = {
27
28
  ],
28
29
  };
29
30
 
30
- export const LINK_DOCS_TWO_COLUMNS: LinkDocsContent = {
31
+ export const LINK_DOCS_ONE_COLUMN: LinkDocsContent = {
31
32
  ...LINK_DOCS,
32
- columnsMode: 'double',
33
+ columnsMode: 'single',
33
34
  };
34
35
 
35
36
  export const LINK_DOCS_ANOTHER_ICON: LinkDocsContent = {
@@ -44,8 +45,24 @@ export const LINK_DOCS_NO_ICON: LinkDocsContent = {
44
45
  };
45
46
 
46
47
  export default {
47
- 'one column': <LinkDocs context={context} {...LINK_DOCS} />,
48
- 'two column': <LinkDocs context={context} {...LINK_DOCS_TWO_COLUMNS} />,
49
- 'another icon': <LinkDocs context={context} {...LINK_DOCS_ANOTHER_ICON} />,
50
- 'no icon': <LinkDocs context={context} {...LINK_DOCS_NO_ICON} />,
48
+ 'two columns (default)': (
49
+ <div className="container grid grid-cols-12">
50
+ <LinkDocs className="col-span-12" context={context} {...LINK_DOCS} />
51
+ </div>
52
+ ),
53
+ 'one column': (
54
+ <div className="container grid grid-cols-12">
55
+ <LinkDocs className="col-span-12" context={context} {...LINK_DOCS_ONE_COLUMN} />
56
+ </div>
57
+ ),
58
+ 'another icon': (
59
+ <div className="container grid grid-cols-12">
60
+ <LinkDocs className="col-span-12" context={context} {...LINK_DOCS_ANOTHER_ICON} />
61
+ </div>
62
+ ),
63
+ 'no icon and title': (
64
+ <div className="container grid grid-cols-12">
65
+ <LinkDocs className="col-span-12" context={context} {...LINK_DOCS_NO_ICON} />
66
+ </div>
67
+ ),
51
68
  };