@cloud-ru/uikit-product-site-hero 0.6.3 → 1.1.0

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 (127) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -2
  3. package/dist/cjs/components/HeroEvent/HeroEvent.js +1 -1
  4. package/dist/cjs/components/HeroEvent/styles.module.css +17 -9
  5. package/dist/cjs/components/HeroMain/HeroMain.js +2 -2
  6. package/dist/cjs/components/HeroMain/styles.module.css +16 -10
  7. package/dist/cjs/components/HeroSlider/HeroSlider.d.ts +5 -4
  8. package/dist/cjs/components/HeroSlider/HeroSlider.js +25 -7
  9. package/dist/cjs/components/HeroSlider/components/Control/Control.d.ts +7 -0
  10. package/dist/cjs/components/HeroSlider/components/Control/Control.js +27 -0
  11. package/dist/cjs/components/HeroSlider/components/Control/index.d.ts +1 -0
  12. package/dist/cjs/components/HeroSlider/components/{HeroSlideVideoBg → Control}/index.js +1 -1
  13. package/dist/cjs/components/HeroSlider/components/Control/styles.module.css +45 -0
  14. package/dist/cjs/components/HeroSlider/components/HeroSlide/HeroSlide.js +4 -2
  15. package/dist/cjs/components/HeroSlider/components/HeroSlide/constants.d.ts +0 -2
  16. package/dist/cjs/components/HeroSlider/components/HeroSlide/constants.js +0 -2
  17. package/dist/cjs/components/HeroSlider/components/HeroSlide/styles.module.css +57 -66
  18. package/dist/cjs/components/HeroSlider/components/HeroSlide/types.d.ts +16 -5
  19. package/dist/cjs/components/HeroSlider/components/HeroSlide/util.d.ts +0 -3
  20. package/dist/cjs/components/HeroSlider/components/HeroSlide/util.js +5 -12
  21. package/dist/cjs/components/HeroSlider/components/HeroSlideImage/HeroSlideImage.d.ts +3 -4
  22. package/dist/cjs/components/HeroSlider/components/HeroSlideImage/HeroSlideImage.js +3 -6
  23. package/dist/cjs/components/HeroSlider/components/HeroSlideImage/styles.module.css +18 -14
  24. package/dist/cjs/components/HeroSlider/components/HeroSlideImageBg/HeroSlideImageBg.d.ts +0 -1
  25. package/dist/cjs/components/HeroSlider/components/HeroSlideImageBg/HeroSlideImageBg.js +1 -1
  26. package/dist/cjs/components/HeroSlider/components/HeroSlideMedia/HeroSlideMedia.js +0 -3
  27. package/dist/cjs/components/HeroSlider/components/HeroSlideMedia/types.d.ts +1 -5
  28. package/dist/cjs/components/HeroSlider/components/TabHeroSlider/TabHeroSlider.d.ts +11 -0
  29. package/dist/cjs/components/HeroSlider/components/TabHeroSlider/TabHeroSlider.js +14 -0
  30. package/dist/cjs/components/HeroSlider/components/TabHeroSlider/index.d.ts +1 -0
  31. package/dist/cjs/components/HeroSlider/components/TabHeroSlider/index.js +17 -0
  32. package/dist/cjs/components/HeroSlider/components/TabHeroSlider/styles.module.css +60 -0
  33. package/dist/cjs/components/HeroSlider/components/TabsRowHeroSlider/TabsRowHeroSlider.d.ts +11 -0
  34. package/dist/cjs/components/HeroSlider/components/TabsRowHeroSlider/TabsRowHeroSlider.js +35 -0
  35. package/dist/cjs/components/HeroSlider/components/TabsRowHeroSlider/index.d.ts +1 -0
  36. package/dist/cjs/components/HeroSlider/components/TabsRowHeroSlider/index.js +17 -0
  37. package/dist/cjs/components/HeroSlider/components/TabsRowHeroSlider/styles.module.css +11 -0
  38. package/dist/cjs/components/HeroSlider/components/index.d.ts +2 -1
  39. package/dist/cjs/components/HeroSlider/components/index.js +2 -1
  40. package/dist/cjs/components/HeroSlider/styles.module.css +53 -9
  41. package/dist/cjs/components/HeroZero/styles.module.css +14 -11
  42. package/dist/cjs/helperComponents/HeroEventButton/HeroEventButton.d.ts +2 -2
  43. package/dist/cjs/helperComponents/HeroEventButton/HeroEventButton.js +2 -2
  44. package/dist/esm/components/HeroEvent/HeroEvent.js +1 -1
  45. package/dist/esm/components/HeroEvent/styles.module.css +17 -9
  46. package/dist/esm/components/HeroMain/HeroMain.js +2 -2
  47. package/dist/esm/components/HeroMain/styles.module.css +16 -10
  48. package/dist/esm/components/HeroSlider/HeroSlider.d.ts +5 -4
  49. package/dist/esm/components/HeroSlider/HeroSlider.js +26 -8
  50. package/dist/esm/components/HeroSlider/components/Control/Control.d.ts +7 -0
  51. package/dist/esm/components/HeroSlider/components/Control/Control.js +21 -0
  52. package/dist/esm/components/HeroSlider/components/Control/index.d.ts +1 -0
  53. package/dist/esm/components/HeroSlider/components/Control/index.js +1 -0
  54. package/dist/esm/components/HeroSlider/components/Control/styles.module.css +45 -0
  55. package/dist/esm/components/HeroSlider/components/HeroSlide/HeroSlide.js +5 -3
  56. package/dist/esm/components/HeroSlider/components/HeroSlide/constants.d.ts +0 -2
  57. package/dist/esm/components/HeroSlider/components/HeroSlide/constants.js +0 -2
  58. package/dist/esm/components/HeroSlider/components/HeroSlide/styles.module.css +57 -66
  59. package/dist/esm/components/HeroSlider/components/HeroSlide/types.d.ts +16 -5
  60. package/dist/esm/components/HeroSlider/components/HeroSlide/util.d.ts +0 -3
  61. package/dist/esm/components/HeroSlider/components/HeroSlide/util.js +4 -10
  62. package/dist/esm/components/HeroSlider/components/HeroSlideImage/HeroSlideImage.d.ts +3 -4
  63. package/dist/esm/components/HeroSlider/components/HeroSlideImage/HeroSlideImage.js +3 -6
  64. package/dist/esm/components/HeroSlider/components/HeroSlideImage/styles.module.css +18 -14
  65. package/dist/esm/components/HeroSlider/components/HeroSlideImageBg/HeroSlideImageBg.d.ts +0 -1
  66. package/dist/esm/components/HeroSlider/components/HeroSlideImageBg/HeroSlideImageBg.js +2 -2
  67. package/dist/esm/components/HeroSlider/components/HeroSlideMedia/HeroSlideMedia.js +0 -3
  68. package/dist/esm/components/HeroSlider/components/HeroSlideMedia/types.d.ts +1 -5
  69. package/dist/esm/components/HeroSlider/components/TabHeroSlider/TabHeroSlider.d.ts +11 -0
  70. package/dist/esm/components/HeroSlider/components/TabHeroSlider/TabHeroSlider.js +8 -0
  71. package/dist/esm/components/HeroSlider/components/TabHeroSlider/index.d.ts +1 -0
  72. package/dist/esm/components/HeroSlider/components/TabHeroSlider/index.js +1 -0
  73. package/dist/esm/components/HeroSlider/components/TabHeroSlider/styles.module.css +60 -0
  74. package/dist/esm/components/HeroSlider/components/TabsRowHeroSlider/TabsRowHeroSlider.d.ts +11 -0
  75. package/dist/esm/components/HeroSlider/components/TabsRowHeroSlider/TabsRowHeroSlider.js +29 -0
  76. package/dist/esm/components/HeroSlider/components/TabsRowHeroSlider/index.d.ts +1 -0
  77. package/dist/esm/components/HeroSlider/components/TabsRowHeroSlider/index.js +1 -0
  78. package/dist/esm/components/HeroSlider/components/TabsRowHeroSlider/styles.module.css +11 -0
  79. package/dist/esm/components/HeroSlider/components/index.d.ts +2 -1
  80. package/dist/esm/components/HeroSlider/components/index.js +2 -1
  81. package/dist/esm/components/HeroSlider/styles.module.css +53 -9
  82. package/dist/esm/components/HeroZero/styles.module.css +14 -11
  83. package/dist/esm/helperComponents/HeroEventButton/HeroEventButton.d.ts +2 -2
  84. package/dist/esm/helperComponents/HeroEventButton/HeroEventButton.js +2 -2
  85. package/package.json +4 -5
  86. package/src/components/HeroEvent/HeroEvent.tsx +20 -4
  87. package/src/components/HeroEvent/styles.module.scss +22 -10
  88. package/src/components/HeroMain/HeroMain.tsx +16 -2
  89. package/src/components/HeroMain/styles.module.scss +22 -12
  90. package/src/components/HeroSlider/HeroSlider.tsx +56 -31
  91. package/src/components/HeroSlider/components/Control/Control.tsx +28 -0
  92. package/src/components/HeroSlider/components/Control/index.ts +1 -0
  93. package/src/components/HeroSlider/components/Control/styles.module.scss +56 -0
  94. package/src/components/HeroSlider/components/HeroSlide/HeroSlide.tsx +34 -30
  95. package/src/components/HeroSlider/components/HeroSlide/constants.ts +0 -2
  96. package/src/components/HeroSlider/components/HeroSlide/styles.module.scss +71 -87
  97. package/src/components/HeroSlider/components/HeroSlide/types.ts +17 -5
  98. package/src/components/HeroSlider/components/HeroSlide/util.ts +4 -17
  99. package/src/components/HeroSlider/components/HeroSlideImage/HeroSlideImage.tsx +7 -11
  100. package/src/components/HeroSlider/components/HeroSlideImage/styles.module.scss +20 -20
  101. package/src/components/HeroSlider/components/HeroSlideImageBg/HeroSlideImageBg.tsx +1 -9
  102. package/src/components/HeroSlider/components/HeroSlideMedia/HeroSlideMedia.tsx +0 -4
  103. package/src/components/HeroSlider/components/HeroSlideMedia/types.ts +1 -6
  104. package/src/components/HeroSlider/components/TabHeroSlider/TabHeroSlider.tsx +35 -0
  105. package/src/components/HeroSlider/components/TabHeroSlider/index.ts +1 -0
  106. package/src/components/HeroSlider/components/TabHeroSlider/styles.module.scss +86 -0
  107. package/src/components/HeroSlider/components/TabsRowHeroSlider/TabsRowHeroSlider.tsx +58 -0
  108. package/src/components/HeroSlider/components/TabsRowHeroSlider/index.ts +1 -0
  109. package/src/components/HeroSlider/components/TabsRowHeroSlider/styles.module.scss +14 -0
  110. package/src/components/HeroSlider/components/index.ts +2 -1
  111. package/src/components/HeroSlider/styles.module.scss +85 -22
  112. package/src/components/HeroZero/styles.module.scss +22 -16
  113. package/src/helperComponents/HeroEventButton/HeroEventButton.tsx +12 -2
  114. package/dist/cjs/components/HeroSlider/components/HeroSlideVideoBg/HTMLComment.d.ts +0 -5
  115. package/dist/cjs/components/HeroSlider/components/HeroSlideVideoBg/HTMLComment.js +0 -31
  116. package/dist/cjs/components/HeroSlider/components/HeroSlideVideoBg/HeroSlideVideoBg.d.ts +0 -8
  117. package/dist/cjs/components/HeroSlider/components/HeroSlideVideoBg/HeroSlideVideoBg.js +0 -15
  118. package/dist/cjs/components/HeroSlider/components/HeroSlideVideoBg/index.d.ts +0 -1
  119. package/dist/esm/components/HeroSlider/components/HeroSlideVideoBg/HTMLComment.d.ts +0 -5
  120. package/dist/esm/components/HeroSlider/components/HeroSlideVideoBg/HTMLComment.js +0 -28
  121. package/dist/esm/components/HeroSlider/components/HeroSlideVideoBg/HeroSlideVideoBg.d.ts +0 -8
  122. package/dist/esm/components/HeroSlider/components/HeroSlideVideoBg/HeroSlideVideoBg.js +0 -12
  123. package/dist/esm/components/HeroSlider/components/HeroSlideVideoBg/index.d.ts +0 -1
  124. package/dist/esm/components/HeroSlider/components/HeroSlideVideoBg/index.js +0 -1
  125. package/src/components/HeroSlider/components/HeroSlideVideoBg/HTMLComment.tsx +0 -36
  126. package/src/components/HeroSlider/components/HeroSlideVideoBg/HeroSlideVideoBg.tsx +0 -30
  127. package/src/components/HeroSlider/components/HeroSlideVideoBg/index.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 1.1.0 (2025-12-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **SITE-10072:** redesign HeroSlider ([30b951b](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/30b951b16af801e5215907a9644b9b4e82eac3ce))
12
+
13
+
14
+ ### Features
15
+
16
+ * **SITE-10394:** add border radius ([5e950bc](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/5e950bce806fab0a3213eef811a7ebcb411f1860))
17
+
18
+
19
+
20
+
21
+
6
22
  ## 0.6.3 (2025-12-12)
7
23
 
8
24
  ### Only dependencies have been changed
package/README.md CHANGED
@@ -58,12 +58,11 @@ Hero blocks for Site
58
58
  | name | type | default value | description |
59
59
  |------|------|---------------|-------------|
60
60
  | layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
61
+ | tabs* | `TabHeroSliderBase[]` | - | Заголовки для tabs |
61
62
  | items* | `HeroSlideProps[]` | - | Слайды карусели |
62
63
  | id | `string` | - | |
63
64
  | className | `string` | - | CSS-класс |
64
- | pagination | `boolean` | true | Использовать пагинацию для переключения страниц |
65
65
  | state | `{ page: number; onChange(page: number): void; }` | - | Управление состоянием извне |
66
- | autoSwipe | `number` | - | Автоматическое переключение слайдов в секундах |
67
66
 
68
67
 
69
68
  [//]: DOCUMENTATION_SECTION_END
@@ -30,5 +30,5 @@ function HeroEvent(_a) {
30
30
  const formatTitle = format ? constants_2.FORMAT_LABELS[format] : undefined;
31
31
  const audienceTitle = audience ? constants_2.AUDIENCE_LABELS[audience] : undefined;
32
32
  const showTagRow = Boolean(category || formatTitle || audienceTitle);
33
- return ((0, jsx_runtime_1.jsx)(uikit_product_site_layout_1.Layout.SectionWrapper, { layoutType: layoutType, className: (0, classnames_1.default)(className, styles_module_scss_1.default.sectionWrapper), "data-section-background": backgroundColor, children: (0, jsx_runtime_1.jsx)("section", Object.assign({ className: styles_module_scss_1.default.wrapper, "data-layout-type": layoutType }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.heroEvent, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(breadcrumbs_1.Breadcrumbs, { size: 'xs', items: breadcrumbs, "data-test-id": 'hero-event__breadcrumbs' }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.left, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.titleWrapper, "data-layout-type": layoutType, children: [showTagRow && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tagRow, children: [category && (0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, Object.assign({}, category, { color: 'decor', size: 'xs' })), formatTitle && (0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, { appearance: 'violet', text: formatTitle, color: 'decor', size: 'xs' }), audienceTitle && (0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, { appearance: 'violet', text: audienceTitle, color: 'decor', size: 'xs' })] })), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.textWrapper, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)("h1", { className: styles_module_scss_1.default.title, "data-layout-type": layoutType, children: title }), (0, jsx_runtime_1.jsxs)("p", { className: styles_module_scss_1.default.coords, "data-color": backgroundColor, children: [(0, jsx_runtime_1.jsxs)("time", { className: styles_module_scss_1.default.time, children: [startsAt, place.title && ', '] }), place.title && (0, jsx_runtime_1.jsx)(helperComponents_1.Place, Object.assign({}, place, { title: place.title }))] })] })] }), (0, jsx_runtime_1.jsx)(helperComponents_1.HeroEventButton, Object.assign({}, button, { layoutType: layoutType }))] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.imageWrapper, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)("img", { className: styles_module_scss_1.default.image, alt: 'hero_img', src: image, "data-layout-type": layoutType }) })] })] }) })) }));
33
+ return ((0, jsx_runtime_1.jsx)(uikit_product_site_layout_1.Layout.SectionWrapper, { layoutType: layoutType, className: (0, classnames_1.default)(className, styles_module_scss_1.default.sectionWrapper), "data-section-background": backgroundColor, children: (0, jsx_runtime_1.jsx)("section", Object.assign({ className: styles_module_scss_1.default.wrapper, "data-layout-type": layoutType }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.heroEvent, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(breadcrumbs_1.Breadcrumbs, { size: 'xs', items: breadcrumbs, "data-test-id": 'hero-event__breadcrumbs' }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.left, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.titleWrapper, "data-layout-type": layoutType, children: [showTagRow && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tagRow, children: [category && (0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, Object.assign({}, category, { color: 'decor', size: 'xs', className: styles_module_scss_1.default.promoTag })), formatTitle && ((0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, { appearance: 'violet', text: formatTitle, color: 'decor', size: 'xs', className: styles_module_scss_1.default.promoTag })), audienceTitle && ((0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, { appearance: 'violet', text: audienceTitle, color: 'decor', size: 'xs', className: styles_module_scss_1.default.promoTag }))] })), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.textWrapper, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)("h1", { className: styles_module_scss_1.default.title, "data-layout-type": layoutType, children: title }), (0, jsx_runtime_1.jsxs)("p", { className: styles_module_scss_1.default.coords, "data-color": backgroundColor, children: [(0, jsx_runtime_1.jsxs)("time", { className: styles_module_scss_1.default.time, children: [startsAt, place.title && ', '] }), place.title && (0, jsx_runtime_1.jsx)(helperComponents_1.Place, Object.assign({}, place, { title: place.title }))] })] })] }), (0, jsx_runtime_1.jsx)(helperComponents_1.HeroEventButton, Object.assign({}, button, { layoutType: layoutType, className: styles_module_scss_1.default.button }))] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.imageWrapper, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)("img", { className: styles_module_scss_1.default.image, alt: 'hero_img', src: image, "data-layout-type": layoutType }) })] })] }) })) }));
34
34
  }
