@redneckz/wildless-cms-uni-blocks 0.3.59 → 0.3.60

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 (78) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +26 -10
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/Blocks.d.ts +1 -0
  5. package/dist/components/Blocks.js +2 -0
  6. package/dist/components/Blocks.js.map +1 -1
  7. package/dist/components/GroupBlock/GroupBlock.js +1 -1
  8. package/dist/components/GroupBlock/GroupBlock.js.map +1 -1
  9. package/dist/components/GroupBlock/GroupBlockTabs.js +4 -4
  10. package/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  11. package/dist/components/Insurance/Insurance.d.ts +5 -0
  12. package/dist/components/Insurance/Insurance.js +22 -0
  13. package/dist/components/Insurance/Insurance.js.map +1 -0
  14. package/dist/components/Insurance/InsuranceContent.d.ts +13 -0
  15. package/dist/components/Insurance/InsuranceContent.js +2 -0
  16. package/dist/components/Insurance/InsuranceContent.js.map +1 -0
  17. package/dist/ui-kit/Icon/Icon.js +1 -1
  18. package/dist/ui-kit/Icon/Icon.js.map +1 -1
  19. package/lib/common.css +1 -1
  20. package/lib/components/Blocks.d.ts +1 -0
  21. package/lib/components/Blocks.js +2 -0
  22. package/lib/components/Blocks.js.map +1 -1
  23. package/lib/components/GroupBlock/GroupBlock.js +1 -1
  24. package/lib/components/GroupBlock/GroupBlock.js.map +1 -1
  25. package/lib/components/GroupBlock/GroupBlockTabs.js +4 -4
  26. package/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  27. package/lib/components/Insurance/Insurance.d.ts +5 -0
  28. package/lib/components/Insurance/Insurance.fixture.d.ts +4 -0
  29. package/lib/components/Insurance/Insurance.js +20 -0
  30. package/lib/components/Insurance/Insurance.js.map +1 -0
  31. package/lib/components/Insurance/InsuranceContent.d.ts +13 -0
  32. package/lib/components/Insurance/InsuranceContent.js +2 -0
  33. package/lib/components/Insurance/InsuranceContent.js.map +1 -0
  34. package/lib/ui-kit/Icon/Icon.js +1 -1
  35. package/lib/ui-kit/Icon/Icon.js.map +1 -1
  36. package/mobile/bundle/bundle.umd.js +1 -1
  37. package/mobile/bundle/bundle.umd.min.js +1 -1
  38. package/mobile/dist/components/GroupBlock/GroupBlock.js +1 -1
  39. package/mobile/dist/components/GroupBlock/GroupBlock.js.map +1 -1
  40. package/mobile/dist/components/GroupBlock/GroupBlockTabs.js +4 -4
  41. package/mobile/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  42. package/mobile/dist/components/Insurance/Insurance.d.ts +5 -0
  43. package/mobile/dist/components/Insurance/Insurance.js +22 -0
  44. package/mobile/dist/components/Insurance/Insurance.js.map +1 -0
  45. package/mobile/dist/components/Insurance/InsuranceContent.d.ts +13 -0
  46. package/mobile/dist/components/Insurance/InsuranceContent.js +2 -0
  47. package/mobile/dist/components/Insurance/InsuranceContent.js.map +1 -0
  48. package/mobile/dist/ui-kit/Icon/Icon.js +1 -1
  49. package/mobile/dist/ui-kit/Icon/Icon.js.map +1 -1
  50. package/mobile/lib/components/GroupBlock/GroupBlock.js +1 -1
  51. package/mobile/lib/components/GroupBlock/GroupBlock.js.map +1 -1
  52. package/mobile/lib/components/GroupBlock/GroupBlockTabs.js +4 -4
  53. package/mobile/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
  54. package/mobile/lib/components/Insurance/Insurance.d.ts +5 -0
  55. package/mobile/lib/components/Insurance/Insurance.js +20 -0
  56. package/mobile/lib/components/Insurance/Insurance.js.map +1 -0
  57. package/mobile/lib/components/Insurance/InsuranceContent.d.ts +13 -0
  58. package/mobile/lib/components/Insurance/InsuranceContent.js +2 -0
  59. package/mobile/lib/components/Insurance/InsuranceContent.js.map +1 -0
  60. package/mobile/lib/ui-kit/Icon/Icon.js +1 -1
  61. package/mobile/lib/ui-kit/Icon/Icon.js.map +1 -1
  62. package/mobile/src/components/ContentPage/ContentPage.page.json +39 -0
  63. package/mobile/src/components/GroupBlock/GroupBlock.tsx +1 -3
  64. package/mobile/src/components/GroupBlock/GroupBlockTabs.tsx +4 -4
  65. package/mobile/src/components/Insurance/Insurance.tsx +68 -0
  66. package/mobile/src/components/Insurance/InsuranceContent.ts +14 -0
  67. package/mobile/src/components/Insurance/Insuranse.example.json +36 -0
  68. package/mobile/src/ui-kit/Icon/Icon.tsx +1 -1
  69. package/package.json +1 -1
  70. package/src/components/Blocks.ts +2 -0
  71. package/src/components/ContentPage/ContentPage.page.json +39 -0
  72. package/src/components/GroupBlock/GroupBlock.tsx +1 -3
  73. package/src/components/GroupBlock/GroupBlockTabs.tsx +4 -4
  74. package/src/components/Insurance/Insurance.fixture.tsx +65 -0
  75. package/src/components/Insurance/Insurance.tsx +68 -0
  76. package/src/components/Insurance/InsuranceContent.ts +14 -0
  77. package/src/components/Insurance/Insuranse.example.json +36 -0
  78. package/src/ui-kit/Icon/Icon.tsx +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/ui-kit/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CACrB,CAAC,EACC,SAAS,GAAG,EAAE,EACd,IAAI,GAAG,EAAE,EACT,GAAG,GAAG,UAAU,YAAY,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,EAC5C,KAAK,GAAG,GAAG,EACX,WAAW,EACX,KAAK,EACL,GAAG,QAAQ,EACZ,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,GAAG,eAAe,CAAC,GAAG,IAAI,EAAE,SAAS,IAAI,MAAM,CAAC;IAC7D,MAAM,WAAW,GAAG,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;IAEvE,IAAI,KAAK,EAAE;QACT,OAAO,CACL,eAAK,SAAS,EAAE,SAAS,KAAM,QAAQ,iBAAc,MAAM,aACxD,KAAK,CAAC,CAAC,CAAC,0BAAQ,KAAK,GAAS,CAAC,CAAC,CAAC,IAAI,EACrC,GAAG,CAAC,CAAC,CAAC,yBAAO,GAAG,GAAQ,CAAC,CAAC,CAAC,IAAI,EAChC,cAAK,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,IAAI,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,OAAO,GAAI,IAC5E,CACP,CAAC;KACH;IAED,OAAO,CACL,cACE,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,KACR,QAAQ,iBACA,MAAM,GAClB,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
