@redneckz/wildless-cms-uni-blocks 0.5.15 → 0.6.16

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 (253) hide show
  1. package/bin/migration-scripts/0.5.14.js +27 -0
  2. package/bin/migration-scripts/0.6.16.js +90 -0
  3. package/bin/utils.js +2 -0
  4. package/bundle/blocks.schema.json +1 -1
  5. package/bundle/bundle.umd.js +57 -44
  6. package/bundle/bundle.umd.min.js +1 -1
  7. package/bundle/components/Blocks.d.ts +1 -0
  8. package/bundle/components/ContactsBlock/ContactsBlock.d.ts +5 -0
  9. package/bundle/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
  10. package/bundle/components/ContentPage/renderContentPageHead.d.ts +3 -0
  11. package/bundle/components/Gallery/GalleryContent.d.ts +3 -1
  12. package/bundle/components/Headline/constants.d.ts +0 -2
  13. package/bundle/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
  14. package/bundle/model/AlignText.d.ts +2 -0
  15. package/bundle/model/HeadlineType.d.ts +2 -2
  16. package/dist/components/Accordion/Accordion.js +2 -6
  17. package/dist/components/Accordion/Accordion.js.map +1 -1
  18. package/dist/components/Blocks.d.ts +1 -0
  19. package/dist/components/Blocks.js +2 -0
  20. package/dist/components/Blocks.js.map +1 -1
  21. package/dist/components/ContactsBlock/ContactsBlock.d.ts +5 -0
  22. package/dist/components/ContactsBlock/ContactsBlock.js +19 -0
  23. package/dist/components/ContactsBlock/ContactsBlock.js.map +1 -0
  24. package/dist/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
  25. package/dist/components/ContactsBlock/ContactsBlockContent.js +2 -0
  26. package/dist/components/ContactsBlock/ContactsBlockContent.js.map +1 -0
  27. package/dist/components/ContentPage/renderContentPageHead.d.ts +3 -0
  28. package/dist/components/ContentPage/renderContentPageHead.js +30 -0
  29. package/dist/components/ContentPage/renderContentPageHead.js.map +1 -0
  30. package/dist/components/Gallery/Gallery.mobile.js +2 -1
  31. package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
  32. package/dist/components/Gallery/GalleryCardInner.js +6 -11
  33. package/dist/components/Gallery/GalleryCardInner.js.map +1 -1
  34. package/dist/components/Gallery/GalleryContainer.js +2 -2
  35. package/dist/components/Gallery/GalleryContainer.js.map +1 -1
  36. package/dist/components/Gallery/GalleryContent.d.ts +3 -1
  37. package/dist/components/Gallery/GalleryInner.js +4 -3
  38. package/dist/components/Gallery/GalleryInner.js.map +1 -1
  39. package/dist/components/Headline/Headline.js +2 -1
  40. package/dist/components/Headline/Headline.js.map +1 -1
  41. package/dist/components/Headline/Headline.mobile.js +2 -1
  42. package/dist/components/Headline/Headline.mobile.js.map +1 -1
  43. package/dist/components/Headline/constants.d.ts +0 -2
  44. package/dist/components/Headline/constants.js +2 -6
  45. package/dist/components/Headline/constants.js.map +1 -1
  46. package/dist/components/MobileAppTile/MobileAppTile.js +5 -3
  47. package/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
  48. package/dist/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
  49. package/dist/components/StepsBlock/StepsBlock.js +1 -1
  50. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  51. package/dist/components/Tile/Tile.js +1 -1
  52. package/dist/components/Tile/Tile.js.map +1 -1
  53. package/dist/model/AlignText.d.ts +2 -0
  54. package/dist/model/AlignText.js +8 -0
  55. package/dist/model/AlignText.js.map +1 -0
  56. package/dist/model/HeadlineType.d.ts +2 -2
  57. package/dist/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  58. package/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  59. package/dist/ui-kit/List/ListItem.js +4 -4
  60. package/dist/ui-kit/List/ListItem.js.map +1 -1
  61. package/lib/common.css +1 -1
  62. package/lib/components/Accordion/Accordion.js +2 -6
  63. package/lib/components/Accordion/Accordion.js.map +1 -1
  64. package/lib/components/Blocks.d.ts +1 -0
  65. package/lib/components/Blocks.js +2 -0
  66. package/lib/components/Blocks.js.map +1 -1
  67. package/lib/components/ContactsBlock/ContactsBlock.d.ts +5 -0
  68. package/lib/components/ContactsBlock/ContactsBlock.fixture.d.ts +5 -0
  69. package/lib/components/ContactsBlock/ContactsBlock.js +17 -0
  70. package/lib/components/ContactsBlock/ContactsBlock.js.map +1 -0
  71. package/lib/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
  72. package/lib/components/ContactsBlock/ContactsBlockContent.js +2 -0
  73. package/lib/components/ContactsBlock/ContactsBlockContent.js.map +1 -0
  74. package/lib/components/ContentPage/renderContentPageHead.d.ts +3 -0
  75. package/lib/components/ContentPage/renderContentPageHead.js +27 -0
  76. package/lib/components/ContentPage/renderContentPageHead.js.map +1 -0
  77. package/lib/components/Gallery/Gallery.mobile.js +2 -1
  78. package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
  79. package/lib/components/Gallery/GalleryCardInner.js +6 -11
  80. package/lib/components/Gallery/GalleryCardInner.js.map +1 -1
  81. package/lib/components/Gallery/GalleryContainer.js +2 -2
  82. package/lib/components/Gallery/GalleryContainer.js.map +1 -1
  83. package/lib/components/Gallery/GalleryContent.d.ts +3 -1
  84. package/lib/components/Gallery/GalleryInner.js +4 -3
  85. package/lib/components/Gallery/GalleryInner.js.map +1 -1
  86. package/lib/components/Headline/Headline.js +3 -2
  87. package/lib/components/Headline/Headline.js.map +1 -1
  88. package/lib/components/Headline/Headline.mobile.js +3 -2
  89. package/lib/components/Headline/Headline.mobile.js.map +1 -1
  90. package/lib/components/Headline/constants.d.ts +0 -2
  91. package/lib/components/Headline/constants.js +1 -5
  92. package/lib/components/Headline/constants.js.map +1 -1
  93. package/lib/components/MiniGallery/MiniGallery.fixture.d.ts +2 -1
  94. package/lib/components/MobileAppTile/MobileAppTile.js +5 -3
  95. package/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
  96. package/lib/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
  97. package/lib/components/StepsBlock/StepsBlock.js +1 -1
  98. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  99. package/lib/components/Tile/Tile.js +1 -1
  100. package/lib/components/Tile/Tile.js.map +1 -1
  101. package/lib/model/AlignText.d.ts +2 -0
  102. package/lib/model/AlignText.js +6 -0
  103. package/lib/model/AlignText.js.map +1 -0
  104. package/lib/model/HeadlineType.d.ts +2 -2
  105. package/lib/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  106. package/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  107. package/lib/ui-kit/List/ListItem.js +4 -4
  108. package/lib/ui-kit/List/ListItem.js.map +1 -1
  109. package/mobile/bundle/bundle.umd.js +10 -8
  110. package/mobile/bundle/bundle.umd.min.js +1 -1
  111. package/mobile/bundle/components/ContactsBlock/ContactsBlock.d.ts +5 -0
  112. package/mobile/bundle/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
  113. package/mobile/bundle/components/ContentPage/renderContentPageHead.d.ts +3 -0
  114. package/mobile/bundle/components/Gallery/GalleryContent.d.ts +3 -1
  115. package/mobile/bundle/components/Headline/constants.d.ts +0 -2
  116. package/mobile/bundle/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
  117. package/mobile/bundle/model/AlignText.d.ts +2 -0
  118. package/mobile/bundle/model/HeadlineType.d.ts +2 -2
  119. package/mobile/dist/components/ContactsBlock/ContactsBlock.d.ts +5 -0
  120. package/mobile/dist/components/ContactsBlock/ContactsBlock.js +19 -0
  121. package/mobile/dist/components/ContactsBlock/ContactsBlock.js.map +1 -0
  122. package/mobile/dist/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
  123. package/mobile/dist/components/ContactsBlock/ContactsBlockContent.js +2 -0
  124. package/mobile/dist/components/ContactsBlock/ContactsBlockContent.js.map +1 -0
  125. package/mobile/dist/components/ContentPage/renderContentPageHead.d.ts +3 -0
  126. package/mobile/dist/components/ContentPage/renderContentPageHead.js +30 -0
  127. package/mobile/dist/components/ContentPage/renderContentPageHead.js.map +1 -0
  128. package/mobile/dist/components/Gallery/Gallery.js +2 -1
  129. package/mobile/dist/components/Gallery/Gallery.js.map +1 -1
  130. package/mobile/dist/components/Gallery/GalleryCardInner.js +6 -11
  131. package/mobile/dist/components/Gallery/GalleryCardInner.js.map +1 -1
  132. package/mobile/dist/components/Gallery/GalleryContainer.js +2 -2
  133. package/mobile/dist/components/Gallery/GalleryContainer.js.map +1 -1
  134. package/mobile/dist/components/Gallery/GalleryContent.d.ts +3 -1
  135. package/mobile/dist/components/Gallery/GalleryInner.js +4 -3
  136. package/mobile/dist/components/Gallery/GalleryInner.js.map +1 -1
  137. package/mobile/dist/components/Headline/Headline.js +2 -1
  138. package/mobile/dist/components/Headline/Headline.js.map +1 -1
  139. package/mobile/dist/components/Headline/constants.d.ts +0 -2
  140. package/mobile/dist/components/Headline/constants.js +2 -6
  141. package/mobile/dist/components/Headline/constants.js.map +1 -1
  142. package/mobile/dist/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
  143. package/mobile/dist/components/Tile/Tile.js +1 -1
  144. package/mobile/dist/components/Tile/Tile.js.map +1 -1
  145. package/mobile/dist/model/AlignText.d.ts +2 -0
  146. package/mobile/dist/model/AlignText.js +8 -0
  147. package/mobile/dist/model/AlignText.js.map +1 -0
  148. package/mobile/dist/model/HeadlineType.d.ts +2 -2
  149. package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  150. package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  151. package/mobile/dist/ui-kit/List/ListItem.js +4 -4
  152. package/mobile/dist/ui-kit/List/ListItem.js.map +1 -1
  153. package/mobile/lib/components/ContactsBlock/ContactsBlock.d.ts +5 -0
  154. package/mobile/lib/components/ContactsBlock/ContactsBlock.js +17 -0
  155. package/mobile/lib/components/ContactsBlock/ContactsBlock.js.map +1 -0
  156. package/mobile/lib/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
  157. package/mobile/lib/components/ContactsBlock/ContactsBlockContent.js +2 -0
  158. package/mobile/lib/components/ContactsBlock/ContactsBlockContent.js.map +1 -0
  159. package/mobile/lib/components/ContentPage/renderContentPageHead.d.ts +3 -0
  160. package/mobile/lib/components/ContentPage/renderContentPageHead.js +27 -0
  161. package/mobile/lib/components/ContentPage/renderContentPageHead.js.map +1 -0
  162. package/mobile/lib/components/Gallery/Gallery.js +2 -1
  163. package/mobile/lib/components/Gallery/Gallery.js.map +1 -1
  164. package/mobile/lib/components/Gallery/GalleryCardInner.js +6 -11
  165. package/mobile/lib/components/Gallery/GalleryCardInner.js.map +1 -1
  166. package/mobile/lib/components/Gallery/GalleryContainer.js +2 -2
  167. package/mobile/lib/components/Gallery/GalleryContainer.js.map +1 -1
  168. package/mobile/lib/components/Gallery/GalleryContent.d.ts +3 -1
  169. package/mobile/lib/components/Gallery/GalleryInner.js +4 -3
  170. package/mobile/lib/components/Gallery/GalleryInner.js.map +1 -1
  171. package/mobile/lib/components/Headline/Headline.js +3 -2
  172. package/mobile/lib/components/Headline/Headline.js.map +1 -1
  173. package/mobile/lib/components/Headline/constants.d.ts +0 -2
  174. package/mobile/lib/components/Headline/constants.js +1 -5
  175. package/mobile/lib/components/Headline/constants.js.map +1 -1
  176. package/mobile/lib/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
  177. package/mobile/lib/components/Tile/Tile.js +1 -1
  178. package/mobile/lib/components/Tile/Tile.js.map +1 -1
  179. package/mobile/lib/model/AlignText.d.ts +2 -0
  180. package/mobile/lib/model/AlignText.js +6 -0
  181. package/mobile/lib/model/AlignText.js.map +1 -0
  182. package/mobile/lib/model/HeadlineType.d.ts +2 -2
  183. package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  184. package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  185. package/mobile/lib/ui-kit/List/ListItem.js +4 -4
  186. package/mobile/lib/ui-kit/List/ListItem.js.map +1 -1
  187. package/mobile/src/components/ContactsBlock/ContactsBlock.example.json +51 -0
  188. package/mobile/src/components/ContactsBlock/ContactsBlock.tsx +70 -0
  189. package/mobile/src/components/ContactsBlock/ContactsBlock.ui.json +8 -0
  190. package/mobile/src/components/ContactsBlock/ContactsBlockContent.ts +39 -0
  191. package/mobile/src/components/ContentPage/renderContentPageHead.tsx +38 -0
  192. package/mobile/src/components/Gallery/Gallery.example.json +2 -2
  193. package/mobile/src/components/Gallery/Gallery.tsx +9 -5
  194. package/mobile/src/components/Gallery/Gallery.ui.json +11 -1
  195. package/mobile/src/components/Gallery/GalleryCardInner.tsx +17 -26
  196. package/mobile/src/components/Gallery/GalleryContainer.tsx +1 -2
  197. package/mobile/src/components/Gallery/GalleryContent.ts +3 -1
  198. package/mobile/src/components/Gallery/GalleryInner.tsx +11 -4
  199. package/mobile/src/components/Headline/Headline.tsx +4 -3
  200. package/mobile/src/components/Headline/constants.ts +1 -7
  201. package/mobile/src/components/MobileAppTile/MobileAppTileContent.ts +6 -0
  202. package/mobile/src/components/Tile/Tile.tsx +1 -1
  203. package/mobile/src/model/AlignText.ts +7 -0
  204. package/mobile/src/model/HeadlineType.ts +2 -2
  205. package/mobile/src/ui-kit/Foldable/DefaultFoldButton.tsx +32 -23
  206. package/mobile/src/ui-kit/List/ListItem.tsx +10 -7
  207. package/package.json +1 -1
  208. package/src/components/Accordion/Accordion.tsx +2 -8
  209. package/src/components/Blocks.ts +2 -0
  210. package/src/components/ContactsBlock/ContactsBlock.example.json +51 -0
  211. package/src/components/ContactsBlock/ContactsBlock.fixture.tsx +57 -0
  212. package/src/components/ContactsBlock/ContactsBlock.tsx +70 -0
  213. package/src/components/ContactsBlock/ContactsBlock.ui.json +8 -0
  214. package/src/components/ContactsBlock/ContactsBlockContent.ts +39 -0
  215. package/src/components/ContentPage/renderContentPageHead.tsx +38 -0
  216. package/src/components/Gallery/Gallery.example.json +2 -2
  217. package/src/components/Gallery/Gallery.fixture.mobile.tsx +3 -3
  218. package/src/components/Gallery/Gallery.fixture.tsx +20 -24
  219. package/src/components/Gallery/Gallery.mobile.tsx +9 -5
  220. package/src/components/Gallery/Gallery.ui.json +11 -1
  221. package/src/components/Gallery/GalleryCardInner.tsx +17 -26
  222. package/src/components/Gallery/GalleryContainer.tsx +1 -2
  223. package/src/components/Gallery/GalleryContent.ts +3 -1
  224. package/src/components/Gallery/GalleryInner.tsx +11 -4
  225. package/src/components/Headline/Headline.mobile.tsx +4 -3
  226. package/src/components/Headline/Headline.tsx +4 -3
  227. package/src/components/Headline/constants.ts +1 -7
  228. package/src/components/MiniGallery/MiniGallery.fixture.tsx +72 -44
  229. package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +1 -0
  230. package/src/components/MobileAppTile/MobileAppTile.tsx +8 -1
  231. package/src/components/MobileAppTile/MobileAppTileContent.ts +6 -0
  232. package/src/components/StepsBlock/StepsBlock.tsx +1 -1
  233. package/src/components/Tile/Tile.tsx +1 -1
  234. package/src/model/AlignText.ts +7 -0
  235. package/src/model/HeadlineType.ts +2 -2
  236. package/src/ui-kit/Foldable/DefaultFoldButton.tsx +32 -23
  237. package/src/ui-kit/List/ListItem.tsx +10 -7
  238. package/bundle/components/ContentPage/ContentPageHead.d.ts +0 -7
  239. package/dist/components/ContentPage/ContentPageHead.d.ts +0 -7
  240. package/dist/components/ContentPage/ContentPageHead.js +0 -20
  241. package/dist/components/ContentPage/ContentPageHead.js.map +0 -1
  242. package/lib/components/ContentPage/ContentPageHead.d.ts +0 -7
  243. package/lib/components/ContentPage/ContentPageHead.js +0 -18
  244. package/lib/components/ContentPage/ContentPageHead.js.map +0 -1
  245. package/mobile/bundle/components/ContentPage/ContentPageHead.d.ts +0 -7
  246. package/mobile/dist/components/ContentPage/ContentPageHead.d.ts +0 -7
  247. package/mobile/dist/components/ContentPage/ContentPageHead.js +0 -20
  248. package/mobile/dist/components/ContentPage/ContentPageHead.js.map +0 -1
  249. package/mobile/lib/components/ContentPage/ContentPageHead.d.ts +0 -7
  250. package/mobile/lib/components/ContentPage/ContentPageHead.js +0 -18
  251. package/mobile/lib/components/ContentPage/ContentPageHead.js.map +0 -1
  252. package/mobile/src/components/ContentPage/ContentPageHead.tsx +0 -43
  253. package/src/components/ContentPage/ContentPageHead.tsx +0 -43
