@cloud-ru/uikit-product-site-hero 0.5.50 → 0.6.1

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,26 @@
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
+ ## 0.6.1 (2025-12-05)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@cloud-ru/uikit-product-site-layout@0.5.0](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/site-layout/CHANGELOG.md)
10
+
11
+
12
+
13
+
14
+
15
+ # 0.6.0 (2025-12-04)
16
+
17
+
18
+ ### Features
19
+
20
+ * **SITE-10320:** edit hero main ([a85a31d](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/a85a31d49635867e75ae1dffec8ecb510d95a71e))
21
+
22
+
23
+
24
+
25
+
6
26
  ## 0.5.50 (2025-12-04)
7
27
 
8
28
  ### Only dependencies have been changed
package/README.md CHANGED
@@ -19,7 +19,7 @@ Hero blocks for Site
19
19
  | startsAt* | `string` | - | Начало события события |
20
20
  | title* | `string` | - | Заголовок события |
21
21
  | className | `string` | - | CSS - класснейм |
22
- | backgroundColor | enum HeroColor: `"neutral-background1-level"`, `"neutral-background"` | neutral-background | Цвета фона |
22
+ | backgroundColor | enum HeroColor: `"neutral-background1-level"`, `"neutral-background"`, `"graphite-accent-default"` | neutral-background | Цвета фона |
23
23
  | category | `PromoTagProps` | - | Категория события |
24
24
  | format | enum Format: `"online"`, `"offline"`, `"hybrid"` | - | Формат проведения события |
25
25
  | audience | enum Audience: `"it"`, `"students"`, `"business"` | - | Аудитория, для которой проводится событие |
@@ -33,7 +33,7 @@ Hero blocks for Site
33
33
  | description | `string` | - | Описание секции |
34
34
  | buttons | `[ButtonFilledProps, ButtonFilledProps?]` | - | Массив с настройками кнопок ButtonFilled |
35
35
  | showBottomPadding | `boolean` | true | Наличие нижнего паддинга |
36
- | backgroundColor | enum HeroColor: `"neutral-background1-level"`, `"neutral-background"` | neutral-background | Цвет фона |
36
+ | backgroundColor | enum HeroColor: `"neutral-background1-level"`, `"neutral-background"`, `"graphite-accent-default"` | neutral-background | Цвет фона |
37
37
  | contentAlign | "left" \| "center" | left | Выравнивание текста |
38
38
  | className | `string` | - | CSS - класснейм |
39
39
  ## HeroMain
@@ -49,8 +49,8 @@ Hero blocks for Site
49
49
  | tags | `Pick<TagSpecialProps, "text" \| "appearance" \| "tip">[]` | [] | Тэги |
50
50
  | platforms | `Platform[]` | [] | Платформы |
51
51
  | handlePlatformClick | `(e: MouseEvent<HTMLAnchorElement, MouseEvent>, platform: Platform) => void` | - | Обработка клика по платформе |
52
- | backgroundColor | enum HeroColor: `"neutral-background1-level"`, `"neutral-background"` | neutral-background1-level | Цвета фона |
53
- | buttons | `[Omit<ButtonFilledProps, "size" \| "appearance">, Omit<ButtonPromoOutlineProps, "size" \| "appearance">?]` | - | Массив с настройками кнопок ButtonFilled |
52
+ | backgroundColor | enum HeroColor: `"neutral-background1-level"`, `"neutral-background"`, `"graphite-accent-default"` | neutral-background1-level | Цвета фона |
53
+ | buttons | `[Omit<ButtonFilledProps, "size" \| "appearance">, Omit<ButtonPromoOutlineProps, "size" \| "appearance">?, Omit<...>?]` | - | Массив с настройками кнопок ButtonFilled |
54
54
  | className | `string` | - | CSS - класснейм |
55
55
  | navbar | `Pick<SiteNavbarProps, "items" \| "active" \| "onItemClick" \| "topPosition">` | - | Navbar |
56
56
  ## HeroSlider
@@ -4,7 +4,7 @@ import { SiteNavbarProps } from '@cloud-ru/uikit-product-site-navbar';
4
4
  import { TagSpecialProps } from '@cloud-ru/uikit-product-site-tag';
5
5
  import { WithLayoutType, WithSupportProps } from '@cloud-ru/uikit-product-utils';
6
6
  import { BreadcrumbsProps } from '@snack-uikit/breadcrumbs';
7
- import { ButtonFilledProps } from '@snack-uikit/button';
7
+ import { ButtonFilledProps, ButtonOutlineProps } from '@snack-uikit/button';
8
8
  import { HeroColor } from '../../types';
9
9
  import { PlatformLinkProps } from './components';