1
+ {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/ui-kit/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CACrB,CAAC,EACC,SAAS,GAAG,EAAE,EACd,IAAI,GAAG,EAAE,EACT,GAAG,GAAG,UAAU,YAAY,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,EAC5C,KAAK,GAAG,GAAG,EACX,WAAW,EACX,KAAK,EACL,GAAG,QAAQ,EACZ,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,GAAG,eAAe,CAAC,GAAG,IAAI,EAAE,SAAS,IAAI,MAAM,CAAC;IAC7D,MAAM,WAAW,GAAG,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAExF,IAAI,KAAK,EAAE;QACT,OAAO,CACL,eAAK,SAAS,EAAE,SAAS,KAAM,QAAQ,iBAAc,MAAM,aACxD,KAAK,CAAC,CAAC,CAAC,0BAAQ,KAAK,GAAS,CAAC,CAAC,CAAC,IAAI,EACrC,GAAG,CAAC,CAAC,CAAC,yBAAO,GAAG,GAAQ,CAAC,CAAC,CAAC,IAAI,EAChC,cAAK,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,IAAI,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,OAAO,GAAI,IAC5E,CACP,CAAC;KACH;IAED,OAAO,CACL,cACE,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,KACR,QAAQ,iBACA,MAAM,GAClB,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -2149,6 +2149,45 @@
2149
2149
  ]
