@redneckz/wildless-cms-uni-blocks 0.2.85 → 0.2.86

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 (264) hide show
  1. package/bundle/blocks.schema.json +1 -945
  2. package/bundle/bundle.umd.js +194 -195
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/Accordion/Accordion.js +1 -1
  5. package/dist/components/Accordion/Accordion.js.map +1 -1
  6. package/dist/components/Accordion/AccordionContent.d.ts +29 -10
  7. package/dist/components/Accordion/AccordionItem.d.ts +2 -2
  8. package/dist/components/Accordion/AccordionItem.js +5 -6
  9. package/dist/components/Accordion/AccordionItem.js.map +1 -1
  10. package/dist/components/BaseTile/BaseTile.d.ts +2 -2
  11. package/dist/components/BaseTile/BaseTile.js +1 -1
  12. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  13. package/dist/components/BaseTile/BaseTileProps.d.ts +31 -0
  14. package/dist/{model/SitemapContent.js → components/BaseTile/BaseTileProps.js} +1 -1
  15. package/dist/components/BaseTile/BaseTileProps.js.map +1 -0
  16. package/dist/components/BenefitsBlock/BenefitsBlock.d.ts +1 -1
  17. package/dist/components/BenefitsBlock/BenefitsBlock.js +2 -1
  18. package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  19. package/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +14 -1
  20. package/dist/components/BlockContent.d.ts +4 -1
  21. package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +45 -2
  22. package/dist/components/ComparisonTable/HeaderCell.d.ts +2 -2
  23. package/dist/components/ContentPage/ContentPage.d.ts +3 -2
  24. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  25. package/dist/components/CreditCalculator/CreditCalculatorContent.d.ts +4 -0
  26. package/dist/components/ExchangeRateTile/ExchangeRateTile.d.ts +1 -1
  27. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  28. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  29. package/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +4 -0
  30. package/dist/components/Footer/Contacts.js +2 -2
  31. package/dist/components/Footer/Contacts.js.map +1 -1
  32. package/dist/components/Footer/FooterContent.d.ts +35 -9
  33. package/dist/components/Footer/FooterLink.d.ts +2 -2
  34. package/dist/components/Footer/HorizontalNavigation.js.map +1 -1
  35. package/dist/components/Footer/Sitemap.d.ts +1 -1
  36. package/dist/components/Footer/Sitemap.js +1 -1
  37. package/dist/components/Footer/Sitemap.js.map +1 -1
  38. package/dist/components/Footer/SocialMedia.d.ts +2 -2
  39. package/dist/components/Footer/TextInformation.js.map +1 -1
  40. package/dist/components/Gallery/GalleryContent.d.ts +13 -0
  41. package/dist/components/Header/HeaderContent.d.ts +10 -2
  42. package/dist/components/Header/isSubItemActive.d.ts +2 -2
  43. package/dist/components/Header/isSubItemActive.js.map +1 -1
  44. package/dist/components/Header/isTopItemActive.d.ts +2 -2
  45. package/dist/components/Header/isTopItemActive.js.map +1 -1
  46. package/dist/components/MiniGallery/MiniGallery.d.ts +3 -3
  47. package/dist/components/MiniGallery/MiniGalleryContent.d.ts +6 -0
  48. package/dist/components/MiniGallery/MiniGalleryContent.js +2 -0
  49. package/dist/components/MiniGallery/MiniGalleryContent.js.map +1 -0
  50. package/dist/components/MobileAppTile/MobileAppTileContent.d.ts +11 -2
  51. package/dist/components/Placeholder/PlaceholderContent.d.ts +3 -0
  52. package/dist/components/ProductBlock/ProductBlock.mobile.d.ts +2 -2
  53. package/dist/components/ProductBlock/ProductBlock.mobile.js.map +1 -1
  54. package/dist/components/ProductBlock/ProductBlockContent.d.ts +10 -5
  55. package/dist/components/ProductBlock/ProductBlockInner.d.ts +2 -2
  56. package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
  57. package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  58. package/dist/components/ProductGallery/ProductGallery.d.ts +1 -1
  59. package/dist/components/ProductGallery/ProductGallery.js.map +1 -1
  60. package/dist/components/ProductGallery/ProductGalleryContent.d.ts +17 -2
  61. package/dist/components/ProductTile/ProductTileContent.d.ts +6 -2
  62. package/dist/components/PromoTile/PromoTileContent.d.ts +6 -2
  63. package/dist/components/StepsBlock/StepsBlockContent.d.ts +13 -0
  64. package/dist/components/TextBlock/TextBlockContent.d.ts +13 -0
  65. package/dist/components/Tile/TileContent.d.ts +5 -2
  66. package/dist/hooks/useLink.d.ts +3 -3
  67. package/dist/hooks/useLink.js.map +1 -1
  68. package/dist/index.d.ts +12 -12
  69. package/dist/index.js +10 -10
  70. package/dist/index.js.map +1 -1
  71. package/dist/mergeTopItems.d.ts +2 -2
  72. package/dist/mergeTopItems.js.map +1 -1
  73. package/dist/model/BlockVersion.d.ts +4 -0
  74. package/dist/model/ButtonVersion.d.ts +4 -0
  75. package/dist/model/LinkProps.d.ts +21 -0
  76. package/dist/model/{LinkContent.js → LinkProps.js} +1 -1
  77. package/dist/model/LinkProps.js.map +1 -0
  78. package/dist/model/Picture.d.ts +11 -0
  79. package/dist/model/SitemapProps.d.ts +13 -0
  80. package/dist/{components/BaseTile/BaseTileContent.js → model/SitemapProps.js} +1 -1
  81. package/dist/model/SitemapProps.js.map +1 -0
  82. package/dist/types.d.ts +2 -2
  83. package/dist/ui-kit/Breadcrumb.d.ts +2 -2
  84. package/dist/ui-kit/Button/Button.d.ts +6 -3
  85. package/dist/ui-kit/Button/Button.js.map +1 -1
  86. package/dist/ui-kit/Button/ButtonProps.d.ts +15 -12
  87. package/dist/ui-kit/Icon/IconProps.d.ts +49 -18
  88. package/dist/ui-kit/Icon/IconProps.js +21 -18
  89. package/dist/ui-kit/Icon/IconProps.js.map +1 -1
  90. package/dist/ui-kit/TopItem/TopItem.d.ts +2 -2
  91. package/lib/common.css +1 -1
  92. package/lib/components/Accordion/Accordion.js +1 -1
  93. package/lib/components/Accordion/Accordion.js.map +1 -1
  94. package/lib/components/Accordion/AccordionContent.d.ts +29 -10
  95. package/lib/components/Accordion/AccordionItem.d.ts +2 -2
  96. package/lib/components/Accordion/AccordionItem.js +5 -6
  97. package/lib/components/Accordion/AccordionItem.js.map +1 -1
  98. package/lib/components/BaseTile/BaseTile.d.ts +2 -2
  99. package/lib/components/BaseTile/BaseTile.js +1 -1
  100. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  101. package/lib/components/BaseTile/BaseTileProps.d.ts +31 -0
  102. package/lib/components/BaseTile/BaseTileProps.js +2 -0
  103. package/lib/components/BaseTile/BaseTileProps.js.map +1 -0
  104. package/lib/components/BenefitsBlock/BenefitsBlock.d.ts +1 -1
  105. package/lib/components/BenefitsBlock/BenefitsBlock.js +2 -1
  106. package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  107. package/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +14 -1
  108. package/lib/components/BlockContent.d.ts +4 -1
  109. package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +45 -2
  110. package/lib/components/ComparisonTable/HeaderCell.d.ts +2 -2
  111. package/lib/components/ContentPage/ContentPage.d.ts +3 -2
  112. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  113. package/lib/components/CreditCalculator/CreditCalculatorContent.d.ts +4 -0
  114. package/lib/components/ExchangeRateTile/ExchangeRateTile.d.ts +1 -1
  115. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  116. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  117. package/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +4 -0
  118. package/lib/components/Footer/Contacts.js +2 -2
  119. package/lib/components/Footer/Contacts.js.map +1 -1
  120. package/lib/components/Footer/FooterContent.d.ts +35 -9
  121. package/lib/components/Footer/FooterLink.d.ts +2 -2
  122. package/lib/components/Footer/HorizontalNavigation.js.map +1 -1
  123. package/lib/components/Footer/Sitemap.d.ts +1 -1
  124. package/lib/components/Footer/Sitemap.js +1 -1
  125. package/lib/components/Footer/Sitemap.js.map +1 -1
  126. package/lib/components/Footer/SocialMedia.d.ts +2 -2
  127. package/lib/components/Footer/TextInformation.js.map +1 -1
  128. package/lib/components/Gallery/GalleryContent.d.ts +13 -0
  129. package/lib/components/Header/HeaderContent.d.ts +10 -2
  130. package/lib/components/Header/isSubItemActive.d.ts +2 -2
  131. package/lib/components/Header/isSubItemActive.js.map +1 -1
  132. package/lib/components/Header/isTopItemActive.d.ts +2 -2
  133. package/lib/components/Header/isTopItemActive.js.map +1 -1
  134. package/lib/components/MiniGallery/MiniGallery.d.ts +3 -3
  135. package/lib/components/MiniGallery/MiniGalleryContent.d.ts +6 -0
  136. package/lib/components/MiniGallery/MiniGalleryContent.js +2 -0
  137. package/lib/components/MiniGallery/MiniGalleryContent.js.map +1 -0
  138. package/lib/components/MobileAppTile/MobileAppTileContent.d.ts +11 -2
  139. package/lib/components/Placeholder/PlaceholderContent.d.ts +3 -0
  140. package/lib/components/ProductBlock/ProductBlock.mobile.d.ts +2 -2
  141. package/lib/components/ProductBlock/ProductBlock.mobile.js.map +1 -1
  142. package/lib/components/ProductBlock/ProductBlockContent.d.ts +10 -5
  143. package/lib/components/ProductBlock/ProductBlockInner.d.ts +2 -2
  144. package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
  145. package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  146. package/lib/components/ProductGallery/ProductGallery.d.ts +1 -1
  147. package/lib/components/ProductGallery/ProductGallery.js.map +1 -1
  148. package/lib/components/ProductGallery/ProductGalleryContent.d.ts +17 -2
  149. package/lib/components/ProductTile/ProductTileContent.d.ts +6 -2
  150. package/lib/components/PromoTile/PromoTileContent.d.ts +6 -2
  151. package/lib/components/StepsBlock/StepsBlockContent.d.ts +13 -0
  152. package/lib/components/TextBlock/TextBlockContent.d.ts +13 -0
  153. package/lib/components/Tile/TileContent.d.ts +5 -2
  154. package/lib/hooks/useLink.d.ts +3 -3
  155. package/lib/hooks/useLink.js.map +1 -1
  156. package/lib/index.d.ts +12 -12
  157. package/lib/index.js +5 -5
  158. package/lib/index.js.map +1 -1
  159. package/lib/mergeTopItems.d.ts +2 -2
  160. package/lib/mergeTopItems.js.map +1 -1
  161. package/lib/model/BlockVersion.d.ts +4 -0
  162. package/lib/model/ButtonVersion.d.ts +4 -0
  163. package/lib/model/LinkProps.d.ts +21 -0
  164. package/lib/model/LinkProps.js +2 -0
  165. package/lib/model/LinkProps.js.map +1 -0
  166. package/lib/model/Picture.d.ts +11 -0
  167. package/lib/model/SitemapProps.d.ts +13 -0
  168. package/lib/model/SitemapProps.js +2 -0
  169. package/lib/model/SitemapProps.js.map +1 -0
  170. package/lib/types.d.ts +2 -2
  171. package/lib/ui-kit/Breadcrumb.d.ts +2 -2
  172. package/lib/ui-kit/Button/Button.d.ts +6 -3
  173. package/lib/ui-kit/Button/Button.js.map +1 -1
  174. package/lib/ui-kit/Button/ButtonProps.d.ts +15 -12
  175. package/lib/ui-kit/Icon/IconProps.d.ts +49 -18
  176. package/lib/ui-kit/Icon/IconProps.js +21 -18
  177. package/lib/ui-kit/Icon/IconProps.js.map +1 -1
  178. package/lib/ui-kit/TopItem/TopItem.d.ts +2 -2
  179. package/package.json +2 -22
  180. package/src/components/Accordion/Accordion.example.json +74 -0
  181. package/src/components/Accordion/Accordion.fixture.tsx +1 -16
  182. package/src/components/Accordion/Accordion.tsx +1 -1
  183. package/src/components/Accordion/AccordionContent.ts +31 -11
  184. package/src/components/Accordion/AccordionItem.tsx +10 -10
  185. package/src/components/BaseTile/BaseTile.tsx +4 -5
  186. package/src/components/BaseTile/BaseTileProps.ts +33 -0
  187. package/src/components/BenefitsBlock/BenefitsBlock.example.json +13 -0
  188. package/src/components/BenefitsBlock/BenefitsBlock.tsx +3 -2
  189. package/src/components/BenefitsBlock/BenefitsBlockContent.ts +14 -1
  190. package/src/components/BlockContent.ts +4 -1
  191. package/src/components/ComparisonTable/ComparisonTable.example.json +84 -0
  192. package/src/components/ComparisonTable/ComparisonTableContent.ts +46 -3
  193. package/src/components/ComparisonTable/HeaderCell.tsx +2 -2
  194. package/src/components/ContentPage/ContentPage.tsx +7 -5
  195. package/src/components/CreditCalculator/CreditCalculatorContent.ts +4 -0
  196. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +2 -2
  197. package/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +4 -0
  198. package/src/components/Footer/Contacts.tsx +2 -2
  199. package/src/components/Footer/FooterContent.ts +36 -9
  200. package/src/components/Footer/FooterLink.ts +2 -2
  201. package/src/components/Footer/HorizontalNavigation.tsx +2 -2
  202. package/src/components/Footer/Sitemap.tsx +5 -5
  203. package/src/components/Footer/SocialMedia.tsx +2 -2
  204. package/src/components/Footer/TextInformation.tsx +2 -2
  205. package/src/components/Gallery/Gallery.example.json +71 -0
  206. package/src/components/Gallery/GalleryContent.ts +13 -0
  207. package/src/components/Header/HeaderContent.ts +10 -2
  208. package/src/components/Header/isSubItemActive.ts +3 -3
  209. package/src/components/Header/isTopItemActive.ts +3 -3
  210. package/src/components/MiniGallery/MiniGallery.example.json +61 -0
  211. package/src/components/MiniGallery/MiniGallery.tsx +3 -3
  212. package/src/components/MiniGallery/MiniGalleryContent.ts +6 -0
  213. package/src/components/MobileAppTile/MobileAppTile.example.json +20 -0
  214. package/src/components/MobileAppTile/MobileAppTileContent.ts +11 -2
  215. package/src/components/Placeholder/PlaceholderContent.ts +3 -0
  216. package/src/components/ProductBlock/ProductBlock.example.json +17 -0
  217. package/src/components/ProductBlock/ProductBlock.mobile.tsx +3 -3
  218. package/src/components/ProductBlock/ProductBlockContent.ts +10 -5
  219. package/src/components/ProductBlock/ProductBlockInner.tsx +4 -4
  220. package/src/components/ProductGallery/ProductGallery.example.json +21 -0
  221. package/src/components/ProductGallery/ProductGallery.tsx +3 -3
  222. package/src/components/ProductGallery/ProductGalleryContent.ts +17 -2
  223. package/src/components/ProductTile/ProductTile.example.json +30 -0
  224. package/src/components/ProductTile/ProductTileContent.ts +6 -2
  225. package/src/components/PromoTile/PromoTile.example.json +13 -0
  226. package/src/components/PromoTile/PromoTileContent.ts +6 -2
  227. package/src/components/StepsBlock/StepsBlock.example.json +17 -0
  228. package/src/components/StepsBlock/StepsBlockContent.ts +13 -0
  229. package/src/components/TextBlock/TextBlock.example.json +6 -0
  230. package/src/components/TextBlock/TextBlockContent.ts +14 -0
  231. package/src/components/Tile/Tile.example.json +18 -0
  232. package/src/components/Tile/TileContent.ts +5 -2
  233. package/src/hooks/useLink.ts +2 -2
  234. package/src/index.ts +14 -21
  235. package/src/mergeTopItems.ts +5 -5
  236. package/src/model/BlockVersion.ts +4 -0
  237. package/src/model/ButtonVersion.ts +4 -0
  238. package/src/model/LinkProps.ts +22 -0
  239. package/src/model/Picture.ts +11 -0
  240. package/src/model/SitemapProps.ts +15 -0
  241. package/src/types.ts +2 -2
  242. package/src/ui-kit/Breadcrumb.tsx +2 -2
  243. package/src/ui-kit/Button/Button.tsx +7 -3
  244. package/src/ui-kit/Button/ButtonProps.ts +16 -13
  245. package/src/ui-kit/Icon/IconProps.ts +35 -4
  246. package/src/ui-kit/TopItem/TopItem.tsx +2 -2
  247. package/dist/components/BaseTile/BaseTileContent.d.ts +0 -13
  248. package/dist/components/BaseTile/BaseTileContent.js.map +0 -1
  249. package/dist/model/LinkContent.d.ts +0 -5
  250. package/dist/model/LinkContent.js.map +0 -1
  251. package/dist/model/SitemapContent.d.ts +0 -7
  252. package/dist/model/SitemapContent.js.map +0 -1
  253. package/lib/components/BaseTile/BaseTileContent.d.ts +0 -13
  254. package/lib/components/BaseTile/BaseTileContent.js +0 -2
  255. package/lib/components/BaseTile/BaseTileContent.js.map +0 -1
  256. package/lib/model/LinkContent.d.ts +0 -5
  257. package/lib/model/LinkContent.js +0 -2
  258. package/lib/model/LinkContent.js.map +0 -1
  259. package/lib/model/SitemapContent.d.ts +0 -7
  260. package/lib/model/SitemapContent.js +0 -2
  261. package/lib/model/SitemapContent.js.map +0 -1
  262. package/src/components/BaseTile/BaseTileContent.ts +0 -14
  263. package/src/model/LinkContent.ts +0 -5
  264. package/src/model/SitemapContent.ts +0 -9