10
10
  export type HeroMainProps = WithSupportProps<WithLayoutType<{
@@ -27,7 +27,11 @@ export type HeroMainProps = WithSupportProps<WithLayoutType<{
27
27
  /** Цвета фона */
28
28
  backgroundColor?: HeroColor;
29
29
  /** Массив с настройками кнопок ButtonFilled */
30
- buttons?: [Omit<ButtonFilledProps, 'size' | 'appearance'>, Omit<ButtonPromoOutlineProps, 'size' | 'appearance'>?];
30
+ buttons?: [
31
+ Omit<ButtonFilledProps, 'size' | 'appearance'>,
32
+ Omit<ButtonPromoOutlineProps, 'size' | 'appearance'>?,
33
+ Omit<ButtonOutlineProps, 'size'>?
34
+ ];
31
35
  /** CSS - класснейм */
32
36
  className?: string;
33
37
  /** Navbar */
@@ -29,6 +29,7 @@ const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
29
29
  const breadcrumbs_1 = require("@snack-uikit/breadcrumbs");
30
30
  const button_1 = require("@snack-uikit/button");
31
31
  const typography_1 = require("@snack-uikit/typography");
32
+ const constants_1 = require("../../constants");
32
33
  const components_1 = require("./components");
33
34
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
34
35
  const utils_1 = require("./utils");
@@ -36,5 +37,8 @@ function HeroMain(_a) {
36
37
  var { title, description, image, video, breadcrumbs, tags = [], platforms = [], handlePlatformClick, backgroundColor = 'neutral-background1-level', buttons, navbar, layoutType, className } = _a, rest = __rest(_a, ["title", "description", "image", "video", "breadcrumbs", "tags", "platforms", "handlePlatformClick", "backgroundColor", "buttons", "navbar", "layoutType", "className"]);
37
38
  const { t } = (0, uikit_product_locale_1.useLocale)('SiteHero');
38
39
  const isAdaptive = ['mobile', 'tablet'].includes(layoutType);
39
- 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), "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, 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 && ((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)("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, { "data-test-id": 'hero-main__navbar' })) }))] }));
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
+ [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' })) }))] }));
40
44
  }