2150
2150
  }
2151
2151
  },
2152
+ {
2153
+ "type": "Insurance",
2154
+ "style": ["col-span-12"],
2155
+ "content": {
2156
+ "title": "Страховые риски и продукты",
2157
+ "description": "Описание",
2158
+ "insuranceSum": 500000,
2159
+ "image": {
2160
+ "src": "insurance.png",
2161
+ "title": "страхование",
2162
+ "format": "webp",
2163
+ "alt": "Страховые риски и продукты",
2164
+ "size": {
2165
+ "width": 400,
2166
+ "height": 300
2167
+ },
2168
+ "sources": [
2169
+ {
2170
+ "src": "insurance.png 1x, insurance-2x.png 2x",
2171
+ "format": "png"
2172
+ }
2173
+ ]
2174
+ },
2175
+ "benefits": [
2176
+ {
2177
+ "label": "Ликвидация организации",
2178
+ "icon": {
2179
+ "icon": "ShieldTickIcon"
2180
+ }
2181
+ },
2182
+ {
2183
+ "label": "Сокращение численности работников организации",
2184
+ "icon": {
2185
+ "icon": "ShieldTickIcon"
2186
+ }
2187
+ }
2188
+ ]
2189
+ }
2190
+ },
2152
2191
  {
2153
2192
  "type": "Footer",
2154
2193
  "style": ["col-span-12"],
@@ -33,9 +33,7 @@ export const GroupBlock = JSX<GroupBlockProps>(
33
33
  <GroupBlockTabs currentTag={currentTag} onTabClick={setCurrentTag} tabs={tabsNewMap} />
34
34
  ) : null}
35
35
  {groupBlocks.length ? (
36
- <div className="list-none">
37
- <GroupBlocksItem context={context} groupBlocks={filteredBlocks} />
38
- </div>
36
+ <GroupBlocksItem context={context} groupBlocks={filteredBlocks} />
39
37
  ) : null}
40
38
  </section>
41
39
  );
@@ -15,13 +15,13 @@ export const GroupBlockTabs = JSX<GroupBlockTabsProps>((props) => {
15
15
  const { tabs, currentTag, onTabClick, className = '', isShowCounter = true } = props;
16
16
 
17
17
  return (
18
- <div className={`mb-2 box-border flex gap-x-1 h-12 ${className}`} role="tablist">
18
+ <div className={`mb-2 box-border flex gap-x-1 ${className}`} role="tablist">
19
19
  {tabs?.map(renderTab(onTabClick, isShowCounter, currentTag))}
20
20
  </div>
21
21
  );
22
22
  });
23
23
 
24
- const badgeStyle = 'w-[22px] h-[22px] rounded-full text-m-sm';
24
+ const badgeStyle = 'min-w-[22px] w-[22px] h-[22px] rounded-full text-m-sm';
25
25
 
26
26
  const renderTab =
27
27
  (onTabClick: TabClickHandler, isShowCounter: boolean, currentTag?: string) =>
@@ -30,12 +30,12 @@ const renderTab =
30
30
  const tabBg = isActive ? 'bg-primary-main' : 'group bg-white';
31
31
  const tabText = isActive ? 'text-white' : 'text-secondary-text group-hover:text-primary-main';