@@ -19,15 +19,8 @@
19
19
  display:flex;
20
20
  gap:var(--dimension-050m, 4px);
21
21
  }
22
-
23
- .heroEvent{
24
- display:flex;
25
- flex-direction:column;
26
- gap:var(--dimension-4m, 32px);
27
- overflow:hidden;
28
- }
29
- .heroEvent[data-layout-type=tablet], .heroEvent[data-layout-type=mobile]{
30
- gap:var(--dimension-3m, 24px);
22
+ .tagRow .promoTag{
23
+ border-radius:2px;
31
24
  }
32
25
 
33
26
  .content{
@@ -116,6 +109,8 @@
116
109
  position:relative;
117
110
  width:488px;
118
111
  flex-shrink:0;
112
+ border-radius:4px;
113
+ overflow:hidden;
119
114
  }
120
115
  .imageWrapper[data-layout-type=tablet], .imageWrapper[data-layout-type=mobile]{
121
116
  display:flex;
@@ -132,4 +127,17 @@
132
127
  }
133
128
  .image[data-layout-type=tablet], .image[data-layout-type=mobile]{
134
129
  max-width:504px;
130
+ }
131
+
132
+ .heroEvent{
133
+ display:flex;
134
+ flex-direction:column;
135
+ gap:var(--dimension-4m, 32px);
136
+ overflow:hidden;
137
+ }
138
+ .heroEvent[data-layout-type=tablet], .heroEvent[data-layout-type=mobile]{
139
+ gap:var(--dimension-3m, 24px);
140
+ }
141
+ .heroEvent .content .button{
142
+ border-radius:2px;
135
143
  }
@@ -39,6 +39,6 @@ function HeroMain(_a) {
39
39
  const isAdaptive = ['mobile', 'tablet'].includes(layoutType);
40
40
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(uikit_product_site_layout_1.Layout.SectionWrapper, { layoutType: layoutType, className: (0, classnames_1.default)(className, styles_module_scss_1.default.sectionWrapper, {
41
41
  [styles_module_scss_1.default.withNavbarBorderRadius]: navbar && navbar.items.length > 0,
42
- }), "data-section-background": backgroundColor, children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: styles_module_scss_1.default.contentWrapper }, (0, uikit_product_utils_1.extractSupportProps)(rest), { "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.left, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.leftContent, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(breadcrumbs_1.Breadcrumbs, { size: 'xs', items: breadcrumbs, "data-test-id": 'hero-main__breadcrumbs' }), tags.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.tagRow, "data-layout-type": layoutType, children: tags.map(({ text, tip, appearance }) => ((0, jsx_runtime_1.jsx)(uikit_product_site_tag_1.TagSpecial, { text: text, tip: tip, appearance: appearance }, text))) })), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.textWrapper, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, Object.assign({ tag: 'h1', family: 'sans' }, (0, utils_1.getTitleTypographyProps)(layoutType), { className: styles_module_scss_1.default.title, children: (0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: title }) })), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyL, { tag: 'div', className: styles_module_scss_1.default.description, children: (0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: description }) }), platforms && platforms.length > 0 && handlePlatformClick && ((0, jsx_runtime_1.jsxs)(typography_1.Typography.SansBodyL, { tag: 'p', className: styles_module_scss_1.default.platforms, children: [t('Main.platforms'), ":", ' ', platforms.map((platform, index) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.PlatformLink, { platform: platform, appearance: (0, utils_1.getAppearanceByBackground)(backgroundColor), handlePlatformClick: handlePlatformClick }), platforms.length - 1 !== index && ', '] }, platform.id || platform.title)))] }))] })] }), buttons && buttons.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.buttons, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(button_1.ButtonFilled, Object.assign({}, buttons[0], { "data-layout-type": layoutType, size: 'l', appearance: 'primary', fullWidth: isAdaptive })), buttons.length > 1 &&
43
- (backgroundColor !== constants_1.HERO_COLORS.GraphiteAccentDefault ? ((0, jsx_runtime_1.jsx)(uikit_product_button_predefined_1.ButtonPromoOutline, Object.assign({}, buttons[1], { "data-layout-type": layoutType, size: 'l', appearance: 'secondary', fullWidth: isAdaptive }))) : ((0, jsx_runtime_1.jsx)(button_1.ButtonOutline, Object.assign({}, buttons[1], { "data-layout-type": layoutType, size: 'l', fullWidth: isAdaptive }))))] }))] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.imageWrapper, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.media, "data-layout-type": layoutType, children: [image && (0, jsx_runtime_1.jsx)("img", { alt: 'hero_img', src: image }), !image && video && (0, jsx_runtime_1.jsx)(uikit_product_site_media_1.SiteVideo, { className: styles_module_scss_1.default.video, video: video, layoutType: layoutType })] }) })] }) })) }), navbar && navbar.items.length > 0 && ((0, jsx_runtime_1.jsx)(uikit_product_site_layout_1.Layout.SectionWrapper, { layoutType: layoutType, className: (0, classnames_1.default)(styles_module_scss_1.default.sectionWrapper, styles_module_scss_1.default.navbarWrapper), "data-sticky": true, "data-section-background": backgroundColor, children: (0, jsx_runtime_1.jsx)(uikit_product_site_navbar_1.SiteNavbar, Object.assign({}, navbar, { appereance: (0, utils_1.getNavbarAppearanceByBackground)(backgroundColor), "data-test-id": 'hero-main__navbar' })) }))] }));
42
+ }), "data-section-background": backgroundColor, children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: styles_module_scss_1.default.contentWrapper }, (0, uikit_product_utils_1.extractSupportProps)(rest), { "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.left, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.leftContent, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(breadcrumbs_1.Breadcrumbs, { size: 'xs', items: breadcrumbs, "data-test-id": 'hero-main__breadcrumbs' }), tags.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.tagRow, "data-layout-type": layoutType, children: tags.map(({ text, tip, appearance }) => ((0, jsx_runtime_1.jsx)(uikit_product_site_tag_1.TagSpecial, { text: text, tip: tip, appearance: appearance, className: styles_module_scss_1.default.promoTag }, text))) })), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.textWrapper, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, Object.assign({ tag: 'h1', family: 'sans' }, (0, utils_1.getTitleTypographyProps)(layoutType), { className: styles_module_scss_1.default.title, children: (0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: title }) })), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyL, { tag: 'div', className: styles_module_scss_1.default.description, children: (0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: description }) }), platforms && platforms.length > 0 && handlePlatformClick && ((0, jsx_runtime_1.jsxs)(typography_1.Typography.SansBodyL, { tag: 'p', className: styles_module_scss_1.default.platforms, children: [t('Main.platforms'), ":", ' ', platforms.map((platform, index) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.PlatformLink, { platform: platform, appearance: (0, utils_1.getAppearanceByBackground)(backgroundColor), handlePlatformClick: handlePlatformClick }), platforms.length - 1 !== index && ', '] }, platform.id || platform.title)))] }))] })] }), buttons && buttons.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.buttons, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(button_1.ButtonFilled, Object.assign({}, buttons[0], { "data-layout-type": layoutType, size: 'l', appearance: 'primary', fullWidth: isAdaptive, className: styles_module_scss_1.default.button })), buttons.length > 1 &&
43
+ (backgroundColor !== constants_1.HERO_COLORS.GraphiteAccentDefault ? ((0, jsx_runtime_1.jsx)(uikit_product_button_predefined_1.ButtonPromoOutline, Object.assign({}, buttons[1], { "data-layout-type": layoutType, size: 'l', appearance: 'secondary', fullWidth: isAdaptive, className: styles_module_scss_1.default.button }))) : ((0, jsx_runtime_1.jsx)(button_1.ButtonOutline, Object.assign({}, buttons[1], { "data-layout-type": layoutType, size: 'l', fullWidth: isAdaptive, className: styles_module_scss_1.default.button }))))] }))] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.imageWrapper, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.media, "data-layout-type": layoutType, children: [image && (0, jsx_runtime_1.jsx)("img", { alt: 'hero_img', src: image }), !image && video && (0, jsx_runtime_1.jsx)(uikit_product_site_media_1.SiteVideo, { className: styles_module_scss_1.default.video, video: video, layoutType: layoutType })] }) })] }) })) }), navbar && navbar.items.length > 0 && ((0, jsx_runtime_1.jsx)(uikit_product_site_layout_1.Layout.SectionWrapper, { layoutType: layoutType, className: (0, classnames_1.default)(styles_module_scss_1.default.sectionWrapper, styles_module_scss_1.default.navbarWrapper), "data-sticky": true, "data-section-background": backgroundColor, children: (0, jsx_runtime_1.jsx)(uikit_product_site_navbar_1.SiteNavbar, Object.assign({}, navbar, { appereance: (0, utils_1.getNavbarAppearanceByBackground)(backgroundColor), "data-test-id": 'hero-main__navbar' })) }))] }));
44
44
  }
