@cloud-ru/ds-uikit-product-notification 2.1.4 → 2.1.5-preview-0343264d.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/README.md +1 -1
- package/dist/cjs/components/NotificationPanel/NotificationPanel.js +4 -4
- package/dist/cjs/components/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +4 -1
- package/dist/cjs/components/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettings.js +2 -1
- package/dist/cjs/components/NotificationPanel/styles.module.css +4 -1
- package/dist/cjs/constants.d.ts +1 -0
- package/dist/cjs/constants.js +2 -1
- package/dist/cjs/style.css +4 -1
- package/dist/esm/components/NotificationPanel/NotificationPanel.js +5 -5
- package/dist/esm/components/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +4 -1
- package/dist/esm/components/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettings.js +3 -2
- package/dist/esm/components/NotificationPanel/styles.module.css +4 -1
- package/dist/esm/constants.d.ts +1 -0
- package/dist/esm/constants.js +1 -0
- package/dist/esm/style.css +4 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +19 -19
- package/src/components/NotificationPanel/NotificationPanel.tsx +8 -6
- package/src/components/NotificationPanel/components/NotificationPanelSettings/NotificationPanelSettings.tsx +10 -3
- package/src/components/NotificationPanel/styles.module.scss +5 -1
- package/src/constants.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/ds-uikit-product-notification",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5-preview-0343264d.0",
|
|
4
4
|
"description": "Пакет уведомлений — карточка NotificationCard, лента NotificationPanelContent со стеками и группами и адаптивная обёртка NotificationPanel (drawer на desktop, bottom-sheet на mobile).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,24 +34,24 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"classnames": "^2.5.1",
|
|
37
|
-
"@cloud-ru/ds-adaptive": "
|
|
38
|
-
"@cloud-ru/ds-button": "
|
|
39
|
-
"@cloud-ru/ds-chips": "
|
|
40
|
-
"@cloud-ru/ds-
|
|
41
|
-
"@cloud-ru/ds-
|
|
42
|
-
"@cloud-ru/ds-info-block": "
|
|
43
|
-
"@cloud-ru/ds-link": "
|
|
44
|
-
"@cloud-ru/ds-
|
|
45
|
-
"@cloud-ru/ds-
|
|
46
|
-
"@cloud-ru/ds-scroll": "
|
|
47
|
-
"@cloud-ru/ds-segment-control": "
|
|
48
|
-
"@cloud-ru/ds-skeleton": "
|
|
49
|
-
"@cloud-ru/ds-
|
|
50
|
-
"@cloud-ru/ds-
|
|
51
|
-
"@cloud-ru/ds-tooltip": "
|
|
52
|
-
"@cloud-ru/ds-truncate-string": "
|
|
53
|
-
"@cloud-ru/ds-typography": "
|
|
54
|
-
"@cloud-ru/ds-utils": "
|
|
37
|
+
"@cloud-ru/ds-adaptive": "1.0.3",
|
|
38
|
+
"@cloud-ru/ds-button": "1.0.5",
|
|
39
|
+
"@cloud-ru/ds-chips": "1.2.5-preview-0343264d.0",
|
|
40
|
+
"@cloud-ru/ds-drawer": "2.1.6-preview-0343264d.0",
|
|
41
|
+
"@cloud-ru/ds-icons": "1.7.1",
|
|
42
|
+
"@cloud-ru/ds-info-block": "1.0.4",
|
|
43
|
+
"@cloud-ru/ds-link": "1.0.18",
|
|
44
|
+
"@cloud-ru/ds-list": "3.0.4-preview-0343264d.0",
|
|
45
|
+
"@cloud-ru/ds-materials": "2.0.2",
|
|
46
|
+
"@cloud-ru/ds-scroll": "1.0.6",
|
|
47
|
+
"@cloud-ru/ds-segment-control": "1.0.18",
|
|
48
|
+
"@cloud-ru/ds-skeleton": "1.0.3",
|
|
49
|
+
"@cloud-ru/ds-status": "1.1.13",
|
|
50
|
+
"@cloud-ru/ds-tag": "1.1.18-preview-0343264d.0",
|
|
51
|
+
"@cloud-ru/ds-tooltip": "1.0.16",
|
|
52
|
+
"@cloud-ru/ds-truncate-string": "1.0.17",
|
|
53
|
+
"@cloud-ru/ds-typography": "1.0.2",
|
|
54
|
+
"@cloud-ru/ds-utils": "1.3.0"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
@@ -10,7 +10,7 @@ import { WithSupportProps } from '@cloud-ru/ds-utils';
|
|
|
10
10
|
import cn from 'classnames';
|
|
11
11
|
import { ReactNode, RefObject, useMemo } from 'react';
|
|
12
12
|
|
|
13
|
-
import { TEST_IDS } from '../../constants';
|
|
13
|
+
import { TEST_IDS, TOOLTIP_HOVER_DELAY_OPEN } from '../../constants';
|
|
14
14
|
import { NotificationCardSkeleton } from '../NotificationCard/NotificationCardSkeleton';
|
|
15
15
|
import {
|
|
16
16
|
NotificationCardStack,
|
|
@@ -100,9 +100,11 @@ export function NotificationPanel({
|
|
|
100
100
|
|
|
101
101
|
// Figma: `slotAfterHeadline` (window) / `slotAfterTitle` (bottomSheet) — кнопки прижаты вправо.
|
|
102
102
|
const actions = (readAllButton || settings) && (
|
|
103
|
-
<span className={styles.headerActions}>
|
|
103
|
+
<span className={styles.headerActions} data-mobile={isMobile || undefined}>
|
|
104
104
|
{readAllButton && (
|
|
105
|
-
<WithTooltip
|
|
105
|
+
<WithTooltip
|
|
106
|
+
tooltip={readAllTooltip ? { hoverDelayOpen: TOOLTIP_HOVER_DELAY_OPEN, ...readAllTooltip } : undefined}
|
|
107
|
+
>
|
|
106
108
|
<Button
|
|
107
109
|
{...readAllButtonProps}
|
|
108
110
|
icon={readAllButtonProps.icon || <DecorCheckedSVG />}
|
|
@@ -126,7 +128,7 @@ export function NotificationPanel({
|
|
|
126
128
|
{segments && (
|
|
127
129
|
<SegmentControl
|
|
128
130
|
{...segments}
|
|
129
|
-
size=
|
|
131
|
+
size={buttonSize}
|
|
130
132
|
// В мобильном мастере сегменты делят всю ширину sheet'а.
|
|
131
133
|
width={isMobile ? 'full' : segments.width}
|
|
132
134
|
items={segments.items.map(item => ({
|
|
@@ -139,7 +141,7 @@ export function NotificationPanel({
|
|
|
139
141
|
|
|
140
142
|
{!isMobile && chipToggle && (
|
|
141
143
|
<ChipToggle
|
|
142
|
-
size=
|
|
144
|
+
size={buttonSize}
|
|
143
145
|
disabled={loading}
|
|
144
146
|
label={chipToggle.label}
|
|
145
147
|
onChange={chipToggle.onChange}
|
|
@@ -155,7 +157,7 @@ export function NotificationPanel({
|
|
|
155
157
|
position={position}
|
|
156
158
|
width={width}
|
|
157
159
|
className={cn(styles.panel, className)}
|
|
158
|
-
showButtonClosed
|
|
160
|
+
showButtonClosed
|
|
159
161
|
title={<span data-test-id={TEST_IDS.panel.title}>{title}</span>}
|
|
160
162
|
slotAfterTitle={actions}
|
|
161
163
|
slotSecondTitle={filters}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Button, ButtonProps } from '@cloud-ru/ds-button';
|
|
2
2
|
import { SettingsSVG } from '@cloud-ru/ds-icons/interface/system';
|
|
3
3
|
import { DroplistProps } from '@cloud-ru/ds-list';
|
|
4
|
+
import { TooltipProps, WithTooltip } from '@cloud-ru/ds-tooltip';
|
|
4
5
|
import { ElementType } from 'react';
|
|
5
6
|
|
|
6
|
-
import { TEST_IDS } from '../../../../constants';
|
|
7
|
+
import { TEST_IDS, TOOLTIP_HOVER_DELAY_OPEN } from '../../../../constants';
|
|
7
8
|
import { Action } from '../../../../types';
|
|
8
9
|
import { NotificationPanelSettingsDroplist } from './NotificationPanelSettingsDroplist';
|
|
9
10
|
|
|
@@ -11,7 +12,7 @@ export type NotificationPanelSettingsProps = {
|
|
|
11
12
|
/** Дополнительные действия панели */
|
|
12
13
|
actions?: Action[];
|
|
13
14
|
/** Кнопка дополнительного действия панели */
|
|
14
|
-
button?: Omit<ButtonProps<ElementType>, 'label' | 'size' | 'view' | 'data-test-id'
|
|
15
|
+
button?: Omit<ButtonProps<ElementType>, 'label' | 'size' | 'view' | 'data-test-id'> & { tooltip?: TooltipProps };
|
|
15
16
|
size?: 's' | 'm';
|
|
16
17
|
} & Pick<DroplistProps, 'itemRender' | 'groupItemRender'>;
|
|
17
18
|
|
|
@@ -34,7 +35,13 @@ export function NotificationPanelSettings({
|
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
if (!actions?.length) {
|
|
37
|
-
return
|
|
38
|
+
return (
|
|
39
|
+
<WithTooltip
|
|
40
|
+
tooltip={buttonProps.tooltip ? { hoverDelayOpen: TOOLTIP_HOVER_DELAY_OPEN, ...buttonProps.tooltip } : undefined}
|
|
41
|
+
>
|
|
42
|
+
<Button {...buttonProps} />
|
|
43
|
+
</WithTooltip>
|
|
44
|
+
);
|
|
38
45
|
}
|
|
39
46
|
|
|
40
47
|
return (
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
flex: 1 1 auto;
|
|
13
13
|
align-items: center;
|
|
14
14
|
justify-content: flex-end;
|
|
15
|
+
|
|
16
|
+
&:not([data-mobile]) {
|
|
17
|
+
padding-right: base.$sn-primitive-dimension-16;
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
.filtersRow {
|
|
@@ -28,7 +32,7 @@
|
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
&[data-mobile] {
|
|
31
|
-
padding-inline: base.$sn-primitive-dimension-
|
|
35
|
+
padding-inline: base.$sn-primitive-dimension-6;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
// Сегменты в мобильном мастере растянуты на всю ширину слота.
|