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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +42 -16
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/BaseTile/BaseTile.js +2 -2
  5. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  6. package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
  7. package/dist/components/LinkDocs/LinkDocs.js +1 -1
  8. package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
  9. package/dist/components/LinkDocs/LinkDocsContent.d.ts +3 -3
  10. package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
  11. package/dist/components/ProductBlock/ProductBlock.js +12 -4
  12. package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  13. package/dist/components/ProductBlock/ProductBlockContent.d.ts +13 -2
  14. package/dist/components/ProductBlock/ProductBlockInner.js +16 -4
  15. package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  16. package/dist/components/ProductTile/ProductTileContent.d.ts +2 -2
  17. package/dist/components/TextBlock/TextBlockContent.d.ts +1 -0
  18. package/dist/components/Tile/TileContent.d.ts +1 -1
  19. package/dist/model/ButtonVersion.d.ts +1 -0
  20. package/dist/model/LinkProps.d.ts +2 -1
  21. package/dist/ui-kit/Button/ButtonProps.d.ts +6 -1
  22. package/dist/ui-kit/Icon/Icon.js +1 -1
  23. package/dist/ui-kit/Icon/Icon.js.map +1 -1
  24. package/dist/ui-kit/Icon/IconProps.d.ts +49 -41
  25. package/dist/ui-kit/Icon/IconProps.js +45 -41
  26. package/dist/ui-kit/Icon/IconProps.js.map +1 -1
  27. package/dist/ui-kit/Img.js +9 -3
  28. package/dist/ui-kit/Img.js.map +1 -1
  29. package/lib/common.css +1 -1
  30. package/lib/components/BaseTile/BaseTile.js +2 -2
  31. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  32. package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
  33. package/lib/components/LinkDocs/LinkDocs.js +1 -1
  34. package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
  35. package/lib/components/LinkDocs/LinkDocsContent.d.ts +3 -3
  36. package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
  37. package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
  38. package/lib/components/ProductBlock/ProductBlock.js +12 -4
  39. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  40. package/lib/components/ProductBlock/ProductBlockContent.d.ts +13 -2
  41. package/lib/components/ProductBlock/ProductBlockInner.js +16 -4
  42. package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  43. package/lib/components/ProductTile/ProductTileContent.d.ts +2 -2
  44. package/lib/components/TextBlock/TextBlockContent.d.ts +1 -0
  45. package/lib/components/Tile/TileContent.d.ts +1 -1
  46. package/lib/model/ButtonVersion.d.ts +1 -0
  47. package/lib/model/LinkProps.d.ts +2 -1
  48. package/lib/ui-kit/Button/ButtonProps.d.ts +6 -1
  49. package/lib/ui-kit/Icon/Icon.js +1 -1
  50. package/lib/ui-kit/Icon/Icon.js.map +1 -1
  51. package/lib/ui-kit/Icon/IconProps.d.ts +49 -41
  52. package/lib/ui-kit/Icon/IconProps.js +45 -41
  53. package/lib/ui-kit/Icon/IconProps.js.map +1 -1
  54. package/lib/ui-kit/Img.js +9 -3
  55. package/lib/ui-kit/Img.js.map +1 -1
  56. package/package.json +3 -2
  57. package/src/components/Accordion/Accordion.example.json +4 -4
  58. package/src/components/BaseTile/BaseTile.tsx +6 -2
  59. package/src/components/ComparisonTable/ComparisonTable.example.json +1 -1
  60. package/src/components/ComparisonTable/ComparisonTableContent.ts +2 -3
  61. package/src/components/LinkDocs/LinkDocs.tsx +1 -1
  62. package/src/components/LinkDocs/LinkDocsContent.ts +3 -3
  63. package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +2 -0
  64. package/src/components/PictureText/PictureText.example.json +1 -1
  65. package/src/components/ProductBlock/ProductBlock.example.json +1 -1
  66. package/src/components/ProductBlock/ProductBlock.fixture.tsx +58 -1
  67. package/src/components/ProductBlock/ProductBlock.tsx +19 -8
  68. package/src/components/ProductBlock/ProductBlockContent.ts +14 -2
  69. package/src/components/ProductBlock/ProductBlockInner.tsx +38 -6
  70. package/src/components/ProductTile/ProductTile.example.json +1 -1
  71. package/src/components/ProductTile/ProductTileContent.ts +2 -2
  72. package/src/components/TextBlock/TextBlockContent.ts +1 -0
  73. package/src/components/Tile/Tile.example.json +1 -1
  74. package/src/components/Tile/TileContent.ts +1 -1
  75. package/src/icons/AppleIcon.svg +1 -1
  76. package/src/icons/CalendarWhiteIcon.svg +17 -0
  77. package/src/icons/EmptyWalletWhiteIcon.svg +16 -0
  78. package/src/icons/GridIcon.svg +2 -2
  79. package/src/icons/PercentageSquareWhiteIcon.svg +16 -0
  80. package/src/icons/PlayMarketIcon.svg +1 -1
  81. package/src/model/ButtonVersion.ts +1 -0
  82. package/src/model/LinkProps.ts +2 -1
  83. package/src/ui-kit/Button/ButtonProps.ts +6 -1
  84. package/src/ui-kit/Icon/Icon.tsx +1 -1
  85. package/src/ui-kit/Icon/IconProps.ts +8 -0
  86. package/src/ui-kit/Img.tsx +23 -10