@@ -43,16 +43,6 @@
43
43
  border-radius:0 0 var(--dimension-050m, 4px) var(--dimension-050m, 4px);
44
44
  }
45
45
 
46
- .contentWrapper{
47
- padding:var(--dimension-5m, 40px) 0;
48
- }
49
- .contentWrapper[data-layout-type=tablet]{
50
- padding:var(--dimension-4m, 32px) 0;
51
- }
52
- .contentWrapper[data-layout-type=mobile]{
53
- padding:var(--dimension-3m, 24px) 0;
54
- }
55
-
56
46
  .content{
57
47
  display:flex;
58
48
  align-items:stretch;
@@ -92,6 +82,9 @@
92
82
  flex-wrap:wrap;
93
83
  gap:var(--dimension-025m, 2px);
94
84
  }
85
+ .tagRow .promoTag{
86
+ border-radius:2px;
87
+ }
95
88
 
96
89
  .textWrapper{
97
90
  display:flex;
@@ -139,6 +132,19 @@
139
132
  flex-direction:column;
140
133
  }
141
134
 
135
+ .contentWrapper{
136
+ padding:var(--dimension-5m, 40px) 0;
137
+ }
138
+ .contentWrapper[data-layout-type=tablet]{
139
+ padding:var(--dimension-4m, 32px) 0;
140
+ }
141
+ .contentWrapper[data-layout-type=mobile]{
142
+ padding:var(--dimension-3m, 24px) 0;
143
+ }
144
+ .contentWrapper .buttons .button{
145
+ border-radius:2px;
146
+ }
147
+
142
148
  .navbarWrapper{
143
149
  z-index:5;
144
150
  }