@@ -7,6 +7,7 @@ type Platform = {
7
7
  export type PlatformLinkProps = {
8
8
  platform: Platform;
9
9
  handlePlatformClick(e: MouseEvent<HTMLAnchorElement>, platform: Platform): void;
10
+ appearance?: 'neutral' | 'invert-neutral';
10
11
  };
11
- export declare function PlatformLink({ platform, handlePlatformClick }: PlatformLinkProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function PlatformLink({ platform, appearance, handlePlatformClick }: PlatformLinkProps): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlatformLink = PlatformLink;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const link_1 = require("@snack-uikit/link");
6
- function PlatformLink({ platform, handlePlatformClick }) {
6
+ function PlatformLink({ platform, appearance = 'neutral', handlePlatformClick }) {
7
7
  const handleClick = (e) => {
8
8
  handlePlatformClick(e, platform);
9
9
  };
10
- return ((0, jsx_runtime_1.jsx)(link_1.Link, { text: platform.title, href: platform.href, onClick: handleClick, size: 'l', textMode: 'accent', appearance: 'neutral' }));
10
+ return ((0, jsx_runtime_1.jsx)(link_1.Link, { text: platform.title, href: platform.href, onClick: handleClick, size: 'l', textMode: 'accent', appearance: appearance }));
11
11
  }
@@ -1,13 +1,47 @@
1
+ .title{
2
+ color:var(--sys-neutral-text-main, #41424e);
3
+ word-break:break-word;
4
+ white-space:pre-line;
5
+ max-width:720px;
6
+ }
7
+
8
+ .description{
9
+ color:var(--sys-neutral-text-support, #656774);
10
+ word-break:break-word;
11
+ max-width:560px;
12
+ }
13
+
14
+ .platforms{
15
+ color:var(--sys-neutral-text-main, #41424e);
16
+ }
17
+
18
+ .sectionWrapper{
19
+ border-radius:var(--dimension-050m, 4px);
20
+ }
1
21
  .sectionWrapper[data-section-background=neutral-background1-level]{
2
22
  background-color:var(--sys-neutral-background1-level, #fdfdfd);
3
23
  }
4
24
  .sectionWrapper[data-section-background=neutral-background]{
5
25
  background-color:var(--sys-neutral-background, #eeeff3);
6
26
  }
27
+ .sectionWrapper[data-section-background=graphite-accent-default]{
28
+ background-color:var(--sys-graphite-accent-default, #222222);
29
+ }
30
+ .sectionWrapper[data-section-background=graphite-accent-default] .title,
31
+ .sectionWrapper[data-section-background=graphite-accent-default] .description,
32
+ .sectionWrapper[data-section-background=graphite-accent-default] .platforms{
33
+ color:var(--sys-graphite-on-accent, #ffffff);
34
+ }
7
35
  .sectionWrapper[data-sticky]{
8
36
  position:sticky;
9
37
  top:0;
10
38
  }
39
+ .sectionWrapper.withNavbarBorderRadius{
40
+ border-radius:var(--dimension-050m, 4px) var(--dimension-050m, 4px) 0 0;
41
+ }
42
+ .sectionWrapper.navbarWrapper{
43
+ border-radius:0 0 var(--dimension-050m, 4px) var(--dimension-050m, 4px);
44
+ }
11
45
 
12
46
  .contentWrapper{
13
47
  padding:var(--dimension-5m, 40px) 0;
@@ -56,7 +90,7 @@
56
90
  .tagRow{
57
91
  display:flex;
58
92
  flex-wrap:wrap;
59
- gap:var(--dimension-050m, 4px);
93
+ gap:var(--dimension-025m, 2px);
60
94
  }
61
95
 
62
96
  .textWrapper{
@@ -65,23 +99,6 @@
65
99
  gap:var(--dimension-2m, 16px);
66
100
  }
67
101
 
68
- .title{
69
- color:var(--sys-neutral-text-main, #41424e);
70
- word-break:break-word;
71
- white-space:pre-line;
72
- max-width:720px;
73
- }
74
-
75
- .description{
76
- color:var(--sys-neutral-text-support, #656774);
77
- word-break:break-word;
78
- max-width:560px;
79
- }
80
-
81
- .platforms{
82
- color:var(--sys-neutral-text-main, #41424e);
83
- }
84
-
85
102
  .imageWrapper{
86
103
  display:flex;
87
104
  flex-direction:column;
@@ -113,14 +130,13 @@
113
130
  .buttons{
114
131
  display:flex;
115
132
  flex-direction:row;
116
- gap:var(--dimension-2m, 16px);
133
+ gap:var(--dimension-1m, 8px);
117
134
  }
118
135
  .buttons[data-layout-type=tablet]{
119
136
  flex-direction:column;
120
137
  }
121
138
  .buttons[data-layout-type=mobile]{
122
139
  flex-direction:column;
123
- gap:var(--dimension-1m, 8px);
124
140
  }
125
141
 
126
142
  .navbarWrapper{
@@ -1,3 +1,12 @@
1
1
  import { LayoutType } from '@cloud-ru/uikit-product-utils';
2
2
  import { TypographyProps } from '@snack-uikit/typography';
3
+ import { HeroColor } from '../../types';
3
4
  export declare const getTitleTypographyProps: (layoutType: LayoutType) => Pick<TypographyProps, "size" | "purpose">;
5
+ export declare const getAppearanceByBackground: (backgroundColor: HeroColor) => "neutral" | "invert-neutral";
6
+ export declare const getNavbarAppearanceByBackground: (backgroundColor: HeroColor) => {
7
+ colorText: "invert";
8
+ dividerBackgroundColor: "invert";
9
+ } | {
10
+ colorText: "neutral";
11
+ dividerBackgroundColor: "neutral";
12
+ };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTitleTypographyProps = void 0;
3
+ exports.getNavbarAppearanceByBackground = exports.getAppearanceByBackground = exports.getTitleTypographyProps = void 0;
4
+ const constants_1 = require("../../constants");
4
5
  const getTitleTypographyProps = (layoutType) => {
5
6
  switch (layoutType) {
6
7
  case 'mobile':
@@ -14,3 +15,9 @@ const getTitleTypographyProps = (layoutType) => {
14
15
  }
15
16
  };
16
17
  exports.getTitleTypographyProps = getTitleTypographyProps;
18
+ const getAppearanceByBackground = (backgroundColor) => backgroundColor === constants_1.HERO_COLORS.GraphiteAccentDefault ? 'invert-neutral' : 'neutral';
19
+ exports.getAppearanceByBackground = getAppearanceByBackground;
20
+ const getNavbarAppearanceByBackground = (backgroundColor) => backgroundColor === constants_1.HERO_COLORS.GraphiteAccentDefault
21
+ ? { colorText: 'invert', dividerBackgroundColor: 'invert' }
22
+ : { colorText: 'neutral', dividerBackgroundColor: 'neutral' };
23
+ exports.getNavbarAppearanceByBackground = getNavbarAppearanceByBackground;
@@ -8,4 +8,5 @@ export declare const HERO_EVENT_BUTTONS: {
8
8
  export declare const HERO_COLORS: {
9
9
  readonly NeutralBackground1Level: "neutral-background1-level";
10
10
  readonly NeutralBackground: "neutral-background";
11
+ readonly GraphiteAccentDefault: "graphite-accent-default";
11
12
  };
@@ -11,4 +11,5 @@ exports.HERO_EVENT_BUTTONS = {
11
11
  exports.HERO_COLORS = {
12
12
  NeutralBackground1Level: 'neutral-background1-level',
13
13
  NeutralBackground: 'neutral-background',
14
+ GraphiteAccentDefault: 'graphite-accent-default',
14
15
  };
@@ -4,7 +4,7 @@ import { SiteNavbarProps } from '@cloud-ru/uikit-product-site-navbar';
4
4
  import { TagSpecialProps } from '@cloud-ru/uikit-product-site-tag';
5
5
  import { WithLayoutType, WithSupportProps } from '@cloud-ru/uikit-product-utils';
6
6
  import { BreadcrumbsProps } from '@snack-uikit/breadcrumbs';
7
- import { ButtonFilledProps } from '@snack-uikit/button';
7
+ import { ButtonFilledProps, ButtonOutlineProps } from '@snack-uikit/button';
8
8
  import { HeroColor } from '../../types';
9
9
  import { PlatformLinkProps } from './components';
10
10
  export type HeroMainProps = WithSupportProps<WithLayoutType<{
@@ -27,7 +27,11 @@ export type HeroMainProps = WithSupportProps<WithLayoutType<{
27
27
  /** Цвета фона */
28
28
  backgroundColor?: HeroColor;
29
29
  /** Массив с настройками кнопок ButtonFilled */
30
- buttons?: [Omit<ButtonFilledProps, 'size' | 'appearance'>, Omit<ButtonPromoOutlineProps, 'size' | 'appearance'>?];
30
+ buttons?: [
31
+ Omit<ButtonFilledProps, 'size' | 'appearance'>,
32
+ Omit<ButtonPromoOutlineProps, 'size' | 'appearance'>?,
33
+ Omit<ButtonOutlineProps, 'size'>?
34
+ ];
31
35
  /** CSS - класснейм */
32
36
  className?: string;
33
37
  /** Navbar */
@@ -21,14 +21,18 @@ import { RichText } from '@cloud-ru/uikit-product-site-rich-text';
21
21
  import { TagSpecial } from '@cloud-ru/uikit-product-site-tag';
22
22
  import { extractSupportProps } from '@cloud-ru/uikit-product-utils';
23
23
  import { Breadcrumbs } from '@snack-uikit/breadcrumbs';
24
- import { ButtonFilled } from '@snack-uikit/button';
24
+ import { ButtonFilled, ButtonOutline } from '@snack-uikit/button';
25
25
  import { Typography } from '@snack-uikit/typography';
26
+ import { HERO_COLORS } from '../../constants';
26
27
  import { PlatformLink } from './components';
27
28
  import styles from './styles.module.css';
28
- import { getTitleTypographyProps } from './utils';
29
+ import { getAppearanceByBackground, getNavbarAppearanceByBackground, getTitleTypographyProps } from './utils';
29
30
  export function HeroMain(_a) {
30
31
  var { title, description, image, video, breadcrumbs, tags = [], platforms = [], handlePlatformClick, backgroundColor = 'neutral-background1-level', buttons, navbar, layoutType, className } = _a, rest = __rest(_a, ["title", "description", "image", "video", "breadcrumbs", "tags", "platforms", "handlePlatformClick", "backgroundColor", "buttons", "navbar", "layoutType", "className"]);
31
32
  const { t } = useLocale('SiteHero');
32
33
  const isAdaptive = ['mobile', 'tablet'].includes(layoutType);
33
- return (_jsxs(_Fragment, { children: [_jsx(Layout.SectionWrapper, { layoutType: layoutType, className: cn(className, styles.sectionWrapper), "data-section-background": backgroundColor, children: _jsx("div", Object.assign({ className: styles.contentWrapper }, extractSupportProps(rest), { "data-layout-type": layoutType, children: _jsxs("div", { className: styles.content, "data-layout-type": layoutType, children: [_jsxs("div", { className: styles.left, "data-layout-type": layoutType, children: [_jsxs("div", { className: styles.leftContent, "data-layout-type": layoutType, children: [_jsx(Breadcrumbs, { size: 'xs', items: breadcrumbs, "data-test-id": 'hero-main__breadcrumbs' }), tags.length > 0 && (_jsx("div", { className: styles.tagRow, "data-layout-type": layoutType, children: tags.map(({ text, tip, appearance }) => (_jsx(TagSpecial, { text: text, tip: tip, appearance: appearance }, text))) })), _jsxs("div", { className: styles.textWrapper, children: [_jsx(Typography, Object.assign({ tag: 'h1', family: 'sans' }, getTitleTypographyProps(layoutType), { className: styles.title, children: _jsx(RichText, { richText: title }) })), _jsx(Typography.SansBodyL, { tag: 'div', className: styles.description, children: _jsx(RichText, { richText: description }) }), platforms && platforms.length > 0 && handlePlatformClick && (_jsxs(Typography.SansBodyL, { tag: 'p', className: styles.platforms, children: [t('Main.platforms'), ":", ' ', platforms.map((platform, index) => (_jsxs(Fragment, { children: [_jsx(PlatformLink, { platform: platform, handlePlatformClick: handlePlatformClick }), platforms.length - 1 !== index && ', '] }, platform.id || platform.title)))] }))] })] }), buttons && buttons.length > 0 && (_jsxs("div", { className: styles.buttons, "data-layout-type": layoutType, children: [_jsx(ButtonFilled, Object.assign({}, buttons[0], { "data-layout-type": layoutType, size: 'l', appearance: 'primary', fullWidth: isAdaptive })), buttons.length > 1 && (_jsx(ButtonPromoOutline, Object.assign({}, buttons[1], { "data-layout-type": layoutType, size: 'l', appearance: 'secondary', fullWidth: isAdaptive })))] }))] }), _jsx("div", { className: styles.imageWrapper, "data-layout-type": layoutType, children: _jsxs("div", { className: styles.media, "data-layout-type": layoutType, children: [image && _jsx("img", { alt: 'hero_img', src: image }), !image && video && _jsx(SiteVideo, { className: styles.video, video: video, layoutType: layoutType })] }) })] }) })) }), navbar && navbar.items.length > 0 && (_jsx(Layout.SectionWrapper, { layoutType: layoutType, className: cn(styles.sectionWrapper, styles.navbarWrapper), "data-sticky": true, "data-section-background": backgroundColor, children: _jsx(SiteNavbar, Object.assign({}, navbar, { "data-test-id": 'hero-main__navbar' })) }))] }));
34
+ return (_jsxs(_Fragment, { children: [_jsx(Layout.SectionWrapper, { layoutType: layoutType, className: cn(className, styles.sectionWrapper, {
35
+ [styles.withNavbarBorderRadius]: navbar && navbar.items.length > 0,
36
+ }), "data-section-background": backgroundColor, children: _jsx("div", Object.assign({ className: styles.contentWrapper }, extractSupportProps(rest), { "data-layout-type": layoutType, children: _jsxs("div", { className: styles.content, "data-layout-type": layoutType, children: [_jsxs("div", { className: styles.left, "data-layout-type": layoutType, children: [_jsxs("div", { className: styles.leftContent, "data-layout-type": layoutType, children: [_jsx(Breadcrumbs, { size: 'xs', items: breadcrumbs, "data-test-id": 'hero-main__breadcrumbs' }), tags.length > 0 && (_jsx("div", { className: styles.tagRow, "data-layout-type": layoutType, children: tags.map(({ text, tip, appearance }) => (_jsx(TagSpecial, { text: text, tip: tip, appearance: appearance }, text))) })), _jsxs("div", { className: styles.textWrapper, children: [_jsx(Typography, Object.assign({ tag: 'h1', family: 'sans' }, getTitleTypographyProps(layoutType), { className: styles.title, children: _jsx(RichText, { richText: title }) })), _jsx(Typography.SansBodyL, { tag: 'div', className: styles.description, children: _jsx(RichText, { richText: description }) }), platforms && platforms.length > 0 && handlePlatformClick && (_jsxs(Typography.SansBodyL, { tag: 'p', className: styles.platforms, children: [t('Main.platforms'), ":", ' ', platforms.map((platform, index) => (_jsxs(Fragment, { children: [_jsx(PlatformLink, { platform: platform, appearance: getAppearanceByBackground(backgroundColor), handlePlatformClick: handlePlatformClick }), platforms.length - 1 !== index && ', '] }, platform.id || platform.title)))] }))] })] }), buttons && buttons.length > 0 && (_jsxs("div", { className: styles.buttons, "data-layout-type": layoutType, children: [_jsx(ButtonFilled, Object.assign({}, buttons[0], { "data-layout-type": layoutType, size: 'l', appearance: 'primary', fullWidth: isAdaptive })), buttons.length > 1 &&
37
+ (backgroundColor !== HERO_COLORS.GraphiteAccentDefault ? (_jsx(ButtonPromoOutline, Object.assign({}, buttons[1], { "data-layout-type": layoutType, size: 'l', appearance: 'secondary', fullWidth: isAdaptive }))) : (_jsx(ButtonOutline, Object.assign({}, buttons[1], { "data-layout-type": layoutType, size: 'l', fullWidth: isAdaptive }))))] }))] }), _jsx("div", { className: styles.imageWrapper, "data-layout-type": layoutType, children: _jsxs("div", { className: styles.media, "data-layout-type": layoutType, children: [image && _jsx("img", { alt: 'hero_img', src: image }), !image && video && _jsx(SiteVideo, { className: styles.video, video: video, layoutType: layoutType })] }) })] }) })) }), navbar && navbar.items.length > 0 && (_jsx(Layout.SectionWrapper, { layoutType: layoutType, className: cn(styles.sectionWrapper, styles.navbarWrapper), "data-sticky": true, "data-section-background": backgroundColor, children: _jsx(SiteNavbar, Object.assign({}, navbar, { appereance: getNavbarAppearanceByBackground(backgroundColor), "data-test-id": 'hero-main__navbar' })) }))] }));
34
38
  }
@@ -7,6 +7,7 @@ type Platform = {
7
7
  export type PlatformLinkProps = {
8
8
  platform: Platform;
9
9
  handlePlatformClick(e: MouseEvent<HTMLAnchorElement>, platform: Platform): void;
10
+ appearance?: 'neutral' | 'invert-neutral';
10
11
  };
11
- export declare function PlatformLink({ platform, handlePlatformClick }: PlatformLinkProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function PlatformLink({ platform, appearance, handlePlatformClick }: PlatformLinkProps): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Link } from '@snack-uikit/link';
3
- export function PlatformLink({ platform, handlePlatformClick }) {
3
+ export function PlatformLink({ platform, appearance = 'neutral', handlePlatformClick }) {
4
4
  const handleClick = (e) => {
5
5
  handlePlatformClick(e, platform);
6
6
  };
7
- return (_jsx(Link, { text: platform.title, href: platform.href, onClick: handleClick, size: 'l', textMode: 'accent', appearance: 'neutral' }));
7
+ return (_jsx(Link, { text: platform.title, href: platform.href, onClick: handleClick, size: 'l', textMode: 'accent', appearance: appearance }));
8
8
  }
@@ -1,13 +1,47 @@
1
+ .title{
2
+ color:var(--sys-neutral-text-main, #41424e);
3
+ word-break:break-word;
4
+ white-space:pre-line;
5
+ max-width:720px;
6
+ }
7
+
8
+ .description{
9
+ color:var(--sys-neutral-text-support, #656774);
10
+ word-break:break-word;
11
+ max-width:560px;
12
+ }
13
+
14
+ .platforms{
15
+ color:var(--sys-neutral-text-main, #41424e);
16
+ }
17
+
18
+ .sectionWrapper{
19
+ border-radius:var(--dimension-050m, 4px);
20
+ }
1
21
  .sectionWrapper[data-section-background=neutral-background1-level]{
2
22
  background-color:var(--sys-neutral-background1-level, #fdfdfd);
3
23
  }
4
24
  .sectionWrapper[data-section-background=neutral-background]{
5
25
  background-color:var(--sys-neutral-background, #eeeff3);
6
26
  }
27
+ .sectionWrapper[data-section-background=graphite-accent-default]{
28
+ background-color:var(--sys-graphite-accent-default, #222222);
29
+ }
30
+ .sectionWrapper[data-section-background=graphite-accent-default] .title,
31
+ .sectionWrapper[data-section-background=graphite-accent-default] .description,
32
+ .sectionWrapper[data-section-background=graphite-accent-default] .platforms{
33
+ color:var(--sys-graphite-on-accent, #ffffff);
34
+ }
7
35
  .sectionWrapper[data-sticky]{
8
36
  position:sticky;
9
37
  top:0;
10
38
  }
39
+ .sectionWrapper.withNavbarBorderRadius{
40
+ border-radius:var(--dimension-050m, 4px) var(--dimension-050m, 4px) 0 0;
41
+ }
42
+ .sectionWrapper.navbarWrapper{
43
+ border-radius:0 0 var(--dimension-050m, 4px) var(--dimension-050m, 4px);
44
+ }
11
45
 
12
46
  .contentWrapper{
13
47
  padding:var(--dimension-5m, 40px) 0;
@@ -56,7 +90,7 @@
56
90
  .tagRow{
57
91
  display:flex;
58
92
  flex-wrap:wrap;
59
- gap:var(--dimension-050m, 4px);
93
+ gap:var(--dimension-025m, 2px);
60
94
  }
61
95
 
62
96
  .textWrapper{
@@ -65,23 +99,6 @@
65
99
  gap:var(--dimension-2m, 16px);
66
100
  }
67
101
 
68
- .title{
69
- color:var(--sys-neutral-text-main, #41424e);
70
- word-break:break-word;
71
- white-space:pre-line;
72
- max-width:720px;
73
- }
74
-
75
- .description{
76
- color:var(--sys-neutral-text-support, #656774);
77
- word-break:break-word;
78
- max-width:560px;
79
- }
80
-
81
- .platforms{
82
- color:var(--sys-neutral-text-main, #41424e);
83
- }
84
-
85
102
  .imageWrapper{
86
103
  display:flex;
87
104
  flex-direction:column;
@@ -113,14 +130,13 @@
113
130
  .buttons{
114
131
  display:flex;
115
132
  flex-direction:row;
116
- gap:var(--dimension-2m, 16px);
133
+ gap:var(--dimension-1m, 8px);
117
134
  }
118
135
  .buttons[data-layout-type=tablet]{
119
136
  flex-direction:column;
120
137
  }
121
138
  .buttons[data-layout-type=mobile]{
122
139
  flex-direction:column;
123
- gap:var(--dimension-1m, 8px);
124
140
  }
125
141
 
126
142
  .navbarWrapper{
@@ -1,3 +1,12 @@
1
1
  import { LayoutType } from '@cloud-ru/uikit-product-utils';
2
2
  import { TypographyProps } from '@snack-uikit/typography';
3
+ import { HeroColor } from '../../types';
3
4
  export declare const getTitleTypographyProps: (layoutType: LayoutType) => Pick<TypographyProps, "size" | "purpose">;
5
+ export declare const getAppearanceByBackground: (backgroundColor: HeroColor) => "neutral" | "invert-neutral";
6
+ export declare const getNavbarAppearanceByBackground: (backgroundColor: HeroColor) => {
7
+ colorText: "invert";
8
+ dividerBackgroundColor: "invert";
9
+ } | {
10
+ colorText: "neutral";
11
+ dividerBackgroundColor: "neutral";
12
+ };
@@ -1,3 +1,4 @@
1
+ import { HERO_COLORS } from '../../constants';
1
2
  export const getTitleTypographyProps = (layoutType) => {
2
3
  switch (layoutType) {
3
4
  case 'mobile':
@@ -10,3 +11,7 @@ export const getTitleTypographyProps = (layoutType) => {
10
11
  return { purpose: 'display', size: 'm' };
11
12
  }
12
13
  };
14
+ export const getAppearanceByBackground = (backgroundColor) => backgroundColor === HERO_COLORS.GraphiteAccentDefault ? 'invert-neutral' : 'neutral';
15
+ export const getNavbarAppearanceByBackground = (backgroundColor) => backgroundColor === HERO_COLORS.GraphiteAccentDefault
16
+ ? { colorText: 'invert', dividerBackgroundColor: 'invert' }
17
+ : { colorText: 'neutral', dividerBackgroundColor: 'neutral' };
@@ -8,4 +8,5 @@ export declare const HERO_EVENT_BUTTONS: {
8
8
  export declare const HERO_COLORS: {
9
9
  readonly NeutralBackground1Level: "neutral-background1-level";
10
10
  readonly NeutralBackground: "neutral-background";
11
+ readonly GraphiteAccentDefault: "graphite-accent-default";
11
12
  };
@@ -8,4 +8,5 @@ export const HERO_EVENT_BUTTONS = {
8
8
  export const HERO_COLORS = {
9
9
  NeutralBackground1Level: 'neutral-background1-level',
10
10
  NeutralBackground: 'neutral-background',
11
+ GraphiteAccentDefault: 'graphite-accent-default',
11
12
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloud-ru/uikit-product-site-hero",
3
3
  "title": "Site Hero",
4
- "version": "0.5.50",
4
+ "version": "0.6.1",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -38,9 +38,9 @@
38
38
  "dependencies": {
39
39
  "@cloud-ru/uikit-product-button-predefined": "0.7.12",
40
40
  "@cloud-ru/uikit-product-icons": "16.0.0",
41
- "@cloud-ru/uikit-product-site-layout": "0.4.0",
41
+ "@cloud-ru/uikit-product-site-layout": "0.5.0",
42
42
  "@cloud-ru/uikit-product-site-media": "0.1.38",
43
- "@cloud-ru/uikit-product-site-navbar": "0.2.16",
43
+ "@cloud-ru/uikit-product-site-navbar": "0.3.0",
44
44
  "@cloud-ru/uikit-product-site-rich-text": "0.2.15",
45
45
  "@cloud-ru/uikit-product-site-tag": "0.3.15",
46
46
  "@cloud-ru/uikit-product-utils": "8.0.1",
@@ -57,5 +57,5 @@
57
57
  "peerDependencies": {
58
58
  "@cloud-ru/uikit-product-locale": "*"
59
59
  },
60
- "gitHead": "14f18bff39619ba8f885fff42922458e7e0ee62c"
60
+ "gitHead": "cbf5e3534d2bc2d691a1500539d9849938cabeff"
61
61
  }
@@ -10,13 +10,14 @@ import { RichText } from '@cloud-ru/uikit-product-site-rich-text';
10
10
  import { TagSpecial, TagSpecialProps } from '@cloud-ru/uikit-product-site-tag';
11
11
  import { extractSupportProps, WithLayoutType, WithSupportProps } from '@cloud-ru/uikit-product-utils';
12
12
  import { Breadcrumbs, BreadcrumbsProps } from '@snack-uikit/breadcrumbs';
13
- import { ButtonFilled, ButtonFilledProps } from '@snack-uikit/button';
13
+ import { ButtonFilled, ButtonFilledProps, ButtonOutline, ButtonOutlineProps } from '@snack-uikit/button';
14
14
  import { Typography } from '@snack-uikit/typography';
15
15
 
16
+ import { HERO_COLORS } from '../../constants';
16
17
  import { HeroColor } from '../../types';
17
18
  import { PlatformLink, PlatformLinkProps } from './components';
18
19
  import styles from './styles.module.scss';
19
- import { getTitleTypographyProps } from './utils';
20
+ import { getAppearanceByBackground, getNavbarAppearanceByBackground, getTitleTypographyProps } from './utils';
20
21
 
21
22
  export type HeroMainProps = WithSupportProps<
22
23
  WithLayoutType<{
@@ -39,7 +40,11 @@ export type HeroMainProps = WithSupportProps<
39
40
  /** Цвета фона */
40
41
  backgroundColor?: HeroColor;
41
42
  /** Массив с настройками кнопок ButtonFilled */
42
- buttons?: [Omit<ButtonFilledProps, 'size' | 'appearance'>, Omit<ButtonPromoOutlineProps, 'size' | 'appearance'>?];
43
+ buttons?: [
44
+ Omit<ButtonFilledProps, 'size' | 'appearance'>,
45
+ Omit<ButtonPromoOutlineProps, 'size' | 'appearance'>?,
46
+ Omit<ButtonOutlineProps, 'size'>?,
47
+ ];
43
48
  /** CSS - класснейм */
44
49
  className?: string;
45
50
  /** Navbar */
@@ -71,7 +76,9 @@ export function HeroMain({
71
76
  <>
72
77
  <Layout.SectionWrapper
73
78
  layoutType={layoutType}
74
- className={cn(className, styles.sectionWrapper)}
79
+ className={cn(className, styles.sectionWrapper, {
80
+ [styles.withNavbarBorderRadius]: navbar && navbar.items.length > 0,
81
+ })}
75
82
  data-section-background={backgroundColor}
76
83
  >
77
84
  <div className={styles.contentWrapper} {...extractSupportProps(rest)} data-layout-type={layoutType}>
@@ -102,7 +109,11 @@ export function HeroMain({
102
109
  {t('Main.platforms')}:{' '}
103
110
  {platforms.map((platform, index) => (
104
111
  <Fragment key={platform.id || platform.title}>
105
- <PlatformLink platform={platform} handlePlatformClick={handlePlatformClick} />
112
+ <PlatformLink
113
+ platform={platform}
114
+ appearance={getAppearanceByBackground(backgroundColor)}
115
+ handlePlatformClick={handlePlatformClick}
116
+ />
106
117
  {platforms.length - 1 !== index && ', '}
107
118
  </Fragment>
108
119
  ))}
@@ -120,15 +131,18 @@ export function HeroMain({
120
131
  appearance='primary'
121
132
  fullWidth={isAdaptive}
122
133
  />
123
- {buttons.length > 1 && (
124
- <ButtonPromoOutline
125
- {...buttons[1]}
126
- data-layout-type={layoutType}
127
- size='l'
128
- appearance='secondary'
129
- fullWidth={isAdaptive}
130
- />
131
- )}
134
+ {buttons.length > 1 &&
135
+ (backgroundColor !== HERO_COLORS.GraphiteAccentDefault ? (
136
+ <ButtonPromoOutline
137
+ {...buttons[1]}
138
+ data-layout-type={layoutType}
139
+ size='l'
140
+ appearance='secondary'
141
+ fullWidth={isAdaptive}
142
+ />
143
+ ) : (
144
+ <ButtonOutline {...buttons[1]} data-layout-type={layoutType} size='l' fullWidth={isAdaptive} />
145
+ ))}
132
146
  </div>
133
147
  )}
134
148
  </div>
@@ -151,7 +165,11 @@ export function HeroMain({
151
165
  data-sticky={true}
152
166
  data-section-background={backgroundColor}
153
167
  >
154
- <SiteNavbar {...navbar} data-test-id='hero-main__navbar' />
168
+ <SiteNavbar
169
+ {...navbar}
170
+ appereance={getNavbarAppearanceByBackground(backgroundColor)}
171
+ data-test-id='hero-main__navbar'
172
+ />
155
173
  </Layout.SectionWrapper>
156
174
  )}
157
175
  </>
@@ -11,9 +11,10 @@ type Platform = {
11
11
  export type PlatformLinkProps = {
12
12
  platform: Platform;
13
13
  handlePlatformClick(e: MouseEvent<HTMLAnchorElement>, platform: Platform): void;
14
+ appearance?: 'neutral' | 'invert-neutral';
14
15
  };
15
16
 
16
- export function PlatformLink({ platform, handlePlatformClick }: PlatformLinkProps) {
17
+ export function PlatformLink({ platform, appearance = 'neutral', handlePlatformClick }: PlatformLinkProps) {
17
18
  const handleClick = (e: MouseEvent<HTMLAnchorElement>) => {
18
19
  handlePlatformClick(e, platform);
19
20
  };
@@ -25,7 +26,7 @@ export function PlatformLink({ platform, handlePlatformClick }: PlatformLinkProp
25
26
  onClick={handleClick}
26
27
  size='l'
27
28
  textMode='accent'
28
- appearance='neutral'
29
+ appearance={appearance}
29
30
  />
30
31
  );
31
32
  }
@@ -1,6 +1,25 @@
1
1
  @use '@sbercloud/figma-tokens-web/build/scss/styles-theme-variables' as ds;
2
2
 
3
+ .title {
4
+ color: ds.$sys-neutral-text-main;
5
+ word-break: break-word;
6
+ white-space: pre-line;
7
+ max-width: 720px;
8
+ }
9
+
10
+ .description {
11
+ color: ds.$sys-neutral-text-support;
12
+ word-break: break-word;
13
+ max-width: 560px;
14
+ }
15
+
16
+ .platforms {
17
+ color: ds.$sys-neutral-text-main;
18
+ }
19
+
3
20
  .sectionWrapper {
21
+ border-radius: ds.$dimension-050m;
22
+
4
23
  &[data-section-background='neutral-background1-level'] {
5
24
  background-color: ds.$sys-neutral-background1-level;
6
25
  }
@@ -9,10 +28,28 @@
9
28
  background-color: ds.$sys-neutral-background;
10
29
  }
11
30
 
31
+ &[data-section-background='graphite-accent-default'] {
32
+ background-color: ds.$sys-graphite-accent-default;
33
+
34
+ .title,
35
+ .description,
36
+ .platforms {
37
+ color: ds.$sys-graphite-on-accent;
38
+ }
39
+ }
40
+
12
41
  &[data-sticky] {
13
42
  position: sticky;
14
43
  top: 0;
15
44
  }
45
+
46
+ &.withNavbarBorderRadius {
47
+ border-radius: ds.$dimension-050m ds.$dimension-050m 0 0;
48
+ }
49
+
50
+ &.navbarWrapper {
51
+ border-radius: 0 0 ds.$dimension-050m ds.$dimension-050m;
52
+ }
16
53
  }
17
54
 
18
55
  .contentWrapper {
@@ -71,7 +108,7 @@
71
108
  .tagRow {
72
109
  display: flex;
73
110
  flex-wrap: wrap;
74
- gap: ds.$dimension-050m;
111
+ gap: ds.$dimension-025m;
75
112
  }
76
113
 
77
114
  .textWrapper {
@@ -80,23 +117,6 @@
80
117
  gap: ds.$dimension-2m;
81
118
  }
82
119
 
83
- .title {
84
- color: ds.$sys-neutral-text-main;
85
- word-break: break-word;
86
- white-space: pre-line;
87
- max-width: 720px;
88
- }
89
-
90
- .description {
91
- color: ds.$sys-neutral-text-support;
92
- word-break: break-word;
93
- max-width: 560px;
94
- }
95
-
96
- .platforms {
97
- color: ds.$sys-neutral-text-main;
98
- }
99
-
100
120
  .imageWrapper {
101
121
  display: flex;
102
122
  flex-direction: column;
@@ -136,7 +156,7 @@
136
156
  .buttons {
137
157
  display: flex;
138
158
  flex-direction: row;
139
- gap: ds.$dimension-2m;
159
+ gap: ds.$dimension-1m;
140
160
 
141
161
  &[data-layout-type='tablet'] {
142
162
  flex-direction: column;
@@ -144,7 +164,6 @@
144
164
 
145
165
  &[data-layout-type='mobile'] {
146
166
  flex-direction: column;
147
- gap: ds.$dimension-1m;
148
167
  }
149
168
  }
150
169
 
@@ -1,6 +1,9 @@
1
1
  import { LayoutType } from '@cloud-ru/uikit-product-utils';
2
2
  import { TypographyProps } from '@snack-uikit/typography';
3
3
 
4
+ import { HERO_COLORS } from '../../constants';
5
+ import { HeroColor } from '../../types';
6
+
4
7
  export const getTitleTypographyProps = (layoutType: LayoutType): Pick<TypographyProps, 'size' | 'purpose'> => {
5
8
  switch (layoutType) {
6
9
  case 'mobile':
@@ -15,3 +18,11 @@ export const getTitleTypographyProps = (layoutType: LayoutType): Pick<Typography
15
18
  return { purpose: 'display', size: 'm' };
16
19
  }
17
20
  };
21
+
22
+ export const getAppearanceByBackground = (backgroundColor: HeroColor): 'neutral' | 'invert-neutral' =>
23
+ backgroundColor === HERO_COLORS.GraphiteAccentDefault ? 'invert-neutral' : 'neutral';
24
+
25
+ export const getNavbarAppearanceByBackground = (backgroundColor: HeroColor) =>
26
+ backgroundColor === HERO_COLORS.GraphiteAccentDefault
27
+ ? { colorText: 'invert' as const, dividerBackgroundColor: 'invert' as const }
28
+ : { colorText: 'neutral' as const, dividerBackgroundColor: 'neutral' as const };
package/src/constants.ts CHANGED
@@ -9,4 +9,5 @@ export const HERO_EVENT_BUTTONS = {
9
9
  export const HERO_COLORS = {
10
10
  NeutralBackground1Level: 'neutral-background1-level',
11
11
  NeutralBackground: 'neutral-background',
12
+ GraphiteAccentDefault: 'graphite-accent-default',
12
13
  } as const;