@@ -7,13 +7,14 @@ import { renderArrows } from '../../ui-kit/Button/renderArrows';
7
7
  import { galleryLengthForScrollMap } from './constants';
8
8
  import { GalleryContainer } from './GalleryContainer';
9
9
  import type { GalleryContent } from './GalleryContent';
10
+ import { Button } from '../../ui-kit/Button/Button';
10
11
 
11
12
  export interface GalleryInnerProps extends GalleryContent, UniBlockProps {
12
13
  version?: GalleryVersion;
13
14
  }
14
15
 
15
16
  export const GalleryInner = JSX<GalleryInnerProps>(
16
- ({ context, cards = [], className = '', version = 'normal', ...rest }) => {
17
+ ({ context, cards = [], className = '', version = 'normal', button, ...rest }) => {
17
18
  const [activeCardIndex, setActiveCardIndex] = useState(0);
18
19
 
19
20
  const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
@@ -30,7 +31,7 @@ export const GalleryInner = JSX<GalleryInnerProps>(
30
31
  return (
31
32
  <BlockWrapper
32
33
  context={context}
33
- className={`relative font-sans text-primary-text bg-white p-[42px] overflow-hidden ${className}`}
34
+ className={`relative font-sans text-primary-text bg-white p-[42px] overflow-hidden flex flex-col ${className}`}
34
35
  {...rest}
35
36
  >
36
37
  <GalleryContainer
@@ -46,8 +47,14 @@ export const GalleryInner = JSX<GalleryInnerProps>(
46
47
  btnClass: ['left-8', 'right-8'],
47
48
  className: 'top-1/2',
48
49
  })}
49
- <div className="absolute top-0 left-0 bottom-0 w-[82px] bg-opacity-from-white" />
50
- <div className="absolute top-0 right-0 bottom-0 w-[82px] bg-opacity-to-white" />
50
+ {isGalleryScrollAvailable ? (
51
+ <div>
52
+ <div className="absolute top-0 left-0 bottom-0 w-[82px] bg-opacity-from-white" />
53
+ <div className="absolute top-0 right-0 bottom-0 w-[82px] bg-opacity-to-white" />
54
+ </div>
55
+ ) : null}
56
+
57
+ {button ? <Button className="mt-8 mx-auto" {...button} /> : null}
51
58
  </BlockWrapper>
52
59
  );
53
60
  },
@@ -1,9 +1,10 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { AlignText } from '../../model/AlignText';
2
3
 
3
4
  import type { UniBlockProps } from '../../model/JSXBlock';
4
5
  import { Heading } from '../../ui-kit/Heading/Heading';
5
6
  import { Img } from '../../ui-kit/Img/Img';
6
- import { ALIGN_TEXT, HEADLINE_BLOCK_STYLE_MAPS } from './constants';
7
+ import { HEADLINE_BLOCK_STYLE_MAPS } from './constants';
7
8
  import type { HeadlineContent } from './HeadlineContent';
8
9
 
9
10
  export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
@@ -24,12 +25,12 @@ export const Headline = JSX<HeadlineProps>(
24
25
  {title ? (
25
26
  <Heading
26
27
  headingType="h2"
27
- className={`${STYLE_MAPS.text} ${ALIGN_TEXT[align]}`}
28
+ className={`${STYLE_MAPS.text} ${AlignText[align]}`}
28
29
  title={title}
29
30
  />
30
31
  ) : null}
31
32
  {description ? (
32
- <p className={`text-m ${STYLE_MAPS.description} ${ALIGN_TEXT[align]}`}>{description}</p>
33
+ <p className={`text-m ${STYLE_MAPS.description} ${AlignText[align]}`}>{description}</p>
33
34
  ) : null}
34
35
  {image?.src && (
35
36
  <div className="mt-2.5 mx-auto flex justify-center">
@@ -1,14 +1,7 @@
1
- import type { AlignType } from '../../model/AlignType';
2
1
  import type { BlockVersionWithTransparent } from '../../model/BlockVersion';
3
2
  import type { HeadlineSmallVersion, HeadlineVersion } from '../../model/HeadlineType';
4
3
  import type { HeadingTagType, HeadingType } from '../../ui-kit/Heading/HeadingProps';
5
4
 
6
- export const ALIGN_TEXT: Record<AlignType, string> = {
7
- left: 'text-left',
8
- center: 'text-center',
9
- right: 'text-right',
10
- };
11
-
12
5
  type StyleType = {
13
6
  background: string;
14
7
  text: string;
@@ -74,6 +67,7 @@ export const HEADLINE_VERSION: Record<HeadlineVersion, VersionStyleType> = {
74
67
  };
75
68
 
76
69
  export const HEADLINE_SMALL_VERSION: Record<HeadlineSmallVersion, string> = {
70
+ H6: 'text-h6',
77
71
  XL_L: 'text-xl-light',
78
72
  XL_R: 'text-xl',
79
73
  L_L: 'text-l-light',
@@ -1,3 +1,4 @@
1
+ import type { AlignType } from '../../model/AlignType';
1
2
  import type { BlockVersion } from '../../model/BlockVersion';
2
3
  import type { HeadlineCommonProps } from '../../model/HeadlineType';
3
4
  import type { Picture } from '../../model/Picture';
@@ -12,6 +13,11 @@ export type MobileAppTileContent = HeadlineCommonProps &
12
13
  HeadingCommonProps &
13
14
  ButtonContent &
14
15
  ListContent & {
16
+ /**
17
+ * @title Выравнивание заголовка
18
+ * @default left
19
+ */
20
+ alignTitle?: AlignType;
15
21
  // TODO: description для мобильной версии
16
22
  /** @title QR-код */
17
23
  qr?: Picture;
@@ -59,7 +59,7 @@ export const Tile = JSX<TileProps>((props) => {
59
59
  buttons?.length ? (
60
60
  <ButtonSection
61
61
  context={context}
62
- buttons={buttons.map((button) => ({ ...button, className: 'w-[158px]' }))}
62
+ buttons={buttons.map((button) => ({ ...button, className: 'min-w-[158px]' }))}
63
63
  className="flex mt-8 gap-3"
64
64
  />
65
65
  ) : null
@@ -0,0 +1,7 @@
1
+ import type { AlignType } from './AlignType';
2
+
3
+ export const AlignText: Record<AlignType, string> = {
4
+ left: 'text-left',
5
+ center: 'text-center',
6
+ right: 'text-right',
7
+ };
@@ -6,9 +6,9 @@ export type HeadlineVersion = 'XXL' | 'XL' | 'L' | 'M' | 'S';
6
6
 
7
7
  /**
8
8
  * @title Размер заголовка
9
- * @enumNames ["Самый большой тонкий", "Самый большой", "Очень большой тонкий", "Очень большой", "Большой", "Средний", "Маленький"]
9
+ * @enumNames ["Заголовок", "Самый большой тонкий", "Самый большой", "Очень большой тонкий", "Очень большой", "Большой", "Средний", "Маленький"]
10
10
  */
11
- export type HeadlineSmallVersion = 'XL_L' | 'XL_R' | 'L_L' | 'L_R' | 'M' | 'S' | 'XS';
11
+ export type HeadlineSmallVersion = 'H6' | 'XL_L' | 'XL_R' | 'L_L' | 'L_R' | 'M' | 'S' | 'XS';
12
12
 
13
13
  export type TitleProps = {
14
14
  /** @title Заголовок */
@@ -13,29 +13,38 @@ interface DefaultFoldButtonProps {
13
13
  }
14
14
 
15
15
  export const DefaultFoldButton = JSX<DefaultFoldButtonProps>(
16
- ({ className, label, icon, dataTheme = '', onClick }) => (
17
- <button
18
- className={`border-none bg-primary-main hover:bg-primary-hover px-0 py-5 mb-[1px] w-full font-sans text-white flex justify-center cursor-pointer ${
19
- className || ''
20
- }`}
21
- data-theme={dataTheme}
22
- onClick={onClick}
23
- >
24
- <span className="text-h4 pr-3">{label}</span>
25
- {icon ? (
26
- <Img
27
- image={{
28
- icon,
29
- iconVersion: 'white',
30
- }}
31
- className="flex-shrink-0 my-auto"
32
- width="20"
33
- height="20"
34
- asSVG
35
- />
36
- ) : null}
37
- </button>
38
- ),
16
+ ({ className = '', label, icon, dataTheme = '', onClick }) => {
17
+ const STATE_STYLE =
18
+ 'hover:bg-primary-hover focus:border-primary-text active:bg-primary-active outline-none';
19
+ const DIMENSIONS_STYLE = 'flex justify-center w-full px-0 py-5 mb-[1px]';
20
+
21
+ return (
22
+ <button
23
+ className={[
24
+ 'border border-transparent bg-primary-main font-sans text-white cursor-pointer',
25
+ STATE_STYLE,
26
+ DIMENSIONS_STYLE,
27
+ className,
28
+ ].join(' ')}
29
+ data-theme={dataTheme}
30
+ onClick={onClick}
31
+ >
32
+ <span className="text-h4 pr-3">{label}</span>
33
+ {icon ? (
34
+ <Img
35
+ image={{
36
+ icon,
37
+ iconVersion: 'white',
38
+ }}
39
+ className="flex-shrink-0 my-auto"
40
+ width="20"
41
+ height="20"
42
+ asSVG
43
+ />
44
+ ) : null}
45
+ </button>
46
+ );
47
+ },
39
48
  );
40
49
 
41
50
  export const renderDefaultFoldButton = ({ isUnfolded, onToggle }: FoldablePartProps) => {
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { ListItemSize, ListItemVersion } from './ListProps';
3
+
3
4
  /**
4
5
  * @title Параметры элемента списка
5
6
  */
@@ -18,19 +19,21 @@ const LIST_DOT_STYLE_MAP: Record<ListItemVersion, string> = {
18
19
  };
19
20
 
20
21
  const DOT_SIZE_MAP = {
21
- L: 'w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-4 mt-3',
22
- M: 'w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-3 mt-3',
23
- S: 'w-1 h-1 min-w-1 min-h-1 mr-2 mt-2.5',
22
+ L: 'w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-4',
23
+ M: 'w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-3',
24
+ S: 'w-1 h-1 min-w-1 min-h-1 mr-2',
24
25
  };
25
26
 
26
27
  export const ListItem = JSX<ListItemProps>(
27
28
  ({ className = '', isDotted = true, children, version = 'primary', size = 'M' }) => {
28
29
  return (
29
- <div className={`font-sans flex items-start ${className}`} role="listitem">
30
+ <div className={`font-sans flex items-baseline ${className}`} role="listitem">
30
31
  {isDotted ? (
31
- <div
32
- className={`rounded-full inline-block ${LIST_DOT_STYLE_MAP[version]} ${DOT_SIZE_MAP[size]}`}
33
- />
32
+ <div>
33
+ <div
34
+ className={`rounded-full align-middle inline-block ${LIST_DOT_STYLE_MAP[version]} ${DOT_SIZE_MAP[size]}`}
35
+ />
36
+ </div>
34
37
  ) : null}
35
38
  <span>{children}</span>
36
39
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.5.15",
3
+ "version": "0.6.16",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,17 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { AlignType } from '../../model/AlignType';
2
+ import { AlignText } from '../../model/AlignText';
3
3
  import type { JSXBlock, UniBlockProps } from '../../model/JSXBlock';
4
4
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
5
  import { Heading } from '../../ui-kit/Heading/Heading';
6
6
  import type { AccordionContent } from './AccordionContent';
7
7
  import { AccordionItemsList } from './AccordionItemsList';
8
8
 
9
- const ALIGN_TITLE: Record<AlignType, string> = {
10
- left: 'text-left',
11
- center: 'text-center',
12
- right: 'text-right',
13
- };
14
-
15
9
  export interface AccordionProps extends AccordionContent, UniBlockProps {}
16
10
 
17
11
  export const Accordion: JSXBlock<AccordionProps> = JSX<AccordionProps>(
@@ -33,7 +27,7 @@ export const Accordion: JSXBlock<AccordionProps> = JSX<AccordionProps>(
33
27
  <Heading
34
28
  headingType="h3"
35
29
  as="h2"
36
- className={`mb-2.5 ${ALIGN_TITLE[accordionAlignTitle]}`}
30
+ className={`mb-2.5 ${AlignText[accordionAlignTitle]}`}
37
31
  title={title}
38
32
  />
39
33
  ) : null}
@@ -7,6 +7,7 @@ import { Calculator } from './Calculator/Calculator';
7
7
  import { CardTransfer } from './CardTransfer/CardTransfer';
8
8
  import { Catalog } from './Catalog/Catalog';
9
9
  import { ComparisonTable } from './ComparisonTable/ComparisonTable';
10
+ import { ContactsBlock } from './ContactsBlock/ContactsBlock';
10
11
  import { ErrorBlock } from './ErrorBlock/ErrorBlock';
11
12
  import { ExchangeRateTile } from './ExchangeRateTile/ExchangeRateTile';
12
13
  import { Footer } from './Footer/Footer';
@@ -46,6 +47,7 @@ export const Blocks = {
46
47
  ComparisonTable,
47
48
  Calculator,
48
49
  Catalog,
50
+ ContactsBlock,
49
51
  ExchangeRateTile,
50
52
  Footer,
51
53
  Gallery,
@@ -0,0 +1,51 @@
1
+ {
2
+ "contactsBlockVersion": "secondary",
3
+ "info": [
4
+ {
5
+ "title": "Заголовок 1",
6
+ "description": "Описание 1",
7
+ "button": {
8
+ "href": "#",
9
+ "text": "Кнопка 1",
10
+ "target": "_blank",
11
+ "version": "secondary"
12
+ }
13
+ },
14
+ {
15
+ "title": "Заголовок 2",
16
+ "description": "Описание 2",
17
+ "button": {
18
+ "href": "#",
19
+ "text": "Кнопка 2",
20
+ "target": "_blank",
21
+ "version": "secondary"
22
+ }
23
+ }
24
+ ],
25
+ "contacts": [
26
+ [
27
+ {
28
+ "title": "Заголовок 3",
29
+ "description": "Описание 3",
30
+ "additionalDescription": "Доп описание 3"
31
+ },
32
+ {
33
+ "title": "Заголовок 4",
34
+ "description": "Описание 4",
35
+ "additionalDescription": "Доп описание 4"
36
+ }
37
+ ],
38
+ [
39
+ {
40
+ "title": "Заголовок 5",
41
+ "description": "Описание 5",
42
+ "additionalDescription": "Доп описание 5"
43
+ },
44
+ {
45
+ "title": "Заголовок 6",
46
+ "description": "Описание 6",
47
+ "additionalDescription": "Доп описание 6"
48
+ }
49
+ ]
50
+ ]
51
+ }
@@ -0,0 +1,57 @@
1
+ import { context } from '../../react/setup-fixture';
2
+ import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
3
+ import { ContactsBlock } from './ContactsBlock';
4
+
5
+ const button: ButtonProps = {
6
+ href: '#',
7
+ text: 'Перейти',
8
+ target: '_blank',
9
+ version: 'secondary',
10
+ };
11
+
12
+ export default {
13
+ default: (
14
+ <ContactsBlock
15
+ className="col-span-12"
16
+ info={[
17
+ {
18
+ title: 'Телеграм-канал РСХБ Инвестиции',
19
+ description:
20
+ 'Всегда вовремя: главные новости, инвестиционные идеи, анонсы размещения облигаций',
21
+ button,
22
+ },
23
+ {
24
+ title: 'Подписка на аналитику',
25
+ description: 'E-mail рассылка: главное за неделю',
26
+ button,
27
+ },
28
+ ]}
29
+ contacts={[
30
+ [
31
+ {
32
+ title: '8 (800) 100-40-40',
33
+ description: 'Для консультаций',
34
+ },
35
+ {
36
+ title: '8 (800) 100-40-60',
37
+ description: 'Для подачи торговых поручений',
38
+ additionalDescription: 'Потребуется назвать уникальный код клиента и кодовое слово',
39
+ },
40
+ ],
41
+ [
42
+ {
43
+ title: 'invest@rshb.ru',
44
+ description: 'По брокерскому обслуживанию',
45
+ additionalDescription: 'Восстановление логина и номера соглашения',
46
+ },
47
+ {
48
+ title: 'broker@rshb.ru',
49
+ description: 'По брокерскому обслуживанию',
50
+ additionalDescription: 'Получение расчета финансового результата и справки 2-НДФЛ',
51
+ },
52
+ ],
53
+ ]}
54
+ context={context}
55
+ />
56
+ ),
57
+ };
@@ -0,0 +1,70 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { UniBlockProps } from '../../model/JSXBlock';
3
+ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
4
+ import { Button } from '../../ui-kit/Button/Button';
5
+ import { Description } from '../../ui-kit/Description/Description';
6
+ import { Heading } from '../../ui-kit/Heading/Heading';
7
+ import type { ContactItemProps, ContactsBlockContent, InfoItemProps } from './ContactsBlockContent';
8
+
9
+ export interface ContactsBlockProps extends ContactsBlockContent, UniBlockProps {}
10
+
11
+ interface RenderContactsColumnProps {
12
+ contactsColumn?: ContactItemProps[];
13
+ index?: number;
14
+ }
15
+
16
+ const contactsBlockStyleMap = {
17
+ primary: 'bg-white',
18
+ secondary: 'bg-primary-main text-white',
19
+ };
20
+
21
+ export const ContactsBlock = JSX<ContactsBlockProps>(
22
+ ({ className = '', contacts, context, info, contactsBlockVersion = 'secondary', ...rest }) => {
23
+ return (
24
+ <BlockWrapper
25
+ context={context}
26
+ className={`${contactsBlockStyleMap[contactsBlockVersion]} flex p-12 ${className}`}
27
+ {...rest}
28
+ >
29
+ {info ? renderInfo(info) : null}
30
+ {contacts ? renderContacts(contacts) : null}
31
+ </BlockWrapper>
32
+ );
33
+ },
34
+ );
35
+
36
+ const renderInfo = (info: InfoItemProps[]) => (
37
+ <div className="flex grow basis-0 pr-11">
38
+ {info.map(({ title, description, button }, index) => (
39
+ <div className="grow basis-0 pr-11 last:pr-0" key={String(index)}>
40
+ <Heading as="h5" headingType="h5" title={title} className="pb-2.5" />
41
+ <Description className="text-l-light pb-6" description={description} />
42
+ {button ? <Button {...button} /> : null}
43
+ </div>
44
+ ))}
45
+ </div>
46
+ );
47
+
48
+ const renderContacts = (contacts: ContactItemProps[][]) => (
49
+ <div className="flex grow basis-0">
50
+ {contacts.map((contactsColumn, index) => renderContactsColumn({ contactsColumn, index }))}
51
+ </div>
52
+ );
53
+
54
+ const renderContactsColumn = ({ contactsColumn, index }: RenderContactsColumnProps) =>
55
+ contactsColumn ? (
56
+ <div className="flex flex-col grow basis-0 pr-11" key={String(index)}>
57
+ {contactsColumn.map(({ title, description, additionalDescription }, key) => (
58
+ <div className="pr-11 last:pr-0 last:mt-5" key={String(key)}>
59
+ <Heading as="h5" headingType="h5" title={title} />
60
+ <Description className="text-l-light mt-2.5" description={description} />
61
+ {additionalDescription ? (
62
+ <Description
63
+ className="text-m-light mt-1.5 opacity-80"
64
+ description={additionalDescription}
65
+ />
66
+ ) : null}
67
+ </div>
68
+ ))}
69
+ </div>
70
+ ) : null;
@@ -0,0 +1,8 @@
1
+ {
2
+ "content": {},
3
+ "style": {
4
+ "ui:options": {
5
+ "minCols": 12
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,39 @@
1
+ import type { HeadlineCommonProps } from '../../model/HeadlineType';
2
+ import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
3
+
4
+ /**
5
+ * @title Контакты
6
+ */
7
+ export interface ContactsBlockContent {
8
+ /**
9
+ * @title Данные
10
+ * @maxItems 2
11
+ * */
12
+ info?: InfoItemProps[];
13
+ /**
14
+ * @title Контакты
15
+ * @maxItems 2
16
+ * */
17
+ contacts?: ContactItemProps[][];
18
+ contactsBlockVersion?: 'secondary';
19
+ }
20
+
21
+ /**
22
+ * @title Элемент плитки
23
+ */
24
+ export interface ContactItemProps {
25
+ /** @title Дополнительное описание */
26
+ additionalDescription?: string;
27
+ /** @title Описание */
28
+ description?: string;
29
+ /** @title Заголовок */
30
+ title?: string;
31
+ }
32
+
33
+ /**
34
+ * @title Элемент плитки
35
+ */
36
+ export interface InfoItemProps extends HeadlineCommonProps {
37
+ /** @title Кнопка */
38
+ button?: ButtonProps;
39
+ }
@@ -0,0 +1,38 @@
1
+ import type { ContentPageMeta } from '../../model/ContentPageDef';
2
+
3
+ export function renderContentPageHead(data: ContentPageMeta) {
4
+ const { title, main, og, twitter, jsonLd } = data;
5
+ const { description, keywords, canonical, robots } = main || {};
6
+
7
+ return [
8
+ <title key="title">{title}</title>,
9
+ <meta key="viewport" name="viewport" content="width=device-width, initial-scale=1" />,
10
+ description ? <meta key="description" name="description" content={description} /> : null,
11
+ keywords ? <meta key="keywords" name="keywords" content={keywords.join(',')} /> : null,
12
+ robots ? <meta key="robots" name="robots" content={robots.join(',')} /> : null,
13
+ renderOpenGraph(og),
14
+ renderTwitter(twitter),
15
+ canonical ? <link key="canonical" rel="canonical" href={canonical} /> : null,
16
+ jsonLd ? (
17
+ <script key="jsonLd" type="application/ld+json">
18
+ {jsonLd}
19
+ </script>
20
+ ) : null,
21
+ ].filter(Boolean);
22
+ }
23
+
24
+ function renderOpenGraph(og: Record<string, string> | undefined) {
25
+ return og
26
+ ? Object.entries(og).map(([key, value]) => (
27
+ <meta key={key} property={`og:${key}`} content={value} />
28
+ ))
29
+ : null;
30
+ }
31
+
32
+ function renderTwitter(twitter: Record<string, string> | undefined) {
33
+ return twitter
34
+ ? Object.entries(twitter).map(([key, value]) => (
35
+ <meta key={key} name={`twitter:${key}`} content={value} />
36
+ ))
37
+ : null;
38
+ }
@@ -4,7 +4,7 @@
4
4
  "orientation": "horizontal",
5
5
  "cards": [
6
6
  {
7
- "image": {
7
+ "icon": {
8
8
  "format": "webp",
9
9
  "size": {
10
10
  "width": 150,
@@ -23,7 +23,7 @@
23
23
  ]
24
24
  },
25
25
  {
26
- "image": {
26
+ "icon": {
27
27
  "format": "webp",
28
28
  "size": {
29
29
  "width": 140,
@@ -32,19 +32,19 @@ const defaultItems = [
32
32
 
33
33
  const cards: GalleryCardProps[] = [
34
34
  {
35
- image,
35
+ icon: image,
36
36
  title: 'Вклады в любой валюте',
37
37
  description: 'О Вклады до 1,4 млн застрахованы в государственной системе страхования вкладов',
38
38
  button: link,
39
39
  },
40
40
  {
41
- image,
41
+ icon: image,
42
42
  title: 'Вклады в любой валюте',
43
43
  description: 'О Вклады до 1,4 млн застрахованы в государственной системе страхования вкладов',
44
44
  version: 'secondary',
45
45
  },
46
46
  {
47
- image,
47
+ icon: image,
48
48
  title: 'Вклады в любой валюте',
49
49
  isDotted,
50
50
  items: defaultItems,