32
32
  const counterBlockStyle = `${badgeStyle}
33
- ${isActive ? 'bg-white/30 text-white' : 'bg-secondary-text/10 text-secondary-text'}`;
33
+ ${isActive ? 'bg-white/30 text-white' : 'bg-secondary-light text-secondary-text'}`;
34
34
 
35
35
  return (
36
36
  <div
37
37
  key={String(i)}
38
- className={`flex h-full w-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${tabBg}`}
38
+ className={`flex h-full w-full h-12 flex-1 cursor-pointer mr-2 last:mr-0 box-content ${tabBg}`}
39
39
  role="tab"
40
40
  onClick={() => onTabClick(tab.tag)}
41
41
  aria-selected={String(isActive)}
@@ -0,0 +1,68 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { UniBlockProps } from '../../types';
3
+ import type { InsuranceContent } from './InsuranceContent';
4
+ import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
5
+ import { Heading } from '../../ui-kit/Heading/Heading';
6
+ import { Img } from '../../ui-kit/Img/Img';
7
+ import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
8
+
9
+ export interface InsuranceProps extends InsuranceContent, UniBlockProps {}
10
+
11
+ export const Insurance = JSX<InsuranceProps>(
12
+ ({ className = '', title, description, image, benefits, insuranceSum, monthLimit }) => {
13
+ return (
14
+ <section className={`px-[100px] py-[50px] bg-white text-primary-text ${className}`}>
15
+ {title ? <Heading headingType="h3" title={title} className="text-center" /> : null}
16
+ {description ? <div className="text-center text-md mt-3">{description}</div> : null}
17
+ <div>
18
+ <div className="mt-5 mx-auto flex justify-center gap-[120px] mt-[30px]">
19
+ {image?.src ? <Img image={image} /> : null}
20
+ <div className="w-[558px] m-auto">
21
+ {benefits ? (
22
+ <div className="flex flex-col gap-4">{benefits.map(renderBenefit)}</div>
23
+ ) : null}
24
+
25
+ <div className="bg-secondary-light h-15 flex mt-7 gap-6 px-5 py-4">
26
+ {insuranceSum
27
+ ? renderValueBlock('Страховая сумма:', insuranceSum, Boolean(monthLimit))
28
+ : null}
29
+ {monthLimit
30
+ ? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(insuranceSum))
31
+ : null}
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </section>
37
+ );
38
+ },
39
+ );
40
+
41
+ function renderBenefit(benefit: Benefit, i: number) {
42
+ return (
43
+ <div key={String(i)} className="flex items-center gap-5">
44
+ {benefit?.icon ? (
45
+ <Img
46
+ className="w-[50px] h-[50px] min-w-[50px] p-3 rounded-full bg-secondary-light"
47
+ image={benefit.icon}
48
+ width="24"
49
+ height="24"
50
+ asSVG
51
+ />
52
+ ) : null}
53
+ <div className="flex">
54
+ <div className="text-title-2xs">{benefit.label}</div>
55
+ </div>
56
+ </div>
57
+ );
58
+ }
59
+
60
+ function renderValueBlock(title, sum, isAnotherBlock) {
61
+ const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
62
+ return (
63
+ <div className={`flex justify-between items-center gap-2 w-full ${widthStyle}`}>
64
+ <span className="text-secondary-text text-base">{title}</span>
65
+ <span className="text-primary-main text-title-2xs">{addSpacesBetweenNumbers(sum)} ₽</span>
66
+ </div>
67
+ );
68
+ }
@@ -0,0 +1,14 @@
1
+ import type { Picture } from '../../model/Picture';
2
+ import type { BenefitsBlockContent } from '../BenefitsBlock/BenefitsBlockContent';
3
+
4
+ export type InsuranceContent = BenefitsBlockContent & {
5
+ /** @title Заголовок */
6
+ title?: string;
7
+ /** @title Описание */
8
+ description?: string;
9
+ /** @title Ежемесячный лимит */
10
+ monthLimit?: number;
11
+ /** @title Страховая сумма */
12
+ insuranceSum?: number;
13
+ image?: Picture;
14
+ };
@@ -0,0 +1,36 @@
1
+ {
2
+ "title": "Страховые риски и продукты",
3
+ "description": "Описание",
4
+ "insurance": 500000,
5
+ "limit": null,
6
+ "image": {
7
+ "src": "insurance.png",
8
+ "title": "страхование",
9
+ "format": "webp",
10
+ "alt": "страхование",
11
+ "size": {
12
+ "width": 400,
13
+ "height": 300
14
+ },
15
+ "sources": [
16
+ {
17
+ "src": "insurance.png 1x, insurance-2x.png 2x",
18
+ "format": "png"
19
+ }
20
+ ]
21
+ },
22
+ "benefits": [
23
+ {
24
+ "label": "Пункт 1",
25
+ "icon": {
26
+ "icon": "ShieldTickIcon"
27
+ }
28
+ },
29
+ {
30
+ "label": "Пункт 2",
31
+ "icon": {
32
+ "icon": "ShieldTickIcon"
33
+ }
34
+ }
35
+ ]
36
+ }
@@ -14,7 +14,7 @@ export const Icon = JSX<IconProps>(
14
14
  ...imgProps
15
15
  }) => {
16
16
  const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
17
- const svgUseStyle = iconVersion === 'white' ? 'text-black invert' : '';
17
+ const svgUseStyle = iconVersion === 'white' ? 'text-black invert' : 'text-primary-main';
18
18
 
19
19
  if (asSVG) {
20
20
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.3.59",
3
+ "version": "0.3.60",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -10,6 +10,7 @@ import { Gallery } from './Gallery/Gallery';
10
10
  import { GracePeriod } from './GracePeriod/GracePeriod';
11
11
  import { Header } from './Header/Header';
12
12
  import { Headline } from './Headline/Headline';
13
+ import { Insurance } from './Insurance/Insurance';
13
14
  import { LinkDocs } from './LinkDocs/LinkDocs';
14
15
  import { MiniGallery } from './MiniGallery/MiniGallery';
15
16
  import { MobileAppTile } from './MobileAppTile/MobileAppTile';
@@ -42,6 +43,7 @@ export const Blocks = {
42
43
  GracePeriod,
43
44
  Header,
44
45
  Headline,
46
+ Insurance,
45
47
  LinkDocs,
46
48
  MiniGallery,
47
49
  MobileAppTile,
@@ -2149,6 +2149,45 @@
2149
2149
  ]
2150
2150
  }
2151
2151
  },
2152
+ {
2153
+ "type": "Insurance",
2154
+ "style": ["col-span-12"],
2155
+ "content": {
2156
+ "title": "Страховые риски и продукты",
2157
+ "description": "Описание",
2158
+ "insuranceSum": 500000,
2159
+ "image": {
2160
+ "src": "insurance.png",
2161
+ "title": "страхование",
2162
+ "format": "webp",
2163
+ "alt": "Страховые риски и продукты",
2164
+ "size": {
2165
+ "width": 400,
2166
+ "height": 300
2167
+ },
2168
+ "sources": [
2169
+ {
2170
+ "src": "insurance.png 1x, insurance-2x.png 2x",
2171
+ "format": "png"
2172
+ }
2173
+ ]
2174
+ },
2175
+ "benefits": [
2176
+ {
2177
+ "label": "Ликвидация организации",
2178
+ "icon": {
2179
+ "icon": "ShieldTickIcon"
2180
+ }
2181
+ },
2182
+ {
2183
+ "label": "Сокращение численности работников организации",
2184
+ "icon": {
2185
+ "icon": "ShieldTickIcon"
2186
+ }
2187
+ }
2188
+ ]
2189
+ }
2190
+ },
2152
2191
  {
2153
2192
  "type": "Footer",
2154
2193
  "style": ["col-span-12"],
@@ -33,9 +33,7 @@ export const GroupBlock = JSX<GroupBlockProps>(
33
33
  <GroupBlockTabs currentTag={currentTag} onTabClick={setCurrentTag} tabs={tabsNewMap} />
34
34
  ) : null}
35
35
  {groupBlocks.length ? (
36
- <div className="list-none">
37
- <GroupBlocksItem context={context} groupBlocks={filteredBlocks} />
38
- </div>
36
+ <GroupBlocksItem context={context} groupBlocks={filteredBlocks} />
39
37
  ) : null}
40
38
  </section>
41
39
  );
@@ -15,13 +15,13 @@ export const GroupBlockTabs = JSX<GroupBlockTabsProps>((props) => {
15
15
  const { tabs, currentTag, onTabClick, className = '', isShowCounter = true } = props;
16
16
 
17
17
  return (
18
- <div className={`mb-2 box-border flex gap-x-1 h-12 ${className}`} role="tablist">
18
+ <div className={`mb-2 box-border flex gap-x-1 ${className}`} role="tablist">
19
19
  {tabs?.map(renderTab(onTabClick, isShowCounter, currentTag))}
20
20
  </div>
21
21
  );
22
22
  });
23
23
 
24
- const badgeStyle = 'w-[22px] h-[22px] rounded-full text-m-sm';
24
+ const badgeStyle = 'min-w-[22px] w-[22px] h-[22px] rounded-full text-m-sm';
25
25
 
26
26
  const renderTab =
27
27
  (onTabClick: TabClickHandler, isShowCounter: boolean, currentTag?: string) =>
@@ -30,12 +30,12 @@ const renderTab =
30
30
  const tabBg = isActive ? 'bg-primary-main' : 'group bg-white';
31
31
  const tabText = isActive ? 'text-white' : 'text-secondary-text group-hover:text-primary-main';
32
32
  const counterBlockStyle = `${badgeStyle}
