@cloud-ru/ds-uikit-product-notification 1.0.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 +8 -0
- package/LICENSE +201 -0
- package/README.md +728 -0
- package/dist/cjs/components/NotificationCard/NotificationCard.d.ts +43 -0
- package/dist/cjs/components/NotificationCard/NotificationCard.js +80 -0
- package/dist/cjs/components/NotificationCard/NotificationCardSkeleton.d.ts +7 -0
- package/dist/cjs/components/NotificationCard/NotificationCardSkeleton.js +16 -0
- package/dist/cjs/components/NotificationCard/helpers.d.ts +4 -0
- package/dist/cjs/components/NotificationCard/helpers.js +31 -0
- package/dist/cjs/components/NotificationCard/index.d.ts +2 -0
- package/dist/cjs/components/NotificationCard/index.js +18 -0
- package/dist/cjs/components/NotificationCard/styles.module.css +216 -0
- package/dist/cjs/components/NotificationPanel/NotificationPanel.d.ts +22 -0
- package/dist/cjs/components/NotificationPanel/NotificationPanel.js +23 -0
- package/dist/cjs/components/NotificationPanel/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanel/index.js +17 -0
- package/dist/cjs/components/NotificationPanel/styles.module.css +10 -0
- package/dist/cjs/components/NotificationPanelContent/NotificationPanelContent.d.ts +45 -0
- package/dist/cjs/components/NotificationPanelContent/NotificationPanelContent.js +43 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.d.ts +18 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.js +43 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/hooks.d.ts +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/hooks.js +22 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/styles.module.css +69 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/utils.d.ts +4 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/utils.js +11 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.d.ts +4 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.js +15 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/styles.module.css +3 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.d.ts +12 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/styles.module.css +35 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +12 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.js +24 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.d.ts +9 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.js +27 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/components/index.d.ts +4 -0
- package/dist/cjs/components/NotificationPanelContent/components/index.js +20 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/StackTail.d.ts +6 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/StackTail.js +11 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/styles.module.css +49 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/index.d.ts +1 -0
- package/dist/cjs/components/NotificationPanelContent/helperComponents/index.js +17 -0
- package/dist/cjs/components/NotificationPanelContent/index.d.ts +2 -0
- package/dist/cjs/components/NotificationPanelContent/index.js +18 -0
- package/dist/cjs/components/NotificationPanelContent/styles.module.css +98 -0
- package/dist/cjs/components/index.d.ts +3 -0
- package/dist/cjs/components/index.js +19 -0
- package/dist/cjs/constants.d.ts +57 -0
- package/dist/cjs/constants.js +60 -0
- package/dist/cjs/helperComponents/ActionsButton/ActionsButton.d.ts +19 -0
- package/dist/cjs/helperComponents/ActionsButton/ActionsButton.js +28 -0
- package/dist/cjs/helperComponents/ActionsButton/index.d.ts +1 -0
- package/dist/cjs/helperComponents/ActionsButton/index.js +17 -0
- package/dist/cjs/helperComponents/ActionsButton/styles.module.css +3 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +22 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/style.css +483 -0
- package/dist/cjs/types.d.ts +12 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/utils.d.ts +3 -0
- package/dist/cjs/utils.js +7 -0
- package/dist/esm/components/NotificationCard/NotificationCard.d.ts +43 -0
- package/dist/esm/components/NotificationCard/NotificationCard.js +74 -0
- package/dist/esm/components/NotificationCard/NotificationCardSkeleton.d.ts +7 -0
- package/dist/esm/components/NotificationCard/NotificationCardSkeleton.js +10 -0
- package/dist/esm/components/NotificationCard/helpers.d.ts +4 -0
- package/dist/esm/components/NotificationCard/helpers.js +27 -0
- package/dist/esm/components/NotificationCard/index.d.ts +2 -0
- package/dist/esm/components/NotificationCard/index.js +2 -0
- package/dist/esm/components/NotificationCard/styles.module.css +216 -0
- package/dist/esm/components/NotificationPanel/NotificationPanel.d.ts +22 -0
- package/dist/esm/components/NotificationPanel/NotificationPanel.js +17 -0
- package/dist/esm/components/NotificationPanel/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanel/index.js +1 -0
- package/dist/esm/components/NotificationPanel/styles.module.css +10 -0
- package/dist/esm/components/NotificationPanelContent/NotificationPanelContent.d.ts +45 -0
- package/dist/esm/components/NotificationPanelContent/NotificationPanelContent.js +37 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.d.ts +18 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.js +37 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/hooks.d.ts +17 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/hooks.js +19 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/styles.module.css +69 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/utils.d.ts +4 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/utils.js +7 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.d.ts +4 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.js +9 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/styles.module.css +3 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.d.ts +12 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.js +11 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/styles.module.css +35 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +12 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.js +21 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.d.ts +9 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.js +21 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/components/index.d.ts +4 -0
- package/dist/esm/components/NotificationPanelContent/components/index.js +4 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/StackTail.d.ts +6 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/StackTail.js +5 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/styles.module.css +49 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/index.d.ts +1 -0
- package/dist/esm/components/NotificationPanelContent/helperComponents/index.js +1 -0
- package/dist/esm/components/NotificationPanelContent/index.d.ts +2 -0
- package/dist/esm/components/NotificationPanelContent/index.js +2 -0
- package/dist/esm/components/NotificationPanelContent/styles.module.css +98 -0
- package/dist/esm/components/index.d.ts +3 -0
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/constants.d.ts +57 -0
- package/dist/esm/constants.js +57 -0
- package/dist/esm/helperComponents/ActionsButton/ActionsButton.d.ts +19 -0
- package/dist/esm/helperComponents/ActionsButton/ActionsButton.js +22 -0
- package/dist/esm/helperComponents/ActionsButton/index.d.ts +1 -0
- package/dist/esm/helperComponents/ActionsButton/index.js +1 -0
- package/dist/esm/helperComponents/ActionsButton/styles.module.css +3 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/style.css +483 -0
- package/dist/esm/types.d.ts +12 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/utils.d.ts +3 -0
- package/dist/esm/utils.js +4 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +60 -0
- package/src/components/NotificationCard/NotificationCard.tsx +252 -0
- package/src/components/NotificationCard/NotificationCardSkeleton.tsx +40 -0
- package/src/components/NotificationCard/helpers.tsx +36 -0
- package/src/components/NotificationCard/index.ts +2 -0
- package/src/components/NotificationCard/styles.module.scss +165 -0
- package/src/components/NotificationPanel/NotificationPanel.tsx +56 -0
- package/src/components/NotificationPanel/index.ts +1 -0
- package/src/components/NotificationPanel/styles.module.scss +15 -0
- package/src/components/NotificationPanelContent/NotificationPanelContent.tsx +168 -0
- package/src/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.tsx +128 -0
- package/src/components/NotificationPanelContent/components/NotificationCardStack/hooks.ts +45 -0
- package/src/components/NotificationPanelContent/components/NotificationCardStack/index.ts +1 -0
- package/src/components/NotificationPanelContent/components/NotificationCardStack/styles.module.scss +90 -0
- package/src/components/NotificationPanelContent/components/NotificationCardStack/utils.ts +11 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.tsx +21 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelBlank/index.ts +1 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelBlank/styles.module.scss +5 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.tsx +31 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelGroup/index.ts +1 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelGroup/styles.module.scss +45 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.tsx +34 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.tsx +43 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelSettings/index.ts +1 -0
- package/src/components/NotificationPanelContent/components/index.ts +4 -0
- package/src/components/NotificationPanelContent/helperComponents/StackTail/StackTail.tsx +17 -0
- package/src/components/NotificationPanelContent/helperComponents/StackTail/index.ts +1 -0
- package/src/components/NotificationPanelContent/helperComponents/StackTail/styles.module.scss +85 -0
- package/src/components/NotificationPanelContent/helperComponents/index.ts +1 -0
- package/src/components/NotificationPanelContent/index.ts +2 -0
- package/src/components/NotificationPanelContent/styles.module.scss +116 -0
- package/src/components/index.ts +3 -0
- package/src/constants.ts +58 -0
- package/src/helperComponents/ActionsButton/ActionsButton.tsx +73 -0
- package/src/helperComponents/ActionsButton/index.ts +1 -0
- package/src/helperComponents/ActionsButton/styles.module.scss +3 -0
- package/src/index.ts +4 -0
- package/src/types.ts +15 -0
- package/src/utils.ts +6 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TruncateString } from '@cloud-ru/ds-truncate-string';
|
|
3
|
+
import { Typography } from '@cloud-ru/ds-typography';
|
|
4
|
+
import { extractSupportProps } from '@cloud-ru/ds-utils';
|
|
5
|
+
import cn from 'classnames';
|
|
6
|
+
import { TEST_IDS } from '../../../../constants.js';
|
|
7
|
+
import styles from './styles.module.css';
|
|
8
|
+
/** Группа уведомлений с заголовком внутри панели */
|
|
9
|
+
export function NotificationPanelGroup({ title, children, className, ...rest }) {
|
|
10
|
+
return (_jsxs("div", { className: cn(styles.root, className), "data-test-id": TEST_IDS.panel.group.root, ...extractSupportProps(rest), children: [_jsx("div", { className: styles.title, "data-test-id": TEST_IDS.panel.group.title, children: _jsx(Typography, { variant: 'label', size: 's', weight: 'thin', as: 'span', className: styles.text, children: _jsx(TruncateString, { text: title }) }) }), _jsx("div", { className: styles.content, children: children })] }));
|
|
11
|
+
}
|
package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationPanelGroup.js';
|
package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationPanelGroup.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.root{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.title{
|
|
8
|
+
pointer-events:none;
|
|
9
|
+
position:sticky;
|
|
10
|
+
z-index:1;
|
|
11
|
+
top:var(--sn-primitive-dimension-4, 4px);
|
|
12
|
+
display:flex;
|
|
13
|
+
justify-content:center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.text{
|
|
17
|
+
pointer-events:initial;
|
|
18
|
+
display:inline-flex;
|
|
19
|
+
align-items:center;
|
|
20
|
+
justify-content:center;
|
|
21
|
+
min-height:var(--sn-primitive-dimension-20, 20px);
|
|
22
|
+
color:var(--sn-theme-color-available-version-textDisabled, var(--sn-brand-color-text-version-disabled, rgba(65, 66, 78, 0.3490196078)));
|
|
23
|
+
background-color:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-primitive-color-gray-95, #fdfdfd)));
|
|
24
|
+
}
|
|
25
|
+
.text[data-size][data-weight][data-variant]{
|
|
26
|
+
padding-inline:var(--sn-primitive-dimension-8, 8px);
|
|
27
|
+
border:var(--sn-primitive-strokeWeight-strokeRegular, 1px) solid var(--sn-theme-color-neutral-decorTransparent, var(--sn-brand-color-neutral-transparent-forLightMode, rgba(124, 131, 182, 0.0784313725)));
|
|
28
|
+
border-radius:var(--sn-density-radius-xl, var(--sn-primitive-dimension-28, 28px));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.content{
|
|
32
|
+
display:flex;
|
|
33
|
+
flex-direction:column;
|
|
34
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
35
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ButtonProps } from '@cloud-ru/ds-button';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { Action } from '../../../../types.js';
|
|
4
|
+
export type NotificationPanelSettingsProps = {
|
|
5
|
+
/** Дополнительные действия панели */
|
|
6
|
+
actions?: Action[];
|
|
7
|
+
/** Кнопка дополнительного действия панели */
|
|
8
|
+
button?: Omit<ButtonProps<ElementType>, 'label' | 'size' | 'view' | 'data-test-id'>;
|
|
9
|
+
size?: 's' | 'm';
|
|
10
|
+
};
|
|
11
|
+
/** Кнопка настроек панели уведомлений (с выпадающим списком действий, если переданы). */
|
|
12
|
+
export declare function NotificationPanelSettings({ actions, button, size }: NotificationPanelSettingsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
3
|
+
import { SettingsSVG } from '@cloud-ru/ds-icons/interface/system';
|
|
4
|
+
import { TEST_IDS } from '../../../../constants.js';
|
|
5
|
+
import { NotificationPanelSettingsDroplist } from './NotificationPanelSettingsDroplist.js';
|
|
6
|
+
/** Кнопка настроек панели уведомлений (с выпадающим списком действий, если переданы). */
|
|
7
|
+
export function NotificationPanelSettings({ actions, button, size = 'm' }) {
|
|
8
|
+
const buttonProps = {
|
|
9
|
+
...button,
|
|
10
|
+
view: 'function',
|
|
11
|
+
appearance: 'neutral',
|
|
12
|
+
size,
|
|
13
|
+
icon: button?.icon || _jsx(SettingsSVG, {}),
|
|
14
|
+
'aria-label': button?.['aria-label'] ?? 'Настройки уведомлений',
|
|
15
|
+
'data-test-id': TEST_IDS.panel.settings.droplistTrigger,
|
|
16
|
+
};
|
|
17
|
+
if (!actions?.length) {
|
|
18
|
+
return _jsx(Button, { ...buttonProps });
|
|
19
|
+
}
|
|
20
|
+
return _jsx(NotificationPanelSettingsDroplist, { actions: actions, button: buttonProps });
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonProps } from '@cloud-ru/ds-button';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { Action } from '../../../../types.js';
|
|
4
|
+
type NotificationPanelSettingsDroplistProps = {
|
|
5
|
+
actions: Action[];
|
|
6
|
+
button: ButtonProps<ElementType>;
|
|
7
|
+
};
|
|
8
|
+
export declare function NotificationPanelSettingsDroplist({ actions, button }: NotificationPanelSettingsDroplistProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
3
|
+
import { Droplist } from '@cloud-ru/ds-list';
|
|
4
|
+
import { Tag } from '@cloud-ru/ds-tag';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { TEST_IDS } from '../../../../constants.js';
|
|
7
|
+
import styles from '../../styles.module.css';
|
|
8
|
+
export function NotificationPanelSettingsDroplist({ actions, button }) {
|
|
9
|
+
const [isDroplistOpen, setDroplistOpen] = useState(false);
|
|
10
|
+
return (_jsx(Droplist, { trigger: 'click', open: isDroplistOpen, onOpenChange: setDroplistOpen, scroll: true, placement: 'bottom-end', size: 'm', "data-test-id": TEST_IDS.panel.settings.droplist, triggerClassName: styles.inlineFlex, items: actions.map(({ icon, content, tagLabel, disabled, onClick }, index) => ({
|
|
11
|
+
onClick: e => {
|
|
12
|
+
setDroplistOpen(false);
|
|
13
|
+
onClick?.(e);
|
|
14
|
+
},
|
|
15
|
+
disabled,
|
|
16
|
+
content,
|
|
17
|
+
beforeContent: icon,
|
|
18
|
+
afterContent: tagLabel ? _jsx(Tag, { label: tagLabel }) : undefined,
|
|
19
|
+
'data-test-id': `${TEST_IDS.panel.settings.droplistAction}-${index}`,
|
|
20
|
+
})), children: _jsx(Button, { ...button }) }));
|
|
21
|
+
}
|
package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationPanelSettings.js';
|
package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationPanelSettings.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styles from './styles.module.css';
|
|
3
|
+
export function StackTail({ open, count }) {
|
|
4
|
+
return (_jsx("div", { className: styles.container, "data-open": open || undefined, children: _jsxs("div", { className: styles.animationContainer, children: [count > 1 && _jsx("div", { className: styles.card, "data-level": '3' }), _jsx("div", { className: styles.card, "data-level": '2' })] }) }));
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StackTail.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StackTail.js';
|
package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/styles.module.css
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.container{
|
|
2
|
+
position:relative;
|
|
3
|
+
height:0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.animationContainer{
|
|
7
|
+
position:absolute;
|
|
8
|
+
top:0;
|
|
9
|
+
bottom:calc(-1 * var(--sn-primitive-dimension-8, 8px));
|
|
10
|
+
overflow:hidden;
|
|
11
|
+
width:100%;
|
|
12
|
+
transition:bottom calc(var(--snack-notification-stack-animation-duration) / 2) calc(calc(var(--snack-notification-stack-animation-duration) / 2) / 1.7) ease-out;
|
|
13
|
+
}
|
|
14
|
+
[data-open] .animationContainer{
|
|
15
|
+
bottom:calc(-1 * 416px);
|
|
16
|
+
transition:bottom calc(var(--snack-notification-stack-animation-duration) / 2) ease-out;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.card{
|
|
20
|
+
position:absolute;
|
|
21
|
+
overflow:hidden;
|
|
22
|
+
height:200px;
|
|
23
|
+
border:var(--sn-primitive-strokeWeight-strokeRegular, 1px) solid var(--sn-theme-color-available-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-default-borderColor, rgba(159, 166, 198, 0.3019607843)));
|
|
24
|
+
border-radius:var(--sn-density-radius-2xs, var(--sn-primitive-dimension-4, 4px));
|
|
25
|
+
background-color:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-primitive-color-gray-95, #fdfdfd)));
|
|
26
|
+
transition:right calc(var(--snack-notification-stack-animation-duration) / 2) calc(var(--snack-notification-stack-animation-duration) / 2) ease, left calc(var(--snack-notification-stack-animation-duration) / 2) calc(var(--snack-notification-stack-animation-duration) / 2) ease, opacity calc(var(--snack-notification-stack-animation-duration) / 2) calc(var(--snack-notification-stack-animation-duration) / 2) ease;
|
|
27
|
+
}
|
|
28
|
+
.card::after{
|
|
29
|
+
content:"";
|
|
30
|
+
position:absolute;
|
|
31
|
+
inset:0;
|
|
32
|
+
background-color:var(--sn-theme-color-neutral-decorTransparent, var(--sn-brand-color-neutral-transparent-forLightMode, rgba(124, 131, 182, 0.0784313725)));
|
|
33
|
+
}
|
|
34
|
+
.card[data-level="2"]{
|
|
35
|
+
right:var(--sn-primitive-dimension-4, 4px);
|
|
36
|
+
bottom:50%;
|
|
37
|
+
left:var(--sn-primitive-dimension-4, 4px);
|
|
38
|
+
}
|
|
39
|
+
.card[data-level="3"]{
|
|
40
|
+
right:var(--sn-primitive-dimension-8, 8px);
|
|
41
|
+
bottom:0;
|
|
42
|
+
left:var(--sn-primitive-dimension-8, 8px);
|
|
43
|
+
}
|
|
44
|
+
[data-open] .card{
|
|
45
|
+
right:0;
|
|
46
|
+
left:0;
|
|
47
|
+
opacity:0;
|
|
48
|
+
transition:right calc(var(--snack-notification-stack-animation-duration) / 2) ease, left calc(var(--snack-notification-stack-animation-duration) / 2) ease, opacity calc(var(--snack-notification-stack-animation-duration) / 2) ease;
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StackTail/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StackTail/index.js';
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
.notificationPanelHeader{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
5
|
+
padding-block:var(--sn-primitive-dimension-24, 24px);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.notificationPanelHeadline{
|
|
9
|
+
display:flex;
|
|
10
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
11
|
+
align-items:center;
|
|
12
|
+
height:var(--sn-primitive-dimension-32, 32px);
|
|
13
|
+
padding-inline:var(--sn-primitive-dimension-24, 24px);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.notificationPanelTitle{
|
|
17
|
+
flex:1 1 auto;
|
|
18
|
+
min-width:0;
|
|
19
|
+
color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #41424e));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.notificationPanelHeaderActions{
|
|
23
|
+
display:flex;
|
|
24
|
+
align-items:center;
|
|
25
|
+
justify-content:flex-end;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.actionsRow{
|
|
29
|
+
display:flex;
|
|
30
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
31
|
+
align-items:center;
|
|
32
|
+
justify-content:space-between;
|
|
33
|
+
padding-top:var(--sn-primitive-dimension-12, 12px);
|
|
34
|
+
padding-inline:var(--sn-primitive-dimension-24, 24px);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.notificationPanelBody{
|
|
38
|
+
display:flex;
|
|
39
|
+
flex-direction:column;
|
|
40
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
41
|
+
min-height:100%;
|
|
42
|
+
padding-right:var(--sn-primitive-dimension-24, 24px);
|
|
43
|
+
padding-bottom:var(--sn-primitive-dimension-16, 16px);
|
|
44
|
+
padding-left:var(--sn-primitive-dimension-24, 24px);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.notificationPanelFooterButton{
|
|
48
|
+
cursor:pointer;
|
|
49
|
+
padding:var(--sn-primitive-dimension-12, 12px) var(--sn-primitive-dimension-24, 24px);
|
|
50
|
+
border:none;
|
|
51
|
+
border-top:var(--sn-primitive-strokeWeight-strokeRegular, 1px) solid var(--sn-theme-color-available-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-default-borderColor, rgba(159, 166, 198, 0.3019607843)));
|
|
52
|
+
color:var(--sn-theme-color-neutral-text, var(--sn-brand-color-neutral-45, var(--sn-primitive-color-gray-45, #81869c)));
|
|
53
|
+
background-color:transparent;
|
|
54
|
+
}
|
|
55
|
+
.notificationPanelFooterButton:hover{
|
|
56
|
+
background-color:var(--sn-theme-color-neutral-decorTransparent, var(--sn-brand-color-neutral-transparent-forLightMode, rgba(124, 131, 182, 0.0784313725)));
|
|
57
|
+
}
|
|
58
|
+
.notificationPanelFooterButton:focus-visible{
|
|
59
|
+
outline:var(--sn-primitive-strokeWeight-strokeSemiBold, 2px) solid var(--sn-theme-color-available-complementary, #000000);
|
|
60
|
+
outline-offset:0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.wrapper{
|
|
64
|
+
display:flex;
|
|
65
|
+
flex-direction:column;
|
|
66
|
+
height:100%;
|
|
67
|
+
min-height:0;
|
|
68
|
+
background-color:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-primitive-color-gray-95, #fdfdfd)));
|
|
69
|
+
}
|
|
70
|
+
.wrapper[data-layout-type=mobile] .notificationPanelHeader{
|
|
71
|
+
gap:0;
|
|
72
|
+
padding-block:var(--sn-primitive-dimension-8, 8px);
|
|
73
|
+
}
|
|
74
|
+
.wrapper[data-layout-type=mobile] .notificationPanelHeadline{
|
|
75
|
+
padding-bottom:var(--sn-primitive-dimension-8, 8px);
|
|
76
|
+
padding-inline:var(--sn-primitive-dimension-16, 16px);
|
|
77
|
+
}
|
|
78
|
+
.wrapper[data-layout-type=mobile] .actionsRow{
|
|
79
|
+
padding-top:0;
|
|
80
|
+
padding-inline:var(--sn-primitive-dimension-16, 16px);
|
|
81
|
+
}
|
|
82
|
+
.wrapper[data-layout-type=mobile] .notificationPanelBody{
|
|
83
|
+
padding:var(--sn-primitive-dimension-8, 8px) var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.scrollArea{
|
|
87
|
+
flex:1 1 auto;
|
|
88
|
+
min-height:0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.scrollStub{
|
|
92
|
+
width:100%;
|
|
93
|
+
height:var(--sn-primitive-dimension-1, 1px);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.inlineFlex{
|
|
97
|
+
display:inline-flex;
|
|
98
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const APPEARANCE: {
|
|
2
|
+
readonly Default: "default";
|
|
3
|
+
readonly Error: "error";
|
|
4
|
+
readonly Warning: "warning";
|
|
5
|
+
readonly Success: "success";
|
|
6
|
+
};
|
|
7
|
+
export declare const TEST_IDS: {
|
|
8
|
+
readonly card: {
|
|
9
|
+
readonly root: "notification-card";
|
|
10
|
+
readonly label: "notification-card__label";
|
|
11
|
+
readonly title: "notification-card__title";
|
|
12
|
+
readonly description: "notification-card__description";
|
|
13
|
+
readonly link: "notification-card__link";
|
|
14
|
+
readonly date: "notification-card__date";
|
|
15
|
+
readonly statusIndicator: "notification-card__status-indicator";
|
|
16
|
+
readonly skeleton: "notification-card__skeleton";
|
|
17
|
+
readonly actions: {
|
|
18
|
+
readonly wrapper: "notification-card__actions";
|
|
19
|
+
readonly droplist: "notification-card__droplist";
|
|
20
|
+
readonly droplistTrigger: "notification-card__droplist-trigger";
|
|
21
|
+
readonly droplistAction: "notification-card__droplist-action";
|
|
22
|
+
};
|
|
23
|
+
readonly primaryButton: "notification-card__primary-button";
|
|
24
|
+
readonly secondaryButton: "notification-card__secondary-button";
|
|
25
|
+
};
|
|
26
|
+
readonly panel: {
|
|
27
|
+
readonly root: "notification-panel";
|
|
28
|
+
readonly title: "notification-panel__title";
|
|
29
|
+
readonly segments: "notification-panel__segments";
|
|
30
|
+
readonly chipToggle: "notification-panel__chip-toggle";
|
|
31
|
+
readonly settings: {
|
|
32
|
+
readonly droplist: "notification-panel__settings__droplist";
|
|
33
|
+
readonly droplistTrigger: "notification-panel__settings__droplist-trigger";
|
|
34
|
+
readonly droplistAction: "notification-panel__settings__droplist-action";
|
|
35
|
+
};
|
|
36
|
+
readonly readAll: "notification-panel__read-all";
|
|
37
|
+
readonly footerButton: "notification-panel__footer-button";
|
|
38
|
+
readonly blank: "notification-panel__blank";
|
|
39
|
+
readonly error: "notification-panel__error";
|
|
40
|
+
readonly group: {
|
|
41
|
+
readonly root: "notification-panel__group";
|
|
42
|
+
readonly title: "notification-panel__group__title";
|
|
43
|
+
};
|
|
44
|
+
readonly cardStack: {
|
|
45
|
+
readonly headline: "notification-panel__card-stack__headline";
|
|
46
|
+
readonly wrapper: "notification-panel__card-stack__wrapper";
|
|
47
|
+
readonly title: "notification-panel__card-stack__title";
|
|
48
|
+
readonly openButton: "notification-panel__card-stack__open-button";
|
|
49
|
+
readonly actions: {
|
|
50
|
+
readonly wrapper: "notification-panel__card-stack__actions";
|
|
51
|
+
readonly droplist: "notification-panel__card-stack__droplist";
|
|
52
|
+
readonly droplistTrigger: "notification-panel__card-stack__droplist-trigger";
|
|
53
|
+
readonly droplistAction: "notification-panel__card-stack__droplist-action";
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const APPEARANCE = {
|
|
2
|
+
Default: 'default',
|
|
3
|
+
Error: 'error',
|
|
4
|
+
Warning: 'warning',
|
|
5
|
+
Success: 'success',
|
|
6
|
+
};
|
|
7
|
+
export const TEST_IDS = {
|
|
8
|
+
card: {
|
|
9
|
+
root: 'notification-card',
|
|
10
|
+
label: 'notification-card__label',
|
|
11
|
+
title: 'notification-card__title',
|
|
12
|
+
description: 'notification-card__description',
|
|
13
|
+
link: 'notification-card__link',
|
|
14
|
+
date: 'notification-card__date',
|
|
15
|
+
statusIndicator: 'notification-card__status-indicator',
|
|
16
|
+
skeleton: 'notification-card__skeleton',
|
|
17
|
+
actions: {
|
|
18
|
+
wrapper: 'notification-card__actions',
|
|
19
|
+
droplist: 'notification-card__droplist',
|
|
20
|
+
droplistTrigger: 'notification-card__droplist-trigger',
|
|
21
|
+
droplistAction: 'notification-card__droplist-action',
|
|
22
|
+
},
|
|
23
|
+
primaryButton: 'notification-card__primary-button',
|
|
24
|
+
secondaryButton: 'notification-card__secondary-button',
|
|
25
|
+
},
|
|
26
|
+
panel: {
|
|
27
|
+
root: 'notification-panel',
|
|
28
|
+
title: 'notification-panel__title',
|
|
29
|
+
segments: 'notification-panel__segments',
|
|
30
|
+
chipToggle: 'notification-panel__chip-toggle',
|
|
31
|
+
settings: {
|
|
32
|
+
droplist: 'notification-panel__settings__droplist',
|
|
33
|
+
droplistTrigger: 'notification-panel__settings__droplist-trigger',
|
|
34
|
+
droplistAction: 'notification-panel__settings__droplist-action',
|
|
35
|
+
},
|
|
36
|
+
readAll: 'notification-panel__read-all',
|
|
37
|
+
footerButton: 'notification-panel__footer-button',
|
|
38
|
+
blank: 'notification-panel__blank',
|
|
39
|
+
error: 'notification-panel__error',
|
|
40
|
+
group: {
|
|
41
|
+
root: 'notification-panel__group',
|
|
42
|
+
title: 'notification-panel__group__title',
|
|
43
|
+
},
|
|
44
|
+
cardStack: {
|
|
45
|
+
headline: 'notification-panel__card-stack__headline',
|
|
46
|
+
wrapper: 'notification-panel__card-stack__wrapper',
|
|
47
|
+
title: 'notification-panel__card-stack__title',
|
|
48
|
+
openButton: 'notification-panel__card-stack__open-button',
|
|
49
|
+
actions: {
|
|
50
|
+
wrapper: 'notification-panel__card-stack__actions',
|
|
51
|
+
droplist: 'notification-panel__card-stack__droplist',
|
|
52
|
+
droplistTrigger: 'notification-panel__card-stack__droplist-trigger',
|
|
53
|
+
droplistAction: 'notification-panel__card-stack__droplist-action',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Dispatch, ReactElement, SetStateAction } from 'react';
|
|
2
|
+
import { Action } from '../../types.js';
|
|
3
|
+
export type ActionsButtonTestIds = {
|
|
4
|
+
wrapper: string;
|
|
5
|
+
droplist: string;
|
|
6
|
+
droplistTrigger: string;
|
|
7
|
+
droplistAction: string;
|
|
8
|
+
};
|
|
9
|
+
export type ActionsButtonProps = {
|
|
10
|
+
actions: Action[];
|
|
11
|
+
open: boolean;
|
|
12
|
+
setDroplistOpen: Dispatch<SetStateAction<boolean>>;
|
|
13
|
+
icon: ReactElement;
|
|
14
|
+
/** Доступное имя кнопки-триггера (icon-only кнопка иначе безымянна для скринридера). */
|
|
15
|
+
triggerAriaLabel: string;
|
|
16
|
+
testIds: ActionsButtonTestIds;
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function ActionsButton({ actions, open, setDroplistOpen, icon, triggerAriaLabel, testIds, className, }: ActionsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
3
|
+
import { Droplist } from '@cloud-ru/ds-list';
|
|
4
|
+
import { Tag } from '@cloud-ru/ds-tag';
|
|
5
|
+
import cn from 'classnames';
|
|
6
|
+
import { stopPropagationClick } from '../../utils.js';
|
|
7
|
+
import styles from './styles.module.css';
|
|
8
|
+
export function ActionsButton({ actions, open, setDroplistOpen, icon, triggerAriaLabel, testIds, className, }) {
|
|
9
|
+
return (
|
|
10
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
11
|
+
_jsx("div", { className: cn(styles.inlineFlex, className), "data-test-id": testIds.wrapper, onClick: stopPropagationClick, children: _jsx(Droplist, { size: 'm', trigger: 'clickAndFocusVisible', open: open, onOpenChange: setDroplistOpen, placement: 'bottom-end', scroll: true, "data-test-id": testIds.droplist, items: actions.map(({ onClick, disabled, content, tagLabel, icon: itemIcon }, index) => ({
|
|
12
|
+
onClick: e => {
|
|
13
|
+
setDroplistOpen(false);
|
|
14
|
+
onClick?.(e);
|
|
15
|
+
},
|
|
16
|
+
disabled,
|
|
17
|
+
content,
|
|
18
|
+
beforeContent: itemIcon,
|
|
19
|
+
afterContent: tagLabel ? _jsx(Tag, { label: tagLabel }) : undefined,
|
|
20
|
+
'data-test-id': `${testIds.droplistAction}-${index}`,
|
|
21
|
+
})), triggerClassName: styles.inlineFlex, children: _jsx(Button, { view: 'function', appearance: 'neutral', size: 'm', icon: icon, "aria-label": triggerAriaLabel, "data-test-id": testIds.droplistTrigger }) }) }));
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActionsButton.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActionsButton.js';
|