@cloud-ru/uikit-product-site-header 1.6.4 → 1.7.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 +11 -0
- package/dist/cjs/components/HeaderItems/types.d.ts +2 -1
- package/dist/cjs/helperComponents/LinkItemHeader/LinkItemHeader.d.ts +2 -1
- package/dist/cjs/helperComponents/MoreButton/MoreButton.js +2 -2
- package/dist/esm/components/HeaderItems/types.d.ts +2 -1
- package/dist/esm/helperComponents/LinkItemHeader/LinkItemHeader.d.ts +2 -1
- package/dist/esm/helperComponents/MoreButton/MoreButton.js +2 -2
- package/package.json +2 -2
- package/src/components/HeaderItems/types.ts +3 -1
- package/src/helperComponents/LinkItemHeader/LinkItemHeader.tsx +2 -1
- package/src/helperComponents/MoreButton/MoreButton.tsx +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.7.0 (2026-06-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **SITE-11512:** change site header item click handler type to MouseEventHandler ([babc89b](https://github.com/cloud-ru-tech/uikit-product/commit/babc89b3847ac55af3673bb5e13de07be709e179))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 1.6.4 (2026-06-26)
|
|
7
18
|
|
|
8
19
|
### Only dependencies have been changed
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
1
2
|
import { IconProps } from '../../helperComponents/Icon';
|
|
2
3
|
export type LinkItem = {
|
|
3
4
|
/** id Элемента */
|
|
@@ -5,7 +6,7 @@ export type LinkItem = {
|
|
|
5
6
|
/** Текст элемента */
|
|
6
7
|
label: string;
|
|
7
8
|
/** Хэндлер клика элемента */
|
|
8
|
-
onClick?:
|
|
9
|
+
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
9
10
|
/** Ссылка элемента */
|
|
10
11
|
href?: string;
|
|
11
12
|
/** target для ссылки элемента */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
1
2
|
import { IconProps } from '../Icon';
|
|
2
3
|
type LinkItemHeaderProps = {
|
|
3
4
|
href?: string;
|
|
@@ -5,7 +6,7 @@ type LinkItemHeaderProps = {
|
|
|
5
6
|
label: string;
|
|
6
7
|
withoutHover?: boolean;
|
|
7
8
|
active?: boolean;
|
|
8
|
-
onClick?:
|
|
9
|
+
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
9
10
|
icon?: IconProps['icon'] | null;
|
|
10
11
|
};
|
|
11
12
|
export declare function LinkItemHeader({ href, label, onClick, withoutHover, target, active, icon }: LinkItemHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -22,8 +22,8 @@ function MoreButton({ linkItemsArray, activeItemId }) {
|
|
|
22
22
|
}, content: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.tagRowDropListScroll, children: linkItemsArray.map(item => ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)(styles_module_scss_1.default.rowLinkMore, {
|
|
23
23
|
[styles_module_scss_1.default.hovered]: !item.href,
|
|
24
24
|
[styles_module_scss_1.default.active]: item.id === activeItemId && !item.href,
|
|
25
|
-
}, item.className) }, item.dataAttributes, { children: (0, jsx_runtime_1.jsx)(LinkItemHeader_1.LinkItemHeader, { label: item.label, onClick:
|
|
26
|
-
item.onClick && item.onClick();
|
|
25
|
+
}, item.className) }, item.dataAttributes, { children: (0, jsx_runtime_1.jsx)(LinkItemHeader_1.LinkItemHeader, { label: item.label, onClick: e => {
|
|
26
|
+
item.onClick && item.onClick(e);
|
|
27
27
|
onClickOpen();
|
|
28
28
|
}, href: item.href, icon: item.icon, withoutHover: true }) }), item.id))) }), children: (0, jsx_runtime_1.jsx)("button", { className: styles_module_scss_1.default.button, onClick: onClickOpen, children: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.MoreSVG, {}) }) }));
|
|
29
29
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
1
2
|
import { IconProps } from '../../helperComponents/Icon';
|
|
2
3
|
export type LinkItem = {
|
|
3
4
|
/** id Элемента */
|
|
@@ -5,7 +6,7 @@ export type LinkItem = {
|
|
|
5
6
|
/** Текст элемента */
|
|
6
7
|
label: string;
|
|
7
8
|
/** Хэндлер клика элемента */
|
|
8
|
-
onClick?:
|
|
9
|
+
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
9
10
|
/** Ссылка элемента */
|
|
10
11
|
href?: string;
|
|
11
12
|
/** target для ссылки элемента */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
1
2
|
import { IconProps } from '../Icon';
|
|
2
3
|
type LinkItemHeaderProps = {
|
|
3
4
|
href?: string;
|
|
@@ -5,7 +6,7 @@ type LinkItemHeaderProps = {
|
|
|
5
6
|
label: string;
|
|
6
7
|
withoutHover?: boolean;
|
|
7
8
|
active?: boolean;
|
|
8
|
-
onClick?:
|
|
9
|
+
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
9
10
|
icon?: IconProps['icon'] | null;
|
|
10
11
|
};
|
|
11
12
|
export declare function LinkItemHeader({ href, label, onClick, withoutHover, target, active, icon }: LinkItemHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,8 +16,8 @@ export function MoreButton({ linkItemsArray, activeItemId }) {
|
|
|
16
16
|
}, content: _jsx("div", { className: styles.tagRowDropListScroll, children: linkItemsArray.map(item => (_jsx("div", Object.assign({ className: cn(styles.rowLinkMore, {
|
|
17
17
|
[styles.hovered]: !item.href,
|
|
18
18
|
[styles.active]: item.id === activeItemId && !item.href,
|
|
19
|
-
}, item.className) }, item.dataAttributes, { children: _jsx(LinkItemHeader, { label: item.label, onClick:
|
|
20
|
-
item.onClick && item.onClick();
|
|
19
|
+
}, item.className) }, item.dataAttributes, { children: _jsx(LinkItemHeader, { label: item.label, onClick: e => {
|
|
20
|
+
item.onClick && item.onClick(e);
|
|
21
21
|
onClickOpen();
|
|
22
22
|
}, href: item.href, icon: item.icon, withoutHover: true }) }), item.id))) }), children: _jsx("button", { className: styles.button, onClick: onClickOpen, children: _jsx(MoreSVG, {}) }) }));
|
|
23
23
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/uikit-product-site-header",
|
|
3
3
|
"title": "Siteheader",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.0",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
7
7
|
"*.woff",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@cloud-ru/figma-tokens-web": "*"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "389c4dab607d73457cb985d8dbc6559ca8915503"
|
|
58
58
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
2
|
+
|
|
1
3
|
import { IconProps } from '../../helperComponents/Icon';
|
|
2
4
|
|
|
3
5
|
export type LinkItem = {
|
|
@@ -6,7 +8,7 @@ export type LinkItem = {
|
|
|
6
8
|
/** Текст элемента */
|
|
7
9
|
label: string;
|
|
8
10
|
/** Хэндлер клика элемента */
|
|
9
|
-
onClick?:
|
|
11
|
+
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
10
12
|
/** Ссылка элемента */
|
|
11
13
|
href?: string;
|
|
12
14
|
/** target для ссылки элемента */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import cn from 'classnames';
|
|
2
|
+
import { MouseEventHandler } from 'react';
|
|
2
3
|
|
|
3
4
|
import { Typography } from '@snack-uikit/typography';
|
|
4
5
|
|
|
@@ -11,7 +12,7 @@ type LinkItemHeaderProps = {
|
|
|
11
12
|
label: string;
|
|
12
13
|
withoutHover?: boolean;
|
|
13
14
|
active?: boolean;
|
|
14
|
-
onClick?:
|
|
15
|
+
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
15
16
|
icon?: IconProps['icon'] | null;
|
|
16
17
|
};
|
|
17
18
|
|
|
@@ -44,8 +44,8 @@ export function MoreButton({ linkItemsArray, activeItemId }: MoreButtonProps) {
|
|
|
44
44
|
>
|
|
45
45
|
<LinkItemHeader
|
|
46
46
|
label={item.label}
|
|
47
|
-
onClick={
|
|
48
|
-
item.onClick && item.onClick();
|
|
47
|
+
onClick={e => {
|
|
48
|
+
item.onClick && item.onClick(e);
|
|
49
49
|
onClickOpen();
|
|
50
50
|
}}
|
|
51
51
|
href={item.href}
|