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

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 (117) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +512 -449
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/Accordion/AccordionBlocks.d.ts +3 -0
  5. package/dist/components/Accordion/AccordionBlocks.js +6 -0
  6. package/dist/components/Accordion/AccordionBlocks.js.map +1 -1
  7. package/dist/components/Accordion/AccordionContent.d.ts +14 -6
  8. package/dist/components/BaseTile/BaseTile.js +14 -6
  9. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  10. package/dist/components/BaseTile/BaseTileProps.d.ts +10 -0
  11. package/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +1 -1
  12. package/dist/components/BlockContent.d.ts +3 -1
  13. package/dist/components/Blocks.d.ts +17 -14
  14. package/dist/components/Blocks.js +23 -17
  15. package/dist/components/Blocks.js.map +1 -1
  16. package/dist/components/Headline/Headline.d.ts +5 -0
  17. package/dist/components/Headline/Headline.js +9 -0
  18. package/dist/components/Headline/Headline.js.map +1 -0
  19. package/dist/components/Headline/HeadlineContent.d.ts +15 -0
  20. package/dist/components/Headline/HeadlineContent.js +2 -0
  21. package/dist/components/Headline/HeadlineContent.js.map +1 -0
  22. package/dist/components/LinkDocs/LinkDocs.d.ts +5 -0
  23. package/dist/components/LinkDocs/LinkDocs.js +42 -0
  24. package/dist/components/LinkDocs/LinkDocs.js.map +1 -0
  25. package/dist/components/LinkDocs/LinkDocsContent.d.ts +23 -0
  26. package/dist/components/LinkDocs/LinkDocsContent.js +2 -0
  27. package/dist/components/LinkDocs/LinkDocsContent.js.map +1 -0
  28. package/dist/components/MobileAppTile/MobileAppTileContent.d.ts +1 -3
  29. package/dist/components/MobileBlocks.d.ts +8 -6
  30. package/dist/components/MobileBlocks.js +10 -6
  31. package/dist/components/MobileBlocks.js.map +1 -1
  32. package/dist/components/PictureText/PictureText.d.ts +5 -0
  33. package/dist/components/PictureText/PictureText.js +14 -0
  34. package/dist/components/PictureText/PictureText.js.map +1 -0
  35. package/dist/components/PictureText/PictureTextContent.d.ts +11 -0
  36. package/dist/components/PictureText/PictureTextContent.js +2 -0
  37. package/dist/components/PictureText/PictureTextContent.js.map +1 -0
  38. package/dist/components/ProductGallery/ProductGalleryContent.d.ts +2 -2
  39. package/dist/ui-kit/Button/ButtonProps.d.ts +2 -1
  40. package/dist/ui-kit/Icon/IconProps.d.ts +22 -18
  41. package/dist/ui-kit/Icon/IconProps.js +20 -18
  42. package/dist/ui-kit/Icon/IconProps.js.map +1 -1
  43. package/lib/common.css +1 -1
  44. package/lib/components/Accordion/Accordion.fixture.d.ts +1 -0
  45. package/lib/components/Accordion/AccordionBlocks.d.ts +3 -0
  46. package/lib/components/Accordion/AccordionBlocks.js +6 -0
  47. package/lib/components/Accordion/AccordionBlocks.js.map +1 -1
  48. package/lib/components/Accordion/AccordionContent.d.ts +14 -6
  49. package/lib/components/BaseTile/BaseTile.js +14 -6
  50. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  51. package/lib/components/BaseTile/BaseTileProps.d.ts +10 -0
  52. package/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +1 -1
  53. package/lib/components/BlockContent.d.ts +3 -1
  54. package/lib/components/Blocks.d.ts +17 -14
  55. package/lib/components/Blocks.js +23 -17
  56. package/lib/components/Blocks.js.map +1 -1
  57. package/lib/components/Headline/Headline.d.ts +5 -0
  58. package/lib/components/Headline/Headline.fixture.d.ts +7 -0
  59. package/lib/components/Headline/Headline.js +7 -0
  60. package/lib/components/Headline/Headline.js.map +1 -0
  61. package/lib/components/Headline/HeadlineContent.d.ts +15 -0
  62. package/lib/components/Headline/HeadlineContent.js +2 -0
  63. package/lib/components/Headline/HeadlineContent.js.map +1 -0
  64. package/lib/components/LinkDocs/LinkDocs.d.ts +5 -0
  65. package/lib/components/LinkDocs/LinkDocs.fixture.d.ts +12 -0
  66. package/lib/components/LinkDocs/LinkDocs.js +40 -0
  67. package/lib/components/LinkDocs/LinkDocs.js.map +1 -0
  68. package/lib/components/LinkDocs/LinkDocsContent.d.ts +23 -0
  69. package/lib/components/LinkDocs/LinkDocsContent.js +2 -0
  70. package/lib/components/LinkDocs/LinkDocsContent.js.map +1 -0
  71. package/lib/components/MobileAppTile/MobileAppTileContent.d.ts +1 -3
  72. package/lib/components/MobileBlocks.d.ts +8 -6
  73. package/lib/components/MobileBlocks.js +10 -6
  74. package/lib/components/MobileBlocks.js.map +1 -1
  75. package/lib/components/PictureText/PictureText.d.ts +5 -0
  76. package/lib/components/PictureText/PictureText.fixture.d.ts +4 -0
  77. package/lib/components/PictureText/PictureText.js +12 -0
  78. package/lib/components/PictureText/PictureText.js.map +1 -0
  79. package/lib/components/PictureText/PictureTextContent.d.ts +11 -0
  80. package/lib/components/PictureText/PictureTextContent.js +2 -0
  81. package/lib/components/PictureText/PictureTextContent.js.map +1 -0
  82. package/lib/components/ProductGallery/ProductGalleryContent.d.ts +2 -2
  83. package/lib/ui-kit/Button/ButtonProps.d.ts +2 -1
  84. package/lib/ui-kit/Icon/IconProps.d.ts +22 -18
  85. package/lib/ui-kit/Icon/IconProps.js +20 -18
  86. package/lib/ui-kit/Icon/IconProps.js.map +1 -1
  87. package/package.json +1 -1
  88. package/src/components/Accordion/Accordion.fixture.tsx +104 -3
  89. package/src/components/Accordion/AccordionBlocks.tsx +6 -0
  90. package/src/components/Accordion/AccordionContent.ts +18 -6
  91. package/src/components/BaseTile/BaseTile.tsx +24 -15
  92. package/src/components/BaseTile/BaseTileProps.ts +11 -0
  93. package/src/components/BenefitsBlock/BenefitsBlockContent.ts +1 -1
  94. package/src/components/BlockContent.ts +15 -11
  95. package/src/components/Blocks.ts +23 -17
  96. package/src/components/ContentPage/ContentPage.page.json +88 -2
  97. package/src/components/Headline/Headline.example.json +6 -0
  98. package/src/components/Headline/Headline.fixture.tsx +42 -0
  99. package/src/components/Headline/Headline.tsx +15 -0
  100. package/src/components/Headline/HeadlineContent.ts +18 -0
  101. package/src/components/LinkDocs/LinkDocs.fixture.tsx +51 -0
  102. package/src/components/LinkDocs/LinkDocs.tsx +81 -0
  103. package/src/components/LinkDocs/LinkDocsContent.ts +26 -0
  104. package/src/components/MobileAppTile/MobileAppTileContent.ts +1 -3
  105. package/src/components/MobileBlocks.ts +10 -6
  106. package/src/components/PictureText/PictureText.example.json +20 -0
  107. package/src/components/PictureText/PictureText.fixture.tsx +36 -0
  108. package/src/components/PictureText/PictureText.tsx +45 -0
  109. package/src/components/PictureText/PictureTextContent.ts +13 -0
  110. package/src/components/ProductGallery/ProductGalleryContent.ts +2 -2
  111. package/src/icons/DiscountShape.svg +7 -0
  112. package/src/icons/DocIcon.svg +1 -1
  113. package/src/icons/DocumentText.svg +6 -0
  114. package/src/ui-kit/Button/ButtonProps.ts +2 -1
  115. package/src/ui-kit/Icon/IconProps.ts +4 -0
  116. package/src/icons/MinusIcon.svg +0 -1
  117. package/src/icons/PlusIcon.svg +0 -1