@@ -1,13 +1,14 @@
1
1
  import { WithLayoutType, WithSupportProps } from '@cloud-ru/uikit-product-utils';
2
2
  import { CarouselProps } from '@snack-uikit/carousel';
3
3
  import { HeroSlideProps } from './components';
4
+ import { TabHeroSliderBase } from './components/TabHeroSlider';
4
5
  export type HeroSliderProps = WithSupportProps<WithLayoutType<{
5
6
  id?: string;
6
7
  /** Слайды карусели */
7
8
  items: HeroSlideProps[];
9
+ /** Заголовки для tabs */
10
+ tabs: TabHeroSliderBase[];
8
11
  /** CSS-класс */
9
12
  className?: string;
10
- /** Использовать пагинацию для переключения страниц @default true */
11
- pagination?: boolean;
12
- } & Pick<CarouselProps, 'state' | 'autoSwipe'>>>;
13
- export declare function HeroSlider({ id, layoutType, items, autoSwipe, pagination, className, ...rest }: HeroSliderProps): import("react/jsx-runtime").JSX.Element;
13
+ } & Pick<CarouselProps, 'state'>>>;
14
+ export declare function HeroSlider({ id, tabs: tabsProp, layoutType, items: itemsProp, className, ...rest }: HeroSliderProps): import("react/jsx-runtime").JSX.Element;
@@ -20,17 +20,35 @@ const classnames_1 = __importDefault(require("classnames"));
20
20
  const react_1 = require("react");