@@ -1,4 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import type { BlockVersion } from '../../model/BlockVersion';
2
3
  import type { UniBlockProps } from '../../types';
3
4
  import { Icon } from '../../ui-kit/Icon/Icon';
4
5
  import { Img } from '../../ui-kit/Img';
@@ -8,8 +9,32 @@ import type { ProductBlockInnerCommonProps } from './ProductBlockContent';
8
9
 
9
10
  export interface ProductBlockInnerProps extends ProductBlockInnerCommonProps, UniBlockProps {}
10
11
 
12
+ const benefitIconBgStyleMap: Record<BlockVersion, string> = {
13
+ primary: 'bg-main',
14
+ secondary: 'bg-white/30',
15
+ };
16
+ const benefitTitleStyleMap: Record<BlockVersion, string> = {
17
+ primary: 'text-primary-text',
18
+ secondary: 'text-white',
19
+ };
20
+ const benefitDescStyleMap: Record<BlockVersion, string> = {
21
+ primary: 'text-secondary-text',
22
+ secondary: 'text-white',
23
+ };
24
+
11
25
  export const ProductBlockInner = JSX<ProductBlockInnerProps>(
12
- ({ className, context, title, titleSize, description, benefits, buttons, image, items }) => {
26
+ ({
27
+ className,
28
+ context,
29
+ title,
30
+ titleSize,
31
+ description,
32
+ benefits,
33
+ buttons,
34
+ image,
35
+ items,
36
+ version = 'primary',
37
+ }) => {
13
38
  return (
14
39
  <div className={`flex grow justify-between items-stretch ${className || ''}`}>
15
40
  <div className={'flex flex-col'}>
@@ -20,9 +45,12 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
20
45
  description={description}
21
46
  items={items}
22
47
  buttons={buttons}
48
+ version={version}
23
49
  >
24
50
  {benefits?.length ? (
25
- <div className="flex gap-6 mt-6 mb-3.5">{benefits.map(renderBenefit)}</div>
51
+ <div className="flex gap-6 mt-6 mb-3.5">
52
+ {benefits.map((_, i) => renderBenefit(_, i, version))}
53
+ </div>
26
54
  ) : null}
27
55
  </BaseTile>
28
56
  </div>
@@ -32,21 +60,25 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
32
60
  },
33
61
  );
34
62
 
35
- function renderBenefit(benefit: Benefit, i: number) {
63
+ function renderBenefit(benefit: Benefit, i: number, version: string) {
36
64
  return (
37
65
  <div key={String(i)} className="flex gap-4 items-center">
38
66
  {benefit.icon && (
39
67
  <Icon
40
- className="w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border"
68
+ className={`w-[50px] h-[50px] min-w-[50px] min-h-[50px] rounded-full p-[10px] box-border ${benefitIconBgStyleMap[version]}`}
41
69
  name={benefit.icon}
42
70
  width="24"
43
71
  height="24"
44
72
  />
45
73
  )}
46
74
  <div className="flex gap-1 flex-col h-full max-w-[149px]">
47
- <h4 className="font-medium text-primary-text text-xl m-0">{benefit.label}</h4>
75
+ <h4 className={`font-medium text-xl m-0 ${benefitTitleStyleMap[version]}`}>
76
+ {benefit.label}
77
+ </h4>
48
78
  {benefit.description && (
49
- <div className="font-normal text-sm text-secondary-text">{benefit.description}</div>
79
+ <div className={`font-normal text-sm ${benefitDescStyleMap[version]}`}>
80
+ {benefit.description}
81
+ </div>
50
82
  )}
51
83
  </div>
52
84
  </div>
@@ -23,7 +23,7 @@
23
23
  ],
24
24
  "buttons": [
25
25
  {
26
- "text": "Подробнее",
26
+ "text": "Кнопка",
27
27
  "version": "primary"
28
28
  }
29
29
  ]
@@ -4,7 +4,7 @@ import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
4
4
  /**
5
5
  * @title Продуктовая плитка
6
6
  */
7
- export interface ProductTileContent extends BaseTileCommonProps {
7
+ export interface ProductTileContent extends Omit<BaseTileCommonProps, 'align'> {
8
8
  /** @title Преимущества */
9
- benefits?: Benefit[];
9
+ benefits?: Omit<Benefit, 'icon'>[];
10
10
  }
@@ -18,6 +18,7 @@ export type TextBlockIconVersion = 'none' | 'small' | 'big';
18
18
  export interface TextBlockContent {
19
19
  /** @title Заголовок */
20
20
  title?: string;
21
+ /** @title Описание */
21
22
  description?: string;
22
23
  iconVersion?: TextBlockIconVersion;
23
24
  image?: Picture;
@@ -13,7 +13,7 @@
13
13
  "items": ["Пункт 1", "Пункт 2", "Пункт 3"],
14
14
  "buttons": [
15
15
  {
16
- "text": "Подробнее",
16
+ "text": "Кнопка",
17
17
  "version": "primary"
18
18
  }
19
19
  ],
@@ -3,4 +3,4 @@ import type { BaseTileCommonProps } from '../BaseTile/BaseTileProps';
3
3
  /**
4
4
  * @title Плитка
5
5
  */
6
- export type TileContent = BaseTileCommonProps;
6
+ export type TileContent = Omit<BaseTileCommonProps, 'align'>;
@@ -1 +1 @@
1
- <svg id="icon" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 24"><path d="M18.406 12.761c-.023-3.028 2.793-4.511 2.93-4.572-1.603-2.073-4.075-2.357-4.968-2.377-2.083-.204-4.098 1.117-5.174 1.117-1.076 0-2.725-1.097-4.488-1.056-2.266.04-4.395 1.198-5.563 3.007-2.404 3.698-.618 9.124 1.694 12.09 1.145 1.464 2.496 3.09 4.259 3.028 1.717-.06 2.358-.975 4.441-.975 2.06 0 2.656.975 4.465.935 1.854-.02 3.022-1.463 4.12-2.947 1.329-1.666 1.855-3.332 1.878-3.413 0 0-3.549-1.2-3.594-4.837Zm-3.389-8.92c.916-1.037 1.557-2.419 1.374-3.841-1.35.061-3.022.833-3.984 1.829-.847.894-1.625 2.337-1.42 3.698 1.512.102 3.069-.67 4.03-1.686Z" fill="#42AB44"/></svg>
1
+ <svg id="icon" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 24"><path d="M18.406 12.761c-.023-3.028 2.793-4.511 2.93-4.572-1.603-2.073-4.075-2.357-4.968-2.377-2.083-.204-4.098 1.117-5.174 1.117-1.076 0-2.725-1.097-4.488-1.056-2.266.04-4.395 1.198-5.563 3.007-2.404 3.698-.618 9.124 1.694 12.09 1.145 1.464 2.496 3.09 4.259 3.028 1.717-.06 2.358-.975 4.441-.975 2.06 0 2.656.975 4.465.935 1.854-.02 3.022-1.463 4.12-2.947 1.329-1.666 1.855-3.332 1.878-3.413 0 0-3.549-1.2-3.594-4.837Zm-3.389-8.92c.916-1.037 1.557-2.419 1.374-3.841-1.35.061-3.022.833-3.984 1.829-.847.894-1.625 2.337-1.42 3.698 1.512.102 3.069-.67 4.03-1.686Z" fill="currentColor"/></svg>
@@ -0,0 +1,17 @@
1
+ <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path
3
+ stroke="#fff"
4
+ stroke-width="2"
5
+ stroke-miterlimit="10"
6
+ stroke-linecap="round"
7
+ stroke-linejoin="round"
8
+ d="M8 2v3M16 2v3M3.5 9.09h17M3 13.01V8.5c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5V17c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5"
9
+ />
10
+ <path
11
+ stroke="#fff"
12
+ stroke-width="3"
13
+ stroke-linecap="round"
14
+ stroke-linejoin="round"
15
+ d="M15.991 13h.018M15.991 17.006h.018M11.991 13h.018M11.991 17.006h.018M7.991 13h.018M7.991 17.006h.018"
16
+ />
17
+ </svg>
@@ -0,0 +1,16 @@
1
+ <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path
3
+ stroke="#fff"
4
+ stroke-width="2"
5
+ stroke-linecap="round"
6
+ stroke-linejoin="round"
7
+ d="M2.5 14.07v-2.56c0-2.07 1.69-3.76 3.76-3.76h11.48c2.07 0 3.76 1.69 3.76 3.76v1.44h-2.02c-.56 0-1.07.22-1.44.6-.42.41-.66 1-.6 1.63.09 1.08 1.08 1.87 2.16 1.87h1.9v1.19c0 2.07-1.69 3.76-3.76 3.76H6.26c-2.07 0-3.76-1.69-3.76-3.76M12.28 2.17a1.9 1.9 0 0 1 2.57 1.78v3.8"
8
+ />
9
+ <path
10
+ stroke="#fff"
11
+ stroke-width="2"
12
+ stroke-linecap="round"
13
+ stroke-linejoin="round"
14
+ d="M2.5 12.41V7.84c0-1.19.73-2.25 1.84-2.67l3.97-1.5M22.56 13.97v2.06c0 .55-.44 1-1 1.02H19.6c-1.08 0-2.07-.79-2.16-1.87-.06-.63.18-1.22.6-1.63.37-.38.88-.6 1.44-.6h2.08c.56.02 1 .47 1 1.02ZM7 12h7"
15
+ />
16
+ </svg>
@@ -1,4 +1,4 @@
1
1
  <svg id="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 33">
2
- <rect width="32" height="32" y=".5" rx="16"/>
2
+ <rect fill="#F5F7F9" width="32" height="32" y=".5" rx="16"/>
3
3
  <path fill="#1C1C1C" d="M13 11.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM13 16.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM11.5 23a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM18 11.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM16.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM18 21.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM21.5 13a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM23 16.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM21.5 23a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"/>
4
- </svg>
4
+ </svg>
@@ -0,0 +1,16 @@
1
+ <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path
3
+ stroke="#fff"
4
+ stroke-width="2"
5
+ stroke-linecap="round"
6
+ stroke-linejoin="round"
7
+ d="M2 13.05V15c0 5 2 7 7 7h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9M8.32 15.27l6.54-6.54"
8
+ />
9
+ <path
10
+ stroke="#fff"
11
+ stroke-width="2"
12
+ stroke-linecap="round"
13
+ stroke-linejoin="round"
14
+ d="M8.73 10.37a1.23 1.23 0 1 0 0-2.46 1.23 1.23 0 0 0 0 2.46ZM15.27 16.09a1.23 1.23 0 1 0 0-2.46 1.23 1.23 0 0 0 0 2.46Z"
15
+ />
16
+ </svg>
@@ -1 +1 @@
1
- <svg id="icon" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 23"><path d="M0 21.427V1.576C0 .883.447.284 1.094 0L13.85 11.498 1.089 23a1.89 1.89 0 0 1-.795-.646A1.625 1.625 0 0 1 0 21.427Zm17.899-6.282-13.95 7.259 11.002-9.915 2.948 2.656Zm4.335-5.035c.237.162.428.37.561.61.133.239.203.502.205.77.002.267-.064.53-.193.771s-.317.452-.551.617l-2.964 1.542-3.241-2.922 3.24-2.92 2.944 1.532ZM3.959.598l13.938 7.253-2.945 2.654L3.958.598Z" fill="#42AB44"/></svg>
1
+ <svg id="icon" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 23"><path d="M0 21.427V1.576C0 .883.447.284 1.094 0L13.85 11.498 1.089 23a1.89 1.89 0 0 1-.795-.646A1.625 1.625 0 0 1 0 21.427Zm17.899-6.282-13.95 7.259 11.002-9.915 2.948 2.656Zm4.335-5.035c.237.162.428.37.561.61.133.239.203.502.205.77.002.267-.064.53-.193.771s-.317.452-.551.617l-2.964 1.542-3.241-2.922 3.24-2.92 2.944 1.532ZM3.959.598l13.938 7.253-2.945 2.654L3.958.598Z" fill="currentColor"/></svg>
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * @title Цвет кнопки
3
+ * @default primary
3
4
  * @enumNames ["Основная", "Второстепенная"]
4
5
  */
5
6
  export type ButtonVersion = 'primary' | 'secondary';
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * @title Таргет (target)
3
3
  * @enumNames [
4
+ * "",
4
5
  * "self (текущее окно или фрейм)",
5
6
  * "blank (новое окно)",
6
7
  * "parent (фрейм-родитель)",
7
8
  * "top (текущее окно)"
8
9
  * ]
9
10
  */
10
- export type Target = '_blank' | '_self' | '_parent' | '_top';
11
+ export type Target = '' | '_self' | '_blank' | '_parent' | '_top';
11
12
 
12
13
  /**
13
14
  * @title Ссылка
@@ -13,7 +13,10 @@ export interface ButtonAdditionalProps {
13
13
  }
14
14
 
15
15
  export interface ButtonProps extends ButtonAdditionalProps, LinkProps {
16
- /** @title Текст */
16
+ /**
17
+ * @title Текст
18
+ * @default Кнопка
19
+ */
17
20
  text?: string;
18
21
  version?: ButtonVersion;
19
22
  }
@@ -25,4 +28,6 @@ export interface ButtonWithIconProps extends ButtonProps {
25
28
  appendLeft?: any;
26
29
  /** @hidden */
27
30
  rounded?: boolean;
31
+ /** @hidden */
32
+ asSVG?: boolean;
28
33
  }
@@ -3,7 +3,7 @@ import { projectSettings } from '../../ProjectSettings';
3
3
  import type { IconProps } from './IconProps';
4
4
 
5
5
  export const Icon = JSX<IconProps>(
6
- ({ className, name, alt = `Icon ${name}`, title = alt, asSVG, ...imgProps }) => {
6
+ ({ className = '', name, alt = `Icon ${name}`, title = alt, asSVG, ...imgProps }) => {
7
7
  const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
8
8
 
9
9
  if (asSVG) {
@@ -2,10 +2,12 @@
2
2
  * Icons sorted by name
3
3
  */
4
4
  export enum IconMap {
5
+ '',
5
6
  'ActualBalanceIcon',
6
7
  'AppleIcon',
7
8
  'CalendarCircleIcon',
8
9
  'CalendarIcon',
10
+ 'CalendarWhiteIcon',
9
11
  'CardIcon',
10
12
  'CardPosIcon',
11
13
  'CardTickIcon',
@@ -17,6 +19,7 @@ export enum IconMap {
17
19
  'DollarIcon',
18
20
  'EmptyWalletChangeIcon',
19
21
  'EmptyWalletIcon',
22
+ 'EmptyWalletWhiteIcon',
20
23
  'EuroIcon',
21
24
  'GlassIcon',
22
25
  'GridIcon',
@@ -31,6 +34,7 @@ export enum IconMap {
31
34
  'OkIcon',
32
35
  'PassSendIcon',
33
36
  'PercentageSquareIcon',
37
+ 'PercentageSquareWhiteIcon',
34
38
  'PlayMarketIcon',
35
39
  'PlusIcon',
36
40
  'Profile2UserIcon',
@@ -48,10 +52,12 @@ export enum IconMap {
48
52
  /**
49
53
  * @title Иконка
50
54
  * @enumNames [
55
+ * "",
51
56
  * "Деньги",
52
57
  * "Лого «Apple»",
53
58
  * "Скруглённый календарь",
54
59
  * "Календарь",
60
+ * "Календарь белый",
55
61
  * "Кред. карта",
56
62
  * "Кред. карта под наклоном",
57
63
  * "Кред. карта с галочкой",
@@ -63,6 +69,7 @@ export enum IconMap {
63
69
  * "Доллар",
64
70
  * "Пустой кошелёк с возвратом",
65
71
  * "Пустой кошелёк",
72
+ * "Пустой кошелёк белый",
66
73
  * "Евро",
67
74
  * "Зеркало",
68
75
  * "Сетка",
@@ -77,6 +84,7 @@ export enum IconMap {
77
84
  * "Лого «Одноклассники»",
78
85
  * "Бизнес",
79
86
  * "Проценты",
87
+ * "Проценты белые",
80
88
  * "Лого «PlayMarket»",
81
89
  * "Плюс",
82
90
  * "Профиль, 2 персоны",
@@ -6,16 +6,29 @@ export interface TextWithImageProps {
6
6
  image: Picture;
7
7
  }
8
8
 
9
- export const Img = JSX<TextWithImageProps>(({ className, image }) => (
10
- <picture className={`${className || ''}`}>
11
- {image.sources?.length
12
- ? image.sources.map(({ src, format }, index) => (
13
- <source key={`${index}_${src}`} srcSet={src} type={formatToMimeType(format)} />
14
- ))
15
- : null}
16
- <img src={image.src} alt={image.alt || image.title} title={image.title} {...image?.size} />
17
- </picture>
18
- ));
9
+ export const Img = JSX<TextWithImageProps>(({ className, image: { size, ...image } }) => {
10
+ const style = {
11
+ width: size?.width ? `${size?.width}px` : '100%',
12
+ height: size?.height ? `${size?.height}px` : '100%',
13
+ };
14
+
15
+ return (
16
+ <picture className={`flex-none ${className || ''}`}>
17
+ {image.sources?.length
18
+ ? image.sources.map(({ src, format }, index) => (
19
+ <source key={`${index}_${src}`} srcSet={src} type={formatToMimeType(format)} />
20
+ ))
21
+ : null}
22
+ <img
23
+ src={image.src}
24
+ alt={image.alt || image.title}
25
+ title={image.title}
26
+ style={style}
27
+ {...size}
28
+ />
29
+ </picture>
30
+ );
31
+ });
19
32
 
20
33
  export function formatToMimeType(format: ImgSource['format']): string | undefined {
21
34
  return format ? `image/${String(format)}` : undefined;