@@ -1,13 +1,54 @@
1
1
  import { context } from '../../setup-fixture';
2
- import type { TextBlockContent } from '../TextBlock/TextBlockContent';
3
2
  import type { AccordionProps } from './Accordion';
3
+ import type { HeadlineProps } from '../Headline/Headline';
4
+ import type { PictureTextContent } from '../PictureText/PictureTextContent';
5
+ import type { TextBlockContent } from '../TextBlock/TextBlockContent';
6
+
4
7
  import { Accordion } from './Accordion';
8
+ import {
9
+ LinkDocsFixtureSetOne,
10
+ LinkDocsFixtureSetThree,
11
+ LinkDocsFixtureSetTwo,
12
+ } from '../LinkDocs/LinkDocs.fixture';
5
13
 
6
14
  const TEXT_BLOCK: TextBlockContent = {
7
15
  description:
8
16
  'Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque minima odio soluta cupiditate pariatur, labore molestias quas necessitatibus nesciunt in praesentium accusamus provident sequi maiores autem. Voluptas quam neque iste?',
9
17
  };
10
18
 
19
+ const HEADLINE: HeadlineProps = {
20
+ context,
21
+ title: 'Своя кредитная карта',
22
+ description: 'Карта работает в 180 странах мира. Бесплатное снятие наличных в любых банкоматах.',
23
+ align: 'left',
24
+ bgColor: 'bg-white',
25
+ };
26
+
27
+ const PICTURE_TEXT: PictureTextContent = {
28
+ title: 'Варианты потребительского кредита',
29
+ benefits: [
30
+ {
31
+ label: 'Кредит по одному документу',
32
+ description: 'До 300 тыс ₽ по упрощённой процедуре получения кредита',
33
+ icon: 'DocumentText',
34
+ },
35
+ {
36
+ label: 'Кредит на общих условиях',
37
+ description: 'До 5 млн ₽ на общих условиях получения кредита',
38
+ icon: 'DiscountShape',
39
+ },
40
+ ],
41
+ image: {
42
+ src: 'legal-support-business.png',
43
+ alt: 'Варианты потребительского кредита',
44
+ format: 'webp',
45
+ size: {
46
+ width: 200,
47
+ height: 200,
48
+ },
49
+ },
50
+ };
51
+
11
52
  const propsTextBlock: AccordionProps = {
12
53
  title: 'Accordion title',
13
54
  context,
@@ -19,6 +60,10 @@ const propsTextBlock: AccordionProps = {
19
60
  type: 'TextBlock',
20
61
  data: TEXT_BLOCK,
21
62
  },
63
+ {
64
+ type: 'TextBlock',
65
+ data: TEXT_BLOCK,
66
+ },
22
67
  ],