21
21
  const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
22
22
  const carousel_1 = require("@snack-uikit/carousel");
23
- const pagination_1 = require("@snack-uikit/pagination");
24
23
  const components_1 = require("./components");
25
24
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
25
+ const AUTO_SWIPE = 5;
26
+ const AUTO_SWIPE_DISABLED = 0;
26
27
  function HeroSlider(_a) {
27
- var { id, layoutType, items, autoSwipe, pagination = true, className } = _a, rest = __rest(_a, ["id", "layoutType", "items", "autoSwipe", "pagination", "className"]);
28
+ var { id, tabs: tabsProp, layoutType, items: itemsProp, className } = _a, rest = __rest(_a, ["id", "tabs", "layoutType", "items", "className"]);
29
+ // Максимум 5 слайдов
30
+ const items = itemsProp.toSpliced(5);
31
+ const tabs = tabsProp.toSpliced(5);
28
32
  const [currentPage, setCurrentPage] = (0, react_1.useState)(0);
29
- const currentSlideAppearance = items[currentPage].appearance;
30
- return ((0, jsx_runtime_1.jsxs)("section", { className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), id: id, children: [(0, jsx_runtime_1.jsx)(carousel_1.Carousel, Object.assign({ className: styles_module_scss_1.default.heroCarousel, arrows: false, pagination: false, infiniteScroll: true, autoSwipe: autoSwipe, state: {
33
+ const [autoSwipe, setAutoSwipe] = (0, react_1.useState)(AUTO_SWIPE);
34
+ const currentAppearance = items[currentPage].appearance;
35
+ const currentColor = items[currentPage].color;
36
+ const currentTab = tabs[currentPage];
37
+ const handleTabClick = (tab) => {
38
+ const currentIndex = tabs.findIndex(t => t.title === tab.title);
39
+ setCurrentPage(currentIndex);
40
+ setAutoSwipe(AUTO_SWIPE_DISABLED);
41
+ };
42
+ const handleLeftClick = () => {
43
+ setCurrentPage(page => (items.length + page - 1) % items.length);
44
+ setAutoSwipe(AUTO_SWIPE_DISABLED);
45
+ };
46
+ const handleRightClick = () => {
47
+ setCurrentPage(page => (page + 1) % items.length);
48
+ setAutoSwipe(AUTO_SWIPE_DISABLED);
49
+ };
50
+ return ((0, jsx_runtime_1.jsxs)("section", { className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), id: id, "data-appearance": currentAppearance, "data-color": currentColor, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(carousel_1.Carousel, Object.assign({ className: styles_module_scss_1.default.heroCarousel, arrows: false, pagination: false, infiniteScroll: true, autoSwipe: autoSwipe, state: {
31
51
  page: currentPage,
32
52
  onChange: setCurrentPage,
33
- }, gap: '0' }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: items.map((item, i) => ((0, jsx_runtime_1.jsx)(components_1.HeroSlide, Object.assign({}, item, { layoutType: layoutType }), `${item.title}${i}`))) })), pagination && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.paginationWrapper, "data-appearance": currentSlideAppearance, children: (0, jsx_runtime_1.jsx)(pagination_1.PaginationSlider, { "data-test-id": 'hero-slider__pagination', page: currentPage + 1, onChange: (page) => {
34
- setCurrentPage(page - 1);
35
- }, total: items.length }) }))] }));
53
+ }, gap: '0' }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: items.map((item, i) => ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.carouselItemWrapper, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(components_1.HeroSlide, Object.assign({}, item, { className: styles_module_scss_1.default.heroSlide, layoutType: layoutType })) }, `${item.title}${i}`))) })), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tabsWrapper), "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(components_1.TabsRowHeroSlider, { className: styles_module_scss_1.default.tabs, appearance: currentAppearance, active: currentTab, items: tabs, onTabClick: handleTabClick }) }), (0, jsx_runtime_1.jsx)(components_1.Control, { className: styles_module_scss_1.default.control, variant: 'prev', onClick: handleLeftClick }), (0, jsx_runtime_1.jsx)(components_1.Control, { className: styles_module_scss_1.default.control, variant: 'next', onClick: handleRightClick })] }));
36
54
  }
