@redneckz/wildless-cms-uni-blocks 0.3.5 → 0.3.8

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 (251) hide show
  1. package/bundle/bundle.umd.js +54 -32
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/components/BaseTile/BaseTile.js +1 -1
  4. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  5. package/dist/components/Blocks.d.ts +0 -1
  6. package/dist/components/Blocks.js +0 -2
  7. package/dist/components/Blocks.js.map +1 -1
  8. package/dist/components/Blocks.mobile.d.ts +1 -1
  9. package/dist/components/Blocks.mobile.js +2 -2
  10. package/dist/components/Blocks.mobile.js.map +1 -1
  11. package/dist/components/ContentPage/ContentPageHead.js +13 -4
  12. package/dist/components/ContentPage/ContentPageHead.js.map +1 -1
  13. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  14. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  15. package/dist/components/Gallery/GalleryCardInner.js +15 -5
  16. package/dist/components/Gallery/GalleryCardInner.js.map +1 -1
  17. package/dist/components/Header/Header.mobile.js +1 -1
  18. package/dist/components/Header/Header.mobile.js.map +1 -1
  19. package/dist/components/Header/HeaderBurger.js +1 -1
  20. package/dist/components/Header/HeaderBurger.js.map +1 -1
  21. package/dist/components/Header/HeaderTop.js +1 -1
  22. package/dist/components/Header/HeaderTop.js.map +1 -1
  23. package/dist/components/LinkDocs/LinkDocsListItem.js +1 -1
  24. package/dist/components/LinkDocs/LinkDocsListItem.js.map +1 -1
  25. package/dist/components/LinkDocs/LinkDocsListItem.mobile.js +1 -1
  26. package/dist/components/LinkDocs/LinkDocsListItem.mobile.js.map +1 -1
  27. package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
  28. package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  29. package/dist/components/ProductBlock/ProductBlockInner.mobile.js +4 -1
  30. package/dist/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
  31. package/dist/components/ProductBlock/renderBenefit.mobile.js +1 -1
  32. package/dist/components/ProductBlock/renderBenefit.mobile.js.map +1 -1
  33. package/dist/components/ProductGallery/ProductGallery.mobile.js +3 -14
  34. package/dist/components/ProductGallery/ProductGallery.mobile.js.map +1 -1
  35. package/dist/components/ProductGallery/ProductGalleryBlock.mobile.js +1 -1
  36. package/dist/components/StepsBlock/StepsBlock.mobile.js +2 -2
  37. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  38. package/dist/components/Tile/Tile.js +5 -1
  39. package/dist/components/Tile/Tile.js.map +1 -1
  40. package/dist/types.d.ts +10 -5
  41. package/dist/ui-kit/BlockItem/BlockItem.js +3 -3
  42. package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
  43. package/dist/ui-kit/Description/Description.js +1 -1
  44. package/dist/ui-kit/Heading/Heading.js +1 -1
  45. package/dist/ui-kit/Heading/Heading.js.map +1 -1
  46. package/dist/ui-kit/Heading/Heading.mobile.js +1 -1
  47. package/dist/ui-kit/Heading/Heading.mobile.js.map +1 -1
  48. package/dist/ui-kit/List/ListItem.js +2 -2
  49. package/dist/ui-kit/List/ListItem.js.map +1 -1
  50. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  51. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  52. package/dist/ui-kit/SwipeListControl/SwipeListControlItem.js +1 -1
  53. package/dist/ui-kit/SwipeListControl/SwipeListControlItem.js.map +1 -1
  54. package/lib/common.css +1 -1
  55. package/lib/components/BaseTile/BaseTile.js +1 -1
  56. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  57. package/lib/components/Blocks.d.ts +0 -1
  58. package/lib/components/Blocks.js +0 -2
  59. package/lib/components/Blocks.js.map +1 -1
  60. package/lib/components/Blocks.mobile.d.ts +1 -1
  61. package/lib/components/Blocks.mobile.js +2 -2
  62. package/lib/components/Blocks.mobile.js.map +1 -1
  63. package/lib/components/ContentPage/ContentPageHead.js +13 -4
  64. package/lib/components/ContentPage/ContentPageHead.js.map +1 -1
  65. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  66. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  67. package/lib/components/Gallery/GalleryCardInner.js +15 -5
  68. package/lib/components/Gallery/GalleryCardInner.js.map +1 -1
  69. package/lib/components/Header/Header.mobile.js +1 -1
  70. package/lib/components/Header/Header.mobile.js.map +1 -1
  71. package/lib/components/Header/HeaderBurger.js +1 -1
  72. package/lib/components/Header/HeaderBurger.js.map +1 -1
  73. package/lib/components/Header/HeaderTop.js +1 -1
  74. package/lib/components/Header/HeaderTop.js.map +1 -1
  75. package/lib/components/LinkDocs/LinkDocsListItem.js +1 -1
  76. package/lib/components/LinkDocs/LinkDocsListItem.js.map +1 -1
  77. package/lib/components/LinkDocs/LinkDocsListItem.mobile.js +1 -1
  78. package/lib/components/LinkDocs/LinkDocsListItem.mobile.js.map +1 -1
  79. package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
  80. package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  81. package/lib/components/ProductBlock/ProductBlockInner.mobile.js +4 -1
  82. package/lib/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
  83. package/lib/components/ProductBlock/renderBenefit.mobile.js +1 -1
  84. package/lib/components/ProductBlock/renderBenefit.mobile.js.map +1 -1
  85. package/lib/components/ProductGallery/ProductGallery.fixture.mobile.d.ts +1 -0
  86. package/lib/components/ProductGallery/ProductGallery.mobile.js +4 -15
  87. package/lib/components/ProductGallery/ProductGallery.mobile.js.map +1 -1
  88. package/lib/components/ProductGallery/ProductGalleryBlock.mobile.js +1 -1
  89. package/lib/components/StepsBlock/StepsBlock.mobile.js +2 -2
  90. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  91. package/lib/components/Tile/Tile.js +5 -1
  92. package/lib/components/Tile/Tile.js.map +1 -1
  93. package/lib/types.d.ts +10 -5
  94. package/lib/ui-kit/BlockItem/BlockItem.js +3 -3
  95. package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
  96. package/lib/ui-kit/Description/Description.js +1 -1
  97. package/lib/ui-kit/Heading/Heading.js +1 -1
  98. package/lib/ui-kit/Heading/Heading.js.map +1 -1
  99. package/lib/ui-kit/Heading/Heading.mobile.js +1 -1
  100. package/lib/ui-kit/Heading/Heading.mobile.js.map +1 -1
  101. package/lib/ui-kit/List/ListItem.js +2 -2
  102. package/lib/ui-kit/List/ListItem.js.map +1 -1
  103. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  104. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  105. package/lib/ui-kit/SwipeListControl/SwipeListControlItem.js +1 -1
  106. package/lib/ui-kit/SwipeListControl/SwipeListControlItem.js.map +1 -1
  107. package/mobile/bundle/bundle.umd.js +73 -59
  108. package/mobile/bundle/bundle.umd.min.js +1 -1
  109. package/mobile/dist/components/BaseTile/BaseTile.js +1 -1
  110. package/mobile/dist/components/BaseTile/BaseTile.js.map +1 -1
  111. package/mobile/dist/components/Blocks.d.ts +1 -1
  112. package/mobile/dist/components/Blocks.js +2 -2
  113. package/mobile/dist/components/Blocks.js.map +1 -1
  114. package/mobile/dist/components/ContentPage/ContentPageHead.js +13 -4
  115. package/mobile/dist/components/ContentPage/ContentPageHead.js.map +1 -1
  116. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  117. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  118. package/mobile/dist/components/Gallery/GalleryCardInner.js +15 -5
  119. package/mobile/dist/components/Gallery/GalleryCardInner.js.map +1 -1
  120. package/mobile/dist/components/Header/Header.js +1 -1
  121. package/mobile/dist/components/Header/Header.js.map +1 -1
  122. package/mobile/dist/components/Header/HeaderBurger.js +1 -1
  123. package/mobile/dist/components/Header/HeaderBurger.js.map +1 -1
  124. package/mobile/dist/components/Header/HeaderTop.js +1 -1
  125. package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
  126. package/mobile/dist/components/LinkDocs/LinkDocsListItem.js +1 -1
  127. package/mobile/dist/components/LinkDocs/LinkDocsListItem.js.map +1 -1
  128. package/mobile/dist/components/ProductBlock/ProductBlockInner.js +4 -1
  129. package/mobile/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  130. package/mobile/dist/components/ProductBlock/renderBenefit.js +1 -1
  131. package/mobile/dist/components/ProductBlock/renderBenefit.js.map +1 -1
  132. package/mobile/dist/components/ProductGallery/ProductGallery.js +3 -14
  133. package/mobile/dist/components/ProductGallery/ProductGallery.js.map +1 -1
  134. package/mobile/dist/components/ProductGallery/ProductGalleryBlock.js +1 -1
  135. package/mobile/dist/components/StepsBlock/StepsBlock.js +2 -2
  136. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  137. package/mobile/dist/components/Tile/Tile.js +5 -1
  138. package/mobile/dist/components/Tile/Tile.js.map +1 -1
  139. package/mobile/dist/types.d.ts +10 -5
  140. package/mobile/dist/ui-kit/BlockItem/BlockItem.js +3 -3
  141. package/mobile/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
  142. package/mobile/dist/ui-kit/Description/Description.js +1 -1
  143. package/mobile/dist/ui-kit/Heading/Heading.js +1 -1
  144. package/mobile/dist/ui-kit/Heading/Heading.js.map +1 -1
  145. package/mobile/dist/ui-kit/List/ListItem.js +2 -2
  146. package/mobile/dist/ui-kit/List/ListItem.js.map +1 -1
  147. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  148. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  149. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlItem.js +1 -1
  150. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlItem.js.map +1 -1
  151. package/mobile/lib/components/BaseTile/BaseTile.js +1 -1
  152. package/mobile/lib/components/BaseTile/BaseTile.js.map +1 -1
  153. package/mobile/lib/components/Blocks.d.ts +1 -1
  154. package/mobile/lib/components/Blocks.js +2 -2
  155. package/mobile/lib/components/Blocks.js.map +1 -1
  156. package/mobile/lib/components/ContentPage/ContentPageHead.js +13 -4
  157. package/mobile/lib/components/ContentPage/ContentPageHead.js.map +1 -1
  158. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  159. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  160. package/mobile/lib/components/Gallery/GalleryCardInner.js +15 -5
  161. package/mobile/lib/components/Gallery/GalleryCardInner.js.map +1 -1
  162. package/mobile/lib/components/Header/Header.js +1 -1
  163. package/mobile/lib/components/Header/Header.js.map +1 -1
  164. package/mobile/lib/components/Header/HeaderBurger.js +1 -1
  165. package/mobile/lib/components/Header/HeaderBurger.js.map +1 -1
  166. package/mobile/lib/components/Header/HeaderTop.js +1 -1
  167. package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
  168. package/mobile/lib/components/LinkDocs/LinkDocsListItem.js +1 -1
  169. package/mobile/lib/components/LinkDocs/LinkDocsListItem.js.map +1 -1
  170. package/mobile/lib/components/ProductBlock/ProductBlockInner.js +4 -1
  171. package/mobile/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  172. package/mobile/lib/components/ProductBlock/renderBenefit.js +1 -1
  173. package/mobile/lib/components/ProductBlock/renderBenefit.js.map +1 -1
  174. package/mobile/lib/components/ProductGallery/ProductGallery.js +4 -15
  175. package/mobile/lib/components/ProductGallery/ProductGallery.js.map +1 -1
  176. package/mobile/lib/components/ProductGallery/ProductGalleryBlock.js +1 -1
  177. package/mobile/lib/components/StepsBlock/StepsBlock.js +2 -2
  178. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  179. package/mobile/lib/components/Tile/Tile.js +5 -1
  180. package/mobile/lib/components/Tile/Tile.js.map +1 -1
  181. package/mobile/lib/types.d.ts +10 -5
  182. package/mobile/lib/ui-kit/BlockItem/BlockItem.js +3 -3
  183. package/mobile/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
  184. package/mobile/lib/ui-kit/Description/Description.js +1 -1
  185. package/mobile/lib/ui-kit/Heading/Heading.js +1 -1
  186. package/mobile/lib/ui-kit/Heading/Heading.js.map +1 -1
  187. package/mobile/lib/ui-kit/List/ListItem.js +2 -2
  188. package/mobile/lib/ui-kit/List/ListItem.js.map +1 -1
  189. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  190. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  191. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlItem.js +1 -1
  192. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlItem.js.map +1 -1
  193. package/mobile/src/components/BaseTile/BaseTile.tsx +2 -2
  194. package/mobile/src/components/Blocks.ts +2 -2
  195. package/mobile/src/components/ContentPage/ContentPage.page.json +17 -4
  196. package/mobile/src/components/ContentPage/ContentPageHead.tsx +22 -6
  197. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +1 -1
  198. package/mobile/src/components/Gallery/GalleryCardInner.tsx +23 -15
  199. package/mobile/src/components/Header/Header.tsx +1 -1
  200. package/mobile/src/components/Header/HeaderBurger.tsx +2 -2
  201. package/mobile/src/components/Header/HeaderTop.tsx +6 -2
  202. package/mobile/src/components/LinkDocs/LinkDocsListItem.tsx +1 -1
  203. package/mobile/src/components/ProductBlock/ProductBlock.example.json +2 -1
  204. package/mobile/src/components/ProductBlock/ProductBlockInner.tsx +17 -11
  205. package/mobile/src/components/ProductBlock/renderBenefit.tsx +2 -2
  206. package/mobile/src/components/ProductGallery/ProductGallery.tsx +12 -49
  207. package/mobile/src/components/ProductGallery/ProductGalleryBlock.tsx +1 -1
  208. package/mobile/src/components/StepsBlock/StepsBlock.tsx +2 -2
  209. package/mobile/src/components/Tile/Tile.tsx +7 -4
  210. package/mobile/src/types.ts +10 -5
  211. package/mobile/src/ui-kit/BlockItem/BlockItem.tsx +4 -4
  212. package/mobile/src/ui-kit/Description/Description.tsx +1 -1
  213. package/mobile/src/ui-kit/Heading/Heading.tsx +1 -1
  214. package/mobile/src/ui-kit/List/ListItem.tsx +3 -3
  215. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
  216. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlItem.tsx +5 -1
  217. package/package.json +1 -1
  218. package/src/components/BaseTile/BaseTile.tsx +2 -2
  219. package/src/components/Blocks.mobile.ts +2 -2
  220. package/src/components/Blocks.ts +0 -2
  221. package/src/components/ComparisonTable/ComparisonTable.fixture.tsx +0 -1
  222. package/src/components/ContentPage/ContentPage.page.json +17 -4
  223. package/src/components/ContentPage/ContentPageHead.tsx +22 -6
  224. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +1 -1
  225. package/src/components/Gallery/Gallery.fixture.mobile.tsx +1 -1
  226. package/src/components/Gallery/GalleryCardInner.tsx +23 -15
  227. package/src/components/Header/Header.mobile.tsx +1 -1
  228. package/src/components/Header/HeaderBurger.tsx +2 -2
  229. package/src/components/Header/HeaderTop.tsx +6 -2
  230. package/src/components/LinkDocs/LinkDocsListItem.mobile.tsx +1 -1
  231. package/src/components/LinkDocs/LinkDocsListItem.tsx +1 -1
  232. package/src/components/ProductBlock/ProductBlock.example.json +2 -1
  233. package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +2 -2
  234. package/src/components/ProductBlock/ProductBlockInner.mobile.tsx +17 -11
  235. package/src/components/ProductBlock/ProductBlockInner.tsx +2 -2
  236. package/src/components/ProductBlock/renderBenefit.mobile.tsx +2 -2
  237. package/src/components/ProductGallery/ProductGallery.fixture.mobile.tsx +98 -0
  238. package/src/components/ProductGallery/ProductGallery.fixture.tsx +2 -2
  239. package/src/components/ProductGallery/ProductGallery.mobile.tsx +12 -49
  240. package/src/components/ProductGallery/ProductGalleryBlock.mobile.tsx +1 -1
  241. package/src/components/StepsBlock/StepsBlock.mobile.tsx +2 -2
  242. package/src/components/Tile/Tile.tsx +7 -4
  243. package/src/types.ts +10 -5
  244. package/src/ui-kit/BlockItem/BlockItem.tsx +4 -4
  245. package/src/ui-kit/Description/Description.tsx +1 -1
  246. package/src/ui-kit/Heading/Heading.fixture.mobile.tsx +0 -1
  247. package/src/ui-kit/Heading/Heading.mobile.tsx +1 -1
  248. package/src/ui-kit/Heading/Heading.tsx +3 -1
  249. package/src/ui-kit/List/ListItem.tsx +3 -3
  250. package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
  251. package/src/ui-kit/SwipeListControl/SwipeListControlItem.tsx +5 -1