23
68
  },
24
69
  {
@@ -28,14 +73,69 @@ const propsTextBlock: AccordionProps = {
28
73
  type: 'TextBlock',
29
74
  data: TEXT_BLOCK,
30
75
  },
76
+ {
77
+ type: 'TextBlock',
78
+ data: TEXT_BLOCK,
79
+ },
31
80
  ],
32
81
  },
33
82
  {
34
83
  label: 'Accordion label 3',
35
84
  blocks: [
36
85
  {
37
- type: 'TextBlock',
38
- data: TEXT_BLOCK,
86
+ type: 'PictureText',
87
+ data: PICTURE_TEXT,
88
+ },
89
+ {
90
+ type: 'PictureText',
91
+ data: PICTURE_TEXT,
92
+ },
93
+ ],
94
+ },
95
+ {
96
+ label: 'Accordion label 4',
97
+ blocks: [
98
+ {
99
+ type: 'Headline',
100
+ data: HEADLINE,
101
+ },
102
+ {
103
+ type: 'Headline',
104
+ data: HEADLINE,
105
+ },
106
+ ],
107
+ },
108
+ ],
109
+ };
110
+
111
+ const propsLinkDocs: AccordionProps = {
112
+ title: 'Accordion title',
113
+ context,
114
+ accordionItems: [
115
+ {
116
+ label: 'Список документов в 2 колонки',
117
+ blocks: [
118
+ {
119
+ type: 'LinkDocs',
120
+ data: { ...LinkDocsFixtureSetOne, title: '' },
121
+ },
122
+ ],
123
+ },
124
+ {
125
+ label: 'Список документов в одну колонку',
126
+ blocks: [
127
+ {
128
+ type: 'LinkDocs',
129
+ data: { ...LinkDocsFixtureSetTwo, title: '' },
130
+ },
131
+ ],
132
+ },
133
+ {
134
+ label: 'Немного кастомизированный список',
135
+ blocks: [
136
+ {
137
+ type: 'LinkDocs',
138
+ data: LinkDocsFixtureSetThree,
39
139
  },
40
140
  ],
41
141
  },
@@ -44,4 +144,5 @@ const propsTextBlock: AccordionProps = {
44
144
 
45
145
  export default {
46
146
  'with text block': <Accordion {...propsTextBlock} />,
147
+ 'with link docs block': <Accordion {...propsLinkDocs} />,
47
148
  };
@@ -1,7 +1,13 @@
1
+ import { Headline } from '../Headline/Headline';
2
+ import { LinkDocs } from '../LinkDocs/LinkDocs';
3
+ import { PictureText } from '../PictureText/PictureText';
1
4
  import { TextBlock } from '../TextBlock/TextBlock';
2
5
 
3
6
  const AccordionBlocks = {
7
+ Headline,
8
+ LinkDocs,
4
9
  TextBlock,
10
+ PictureText,
5
11
  };
6
12
 
7
13
  export default AccordionBlocks;
@@ -1,20 +1,32 @@
1
+ import type { HeadlineContent } from '../Headline/HeadlineContent';
2
+ import type { LinkDocsContent } from '../LinkDocs/LinkDocsContent';
3
+ import type { PictureTextContent } from '../PictureText/PictureTextContent';
1
4
  import type { TextBlockContent } from '../TextBlock/TextBlockContent';
5
+ import AccordionBlocks from './AccordionBlocks';
2
6
 
3
- /** @title Содержимое блока */
4
- export type AccordionDataContent = TextBlockContent;
7
+ /**
8
+ * @hidden
9
+ * @title Содержимое блока
10
+ */
11
+ export type AccordionData =
12
+ | HeadlineContent
13
+ | LinkDocsContent
14
+ | TextBlockContent
15
+ | PictureTextContent;
5
16
 
6
17
  /**
18
+ * @hidden
7
19
  * @title Тип блока
8
- * @enumNames ["Текстовый блок"]
20
+ * @enumNames ["Заголовок", "Блок документов", Текстовый блок", "Картинка с текстом"]
9
21
  */
10
- export type AccordionDataBlocks = 'TextBlock';
22
+ export type AccordionTypeBlock = keyof typeof AccordionBlocks;
11
23
 
12
24
  /**
13
25
  * Блок
14
26
  */
15
27
  export interface AccordionBlock {
16
- type?: AccordionDataBlocks;
17
- data?: AccordionDataContent;
28
+ type?: AccordionTypeBlock;
29
+ data?: AccordionData;
18
30
  }
19
31
 
20
32
  /**
@@ -8,7 +8,18 @@ import { Icon } from '../../ui-kit/Icon/Icon';
8
8
  import { Img } from '../../ui-kit/Img';
9
9
  import { Title } from '../../ui-kit/Title/Title';
10
10
  import { getColSpan } from '../../utils/getColSpan';
11
- import type { BaseTileCommonProps, BaseTileIconButton } from './BaseTileProps';
11
+ import type { AlignType, BaseTileCommonProps, BaseTileIconButton } from './BaseTileProps';
12
+
13
+ const alignBlock: Record<AlignType, string> = {
14
+ left: 'items-start',
15
+ center: 'items-center',
16
+ right: 'items-end',
17
+ };
18
+ const alignText: Record<AlignType, string> = {
19
+ left: 'text-left',
20
+ center: 'text-center',
21
+ right: 'text-right',
22
+ };
12
23
 
13
24
  export interface BaseTileProps extends BaseTileCommonProps, UniBlockProps {}
14
25
 
@@ -26,21 +37,24 @@ export const BaseTile = JSX<BaseTileProps>(
26
37
  image,
27
38
  items,
28
39
  version = 'primary',
40
+ align = 'left',
29
41
  }) => {
30
42
  const router = context.useRouter();
31
43
  const { handlerDecorator } = context;
32
44
  return (
33
- <div className={`font-sans flex flex-col grow h-full`}>
45
+ <div className={`font-sans flex flex-col grow h-full ${alignBlock[align]}`}>
34
46
  {title && (
35
47
  <Title size={titleSize || getTitleSizeByClassName(className)} className={TITLE_CLASSES}>
36
48
  {title}
37
49
  </Title>
38
50
  )}
39
51
  <div className="flex grow justify-between">
40
- <div className="flex flex-col justify-between items-start">
52
+ <div className={`flex flex-col justify-between ${alignBlock[align]}`}>
41
53
  <div>
42
54
  {description ? (
43
- <div className="font-normal text-base max-w-[600px] mb-5">{description}</div>
55
+ <div className={`font-normal text-base max-w-[600px] ${alignText[align]}`}>
56
+ {description}
57
+ </div>
44
58
  ) : null}
45
59
  {children}
46
60
  {items?.length ? renderItems(items, version) : null}
@@ -73,7 +87,7 @@ function getTitleSizeByClassName(className: string = '') {
73
87
 
74
88
  function renderItems(items: string[] = [], version?: BlockVersion) {
75
89
  return (
76
- <section className="max-w-[600px]" role="list">
90
+ <section className="max-w-[600px] mt-5" role="list">
77
91
  {items.map((_, i) => (
78
92
  <BlockItem key={String(i)} className={i ? 'mt-2.5' : ''} text={_} version={version} />
79
93
  ))}
@@ -84,14 +98,9 @@ function renderItems(items: string[] = [], version?: BlockVersion) {
84
98
  function renderButton({ icon, ...button }: BaseTileIconButton, i: number) {
85
99
  if (!button?.text) return;
86
100
 
87
- if (icon)
88
- return (
89
- <Button
90
- key={String(i)}
91
- appendLeft={<Icon name={icon} width="24" height="24" />}
92
- {...button}
93
- />
94
- );
95
-
96
- return <Button key={String(i)} {...button} />;
101
+ return icon ? (
102
+ <Button key={String(i)} appendLeft={<Icon name={icon} width="24" height="24" />} {...button} />
103
+ ) : (
104
+ <Button key={String(i)} {...button} />
105
+ );
97
106
  }
@@ -4,6 +4,16 @@ import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
4
4
  import type { IconName } from '../../ui-kit/Icon/IconProps';
5
5
  import type { TitleSize } from '../../ui-kit/Title/TitleProps';
6
6
 
7
+ /**
8
+ * @title Выравнивание
9
+ * @enumNames [
10
+ * "По левому краю",
11
+ * "По центру",
12
+ * "По правому краю"
13
+ * ]
14
+ */
15
+ export type AlignType = 'left' | 'center' | 'right';
16
+
7
17
  export interface BaseTileIconButton extends ButtonWithIconProps {
8
18
  icon?: IconName;
9
19
  }
@@ -30,4 +40,5 @@ export interface BaseTileCommonProps {
30
40
  */
31
41
  buttons?: BaseTileIconButton[];
32
42
  version?: BlockVersion;
43
+ align?: AlignType;
33
44
  }
@@ -18,7 +18,7 @@ export interface BenefitsBlockContent {
18
18
  /** @title Заголовок */
19
19
  title?: string;
20
20
  /**
21
- * @title Список преимущества
21
+ * @title Список преимуществ
22
22
  * @maxItems 6
23
23
  */
24
24
  benefits?: Benefit[];
@@ -4,7 +4,9 @@ import type { ExchangeRateTileContent } from './ExchangeRateTile/ExchangeRateTil
4
4
  import type { FooterContent } from './Footer/FooterContent';
5
5
  import type { GalleryContent } from './Gallery/GalleryContent';
6
6
  import type { HeaderContent } from './Header/HeaderContent';
7
+ import type { LinkDocsContent } from './LinkDocs/LinkDocsContent';
7
8
  import type { MobileAppTileContent } from './MobileAppTile/MobileAppTileContent';
9
+ import type { PictureTextContent } from './PictureText/PictureTextContent';
8
10
  import type { PlaceholderContent } from './Placeholder/PlaceholderContent';
9
11
  import type { ProductBlockContent } from './ProductBlock/ProductBlockContent';
10
12
  import type { ProductGalleryContent } from './ProductGallery/ProductGalleryContent';
@@ -18,18 +20,20 @@ import type { TileContent } from './Tile/TileContent';
18
20
  * @hidden
19
21
  */
20
22
  export type BlockContent =
21
- | HeaderContent
23
+ | BenefitsBlockContent
24
+ | ComparisonTableContent
25
+ | ExchangeRateTileContent
22
26
  | FooterContent
27
+ | GalleryContent
28
+ | HeaderContent
29
+ | LinkDocsContent
30
+ | MobileAppTileContent
31
+ | PictureTextContent
23
32
  | PlaceholderContent
24
- | TileContent
25
- | PromoTileContent
26
- | TextBlockContent
27
- | ProductTileContent
28
33
  | ProductBlockContent
29
- | StepsBlockContent
30
- | BenefitsBlockContent
31
34
  | ProductGalleryContent
32
- | ExchangeRateTileContent
33
- | MobileAppTileContent
34
- | GalleryContent
35
- | ComparisonTableContent;
35
+ | ProductTileContent
36
+ | PromoTileContent
37
+ | StepsBlockContent
38
+ | TextBlockContent
39
+ | TileContent;
@@ -1,10 +1,16 @@
1
+ import { Accordion } from './Accordion/Accordion';
1
2
  import { BenefitsBlock } from './BenefitsBlock/BenefitsBlock';
3
+ import { ComparisonTable } from './ComparisonTable/ComparisonTable';
4
+ import { CreditCalculator } from './CreditCalculator/CreditCalculator';
2
5
  import { ExchangeRateTile } from './ExchangeRateTile/ExchangeRateTile';
3
6
  import { Footer } from './Footer/Footer';
4
7
  import { Gallery } from './Gallery/Gallery';
5
8
  import { Header } from './Header/Header';
9
+ import { Headline } from './Headline/Headline';
10
+ import { LinkDocs } from './LinkDocs/LinkDocs';
6
11
  import { MiniGallery } from './MiniGallery/MiniGallery';
7
12
  import { MobileAppTile } from './MobileAppTile/MobileAppTile';
13
+ import { PictureText } from './PictureText/PictureText';
8
14
  import { Placeholder } from './Placeholder/Placeholder';
9
15
  import { ProductBlock } from './ProductBlock/ProductBlock';
10
16
  import { ProductGallery } from './ProductGallery/ProductGallery';
@@ -13,27 +19,27 @@ import { PromoTile } from './PromoTile/PromoTile';
13
19
  import { StepsBlock } from './StepsBlock/StepsBlock';
14
20
  import { TextBlock } from './TextBlock/TextBlock';
15
21
  import { Tile } from './Tile/Tile';
16
- import { ComparisonTable } from './ComparisonTable/ComparisonTable';
17
- import { Accordion } from './Accordion/Accordion';
18
- import { CreditCalculator } from './CreditCalculator/CreditCalculator';
19
22
 
20
23
  export const Blocks = {
21
- Header,
22
- Footer,
23
- Placeholder,
24
- Tile,
25
- PromoTile,
26
- TextBlock,
27
- ProductTile,
28
- ProductBlock,
29
- StepsBlock,
24
+ Accordion,
30
25
  BenefitsBlock,
31
- ProductGallery,
26
+ ComparisonTable,
27
+ CreditCalculator,
32
28
  ExchangeRateTile,
33
- MobileAppTile,
29
+ Footer,
34
30
  Gallery,
31
+ Header,
32
+ Headline,
33
+ LinkDocs,
35
34
  MiniGallery,
36
- ComparisonTable,
37
- Accordion,
38
- CreditCalculator,
35
+ MobileAppTile,
36
+ PictureText,
37
+ Placeholder,
38
+ ProductBlock,
39
+ ProductGallery,
40
+ ProductTile,
41
+ PromoTile,
42
+ StepsBlock,
43
+ TextBlock,
44
+ Tile,
39
45
  };
@@ -1361,10 +1361,96 @@
1361
1361
  }
1362
1362
  },
1363
1363
  {
1364
- "type": "CreditCalculator",
1364
+ "type": "Headline",
1365
1365
  "style": ["col-span-12"],
1366
1366
  "content": {
1367
- "directoryName": "credit-calculator-data"
1367
+ "title": "Своя кредитная карта",
1368
+ "description": "Карта работает в 180 странах мира. Бесплатное снятие наличных в любых банкоматах.",
1369
+ "align": "center",
1370
+ "bgColor": "transparent"
1371
+ }
1372
+ },
1373
+ {
1374
+ "type": "LinkDocs",
1375
+ "style": ["col-span-12"],
1376
+ "content": {
1377
+ "title": "Дополнительные документы",
1378
+ "icon": "DocIcon",
1379
+ "documents": [
1380
+ {
1381
+ "text": "target self",
1382
+ "href": "/abc1/cooldoc.doc",
1383
+ "target": "_self"
1384
+ },
1385
+ {
1386
+ "text": "target blank",
1387
+ "href": "/abc2/wtf.rtf",
1388
+ "target": "_blank"
1389
+ },
1390
+ {
1391
+ "text": "GlassIcon",
1392
+ "href": "/abc3/map.jpeg"
1393
+ },
1394
+ {
1395
+ "text": "no icon",
1396
+ "href": "/abc4"
1397
+ },
1398
+ {
1399
+ "text": "документ 5",
1400
+ "href": "/abc5"
1401
+ },
1402
+ {
1403
+ "text": "документ 6",
1404
+ "href": "/abc6/abc.pdf"
1405
+ },
1406
+ {
1407
+ "text": "Text text text",
1408
+ "href": "/abc7/yolo.png"
1409
+ },
1410
+ {
1411
+ "text": "Some more generic text, and even more, more text",
1412
+ "href": "/abc8/archive.zip",
1413
+ "fileSize": "2.3МБ"
1414
+ },
1415
+ {
1416
+ "text": "И ещё немного текста",
1417
+ "href": "/abc9/rarniw.rar",
1418
+ "fileSize": "666МБ"
1419
+ },
1420
+ {
1421
+ "text": "Форматируем, сортируем, смотрим как отображается...",
1422
+ "href": "/abc10/",
1423
+ "fileSize": "65ГБ"
1424
+ }
1425
+ ]
1426
+ }
1427
+ },
1428
+ {
1429
+ "type": "PictureText",
1430
+ "style": ["col-span-12"],
1431
+ "content": {
1432
+ "title": "Варианты потребительского кредита",
1433
+ "benefits": [
1434
+ {
1435
+ "label": "Кредит по одному документу",
1436
+ "description": "До 300 тыс ₽ по упрощённой процедуре получения кредита",
1437
+ "icon": "DocumentText"
1438
+ },
1439
+ {
1440
+ "label": "Кредит на общих условиях",
1441
+ "description": "До 5 млн ₽ на общих условиях получения кредита",
1442
+ "icon": "DiscountShape"
1443
+ }
1444
+ ],
1445
+ "image": {
1446
+ "src": "legal-support-business.png",
1447
+ "alt": "Варианты потребительского кредита",
1448
+ "format": "webp",
1449
+ "size": {
1450
+ "width": 200,
1451
+ "height": 200
1452
+ }
1453
+ }
1368
1454
  }
1369
1455
  },
1370
1456
  {
@@ -0,0 +1,6 @@
1
+ {
2
+ "title": "Заголовок",
3
+ "description": "Описание",
4
+ "align": "center",
5
+ "bgColor": "transparent"
6
+ }
@@ -0,0 +1,42 @@
1
+ import { context } from '../../setup-fixture';
2
+
3
+ import { Headline } from './Headline';
4
+
5
+ export default {
6
+ default: (
7
+ <Headline
8
+ title="Своя кредитная карта"
9
+ description="Карта работает в 180 странах мира. Бесплатное снятие наличных в любых банкоматах."
10
+ align="left"
11
+ bgColor="bg-white"
12
+ context={context}
13
+ />
14
+ ),
15
+ 'center transparent': (
16
+ <Headline
17
+ title="Своя кредитная карта"
18
+ description="Карта работает в 180 странах мира. Бесплатное снятие наличных в любых банкоматах."
19
+ align="center"
20
+ bgColor="transparent"
21
+ context={context}
22
+ />
23
+ ),
24
+ 'right transparent': (
25
+ <Headline
26
+ title="Своя кредитная карта"
27
+ description="Карта работает в 180 странах мира. Бесплатное снятие наличных в любых банкоматах."
28
+ align="right"
29
+ bgColor="transparent"
30
+ context={context}
31
+ />
32
+ ),
33
+ 'right white': (
34
+ <Headline
35
+ title="Своя кредитная карта"
36
+ description="Карта работает в 180 странах мира. Бесплатное снятие наличных в любых банкоматах."
37
+ align="right"
38
+ bgColor="bg-white"
39
+ context={context}
40
+ />
41
+ ),
42
+ };
@@ -0,0 +1,15 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+
3
+ import type { UniBlockProps } from '../../types';
4
+ import { BaseTile } from '../BaseTile/BaseTile';
5
+ import type { HeadlineContent } from './HeadlineContent';
6
+
7
+ export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
8
+
9
+ export const Headline = JSX<HeadlineProps>(({ bgColor = 'bg-white', className, ...props }) => {
10
+ return (
11
+ <section className={`p-10 ${bgColor} ${className || ''} `}>
12
+ <BaseTile {...props}></BaseTile>
13
+ </section>
14
+ );
15
+ });
@@ -0,0 +1,18 @@
1
+ import type { BaseTileCommonProps } from '../BaseTile/BaseTileProps';
2
+
3
+ /**
4
+ * @title Цвет фона
5
+ * @enumNames [
6
+ * "Прозрачный",
7
+ * "Белый"
8
+ * ]
9
+ */
10
+ export type HeadlineBgColor = 'transparent' | 'bg-white';
11
+
12
+ /**
13
+ * @title Заголовок
14
+ */
15
+ export interface HeadlineContent
16
+ extends Pick<BaseTileCommonProps, 'title' | 'titleSize' | 'description' | 'align'> {
17
+ bgColor?: HeadlineBgColor;
18
+ }
@@ -0,0 +1,51 @@
1
+ import { LinkDocs } from './LinkDocs';
2
+ import { context } from '../../setup-fixture';
3
+ import type { LinkDocsContent } from './LinkDocsContent';
4
+
5
+ export const LinkDocsFixtureSetOne: LinkDocsContent = {
6
+ title: 'Дополнительные документы',
7
+ icon: 'DocIcon',
8
+ documents: [
9
+ { text: 'target self', href: '/abc1/cooldoc.doc', target: '_self' },
10
+ { text: 'target blank', href: '/abc2/wtf.rtf', target: '_blank' },
11
+ { text: 'GlassIcon', href: '/abc3/map.jpeg' },
12
+ { text: 'no icon', href: '/abc4' },
13
+ { text: 'документ 5', href: '/abc5' },
14
+ { text: 'документ 6', href: '/abc6/abc.pdf' },
15
+ { text: 'Text text text', href: '/abc7/yolo.png' },
16
+ {
17
+ text: 'Some more generic text, and even more, more text',
18
+ href: '/abc8/archive.zip',
19
+ fileSize: '2.3МБ',
20
+ },
21
+ { text: 'И ещё немного текста', href: '/abc9/rarniw.rar', fileSize: '666МБ' },
22
+ {
23
+ text: 'Форматируем, сортируем, смотрим как отображается...',
24
+ href: '/abc10/',
25
+ fileSize: '65ГБ',
26
+ },
27
+ ],
28
+ };
29
+
30
+ export const LinkDocsFixtureSetTwo: LinkDocsContent = {
31
+ ...LinkDocsFixtureSetOne,
32
+ columnsMode: 'single',
33
+ };
34
+
35
+ export const LinkDocsFixtureSetThree: LinkDocsContent = {
36
+ ...LinkDocsFixtureSetOne,
37
+ icon: 'GlassIcon',
38
+ title: '',
39
+ };
40
+
41
+ export const LinkDocsFixtureSetFour: LinkDocsContent = {
42
+ ...LinkDocsFixtureSetOne,
43
+ icon: undefined,
44
+ };
45
+
46
+ export default {
47
+ 'default, 2 columns': <LinkDocs context={context} {...LinkDocsFixtureSetOne} />,
48
+ 'one column': <LinkDocs context={context} {...LinkDocsFixtureSetTwo} />,
49
+ 'another icon, no extensions': <LinkDocs context={context} {...LinkDocsFixtureSetThree} />,
50
+ 'no icon': <LinkDocs context={context} {...LinkDocsFixtureSetFour} />,
51
+ };