@@ -0,0 +1,7 @@
1
+ export declare const Control: import("react").ForwardRefExoticComponent<{
2
+ 'data-test-id'?: string;
3
+ } & import("react").AriaAttributes & {
4
+ onClick?(): void;
5
+ variant: "prev" | "next";
6
+ className?: string;
7
+ } & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Control = void 0;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const classnames_1 = __importDefault(require("classnames"));
20
+ const react_1 = require("react");
21
+ const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
22
+ const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
23
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
24
+ exports.Control = (0, react_1.forwardRef)((_a, ref) => {
25
+ var { onClick, variant, className } = _a, rest = __rest(_a, ["onClick", "variant", "className"]);
26
+ return ((0, jsx_runtime_1.jsx)("button", Object.assign({ ref: ref, className: (0, classnames_1.default)(styles_module_scss_1.default.control, className), onClick: onClick, type: 'button', "data-variant": variant }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.ChevronLeftSVG, { size: 24, className: styles_module_scss_1.default.icon }) })));
27
+ });
@@ -0,0 +1 @@
1
+ export * from './Control';
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./HeroSlideVideoBg"), exports);
17
+ __exportStar(require("./Control"), exports);
@@ -0,0 +1,45 @@
1
+ .control{
2
+ width:var(--size-carousel-control-container, 40px);
3
+ height:var(--size-carousel-control-container, 40px);
4
+ border-radius:var(--radius-carousel-control-container, 24px);
5
+ border-width:var(--border-width-025m, 2px);
6
+ cursor:pointer;
7
+ position:absolute;
8
+ top:50%;
9
+ left:28px;
10
+ transform:translateY(-50%);
11
+ display:flex;
12
+ flex-shrink:0;
13
+ align-items:center;
14
+ justify-content:center;
15
+ color:var(--sys-neutral-text-light, #8b8e9b);
16
+ background-color:var(--sys-neutral-background1-level, #fdfdfd);
17
+ border-color:transparent;
18
+ border-style:solid;
19
+ outline-color:transparent;
20
+ box-shadow:var(--box-shadow-elevation-level3, 0px 0px 8px 0px rgba(0, 0, 0, 0.0784313725), 0px 8px 16px 0px rgba(0, 0, 0, 0.0784313725));
21
+ }
22
+ .control:hover, .control:focus-visible{
23
+ color:var(--sys-neutral-text-main, #41424e);
24
+ }
25
+ .control:hover{
26
+ box-shadow:var(--box-shadow-elevation-level4, 0px 0px 8px 0px rgba(0, 0, 0, 0.0784313725), 0px 16px 16px 0px rgba(0, 0, 0, 0.0784313725));
27
+ }
28
+ .control:focus-visible{
29
+ outline-width:var(--border-state-focus-s-border-width, 2px);
30
+ outline-style:var(--border-state-focus-s-border-style, solid);
31
+ outline-color:var(--border-state-focus-s-border-color, );
32
+ border-color:var(--sys-available-complementary, #15151b);
33
+ outline-color:var(--sys-available-on-complementary, #ffffff);
34
+ box-shadow:none;
35
+ }
36
+ .control[data-variant=next]{
37
+ right:28px;
38
+ left:auto;
39
+ }
40
+ .control[data-variant=next]:focus-visible{
41
+ outline-offset:var(--dimension-025m, 2px);
42
+ }
43
+ .control[data-variant=next] .icon{
44
+ transform:rotate(180deg);
45
+ }
@@ -7,13 +7,15 @@ exports.HeroSlide = HeroSlide;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const classnames_1 = __importDefault(require("classnames"));
9
9
  const uikit_product_button_predefined_1 = require("@cloud-ru/uikit-product-button-predefined");
10
- const uikit_product_site_layout_1 = require("@cloud-ru/uikit-product-site-layout");
11
10
  const uikit_product_site_rich_text_1 = require("@cloud-ru/uikit-product-site-rich-text");
12
11
  const uikit_product_site_tag_1 = require("@cloud-ru/uikit-product-site-tag");
12
+ const button_1 = require("@snack-uikit/button");
13
13
  const typography_1 = require("@snack-uikit/typography");
14
14
  const HeroSlideMedia_1 = require("../HeroSlideMedia");
15
15
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
16
16
  const util_1 = require("./util");
17
17
  function HeroSlide({ layoutType, id, title, description, media, button, color, appearance, erid, className, }) {
18
- return ((0, jsx_runtime_1.jsx)("div", { id: id, "data-layout-type": layoutType, "data-appearance": appearance, "data-color": color, className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, className), children: (0, jsx_runtime_1.jsxs)(uikit_product_site_layout_1.Layout.SectionWrapper, { layoutType: layoutType, className: styles_module_scss_1.default.sectionWrapper, children: [erid && (0, jsx_runtime_1.jsx)(uikit_product_site_tag_1.Erid, { className: styles_module_scss_1.default.erid, tip: erid.tip, appearance: erid.appearance }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.slideContentWrapper, "data-layout-type": layoutType, "data-image-format": (0, util_1.getSliderContentWrapperImageType)(media), children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, "data-layout-type": layoutType, "data-image-format": (0, util_1.getSliderContentWrapperImageType)(media), children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.text, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, Object.assign({ family: 'sans' }, (0, util_1.getTitleProps)(layoutType), { tag: 'div', children: (0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: title }) })), description && ((0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyL, { tag: 'div', children: (0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: description }) }))] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.buttonWrapper, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(uikit_product_button_predefined_1.ButtonPromo, Object.assign({ target: '_self' }, button, { size: 'l', appearance: 'tertiary', className: styles_module_scss_1.default.button })) })] }), (0, jsx_runtime_1.jsx)(HeroSlideMedia_1.HeroSlideMedia, Object.assign({}, media, { layoutType: layoutType }))] })] }) }));
18
+ const hasButtonErid = Boolean(erid && erid.place === 'under-button');
19
+ const buttonNode = appearance === 'brand' ? ((0, jsx_runtime_1.jsx)(uikit_product_button_predefined_1.ButtonPromo, Object.assign({}, button, { size: 'l', className: styles_module_scss_1.default.button }))) : ((0, jsx_runtime_1.jsx)(button_1.ButtonFilled, Object.assign({}, button, { size: 'l', appearance: 'primary', className: styles_module_scss_1.default.button })));
20
+ return ((0, jsx_runtime_1.jsxs)("div", { id: id, "data-layout-type": layoutType, "data-appearance": appearance, "data-color": color, className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, className), children: [erid && erid.place === 'tooltip' && (0, jsx_runtime_1.jsx)(uikit_product_site_tag_1.Erid, { className: styles_module_scss_1.default.erid, tip: erid.tip, appearance: 'neutral' }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.slideContentWrapper, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.text, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, Object.assign({ family: 'sans' }, (0, util_1.getTitleProps)(layoutType), { tag: 'div', children: (0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: title }) })), description && ((0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyM, { className: styles_module_scss_1.default.description, tag: 'div', children: (0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: description }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.buttonWrapper, "data-layout-type": layoutType, "data-has-button-erid": hasButtonErid, children: [buttonNode, erid && hasButtonErid && ((0, jsx_runtime_1.jsx)(typography_1.Typography.LightLabelS, { className: styles_module_scss_1.default.buttonErid, tag: 'div', children: erid.tip }))] })] }), (0, jsx_runtime_1.jsx)(HeroSlideMedia_1.HeroSlideMedia, Object.assign({}, media, { layoutType: layoutType }))] })] }));
19
21
  }
