@cloud-ru/uikit-product-site-hero 1.8.4 → 1.12.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,50 @@
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.12.0 (2026-07-22)
7
+
8
+
9
+ ### Features
10
+
11
+ * **SITE-11695:** update for new package ([62b4c56](https://github.com/cloud-ru-tech/uikit-product/commit/62b4c56b3772dbe243f0761a2ef40e9b3e3991c2))
12
+
13
+
14
+
15
+
16
+
17
+ # 1.11.0 (2026-07-21)
18
+
19
+
20
+ ### Features
21
+
22
+ * **SITE-11480:** update heroCentral ([f554b7c](https://github.com/cloud-ru-tech/uikit-product/commit/f554b7cf869fff88eee90b52a4f652a04b04afd0))
23
+
24
+
25
+
26
+
27
+
28
+ # 1.10.0 (2026-07-21)
29
+
30
+
31
+ ### Features
32
+
33
+ * **SITE-11480:** update heroCentral ([f554b7c](https://github.com/cloud-ru-tech/uikit-product/commit/f554b7cf869fff88eee90b52a4f652a04b04afd0))
34
+
35
+
36
+
37
+
38
+
39
+ # 1.9.0 (2026-07-21)
40
+
41
+
42
+ ### Features
43
+
44
+ * **SITE-11480:** update heroCentral ([f554b7c](https://github.com/cloud-ru-tech/uikit-product/commit/f554b7cf869fff88eee90b52a4f652a04b04afd0))
45
+
46
+
47
+
48
+
49
+
6
50
  ## 1.8.4 (2026-07-21)
7
51
 
8
52
  ### Only dependencies have been changed
@@ -18,10 +18,10 @@ type HeroBlockProps = WithSupportProps<{
18
18
  buttons?: HeroCentralButton[];
19
19
  /** Якорное меню */
20
20
  anchors?: AnchorTypeProps[];
21
- /** Хлебные крошки */
22
- breadcrumbs: Item[];
23
21
  /** Текст подсказки */
24
22
  tooltipText?: string;
23
+ /** Хлебные крошки */
24
+ breadcrumbs: Item[];
25
25
  /** Расположение подсказки */
26
26
  tooltipPlacement?: TooltipProps['placement'];
27
27
  /** Фоновое изображение */
@@ -1,11 +1,13 @@
1
1
  import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
2
+ import { ButtonFilledProps } from '@snack-uikit/button';
2
3
  export type ButtonStyle = 'filled' | 'outline';
4
+ type ButtonProps = Pick<ButtonFilledProps, 'label' | 'href' | 'className' | 'fullWidth' | 'size' | 'target' | 'onClick'>;
3
5
  export type HeroCentralButton = {
4
6
  text: string;
5
7
  uniqueId: string;
6
8
  link?: string;
7
9
  style?: ButtonStyle;
8
- onClick?: () => void;
10
+ onClick?: ButtonProps['onClick'];
9
11
  };
10
12
  type HeroCentralButtonsProps = WithLayoutType<{
11
13
  buttons?: HeroCentralButton[];
@@ -12,7 +12,6 @@ function HeroCentralButtons({ buttons, layoutType }) {
12
12
  return null;
13
13
  return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.buttonsContainer, "data-layout-type": layoutType, children: buttons.map(button => {
14
14
  const buttonProps = {
15
- key: button.uniqueId,
16
15
  label: button.text,
17
16
  href: button.link,
18
17
  className: styles_module_scss_1.default.button,
@@ -21,6 +20,7 @@ function HeroCentralButtons({ buttons, layoutType }) {
21
20
  target: '_self',
22
21
  onClick: button.onClick,
23
22
  };
24
- return button.style === 'outline' ? (0, jsx_runtime_1.jsx)(button_1.ButtonOutline, Object.assign({}, buttonProps)) : (0, jsx_runtime_1.jsx)(button_1.ButtonFilled, Object.assign({}, buttonProps));
23
+ const ButtonComponent = button.style === 'outline' ? button_1.ButtonOutline : button_1.ButtonFilled;
24
+ return (0, jsx_runtime_1.jsx)(ButtonComponent, Object.assign({}, buttonProps), button.uniqueId);
25
25
  }) }));
26
26
  }
@@ -18,10 +18,10 @@ type HeroBlockProps = WithSupportProps<{
18
18
  buttons?: HeroCentralButton[];
19
19
  /** Якорное меню */
20
20
  anchors?: AnchorTypeProps[];
21
- /** Хлебные крошки */
22
- breadcrumbs: Item[];
23
21
  /** Текст подсказки */
24
22
  tooltipText?: string;
23
+ /** Хлебные крошки */
24
+ breadcrumbs: Item[];
25
25
  /** Расположение подсказки */
26
26
  tooltipPlacement?: TooltipProps['placement'];
27
27
  /** Фоновое изображение */
@@ -1,11 +1,13 @@
1
1
  import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
2
+ import { ButtonFilledProps } from '@snack-uikit/button';
2
3
  export type ButtonStyle = 'filled' | 'outline';
4
+ type ButtonProps = Pick<ButtonFilledProps, 'label' | 'href' | 'className' | 'fullWidth' | 'size' | 'target' | 'onClick'>;
3
5
  export type HeroCentralButton = {
4
6
  text: string;
5
7
  uniqueId: string;
6
8
  link?: string;
7
9
  style?: ButtonStyle;
8
- onClick?: () => void;
10
+ onClick?: ButtonProps['onClick'];
9
11
  };
10
12
  type HeroCentralButtonsProps = WithLayoutType<{
11
13
  buttons?: HeroCentralButton[];
@@ -6,7 +6,6 @@ export function HeroCentralButtons({ buttons, layoutType }) {
6
6
  return null;
7
7
  return (_jsx("div", { className: styles.buttonsContainer, "data-layout-type": layoutType, children: buttons.map(button => {
8
8
  const buttonProps = {
9
- key: button.uniqueId,
10
9
  label: button.text,
11
10
  href: button.link,
12
11
  className: styles.button,
@@ -15,6 +14,7 @@ export function HeroCentralButtons({ buttons, layoutType }) {
15
14
  target: '_self',
16
15
  onClick: button.onClick,
17
16
  };
18
- return button.style === 'outline' ? _jsx(ButtonOutline, Object.assign({}, buttonProps)) : _jsx(ButtonFilled, Object.assign({}, buttonProps));
17
+ const ButtonComponent = button.style === 'outline' ? ButtonOutline : ButtonFilled;
18
+ return _jsx(ButtonComponent, Object.assign({}, buttonProps), button.uniqueId);
19
19
  }) }));
20
20
  }
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": "1.8.4",
4
+ "version": "1.12.0",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -57,5 +57,5 @@
57
57
  "peerDependencies": {
58
58
  "@cloud-ru/uikit-product-locale": "*"
59
59
  },
60
- "gitHead": "0ba8fab8e570a50b497bfcf5dfc83ddf9eef91ac"
60
+ "gitHead": "49d7e7a510d2e1d91f9c9d34e7a402a54de50263"
61
61
  }
@@ -25,10 +25,10 @@ type HeroBlockProps = WithSupportProps<{
25
25
  buttons?: HeroCentralButton[];
26
26
  /** Якорное меню */
27
27
  anchors?: AnchorTypeProps[];
28
- /** Хлебные крошки */
29
- breadcrumbs: Item[];
30
28
  /** Текст подсказки */
31
29
  tooltipText?: string;
30
+ /** Хлебные крошки */
31
+ breadcrumbs: Item[];
32
32
  /** Расположение подсказки */
33
33
  tooltipPlacement?: TooltipProps['placement'];
34
34
  /** Фоновое изображение */
@@ -1,16 +1,21 @@
1
1
  import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
2
- import { ButtonFilled, ButtonOutline } from '@snack-uikit/button';
2
+ import { ButtonFilled, ButtonFilledProps, ButtonOutline } from '@snack-uikit/button';
3
3
 
4
4
  import styles from './styles.module.scss';
5
5
 
6
6
  export type ButtonStyle = 'filled' | 'outline';
7
7
 
8
+ type ButtonProps = Pick<
9
+ ButtonFilledProps,
10
+ 'label' | 'href' | 'className' | 'fullWidth' | 'size' | 'target' | 'onClick'
11
+ >;
12
+
8
13
  export type HeroCentralButton = {
9
14
  text: string;
10
15
  uniqueId: string;
11
16
  link?: string;
12
17
  style?: ButtonStyle;
13
- onClick?: () => void;
18
+ onClick?: ButtonProps['onClick'];
14
19
  };
15
20
 
16
21
  type HeroCentralButtonsProps = WithLayoutType<{
@@ -23,18 +28,18 @@ export function HeroCentralButtons({ buttons, layoutType }: HeroCentralButtonsPr
23
28
  return (
24
29
  <div className={styles.buttonsContainer} data-layout-type={layoutType}>
25
30
  {buttons.map(button => {
26
- const buttonProps = {
27
- key: button.uniqueId,
31
+ const buttonProps: ButtonProps = {
28
32
  label: button.text,
29
33
  href: button.link,
30
34
  className: styles.button,
31
35
  fullWidth: ['mobile', 'tablet'].includes(layoutType),
32
- size: 'l' as const,
33
- target: '_self' as const,
36
+ size: 'l',
37
+ target: '_self',
34
38
  onClick: button.onClick,
35
39
  };
40
+ const ButtonComponent = button.style === 'outline' ? ButtonOutline : ButtonFilled;
36
41
 
37
- return button.style === 'outline' ? <ButtonOutline {...buttonProps} /> : <ButtonFilled {...buttonProps} />;
42
+ return <ButtonComponent key={button.uniqueId} {...buttonProps} />;
38
43
  })}
39
44
  </div>
40
45
  );