@@ -1,58 +1,21 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { UniBlockProps } from '../../types';
3
- import { ProductGalleryBlock } from './ProductGalleryBlock';
4
3
  import type { ProductGalleryContent } from './ProductGalleryContent';
4
+ import { SwipeListControl } from '../../ui-kit/SwipeListControl/SwipeListControl';
5
+ import { ProductGalleryBlock } from './ProductGalleryBlock';
5
6
 
6
7
  export interface ProductGalleryProps extends ProductGalleryContent, UniBlockProps {}
7
8
 
8
- export const ProductGallery = JSX<ProductGalleryProps>(
9
- ({ className, context, duration = 0, slides = [] }) => {
10
- const galleryBlocks = slides.map((s) => s.productBlock);
11
- const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
12
-
13
- return (
14
- <section className={`font-sans bg-white overflow-hidden w-100 ${className || ''}`}>
15
- <div
16
- className={`flex duration-1000`}
17
- style={{ transform: `translateX(-${activeSlideIndex}00%)` }}
18
- role="list"
19
- >
20
- {galleryBlocks.map((block, i) => (
21
- <ProductGalleryBlock key={String(i)} block={block} context={context} />
22
- ))}
23
- </div>
24
-
25
- <div className="flex px-4 py-6">
26
- {slides.map((_, i) =>
27
- renderNavButton({
28
- slide: _.productBlock,
29
- i,
30
- activeSlideIndex,
31
- onClick: () => setActiveSlideIndex(i),
32
- duration,
33
- }),
34
- )}
35
- </div>
36
- </section>
37
- );
38
- },
39
- );
9
+ export const ProductGallery = JSX<ProductGalleryProps>(({ className, context, slides = [] }) => {
10
+ const galleryBlocks = slides.map((s) => s.productBlock);
40
11
 
41
- function renderNavButton({ slide, i, activeSlideIndex, onClick, duration }) {
42
- const isActiveBtn = i === activeSlideIndex;
43
- const progressBarClassName = isActiveBtn ? 'animate-slide bg-primary-main' : 'bg-main-divider';
44
12
  return (
45
- <button
46
- type="button"
47
- key={String(i)}
48
- onClick={onClick}
49
- aria-label={slide?.title}
50
- className={`relative overflow-hidden border-0 bg-inherit cursor-pointer pl-0 mr-1.5 pt-4 pb-5 last:mr-0 grow basis-0`}
51
- >
52
- <div
53
- className={`absolute bottom-0 left-0 w-full h-[3px] ${progressBarClassName}`}
54
- style={{ animationDuration: `${duration}s`, animationFillMode: 'forwards' }}
55
- ></div>
56
- </button>
13
+ <section className={`font-sans bg-white overflow-hidden w-100 pb-6 ${className || ''}`}>
14
+ <SwipeListControl context={context}>
15
+ {galleryBlocks.map((block, i) => (
16
+ <ProductGalleryBlock key={String(i)} block={block} context={context} />
17
+ ))}
18
+ </SwipeListControl>
19
+ </section>
57
20
  );
58
- }
21
+ });
@@ -12,7 +12,7 @@ export interface ProductGalleryBlockProps extends UniBlockProps {
12
12
  export const ProductGalleryBlock = JSX<ProductGalleryBlockProps>(
13
13
  ({ block, headingType, context }) => {
14
14
  return (
15
- <section className="flex grow-0 shrink-0 basis-full px-4 py-6" role="listitem">
15
+ <section className="flex grow-0 shrink-0 basis-full px-4 pt-6" role="listitem">
16
16
  <div className="flex grow">
17
17
  <ProductBlockInner context={context} headingType={headingType || 'h2'} {...block} />
18
18
  </div>
@@ -49,7 +49,7 @@ const renderStepTitle = (params: RenderStepTitleParams) => {
49
49
  {renderIconArea(step, size, i)}
50
50
  {!isLastStep && <div className={`min-h-8 h-full w-[2px] bg-secondary-light ${margin}`} />}
51
51
  </div>
52
- <div className="flex flex-col justify-center relative">
52
+ <div className="flex flex-col justify-start relative">
53
53
  {step.label && (
54
54
  <div className="font-medium text-m-title-xs m-0 text-left">{step.label}</div>
55
55
  )}
@@ -82,7 +82,7 @@ const renderIconArea = (step: Step, size: SizeVersion, i: number) => {
82
82
  className={`${iconAreaSize} bg-secondary-light rounded-full z-10 mr-3 flex justify-center content-center`}
83
83
  >
84
84
  <span className={`font-medium text-secondary-text self-center ${iconTextSize}`}>
85
- {(step.icon && <Icon name={step.icon} width={iconSize} height={iconSize} asSVG />) || i + 1}
85
+ {(step.icon && <Icon name={step.icon} width={iconSize} height={iconSize} />) || i + 1}
86
86
  </span>
87
87
  </div>
88
88
  );
@@ -49,9 +49,8 @@ export const Tile = JSX<TileProps>((props) => {
49
49
  <Heading
50
50
  headingType={getTileHeadingType(className)}
51
51
  title={title}
52
- className={`whitespace-pre-wrap max-w-[600px] ${
53
- version === 'primary' ? 'text-primary-text' : ''
54
- }`}
52
+ className={`whitespace-pre-wrap max-w-[600px] ${title ? 'mb-3' : ''}
53
+ ${version === 'primary' ? 'text-primary-text' : ''}`}
55
54
  />
56
55
  )
57
56
  }
@@ -64,8 +63,12 @@ export const Tile = JSX<TileProps>((props) => {
64
63
  >
65
64
  {description && <Description className="mt-4 max-w-[600px]" description={description} />}
66
65
  {children}
67
- {items?.length ? <List items={items} /> : null}
66
+ {renderList(items, version)}
68
67
  </BaseTile>
69
68
  </section>
70
69
  );
71
70
  });
71
+
72
+ function renderList(items, version) {
73
+ return items?.length ? <List items={items} version={version} /> : null;
74
+ }
@@ -26,12 +26,17 @@ export interface SlotsMap {
26
26
  }
27
27
 
28
28
  export interface ContentPageMeta {
29
- title: string;
30
- slug: string;
31
- description?: string;
32
- keywords?: string[];
33
- robots?: string[];
29
+ title?: string;
30
+ slug?: string;
31
+ main?: {
32
+ description?: string;
33
+ keywords?: string[];
34
+ canonical?: string;
35
+ robots?: string[];
36
+ };
34
37
  og?: Record<string, string>;
38
+ twitter?: Record<string, string>;
39
+ jsonLd?: string;
35
40
  }
36
41
 
37
42
  export interface ContentPageDef extends ContentPageMeta {
@@ -1,10 +1,10 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { BlockItemProps, BlockItemVersion } from './BlockItemProps';
3
3
 
4
- const LIST_STYLE_CLASSES = 'rounded-full inline-block mr-3';
4
+ const LIST_STYLE_CLASSES = 'rounded-full inline-block mr-3 mt-2';
5
5
 
6
6
  const TEXT_STYLE_MAP: Record<BlockItemVersion, string> = {
7
- primary: 'text-primary-text',
7
+ primary: 'text-secondary-text',
8
8
  secondary: 'text-white',
9
9
  gray: 'text-secondary-text',
10
10
  };
@@ -18,8 +18,8 @@ const LIST_STYLE_MAP: Record<BlockItemVersion, string> = {
18
18
  export const BlockItem = JSX<BlockItemProps>(
19
19
  ({ className = '', isDotted = true, text, children, version = 'primary' }) => {
20
20
  return (
21
- <div className={`font-sans flex items-center ${className}`} role="listitem">
22
- {isDotted && <div className={getListStyle(version)} />}
21
+ <div className={`font-sans flex items-start ${className}`} role="listitem">
22
+ {isDotted && <div className={getListStyle(version)} />}!!!!!
23
23
  <span className={TEXT_STYLE_MAP[version]}>{text || children}</span>
24
24
  </div>
25
25
  );
@@ -8,5 +8,5 @@ export interface DescriptionProps extends DescriptionContent {
8
8
  export const Description = JSX<DescriptionProps>((props) => {
9
9
  const { className, description } = props;
10
10
 
11
- return <div className={`font-normal text-base ${className || ''}`}>{description}</div>;
11
+ return <div className={`font-normal text-m-md ${className || ''}`}>{description}</div>;
12
12
  });
@@ -22,7 +22,7 @@ export const Heading = JSX<HeadingProps>((props) => {
22
22
  const Tag = headingType;
23
23
 
24
24
  return (
25
- <Tag className={`font-sans font-medium ${HeadingClass[headingType]} ${className || ''}`}>
25
+ <Tag className={`font-sans font-medium m-0 ${HeadingClass[headingType]} ${className || ''}`}>
26
26
  {title}
27
27
  </Tag>
28
28
  );
@@ -11,7 +11,7 @@ export interface ListItemProps {
11
11
  isDotted?: boolean;
12
12
  }
13
13
 
14
- const LIST_STYLE_CLASSES = 'rounded-full inline-block mr-3';
14
+ const LIST_STYLE_CLASSES = 'rounded-full inline-block mr-3 mt-2';
15
15
 
16
16
  const TEXT_STYLE_MAP: Record<ListItemVersion, string> = {
17
17
  primary: 'text-primary-text',
@@ -28,9 +28,9 @@ const LIST_STYLE_MAP: Record<ListItemVersion, string> = {
28
28
  export const ListItem = JSX<ListItemProps>(
29
29
  ({ className = '', isDotted = true, children, version = 'primary' }) => {
30
30
  return (
31
- <div className={`font-sans flex items-center ${className}`} role="listitem">
31
+ <div className={`font-sans flex items-start ${className}`} role="listitem">
32
32
  {isDotted && <div className={getListStyle(version)} />}
33
- <span className={TEXT_STYLE_MAP[version]}>{children}</span>
33
+ <span className={`text-m-md ${TEXT_STYLE_MAP[version]}`}>{children}</span>
34
34
  </div>
35
35
  );
36
36
  },
@@ -15,7 +15,7 @@ export interface SwipeListControlDotsProps {
15
15
  export const SwipeListControlDots = JSX<SwipeListControlDotsProps>(
16
16
  ({ children, activeIndex, indexFraction, showDots }) => {
17
17
  return showDots && children?.length ? (
18
- <div className="flex gap-2 mx-auto mt-[22px] w-fit">
18
+ <div className="flex gap-2 mx-auto mt-5 w-fit">
19
19
  {children?.map((_, idx) => (
20
20
  <div
21
21
  key={String(idx)}
@@ -12,7 +12,11 @@ export interface SwipeListControlItemProps {
12
12
  export const SwipeListControlItem = JSX<SwipeListControlItemProps>(
13
13
  ({ className = '', children, ...rest }) => {
14
14
  return (
15
- <div className={`snap-center snap-always min-w-full ${className}`} role="listitem" {...rest}>
15
+ <div
16
+ className={`snap-center snap-always min-w-full box-border ${className}`}
17
+ role="listitem"
18
+ {...rest}
19
+ >
16
20
  {children}
17
21
  </div>
18
22
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.3.5",
3
+ "version": "0.3.8",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -9,8 +9,8 @@ export const BaseTile = JSX<BaseTileProps>(
9
9
  return (
10
10
  <div className={`font-sans flex flex-col grow h-full items-start ${className}`}>
11
11
  {title}
12
- <div className={`flex grow w-full justify-between`}>
13
- <div className={`flex flex-col justify-between`}>
12
+ <div className="flex grow w-full justify-between">
13
+ <div className="flex flex-col justify-between w-full">
14
14
  <div>{children}</div>
15
15
  <div>{buttons}</div>
16
16
  </div>
@@ -1,11 +1,11 @@
1
1
  import { Accordion } from './Accordion/Accordion';
2
2
  import { ExchangeRateTile } from './ExchangeRateTile/ExchangeRateTile';
3
3
  import { Footer } from './Footer/Footer';
4
+ import { Gallery } from './Gallery/Gallery';
4
5
  import { Header } from './Header/Header';
5
6
  import { Headline } from './Headline/Headline';
6
7
  import { LinkDocs } from './LinkDocs/LinkDocs';
7
8
  import { MobileAppTile } from './MobileAppTile/MobileAppTile';
8
- import { Placeholder } from './Placeholder/Placeholder';
9
9
  import { ProductBlock } from './ProductBlock/ProductBlock';
10
10
  import { ProductGallery } from './ProductGallery/ProductGallery';
11
11
  import { StepsBlock } from './StepsBlock/StepsBlock';
@@ -15,11 +15,11 @@ export const Blocks = {
15
15
  Accordion,
16
16
  ExchangeRateTile,
17
17
  Footer,
18
+ Gallery,
18
19
  Header,
19
20
  Headline,
20
21
  LinkDocs,
21
22
  MobileAppTile,
22
- Placeholder,
23
23
  ProductBlock,
24
24
  ProductGallery,
25
25
  StepsBlock,
@@ -12,7 +12,6 @@ import { MiniGallery } from './MiniGallery/MiniGallery';
12
12
  import { MobileAppTile } from './MobileAppTile/MobileAppTile';
13
13
  import { Navigation } from './Navigation/Navigation';
14
14
  import { PictureText } from './PictureText/PictureText';
15
- import { Placeholder } from './Placeholder/Placeholder';
16
15
  import { ProductBlock } from './ProductBlock/ProductBlock';
17
16
  import { ProductGallery } from './ProductGallery/ProductGallery';
18
17
  import { ProductTile } from './ProductTile/ProductTile';
@@ -36,7 +35,6 @@ export const Blocks = {
36
35
  MiniGallery,
37
36
  MobileAppTile,
38
37
  PictureText,
39
- Placeholder,
40
38
  ProductBlock,
41
39
  ProductGallery,
42
40
  ProductTile,
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import type { Picture } from '../../model/Picture';
3
2
  import { context } from '../../setup-fixture';
4
3
  import { ComparisonTable } from './ComparisonTable';
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "title": "Кредиты",
3
3
  "slug": "credits",
4
- "description": "Акционерное общество «Российский Сельскохозяйственный банк»* — один из крупнейших банков в России. Созданный в 2000 году в целях развития национальной кредитно-финансовой системы.",
5
- "keywords": ["кредит", "акция"],
6
- "robots": ["index", "follow"],
4
+ "main": {
5
+ "description": "Акционерное общество «Российский Сельскохозяйственный банк»* — один из крупнейших банков в России. Созданный в 2000 году в целях развития национальной кредитно-финансовой системы.",
6
+ "keywords": ["кредит", "акция"],
7
+ "canonical": "canonical url",
8
+ "robots": ["index", "follow"]
9
+ },
7
10
  "og": {
8
11
  "type": "article",
9
12
  "url": "https://foo.com/bar/baz"
10
13
  },
14
+ "twitter": {
15
+ "card": "summary_large_image"
16
+ },
17
+ "jsonLd": "json",
11
18
  "date": "2022-04-08",
12
19
  "style": ["bg-secondary-light"],
13
20
  "likeControl": true,
@@ -121,7 +128,13 @@
121
128
  "size": {
122
129
  "width": 280,
123
130
  "height": 280
124
- }
131
+ },
132
+ "sources": [
133
+ {
134
+ "src": "money-2.png 1x, money-2-2x.png 2x",
135
+ "format": "png"
136
+ }
137
+ ]
125
138
  }
126
139
  }
127
140
  },
@@ -7,7 +7,8 @@ export interface ContentPageHeadProps {
7
7
  }
8
8
 
9
9
  export const ContentPageHead = JSX<ContentPageHeadProps>(({ HeadComponent, data, children }) => {
10
- const { title, description, keywords, robots, og } = data;
10
+ const { title, main, og, twitter, jsonLd } = data;
11
+ const { description, keywords, canonical, robots } = main || {};
11
12
  return (
12
13
  <HeadComponent>
13
14
  <title>{title}</title>
@@ -15,12 +16,27 @@ export const ContentPageHead = JSX<ContentPageHeadProps>(({ HeadComponent, data,
15
16
  {description && <meta name="description" content={description} />}
16
17
  {keywords && <meta name="keywords" content={keywords.join(',')} />}
17
18
  {robots && <meta name="robots" content={robots.join(',')} />}
18
- {og
19
- ? Object.entries(og).map(([key, value]) => (
20
- <meta key={key} name={`og:${key}`} content={value} />
21
- ))
22
- : null}
19
+ {renderOpenGraph(og)}
20
+ {renderTwitter(twitter)}
21
+ {canonical && <link rel="canonical" href={canonical} />}
22
+ {jsonLd && <script type="application/ld+json">{jsonLd}</script>}
23
23
  {children}
24
24
  </HeadComponent>
25
25
  );
26
26
  });
27
+
28
+ function renderOpenGraph(og: Record<string, string> | undefined) {
29
+ return og
30
+ ? Object.entries(og).map(([key, value]) => (
31
+ <meta key={key} name={`og:${key}`} content={value} />
32
+ ))
33
+ : null;
34
+ }
35
+
36
+ function renderTwitter(twitter: Record<string, string> | undefined) {
37
+ return twitter
38
+ ? Object.entries(twitter).map(([key, value]) => (
39
+ <meta key={key} name={`twitter:${key}`} content={value} />
40
+ ))
41
+ : null;
42
+ }
@@ -44,7 +44,7 @@ export const ExchangeRateTile = JSX<ExchangeRateTileProps>(
44
44
  <Heading
45
45
  headingType={getTileHeadingType(className)}
46
46
  title={title}
47
- className={`whitespace-pre-wrap max-w-[600px]`}
47
+ className={`whitespace-pre-wrap max-w-[600px] ${title ? 'mb-3' : ''}`}
48
48
  />
49
49
  )
50
50
  }
@@ -48,7 +48,7 @@ const cards = [
48
48
  {
49
49
  image,
50
50
  title: 'Вклады в любой валюте',
51
- itemsMobile: defaultItems,
51
+ items: defaultItems,
52
52
  },
53
53
  {
54
54
  title: 'Вклады в любой валюте',
@@ -3,10 +3,11 @@ import type { BlockVersion } from '../../model/BlockVersion';
3
3
  import { BlockItem } from '../../ui-kit/BlockItem/BlockItem';
4
4
  import { Button } from '../../ui-kit/Button/Button';
5
5
  import { Img } from '../../ui-kit/Img/Img';
6
- import type { GalleryCard, GalleryItem } from './GalleryContent';
6
+ import type { GalleryCard } from './GalleryContent';
7
7
 
8
8
  export const GalleryCardInner = JSX<GalleryCard>(
9
9
  ({ title, description, image, items, button, version }) => {
10
+ const titleStyleClasses = getTitleStyle(version, description, items);
10
11
  return (
11
12
  <div>
12
13
  <div>
@@ -15,15 +16,11 @@ export const GalleryCardInner = JSX<GalleryCard>(
15
16
  <Img className="mb-6" image={image} />
16
17
  </div>
17
18
  ) : null}
18
- {title && renderCardTitle(title, description, items)}
19
- {description ? <div className={`font-normal text-sm mt-2`}>{description}</div> : null}
20
- {items?.length ? (
21
- <section className={`max-w-[308px] mt-2`} role="list">
22
- {items
23
- .filter((item) => item?.text)
24
- .map((item, i) => renderItem(item.text as string, i, version))}
25
- </section>
19
+ {title ? renderCardTitle(title, titleStyleClasses) : null}
20
+ {description ? (
21
+ <div className={`font-normal text-sm ${title ? 'mt-2' : ''}`}>{description}</div>
26
22
  ) : null}
23
+ {items?.length ? renderItems(items, version) : null}
27
24
  </div>
28
25
  {button?.text && <Button className="mt-6" {...button} />}
29
26
  </div>
@@ -31,13 +28,17 @@ export const GalleryCardInner = JSX<GalleryCard>(
31
28
  },
32
29
  );
33
30
 
34
- function renderCardTitle(title: string, description?: string, items?: GalleryItem[]) {
31
+ function renderCardTitle(title: string, className: string) {
32
+ return <div className={`font-medium text-xl m-0 ${className}`}>{title}</div>;
33
+ }
34
+
35
+ function renderItems(items, version) {
35
36
  return (
36
- <div
37
- className={`font-medium text-xl m-0 ${!description && !items?.length ? 'text-center' : ''}`}
38
- >
39
- {title}
40
- </div>
37
+ <section className={`max-w-[308px] mt-2`} role="list">
38
+ {items
39
+ .filter((item) => item?.text)
40
+ .map((item, i) => renderItem(item.text as string, i, version))}
41
+ </section>
41
42
  );
42
43
  }
43
44
 
@@ -48,3 +49,10 @@ function renderItem(item: string, i: number, version?: BlockVersion) {
48
49
  </BlockItem>
49
50
  );
50
51
  }
52
+
53
+ function getTitleStyle(version, description, items) {
54
+ return `font-medium text-xl m-0
55
+ ${version !== 'secondary' ? 'text-primary-text' : ''}
56
+ ${!description && !items?.length ? 'text-center' : ''}
57
+ `;
58
+ }
@@ -32,7 +32,7 @@ export const Header = JSX<HeaderProps>(
32
32
 
33
33
  return (
34
34
  <header className={`${bgColor} ${className}`}>
35
- <div className="container px-4 py-0">
35
+ <div className="container px-4 py-0 box-border">
36
36
  <HeaderTop onClick={toggleBurgerMenu} bgColor={bgColor} />
37
37
  <nav className="flex items-center m-0 p-0 overflow-y-hidden w-full h-[50px]">
38
38
  <div className="flex">
@@ -18,8 +18,8 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
18
18
  const [city, getCity] = context.useGeolocation(defaultLocation);
19
19
 
20
20
  return (
21
- <div className="absolute top-0 left-0 w-full h-full bg-white p-4">
22
- <button className="absolute top-4 right-4" onClick={onClick}>
21
+ <div className="absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20">
22
+ <button className="absolute top-4 right-4 border-none bg-transparent" onClick={onClick}>
23
23
  <Icon name="CloseIcon" width="24" height="24" asSVG />
24
24
  </button>
25
25
  <Button onClick={getCity} className="flex items-center text-sm text-secondary-text mb-4">
@@ -11,7 +11,7 @@ export interface HeaderTopProps {
11
11
  export const HeaderTop = JSX<HeaderTopProps>(({ onClick, bgColor }) => (
12
12
  <div className="flex items-center justify-between border-0 border-b border-main-divider h-[50px]">
13
13
  <div className="flex items-center">
14
- <button className="pr-4" onClick={onClick} aria-label="Открыть меню">
14
+ <button className="pr-4 border-0 bg-transparent" onClick={onClick} aria-label="Открыть меню">
15
15
  <Icon
16
16
  name={bgColor === 'bg-white' ? 'BurgerIcon' : 'BurgerIconWhite'}
17
17
  width="24"
@@ -21,7 +21,11 @@ export const HeaderTop = JSX<HeaderTopProps>(({ onClick, bgColor }) => (
21
21
  </button>
22
22
  <Logo bgColor={bgColor} />
23
23
  </div>
24
- <button className={`${bgColor === 'bg-white' ? 'text-primary-main' : 'text-white'} text-sm`}>
24
+ <button
25
+ className={`${
26
+ bgColor === 'bg-white' ? 'text-primary-main' : 'text-white'
27
+ } text-sm border-0 bg-transparent`}
28
+ >
25
29
  Войти
26
30
  </button>
27
31
  </div>
@@ -4,7 +4,7 @@ import type { LinkDocsListItemProps } from './LinkDocsListItemBase';
4
4
 
5
5
  export const LinkDocsListItem = JSX<LinkDocsListItemProps>(({ className = '', doc, icon }) => (
6
6
  <LinkDocsListItemBase
7
- className={`flex h-full ${className}`}
7
+ className={`flex h-full box-border ${className}`}
8
8
  iconClassName="mr-3 min-w-6 min-h-6"
9
9
  doc={doc}
10
10
  icon={icon}
@@ -4,7 +4,7 @@ import type { LinkDocsListItemProps } from './LinkDocsListItemBase';
4
4
 
5
5
  export const LinkDocsListItem = JSX<LinkDocsListItemProps>(({ className = '', doc, icon }) => (
6
6
  <LinkDocsListItemBase
7
- className={className}
7
+ className={`flex h-full box-border ${className}`}
8
8
  iconClassName="mr-2.5 min-w-6 min-h-6 text-primary-text"
9
9
  textClassName="self-center"
10
10
  suffixClassName="text-secondary-text group-hover:text-primary-main"
@@ -13,5 +13,6 @@
13
13
  "text": "Кнопка",
14
14
  "version": "secondary"
15
15
  }
16
- ]
16
+ ],
17
+ "version": "primary"
17
18
  }
@@ -7,8 +7,8 @@ const image: Picture = {
7
7
  format: 'webp',
8
8
  alt: 'Потребительский кредит наличными',
9
9
  size: {
10
- width: 280,
11
- height: 280,
10
+ width: 234,
11
+ height: 234,
12
12
  },
13
13
  sources: [
14
14
  {
@@ -25,7 +25,7 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
25
25
  version = 'primary',
26
26
  }) => {
27
27
  return (
28
- <div className={`${className}`}>
28
+ <div className={`w-full text-primary-text ${className}`}>
29
29
  <div>
30
30
  <BaseTile
31
31
  context={context}
@@ -34,31 +34,37 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
34
34
  <Heading
35
35
  headingType={headingType}
36
36
  title={title}
37
- className={`whitespace-pre-wrap max-w-[600px]`}
37
+ className={`whitespace-pre-wrap max-w-[600px] ${title ? 'mb-3' : ''}`}
38
38
  />
39
39
  )
40
40
  }
41
41
  buttons={
42
42
  buttons?.length ? (
43
- <ButtonSection context={context} buttons={buttons} className="flex mt-9 gap-3" />
43
+ <ButtonSection
44
+ context={context}
45
+ buttons={buttons}
46
+ className="flex flex-col mt-5 gap-2.5"
47
+ />
44
48
  ) : null
45
49
  }
46
50
  >
47
51
  {description && <Description description={description} />}
48
52
  {benefits?.length ? (
49
- <div className="mt-[19px]">
50
- {benefits.map((_, i) => renderBenefit(_, i, version))}
51
- </div>
53
+ <div className="mt-5">{benefits.map((_, i) => renderBenefit(_, i, version))}</div>
52
54
  ) : null}
53
55
  {items?.length ? <List items={items} /> : null}
54
56
  </BaseTile>
55
57
  </div>
56
- {image?.src && (
57
- <div className="mt-5">
58
- <Img image={{ className: 'block', ...image }} />
59
- </div>
60
- )}
58
+ {renderImage(image)}
61
59
  </div>
62
60
  );
63
61
  },
64
62
  );
63
+
64
+ function renderImage(image) {
65
+ return image?.src ? (
66
+ <div className="mt-5">
67
+ <Img image={{ className: 'block', ...image }} />
68
+ </div>
69
+ ) : null;
70
+ }
@@ -25,7 +25,7 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
25
25
  version = 'primary',
26
26
  }) => {
27
27
  return (
28
- <div className={`flex grow justify-between items-stretch ${className}`}>
28
+ <div className={`flex grow justify-between items-stretch text-primary-text ${className}`}>
29
29
  <div className={'flex flex-col'}>
30
30
  <BaseTile
31
31
  context={context}
@@ -52,7 +52,7 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
52
52
  {benefits.map((_, i) => renderBenefit(_, i, version))}
53
53
  </div>
54
54
  ) : null}
55
- {items?.length ? <List items={items} /> : null}
55
+ {items?.length ? <List className="mt-5" items={items} /> : null}
56
56
  </BaseTile>
57
57
  </div>
58
58
  {image?.src && <Img className="mt-auto" image={image} />}