@@ -1,11 +1,16 @@
1
- import type { LinkContent } from '../../model/LinkContent';
2
- import type { BaseTileContent } from '../BaseTile/BaseTileContent';
1
+ import type { LinkProps } from '../../model/LinkProps';
2
+ import type { BaseTileCommonProps } from '../BaseTile/BaseTileProps';
3
3
  import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
4
4
 
5
- export interface ProductBlockInnerContent extends BaseTileContent {
5
+ export interface ProductBlockInnerCommonProps extends BaseTileCommonProps {
6
+ /** @title Преимущества */
6
7
  benefits?: Benefit[];
7
8
  }
8
9
 
9
- export interface ProductBlockContent extends ProductBlockInnerContent {
10
- breadcrumbs?: LinkContent[];
10
+ /**
11
+ * @title Продуктовый блок
12
+ */
13
+ export interface ProductBlockContent extends ProductBlockInnerCommonProps {
14
+ /** @title Хлебные крошки */
15
+ breadcrumbs?: LinkProps[];
11
16
  }
@@ -1,13 +1,13 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { BaseTile } from '../BaseTile/BaseTile';
3
- import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
4
- import type { ProductBlockInnerContent } from './ProductBlockContent';
5
2
  import type { UniBlockProps } from '../../types';
6
3
  import { Icon } from '../../ui-kit/Icon/Icon';
7
4
  import { Img } from '../../ui-kit/Img';
8
5
  import { Title } from '../../ui-kit/Title/Title';
6
+ import { BaseTile } from '../BaseTile/BaseTile';
7
+ import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
8
+ import type { ProductBlockInnerCommonProps } from './ProductBlockContent';
9
9
 
10
- export interface ProductBlockInnerProps extends ProductBlockInnerContent, UniBlockProps {}
10
+ export interface ProductBlockInnerProps extends ProductBlockInnerCommonProps, UniBlockProps {}
11
11
 
12
12
  export const ProductBlockInner = JSX<ProductBlockInnerProps>(
13
13
  ({ className, context, title, titleSize, description, benefits, buttons, image, items }) => {
@@ -0,0 +1,21 @@
1
+ {
2
+ "slides": [
3
+ {
4
+ "nav": {
5
+ "title": "Заголовок",
6
+ "desc": "Описание"
7
+ },
8
+ "productBlock": {
9
+ "title": "Продуктовая галерея",
10
+ "image": {
11
+ "format": "webp",
12
+ "size": {
13
+ "width": 300
14
+ }
15
+ },
16
+ "description": "Описание",
17
+ "items": ["Элемент списка 1", "Элемент списка 2", "Элемент списка 3"]
18
+ }
19
+ }
20
+ ]
21
+ }
@@ -1,8 +1,8 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import type { UniBlockProps } from '../../types';
3
+ import type { ProductBlockInnerCommonProps } from '../ProductBlock/ProductBlockContent';
2
4
  import { ProductBlockInner } from '../ProductBlock/ProductBlockInner';
3
- import type { ProductBlockInnerContent } from '../ProductBlock/ProductBlockContent';
4
5
  import type { ProductGalleryContent } from './ProductGalleryContent';
5
- import type { UniBlockProps } from '../../types';
6
6
 
7
7
  export interface ProductGalleryProps extends ProductGalleryContent, UniBlockProps {}
8
8
 
@@ -38,7 +38,7 @@ export const ProductGallery = JSX<ProductGalleryProps>(
38
38
  },
39
39
  );
40
40
 
41
- function renderProductBlock(block: ProductBlockInnerContent, i: number, context) {
41
+ function renderProductBlock(block: ProductBlockInnerCommonProps, i: number, context) {
42
42
  return (
43
43
  <section key={String(i)} className="flex grow-0 shrink-0 basis-full" role="listitem">
44
44
  <div className="p-10 flex grow">
@@ -1,16 +1,31 @@
1
- import type { ProductBlockInnerContent } from '../ProductBlock/ProductBlockContent';
1
+ import type { ProductBlockInnerCommonProps } from '../ProductBlock/ProductBlockContent';
2
2
 
3
+ /** @title Кнопка под слайдом */
3
4
  interface ProductGalleryNav {
5
+ /** @title Заголовок */
4
6
  title: string;
7
+ /** @title Описание */
5
8
  desc: string;
6
9
  }
7
10
 
11
+ /**
12
+ * @title Слайд
13
+ */
8
14
  export interface ProductSlideContent {
9
15
  nav: ProductGalleryNav;
10
- productBlock: ProductBlockInnerContent;
16
+ /** @title Содержимое слайда */
17
+ productBlock: ProductBlockInnerCommonProps;
11
18
  }
12
19
 
20
+ /**
21
+ * @title Продуктовая галерея
22
+ */
13
23
  export interface ProductGalleryContent {
24
+ /**
25
+ * @title Задержка
26
+ * @hidden //! temporary not used
27
+ */
14
28
  duration?: number;
29
+ /** @title Слайды */
15
30
  slides?: ProductSlideContent[];
16
31
  }
@@ -0,0 +1,30 @@
1
+ {
2
+ "title": "Продуктовая плитка",
3
+ "description": "Описание",
4
+ "image": {
5
+ "format": "webp",
6
+ "size": {
7
+ "width": 300
8
+ }
9
+ },
10
+ "benefits": [
11
+ {
12
+ "label": "Преимущество 1",
13
+ "description": "Описание"
14
+ },
15
+ {
16
+ "label": "Преимущество 2",
17
+ "description": "Описание"
18
+ },
19
+ {
20
+ "label": "Преимущество 3",
21
+ "description": "Описание"
22
+ }
23
+ ],
24
+ "buttons": [
25
+ {
26
+ "text": "Подробнее",
27
+ "version": "primary"
28
+ }
29
+ ]
30
+ }
@@ -1,6 +1,10 @@
1
- import type { BaseTileContent } from '../BaseTile/BaseTileContent';
1
+ import type { BaseTileCommonProps } from '../BaseTile/BaseTileProps';
2
2
  import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
3
3
 
4
- export interface ProductTileContent extends BaseTileContent {
4
+ /**
5
+ * @title Продуктовая плитка
6
+ */
7
+ export interface ProductTileContent extends BaseTileCommonProps {
8
+ /** @title Преимущества */
5
9
  benefits?: Benefit[];
6
10
  }
@@ -0,0 +1,13 @@
1
+ {
2
+ "title": "Акции и спецпредложения",
3
+ "date": "2022-04-16",
4
+ "description": "Пенсионный кредит по специальной процентной ставке",
5
+ "buttons": [
6
+ {
7
+ "text": "Все акции",
8
+ "href": "/credits",
9
+ "version": "secondary"
10
+ }
11
+ ],
12
+ "version": "secondary"
13
+ }
@@ -1,5 +1,9 @@
1
- import type { BaseTileContent } from '../BaseTile/BaseTileContent';
1
+ import type { BaseTileCommonProps } from '../BaseTile/BaseTileProps';
2
2
 
3
- export interface PromoTileContent extends BaseTileContent {
3
+ /**
4
+ * @title Акции
5
+ */
6
+ export interface PromoTileContent extends BaseTileCommonProps {
7
+ /** @title Дата публикации */
4
8
  date?: string;
5
9
  }
@@ -0,0 +1,17 @@
1
+ {
2
+ "title": "Шаги",
3
+ "steps": [
4
+ {
5
+ "label": "Шаг №1",
6
+ "icon": "NewDocIcon"
7
+ },
8
+ {
9
+ "label": "Шаг №2",
10
+ "icon": "PassSendIcon"
11
+ },
12
+ {
13
+ "label": "Шаг №3",
14
+ "icon": "ActualBalanceIcon"
15
+ }
16
+ ]
17
+ }
@@ -1,12 +1,25 @@
1
1
  import type { IconName } from '../../ui-kit/Icon/IconProps';
2
2
 
3
+ /**
4
+ * @title Шаг
5
+ */
3
6
  export interface Step {
7
+ /** @title Название */
4
8
  label: string;
9
+ /** @title Описание */
5
10
  description?: string;
6
11
  icon?: IconName;
7
12
  }
8
13
 
14
+ /**
15
+ * @title Блок шаги
16
+ */
9
17
  export interface StepsBlockContent {
18
+ /** @title Заголовок */
10
19
  title?: string;
20
+ /**
21
+ * @title Шаги
22
+ * @maxItems 6
23
+ */
11
24
  steps?: Step[];
12
25
  }
@@ -0,0 +1,6 @@
1
+ {
2
+ "title": "Заголовок",
3
+ "description": "Описание",
4
+ "blockVersion": "primary",
5
+ "iconVersion": "small"
6
+ }
@@ -1,10 +1,24 @@
1
1
  import type { Picture } from '../../model/Picture';
2
2
 
3
+ /**
4
+ * @title Цвет плитки
5
+ * @enumNames ["Основная", "Второстепенная", "Второстепенная прозрачная"]
6
+ */
3
7
  export type TextBlockVersion = 'primary' | 'secondary' | 'secondary-light';
8
+
9
+ /**
10
+ * @title Размер иконки
11
+ * @enumNames ["Нет", "Маленькая", "Большая"]
12
+ */
4
13
  export type TextBlockIconVersion = 'none' | 'small' | 'big';
5
14
 
15
+ /**
16
+ * @title Текстовый блок
17
+ */
6
18
  export interface TextBlockContent {
19
+ /** @title Заголовок */
7
20
  title?: string;
21
+ /** @title Описание */
8
22
  description?: string;
9
23
  blockVersion?: TextBlockVersion;
10
24
  iconVersion?: TextBlockIconVersion;
@@ -0,0 +1,18 @@
1
+ {
2
+ "title": "Плитка",
3
+ "titleSize": "M",
4
+ "description": "Описание",
5
+ "image": {
6
+ "format": "webp",
7
+ "size": {
8
+ "width": 300
9
+ }
10
+ },
11
+ "items": ["Пункт 1", "Пункт 2", "Пункт 3"],
12
+ "buttons": [
13
+ {
14
+ "text": "Подробнее",
15
+ "version": "primary"
16
+ }
17
+ ]
18
+ }
@@ -1,3 +1,6 @@
1
- import type { BaseTileContent } from '../BaseTile/BaseTileContent';
1
+ import type { BaseTileCommonProps } from '../BaseTile/BaseTileProps';
2
2
 
3
- export type TileContent = BaseTileContent;
3
+ /**
4
+ * @title Плитка
5
+ */
6
+ export type TileContent = BaseTileCommonProps;
@@ -1,5 +1,5 @@
1
1
  import { HandlerDecorator, Router } from '../components/ContentPage/ContentPageContext';
2
- import type { LinkContent } from '../model/LinkContent';
2
+ import type { LinkProps } from '../model/LinkProps';
3
3
  import { adjustHref, isURL } from '../utils/url';
4
4
 
5
5
  const defaultHandlerDecorator: HandlerDecorator = (handler, targetContent) => handler;
@@ -9,7 +9,7 @@ export function useLink(
9
9
  router,
10
10
  handlerDecorator = defaultHandlerDecorator,
11
11
  }: { router: Router; handlerDecorator?: HandlerDecorator },
12
- link: Partial<LinkContent & { className: string }>,
12
+ link: Partial<LinkProps & { className: string }>,
13
13
  ) {
14
14
  const href = adjustHref(link.href, router);
15
15
  return {
package/src/index.ts CHANGED
@@ -1,33 +1,26 @@
1
1
  export { setup } from '@redneckz/uni-jsx';
2
-
3
- export type { ProjectSettings } from './ProjectSettings';
4
- export { projectSettings } from './ProjectSettings';
5
-
6
- export { LikeAPI } from './api/LikeAPI';
7
2
  export { DaDataAPI } from './api/DaDataAPI';
8
-
9
- export type { SitemapContent } from './model/SitemapContent';
10
-
11
- export type { Img, ImgSource, Picture } from './model/Picture';
12
- export type { BlockDef, UniBlockProps, ContentPageMeta, ContentPageDef } from './types';
3
+ export { LikeAPI } from './api/LikeAPI';
4
+ export type { BlockContent } from './components/BlockContent';
5
+ export { Blocks } from './components/Blocks';
6
+ export { ContentPage } from './components/ContentPage/ContentPage';
7
+ export type { BlockDecorator } from './components/ContentPage/ContentPage';
13
8
  export type {
14
- ContentPageContext,
15
- Router,
16
9
  AsyncDataHook,
10
+ ContentPageContext,
17
11
  GeolocationHook,
18
- LikeService,
19
12
  HandlerDecorator,
13
+ LikeService,
14
+ Router,
20
15
  Search,
21
16
  } from './components/ContentPage/ContentPageContext';
22
-
23
17
  export { ContentPageHead } from './components/ContentPage/ContentPageHead';
24
- export type { BlockDecorator } from './components/ContentPage/ContentPage';
25
- export { ContentPage } from './components/ContentPage/ContentPage';
26
18
  export { toMobilePage } from './components/ContentPage/toMobilePage';
27
-
28
- export { Blocks } from './components/Blocks';
29
- export type { BlockContent } from './components/BlockContent';
30
19
  export { MobileBlocks } from './components/MobileBlocks';
31
-
32
- export * as url from './utils/url';
20
+ export type { Img, ImgSource, Picture } from './model/Picture';
21
+ export type { SitemapProps as SitemapContent } from './model/SitemapProps';
22
+ export { projectSettings } from './ProjectSettings';
23
+ export type { ProjectSettings } from './ProjectSettings';
24
+ export type { BlockDef, ContentPageDef, ContentPageMeta, UniBlockProps } from './types';
33
25
  export { joinList } from './utils/joinList';
26
+ export * as url from './utils/url';
@@ -1,13 +1,13 @@
1
- import type { LinkContent } from './model/LinkContent';
1
+ import type { LinkProps } from './model/LinkProps';
2
2
 
3
- const cmp = (a?: LinkContent) => (b?: LinkContent) => a?.href === b?.href;
3
+ const cmp = (a?: LinkProps) => (b?: LinkProps) => a?.href === b?.href;
4
4
 
5
- const substitute = <L extends LinkContent>(items?: L[], substitution?: L[]): L[] =>
5
+ const substitute = <L extends LinkProps>(items?: L[], substitution?: L[]): L[] =>
6
6
  (items || []).map((_) => substitution?.find(cmp(_)) || _);
7
7
 
8
- const subtract = <L extends LinkContent>(minuend?: L[], subtrahend?: L[]): L[] =>
8
+ const subtract = <L extends LinkProps>(minuend?: L[], subtrahend?: L[]): L[] =>
9
9
  (minuend || []).filter((_) => !subtrahend?.find(cmp(_)));
10
10
 
11
- export function mergeTopItems<L extends LinkContent>(left?: L[], right?: L[]): L[] {
11
+ export function mergeTopItems<L extends LinkProps>(left?: L[], right?: L[]): L[] {
12
12
  return substitute(left, right).concat(subtract(right, left));
13
13
  }
@@ -1 +1,5 @@
1
+ /**
2
+ * @title Цвет плитки
3
+ * @enumNames ["Основная", "Второстепенная"]
4
+ */
1
5
  export type BlockVersion = 'primary' | 'secondary';
@@ -1 +1,5 @@
1
+ /**
2
+ * @title Цвет кнопки
3
+ * @enumNames ["Основная", "Второстепенная"]
4
+ */
1
5
  export type ButtonVersion = 'primary' | 'secondary';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @title Таргет (target)
3
+ * @enumNames [
4
+ * "self (текущее окно или фрейм)",
5
+ * "blank (новое окно)",
6
+ * "parent (фрейм-родитель)",
7
+ * "top (текущее окно)"
8
+ * ]
9
+ */
10
+ export type Target = '_blank' | '_self' | '_parent' | '_top';
11
+
12
+ /**
13
+ * @title Ссылка
14
+ * @required ["text", "href"]
15
+ */
16
+ export interface LinkProps {
17
+ /** @title Текст */
18
+ text?: string;
19
+ /** @title URL (href) */
20
+ href?: string;
21
+ target?: Target;
22
+ }
@@ -1,19 +1,30 @@
1
1
  export interface Img {
2
+ /** @title Картинка */
2
3
  src: string;
4
+ /** @title Альтернативный текст (alt) */
3
5
  alt?: string;
6
+ /** @title Текст подсказки (title) */
4
7
  title?: string;
5
8
  }
6
9
 
7
10
  export interface ImgSource {
11
+ /** @title Картинка */
8
12
  src: string;
13
+ /** @title Формат */
9
14
  format?: 'jpeg' | 'jpg' | 'png' | 'gif' | 'webp' | 'heif' | 'avif';
15
+ /** @hidden */
10
16
  options?: Record<string, any>;
17
+ /** @title Размер изображения */
11
18
  size?: {
19
+ /** @title Ширина */
12
20
  width?: number;
21
+ /** @title Высота */
13
22
  height?: number;
14
23
  };
15
24
  }
16
25
 
26
+ /** @title Изображение */
17
27
  export interface Picture extends Img, ImgSource {
28
+ /** @title Другие форматы */
18
29
  sources?: ImgSource[];
19
30
  }
@@ -0,0 +1,15 @@
1
+ import type { LinkProps } from './LinkProps';
2
+
3
+ /**
4
+ * @title Ссылка
5
+ * @required ["text", "href"]
6
+ */
7
+ export interface TopMenuItem extends LinkProps {
8
+ /** @hidden */
9
+ items?: LinkProps[];
10
+ }
11
+
12
+ export interface SitemapProps {
13
+ /** @title Дополнительное меню */
14
+ topItems?: TopMenuItem[];
15
+ }
package/src/types.ts CHANGED
@@ -2,13 +2,13 @@ import type { BlockContent } from './components/BlockContent';
2
2
  import type { ContentPageContext } from './components/ContentPage/ContentPageContext';
3
3
  import type { BlockVersion } from './model/BlockVersion';
4
4
 
5
- export type ColorPalette = 'pc' | 'bc' | 'eo';
5
+ export type ColorPalette = 'pc' | 'bc' | 'eo' | 'eo2' | 'eo3' | 'eo4';
6
6
 
7
7
  export interface BlockDef {
8
8
  type: string;
9
9
  style?: string[];
10
- version?: BlockVersion;
11
10
  content?: BlockContent;
11
+ version?: BlockVersion;
12
12
  blocks?: BlockDef[];
13
13
  mobile?: Pick<BlockDef, 'content' | 'style'> & {
14
14
  hidden?: boolean;
@@ -1,7 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { LinkContent } from '../model/LinkContent';
2
+ import type { LinkProps } from '../model/LinkProps';
3
3
 
4
- export interface BreadcrumbProps extends LinkContent {
4
+ export interface BreadcrumbProps extends LinkProps {
5
5
  className?: string;
6
6
  onClick?: (ev: MouseEvent) => any;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { ButtonVersion } from '../../model/ButtonVersion';
3
- import type { ButtonInnerProps, ButtonProps } from './ButtonProps';
3
+ import type { ButtonProps, ButtonWithIconProps } from './ButtonProps';
4
4
 
5
5
  const buttonStyleMap: Record<ButtonVersion, string> = {
6
6
  primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
@@ -15,7 +15,11 @@ const buttonDisabledStyleMap: Record<ButtonVersion, string> = {
15
15
 
16
16
  const styleButton = 'inline-block text-center font-sans select-none';
17
17
 
18
- export const Button = JSX<ButtonProps>(
18
+ export interface ButtonCommonProps extends ButtonProps, ButtonWithIconProps {}
19
+
20
+ export type ButtonInner = Pick<ButtonCommonProps, 'text' | 'aboveText' | 'appendLeft' | 'rounded'>;
21
+
22
+ export const Button = JSX<ButtonCommonProps>(
19
23
  ({
20
24
  className,
21
25
  text,
@@ -69,7 +73,7 @@ export const Button = JSX<ButtonProps>(
69
73
  },
70
74
  );
71
75
 
72
- export const ButtonInner = JSX<ButtonInnerProps>(({ text, aboveText, appendLeft, rounded }) => {
76
+ export const ButtonInner = JSX<ButtonInner>(({ text, aboveText, appendLeft, rounded }) => {
73
77
  const withoutText = !text && !aboveText && Boolean(appendLeft);
74
78
 
75
79
  const buttonInnerClasses = `flex items-center justify-center ${
@@ -1,24 +1,27 @@
1
1
  import type { ButtonVersion } from '../../model/ButtonVersion';
2
- import type { LinkContent } from '../../model/LinkContent';
3
- import { IconName } from '../Icon/IconProps';
2
+ import type { LinkProps } from '../../model/LinkProps';
4
3
 
5
- export interface ButtonInnerProps {
6
- text?: string;
7
- aboveText?: string;
8
- appendLeft?: any;
9
- rounded?: boolean;
10
- }
11
-
12
- export interface ButtonProps extends LinkContent, ButtonInnerProps {
4
+ /**
5
+ * @hidden
6
+ */
7
+ export interface ButtonAdditionalProps {
13
8
  className?: string;
14
- version?: ButtonVersion;
15
9
  disabled?: boolean;
16
10
  rel?: string;
17
11
  ariaLabel?: string;
18
- /** @hidden */
19
12
  onClick?: (ev: MouseEvent) => any;
20
13
  }
21
14
 
15
+ export interface ButtonProps extends ButtonAdditionalProps, LinkProps {
16
+ text?: string;
17
+ version?: ButtonVersion;
18
+ }
19
+
22
20
  export interface ButtonWithIconProps extends ButtonProps {
23
- icon?: IconName;
21
+ /** @hidden */
22
+ aboveText?: string;
23
+ /** @hidden */
24
+ appendLeft?: any;
25
+ /** @hidden */
26
+ rounded?: boolean;
24
27
  }
@@ -1,29 +1,60 @@
1
+ /**
2
+ * Icons sorted by name
3
+ */
1
4
  export enum IconMap {
2
5
  'ActualBalanceIcon',
3
6
  'AppleIcon',
4
7
  'CalendarIcon',
5
8
  'ClockIcon',
6
9
  'ComfortableCompIcon',
10
+ 'DocIcon',
7
11
  'DollarIcon',
8
12
  'EmptyWalletIcon',
9
13
  'EuroIcon',
14
+ 'GlassIcon',
10
15
  'GridIcon',
11
16
  'LoupeIcon',
17
+ 'MinusIcon',
12
18
  'NewDocIcon',
13
19
  'OkIcon',
14
20
  'PassSendIcon',
15
21
  'PercentageSquareIcon',
16
22
  'PlayMarketIcon',
23
+ 'PlusIcon',
17
24
  'ProfileIcon',
18
25
  'SignDocsIcon',
19
26
  'TelegramIcon',
20
27
  'VKIcon',
21
- 'GlassIcon',
22
- 'DocIcon',
23
- 'PlusIcon',
24
- 'MinusIcon',
25
28
  }
26
29
 
30
+ /**
31
+ * @title Иконка
32
+ * @enumNames [
33
+ * "Деньги",
34
+ * "Лого «Apple»",
35
+ * "Календарь",
36
+ * "Часы",
37
+ * "Кресло",
38
+ * "Документ",
39
+ * "Доллар",
40
+ * "Кошелек",
41
+ * "Евро",
42
+ * "Зеркало",
43
+ * "Сетка",
44
+ * "Лупа",
45
+ * "Минус",
46
+ * "Новый документ",
47
+ * "Лого «Одноклассники»",
48
+ * "Бизнес",
49
+ * "Проценты",
50
+ * "Лого «PlayMarket»",
51
+ * "Плюс",
52
+ * "Профиль",
53
+ * "Подписанные документы",
54
+ * "Лого «Telegram»",
55
+ * "Лого «VK»"
56
+ * ]
57
+ */
27
58
  export type IconName = keyof typeof IconMap;
28
59
 
29
60
  export interface IconProps {
@@ -1,7 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { LinkContent } from '../../model/LinkContent';
2
+ import type { LinkProps } from '../../model/LinkProps';
3
3
 
4
- export interface TopItemContent extends LinkContent {
4
+ export interface TopItemContent extends LinkProps {
5
5
  active?: boolean;
6
6
  }
7
7
 
@@ -1,13 +0,0 @@
1
- import type { BlockVersion } from '../../model/BlockVersion';
2
- import type { Picture } from '../../model/Picture';
3
- import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
4
- import type { TitleSize } from '../../ui-kit/Title/TitleProps';
5
- export interface BaseTileContent {
6
- title?: string;
7
- titleSize?: TitleSize;
8
- description?: string;
9
- image?: Picture;
10
- items?: string[];
11
- buttons?: ButtonWithIconProps[];
12
- version?: BlockVersion;
13
- }