@@ -4,8 +4,6 @@ export declare const Appearance: {
4
4
  readonly Graphite: "graphite";
5
5
  };
6
6
  export declare const Color: {
7
- readonly Neutral: "neutral";
8
- readonly White: "white";
9
7
  readonly Violet: "violet";
10
8
  readonly Blue: "blue";
11
9
  };
@@ -7,8 +7,6 @@ exports.Appearance = {
7
7
  Graphite: 'graphite',
8
8
  };
9
9
  exports.Color = {
10
- Neutral: 'neutral',
11
- White: 'white',
12
10
  Violet: 'violet',
13
11
  Blue: 'blue',
14
12
  };
@@ -1,49 +1,38 @@
1
1
  .wrapper{
2
- position:relative;
3
- display:flex;
4
- align-items:center;
5
- background-color:var(--sys-neutral-background, #eeeff3);
6
- height:368px;
7
- }
8
- .wrapper[data-color=neutral][data-appearance=decor]{
9
- background-color:var(--sys-neutral-background, #eeeff3);
10
- }
11
- .wrapper[data-color=white][data-appearance=decor]{
12
- background-color:var(--sys-neutral-background1-level, #fdfdfd);
13
- }
14
- .wrapper[data-color=violet][data-appearance=decor]{
15
- background-color:var(--sys-violet-decor-default, #e5dcf7);
16
- }
17
- .wrapper[data-color=blue][data-appearance=decor]{
18
- background-color:var(--sys-blue-decor-default, #d0ddf3);
19
- }
20
- .wrapper[data-appearance=graphite]{
21
- background-color:var(--sys-graphite-accent-default, #222222);
2
+ padding:16px 32px;
22
3
  }
23
4
  .wrapper[data-appearance=graphite] .text{
24
- color:var(--sys-invert-neutral-text-main, #e6e8ef);
5
+ color:var(--sys-graphite-on-accent, #ffffff);
25
6
  }
26
- .wrapper[data-appearance=brand]{
27
- background-color:var(--sys-primary-accent-default, #26d07c);
7
+ .wrapper[data-appearance=graphite] .buttonErid{
8
+ color:var(--sys-graphite-text-disabled, #a3a3a3);
28
9
  }
29
10
  .wrapper[data-appearance=brand] .text{
30
11
  color:var(--sys-graphite-text-main, #222222);
31
12
  }
13
+ .wrapper[data-appearance=brand] .buttonErid{
14
+ color:var(--sys-primary-text-support, #125137);
15
+ }
32
16
  .wrapper[data-appearance=decor] .text{
33
17
  color:var(--sys-graphite-text-main, #222222);
34
18
  }
35
-
36
- .sectionWrapper{
37
- height:100%;
19
+ .wrapper[data-appearance=decor] .buttonErid{
20
+ color:var(--sys-neutral-text-support, #656774);
38
21
  }
39
- .sectionWrapper > div[data-layout-type=tablet]{
40
- padding-right:0;
22
+ .wrapper[data-layout-type=tablet]{
23
+ padding:24px 24px 20px 24px;
24
+ }
25
+ .wrapper[data-layout-type=mobile]{
26
+ padding:16px 16px 24px 16px;
41
27
  }
42
28
 
43
29
  .erid{
44
30
  position:absolute;
45
- right:var(--dimension-025m, 2px);
46
- top:var(--dimension-025m, 2px);
31
+ right:0;
32
+ top:0;
33
+ }
34
+ .erid span{
35
+ border-radius:0 2px 0 0;
47
36
  }
48
37
 
49
38
  .slideContentWrapper{
@@ -51,60 +40,62 @@
51
40
  flex-direction:row;
52
41
  height:100%;
53
42
  justify-content:space-between;
43
+ gap:64px;
54
44
  }
55
- .slideContentWrapper[data-layout-type=mobile]{
56
- justify-content:center;
57
- }
58
- .slideContentWrapper[data-image-format=rectangle][data-layout-type=desktop]{
59
- gap:var(--dimension-4m, 32px);
60
- }
61
- .slideContentWrapper[data-image-format=rectangle][data-layout-type=desktopSmall]{
62
- gap:var(--dimension-3m, 24px);
45
+ .slideContentWrapper[data-layout-type=tablet]{
46
+ flex-direction:column-reverse;
47
+ gap:24px;
63
48
  }
64
- .slideContentWrapper[data-image-format=square]{
65
- gap:var(--dimension-2m, 16px);
49
+ .slideContentWrapper[data-layout-type=mobile]{
50
+ flex-direction:column-reverse;
51
+ gap:16px;
66
52
  }
67
53
 
68
54
  .content{
69
55
  display:flex;
70
56
  flex-direction:column;
71
57
  justify-content:space-between;
72
- padding:var(--dimension-7m, 56px) 0;
73
- }
74
- .content[data-layout-type=tablet]{
75
- max-width:unset;
76
- padding:var(--dimension-4m, 32px) 0 var(--dimension-7m, 56px);
77
58
  }
78
- .content[data-layout-type=mobile]{
79
- max-width:unset;
80
- padding:var(--dimension-3m, 24px) 0 var(--dimension-7m, 56px);
81
- width:100%;
82
- }
83
- .content[data-image-format=rectangle][data-layout-type=desktopSmall]{
84
- max-width:650px;
85
- flex-shrink:0;
86
- }
87
- .content[data-image-format=rectangle][data-layout-type=tablet]{
88
- max-width:388px;
89
- }
90
- .content[data-image-format=square]{
91
- max-width:800px;
92
- flex-shrink:0;
93
- }
94
- .content[data-image-format=square][data-layout-type=tablet], .content[data-image-format=square][data-layout-type=mobile]{
95
- max-width:unset;
96
- flex:initial;
59
+
60
+ .description{
61
+ max-width:500px;
62
+ margin-bottom:20px;
97
63
  }
98
64
 
99
65
  .text{
100
66
  display:flex;
101
67
  flex-direction:column;
102
68
  gap:var(--dimension-2m, 16px);
69
+ margin-top:32px;
70
+ }
71
+ .text[data-layout-type=tablet], .text[data-layout-type=mobile]{
72
+ margin-top:0;
73
+ gap:12px;
74
+ margin-bottom:32px;
103
75
  }
104
- .text[data-layout-type=mobile] br{
76
+ .text[data-layout-type=tablet] br, .text[data-layout-type=mobile] br{
105
77
  display:none;
106
78
  }
79
+ .text[data-layout-type=tablet] .description, .text[data-layout-type=mobile] .description{
80
+ max-width:unset;
81
+ }
107
82
 
108
- .buttonWrapper[data-layout-type=mobile] .button{
83
+ .buttonWrapper .buttonErid{
84
+ margin-top:18px;
85
+ }
86
+ .buttonWrapper[data-layout-type=tablet] .button, .buttonWrapper[data-layout-type=mobile] .button{
109
87
  width:100%;
88
+ }
89
+ .buttonWrapper[data-layout-type=mobile] .buttonErid{
90
+ margin-top:16px;
91
+ }
92
+ .buttonWrapper[data-has-button-erid=false]{
93
+ margin-bottom:32px;
94
+ }
95
+ .buttonWrapper[data-has-button-erid=false][data-layout-type=tablet], .buttonWrapper[data-has-button-erid=false][data-layout-type=mobile]{
96
+ margin-bottom:0px;
97
+ }
98
+
99
+ .content .buttonWrapper .button{
100
+ border-radius:2px;
110
101
  }
@@ -1,10 +1,10 @@
1
- import { ButtonPromoProps } from '@cloud-ru/uikit-product-button-predefined';
1
+ import { HTMLAttributeAnchorTarget, MouseEventHandler } from 'react';
2
2
  import { EridProps } from '@cloud-ru/uikit-product-site-tag';
3
3
  import { ValueOf } from '@snack-uikit/utils';
4
4
  import { HeroSlideMediaProps } from '../HeroSlideMedia';
5
5
  import { Appearance, Color } from './constants';
6
6
  type ColorType = ValueOf<typeof Color>;
7
- type AppearanceType = ValueOf<typeof Appearance>;
7
+ export type AppearanceType = ValueOf<typeof Appearance>;
8
8
  export type HeroSlideBaseProps = {
9
9
  /** id компонента */
10
10
  id?: string;
@@ -14,10 +14,21 @@ export type HeroSlideBaseProps = {
14
14
  description?: string;
15
15
  /** Медиа-контент */
16
16
  media: HeroSlideMediaProps;
17
- /** Кнопка ButtonPromo */
18
- button: Omit<ButtonPromoProps, 'size' | 'appearance' | 'className'>;
17
+ /** Кнопка CTA */
18
+ button: {
19
+ /** Текст кнопки */
20
+ label: string;
21
+ /** Ссылка */
22
+ href: string;
23
+ /** Как открывать ссылку */
24
+ target?: HTMLAttributeAnchorTarget;
25
+ /** Обработчик клика по кнопке */
26
+ onClick?: MouseEventHandler<HTMLElement>;
27
+ };
19
28
  /** Плашка рекламы с tooltip */
20
- erid?: Pick<EridProps, 'tip' | 'appearance'>;
29
+ erid?: Pick<EridProps, 'tip'> & {
30
+ place: 'tooltip' | 'under-button';
31
+ };
21
32
  /** CSS-класс */
22
33
  className?: string;
23
34
  };
@@ -1,6 +1,3 @@
1
1
  import { LayoutType } from '@cloud-ru/uikit-product-utils';
2
2
  import { TypographyProps } from '@snack-uikit/typography';
3
- import { HeroSlideImageProps } from '../HeroSlideImage';
4
- import { HeroSlideBaseProps } from './types';
5
3
  export declare const getTitleProps: (layoutType: LayoutType) => Pick<TypographyProps, "purpose" | "size">;
6
- export declare const getSliderContentWrapperImageType: (media: HeroSlideBaseProps["media"]) => HeroSlideImageProps["format"] | undefined;
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSliderContentWrapperImageType = exports.getTitleProps = void 0;
3
+ exports.getTitleProps = void 0;
4
4
  const getTitleProps = (layoutType) => {
5
5
  switch (layoutType) {
6
6
  case 'mobile':
7
+ return {
8
+ purpose: 'headline',
9
+ size: 's',
10
+ };
7
11
  case 'tablet':
8
12
  return {
9
13
  purpose: 'headline',
@@ -17,14 +21,3 @@ const getTitleProps = (layoutType) => {
17
21
  }
18
22
  };
19
23
  exports.getTitleProps = getTitleProps;
20
- const getSliderContentWrapperImageType = (media) => {
21
- switch (media.type) {
22
- case 'image':
23
- return media.format;
24
- case 'imageBg':
25
- case 'videoBg':
26
- default:
27
- return undefined;
28
- }
29
- };
30
- exports.getSliderContentWrapperImageType = getSliderContentWrapperImageType;
@@ -3,9 +3,8 @@ export type HeroSlideImageProps = {
3
3
  /** Ссылки на картинку */
4
4
  source: {
5
5
  desktop: string;
6
- tablet?: string;
6
+ tablet: string;
7
+ mobile: string;
7
8
  };
8
- /** Форма картинки */
9
- format: 'rectangle' | 'square' | 'custom';
10
9
  };
11
- export declare function HeroSlideImage({ source, format, layoutType }: WithLayoutType<HeroSlideImageProps>): import("react/jsx-runtime").JSX.Element | null;
10
+ export declare function HeroSlideImage({ source, layoutType }: WithLayoutType<HeroSlideImageProps>): import("react/jsx-runtime").JSX.Element;