33
- ${isActive ? 'bg-white/30 text-white' : 'bg-secondary-text/10 text-secondary-text'}`;
33
+ ${isActive ? 'bg-white/30 text-white' : 'bg-secondary-light text-secondary-text'}`;
34
34
 
35
35
  return (
36
36
  <div
37
37
  key={String(i)}
38
- className={`flex h-full w-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${tabBg}`}
38
+ className={`flex h-full w-full h-12 flex-1 cursor-pointer mr-2 last:mr-0 box-content ${tabBg}`}
39
39
  role="tab"
40
40
  onClick={() => onTabClick(tab.tag)}
41
41
  aria-selected={String(isActive)}
@@ -0,0 +1,65 @@
1
+ import { Insurance } from './Insurance';
2
+ import { context } from '../../setup-fixture';
3
+ import { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
4
+ import { Picture } from '../../model/Picture';
5
+
6
+ const benefits: Benefit[] = [
7
+ {
8
+ label: 'Телесное повреждение',
9
+ icon: { icon: 'ShieldTickIcon' },
10
+ },
11
+ {
12
+ label: 'Госпитализация застрахованного',
13
+ icon: { icon: 'ShieldTickIcon' },
14
+ },
15
+ {
16
+ label: 'Сокращение численности работников организации',
17
+ icon: { icon: 'ShieldTickIcon' },
18
+ },
19
+ {
20
+ label: 'Смерть застрахованного',
21
+ icon: { icon: 'ShieldTickIcon' },
22
+ },
23
+ ];
24
+
25
+ const image: Picture = {
26
+ src: 'insurance.png',
27
+ format: 'webp',
28
+ alt: 'Страховые риски и продукты',
29
+ size: {
30
+ width: 400,
31
+ height: 300,
32
+ },
33
+ sources: [
34
+ {
35
+ src: 'insurance.png 1x, insurance-2x.png 2x',
36
+ format: 'png',
37
+ },
38
+ ],
39
+ };
40
+
41
+ export default {
42
+ default: (
43
+ <div className="container grid grid-cols-12">
44
+ <Insurance
45
+ context={context}
46
+ className="col-span-12"
47
+ title="Страховые риски и продукты"
48
+ description="Покрываемые риски программы «Защита вас и ваших близких»"
49
+ benefits={benefits}
50
+ image={image}
51
+ insuranceSum={500000}
52
+ />
53
+ <Insurance
54
+ context={context}
55
+ className="col-span-12"
56
+ title="Страховые риски и продукты"
57
+ description="Покрываемые риски программы «Защита вас и ваших близких»"
58
+ benefits={benefits}
59
+ image={image}
60
+ insuranceSum={500000}
61
+ monthLimit={25000}
62
+ />
63
+ </div>
64
+ ),
65
+ };
@@ -0,0 +1,68 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { UniBlockProps } from '../../types';
3
+ import type { InsuranceContent } from './InsuranceContent';
4
+ import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
5
+ import { Heading } from '../../ui-kit/Heading/Heading';
6
+ import { Img } from '../../ui-kit/Img/Img';
7
+ import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
8
+
9
+ export interface InsuranceProps extends InsuranceContent, UniBlockProps {}
10
+
11
+ export const Insurance = JSX<InsuranceProps>(
12
+ ({ className = '', title, description, image, benefits, insuranceSum, monthLimit }) => {
13
+ return (
14
+ <section className={`px-[100px] py-[50px] bg-white text-primary-text ${className}`}>
15
+ {title ? <Heading headingType="h3" title={title} className="text-center" /> : null}
16
+ {description ? <div className="text-center text-md mt-3">{description}</div> : null}
17
+ <div>
18
+ <div className="mt-5 mx-auto flex justify-center gap-[120px] mt-[30px]">
19
+ {image?.src ? <Img image={image} /> : null}
20
+ <div className="w-[558px] m-auto">
21
+ {benefits ? (
22
+ <div className="flex flex-col gap-4">{benefits.map(renderBenefit)}</div>
23
+ ) : null}
24
+
25
+ <div className="bg-secondary-light h-15 flex mt-7 gap-6 px-5 py-4">
26
+ {insuranceSum
27
+ ? renderValueBlock('Страховая сумма:', insuranceSum, Boolean(monthLimit))
28
+ : null}
29
+ {monthLimit
30
+ ? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(insuranceSum))
31
+ : null}
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </section>
37
+ );
38
+ },
39
+ );
40
+
41
+ function renderBenefit(benefit: Benefit, i: number) {
42
+ return (
43
+ <div key={String(i)} className="flex items-center gap-5">
44
+ {benefit?.icon ? (
45
+ <Img
46
+ className="w-[50px] h-[50px] min-w-[50px] p-3 rounded-full bg-secondary-light"
47
+ image={benefit.icon}
48
+ width="24"
49
+ height="24"
50
+ asSVG
51
+ />
52
+ ) : null}
53
+ <div className="flex">
54
+ <div className="text-title-2xs">{benefit.label}</div>
55
+ </div>
56
+ </div>
57
+ );
58
+ }
59
+
60
+ function renderValueBlock(title, sum, isAnotherBlock) {
61
+ const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
62
+ return (
63
+ <div className={`flex justify-between items-center gap-2 w-full ${widthStyle}`}>
64
+ <span className="text-secondary-text text-base">{title}</span>
65
+ <span className="text-primary-main text-title-2xs">{addSpacesBetweenNumbers(sum)} ₽</span>
66
+ </div>
67
+ );
68
+ }
@@ -0,0 +1,14 @@
1
+ import type { Picture } from '../../model/Picture';
2
+ import type { BenefitsBlockContent } from '../BenefitsBlock/BenefitsBlockContent';
3
+
4
+ export type InsuranceContent = BenefitsBlockContent & {
5
+ /** @title Заголовок */
6
+ title?: string;
7
+ /** @title Описание */
8
+ description?: string;
9
+ /** @title Ежемесячный лимит */
10
+ monthLimit?: number;
11
+ /** @title Страховая сумма */
12
+ insuranceSum?: number;
13
+ image?: Picture;
14
+ };
@@ -0,0 +1,36 @@
1
+ {
2
+ "title": "Страховые риски и продукты",
3
+ "description": "Описание",
4
+ "insurance": 500000,
5
+ "limit": null,
6
+ "image": {
7
+ "src": "insurance.png",
8
+ "title": "страхование",
9
+ "format": "webp",
10
+ "alt": "страхование",
11
+ "size": {
12
+ "width": 400,
13
+ "height": 300
14
+ },
15
+ "sources": [
16
+ {
17
+ "src": "insurance.png 1x, insurance-2x.png 2x",
18
+ "format": "png"
19
+ }
20
+ ]
21
+ },
22
+ "benefits": [
23
+ {
24
+ "label": "Пункт 1",
25
+ "icon": {
26
+ "icon": "ShieldTickIcon"
27
+ }
28
+ },
29
+ {
30
+ "label": "Пункт 2",
31
+ "icon": {
32
+ "icon": "ShieldTickIcon"
33
+ }
34
+ }
35
+ ]
36
+ }
@@ -14,7 +14,7 @@ export const Icon = JSX<IconProps>(
14
14
  ...imgProps
15
15
  }) => {
16
16
  const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
17
- const svgUseStyle = iconVersion === 'white' ? 'text-black invert' : '';
17
+ const svgUseStyle = iconVersion === 'white' ? 'text-black invert' : 'text-primary-main';
18
18
 
19
19
  if (asSVG) {
20
20
  return (