@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.
Files changed (183) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +201 -0
  3. package/README.md +728 -0
  4. package/dist/cjs/components/NotificationCard/NotificationCard.d.ts +43 -0
  5. package/dist/cjs/components/NotificationCard/NotificationCard.js +80 -0
  6. package/dist/cjs/components/NotificationCard/NotificationCardSkeleton.d.ts +7 -0
  7. package/dist/cjs/components/NotificationCard/NotificationCardSkeleton.js +16 -0
  8. package/dist/cjs/components/NotificationCard/helpers.d.ts +4 -0
  9. package/dist/cjs/components/NotificationCard/helpers.js +31 -0
  10. package/dist/cjs/components/NotificationCard/index.d.ts +2 -0
  11. package/dist/cjs/components/NotificationCard/index.js +18 -0
  12. package/dist/cjs/components/NotificationCard/styles.module.css +216 -0
  13. package/dist/cjs/components/NotificationPanel/NotificationPanel.d.ts +22 -0
  14. package/dist/cjs/components/NotificationPanel/NotificationPanel.js +23 -0
  15. package/dist/cjs/components/NotificationPanel/index.d.ts +1 -0
  16. package/dist/cjs/components/NotificationPanel/index.js +17 -0
  17. package/dist/cjs/components/NotificationPanel/styles.module.css +10 -0
  18. package/dist/cjs/components/NotificationPanelContent/NotificationPanelContent.d.ts +45 -0
  19. package/dist/cjs/components/NotificationPanelContent/NotificationPanelContent.js +43 -0
  20. package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.d.ts +18 -0
  21. package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.js +43 -0
  22. package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/hooks.d.ts +17 -0
  23. package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/hooks.js +22 -0
  24. package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/index.d.ts +1 -0
  25. package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/index.js +17 -0
  26. package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/styles.module.css +69 -0
  27. package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/utils.d.ts +4 -0
  28. package/dist/cjs/components/NotificationPanelContent/components/NotificationCardStack/utils.js +11 -0
  29. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.d.ts +4 -0
  30. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.js +15 -0
  31. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/index.d.ts +1 -0
  32. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/index.js +17 -0
  33. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelBlank/styles.module.css +3 -0
  34. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.d.ts +12 -0
  35. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.js +17 -0
  36. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/index.d.ts +1 -0
  37. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/index.js +17 -0
  38. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelGroup/styles.module.css +35 -0
  39. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +12 -0
  40. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.js +24 -0
  41. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.d.ts +9 -0
  42. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.js +27 -0
  43. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/index.d.ts +1 -0
  44. package/dist/cjs/components/NotificationPanelContent/components/NotificationPanelSettings/index.js +17 -0
  45. package/dist/cjs/components/NotificationPanelContent/components/index.d.ts +4 -0
  46. package/dist/cjs/components/NotificationPanelContent/components/index.js +20 -0
  47. package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/StackTail.d.ts +6 -0
  48. package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/StackTail.js +11 -0
  49. package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/index.d.ts +1 -0
  50. package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/index.js +17 -0
  51. package/dist/cjs/components/NotificationPanelContent/helperComponents/StackTail/styles.module.css +49 -0
  52. package/dist/cjs/components/NotificationPanelContent/helperComponents/index.d.ts +1 -0
  53. package/dist/cjs/components/NotificationPanelContent/helperComponents/index.js +17 -0
  54. package/dist/cjs/components/NotificationPanelContent/index.d.ts +2 -0
  55. package/dist/cjs/components/NotificationPanelContent/index.js +18 -0
  56. package/dist/cjs/components/NotificationPanelContent/styles.module.css +98 -0
  57. package/dist/cjs/components/index.d.ts +3 -0
  58. package/dist/cjs/components/index.js +19 -0
  59. package/dist/cjs/constants.d.ts +57 -0
  60. package/dist/cjs/constants.js +60 -0
  61. package/dist/cjs/helperComponents/ActionsButton/ActionsButton.d.ts +19 -0
  62. package/dist/cjs/helperComponents/ActionsButton/ActionsButton.js +28 -0
  63. package/dist/cjs/helperComponents/ActionsButton/index.d.ts +1 -0
  64. package/dist/cjs/helperComponents/ActionsButton/index.js +17 -0
  65. package/dist/cjs/helperComponents/ActionsButton/styles.module.css +3 -0
  66. package/dist/cjs/index.d.ts +4 -0
  67. package/dist/cjs/index.js +22 -0
  68. package/dist/cjs/package.json +3 -0
  69. package/dist/cjs/style.css +483 -0
  70. package/dist/cjs/types.d.ts +12 -0
  71. package/dist/cjs/types.js +2 -0
  72. package/dist/cjs/utils.d.ts +3 -0
  73. package/dist/cjs/utils.js +7 -0
  74. package/dist/esm/components/NotificationCard/NotificationCard.d.ts +43 -0
  75. package/dist/esm/components/NotificationCard/NotificationCard.js +74 -0
  76. package/dist/esm/components/NotificationCard/NotificationCardSkeleton.d.ts +7 -0
  77. package/dist/esm/components/NotificationCard/NotificationCardSkeleton.js +10 -0
  78. package/dist/esm/components/NotificationCard/helpers.d.ts +4 -0
  79. package/dist/esm/components/NotificationCard/helpers.js +27 -0
  80. package/dist/esm/components/NotificationCard/index.d.ts +2 -0
  81. package/dist/esm/components/NotificationCard/index.js +2 -0
  82. package/dist/esm/components/NotificationCard/styles.module.css +216 -0
  83. package/dist/esm/components/NotificationPanel/NotificationPanel.d.ts +22 -0
  84. package/dist/esm/components/NotificationPanel/NotificationPanel.js +17 -0
  85. package/dist/esm/components/NotificationPanel/index.d.ts +1 -0
  86. package/dist/esm/components/NotificationPanel/index.js +1 -0
  87. package/dist/esm/components/NotificationPanel/styles.module.css +10 -0
  88. package/dist/esm/components/NotificationPanelContent/NotificationPanelContent.d.ts +45 -0
  89. package/dist/esm/components/NotificationPanelContent/NotificationPanelContent.js +37 -0
  90. package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.d.ts +18 -0
  91. package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.js +37 -0
  92. package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/hooks.d.ts +17 -0
  93. package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/hooks.js +19 -0
  94. package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/index.d.ts +1 -0
  95. package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/index.js +1 -0
  96. package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/styles.module.css +69 -0
  97. package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/utils.d.ts +4 -0
  98. package/dist/esm/components/NotificationPanelContent/components/NotificationCardStack/utils.js +7 -0
  99. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.d.ts +4 -0
  100. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.js +9 -0
  101. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/index.d.ts +1 -0
  102. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/index.js +1 -0
  103. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelBlank/styles.module.css +3 -0
  104. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.d.ts +12 -0
  105. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.js +11 -0
  106. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/index.d.ts +1 -0
  107. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/index.js +1 -0
  108. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelGroup/styles.module.css +35 -0
  109. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +12 -0
  110. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.js +21 -0
  111. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.d.ts +9 -0
  112. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.js +21 -0
  113. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/index.d.ts +1 -0
  114. package/dist/esm/components/NotificationPanelContent/components/NotificationPanelSettings/index.js +1 -0
  115. package/dist/esm/components/NotificationPanelContent/components/index.d.ts +4 -0
  116. package/dist/esm/components/NotificationPanelContent/components/index.js +4 -0
  117. package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/StackTail.d.ts +6 -0
  118. package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/StackTail.js +5 -0
  119. package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/index.d.ts +1 -0
  120. package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/index.js +1 -0
  121. package/dist/esm/components/NotificationPanelContent/helperComponents/StackTail/styles.module.css +49 -0
  122. package/dist/esm/components/NotificationPanelContent/helperComponents/index.d.ts +1 -0
  123. package/dist/esm/components/NotificationPanelContent/helperComponents/index.js +1 -0
  124. package/dist/esm/components/NotificationPanelContent/index.d.ts +2 -0
  125. package/dist/esm/components/NotificationPanelContent/index.js +2 -0
  126. package/dist/esm/components/NotificationPanelContent/styles.module.css +98 -0
  127. package/dist/esm/components/index.d.ts +3 -0
  128. package/dist/esm/components/index.js +3 -0
  129. package/dist/esm/constants.d.ts +57 -0
  130. package/dist/esm/constants.js +57 -0
  131. package/dist/esm/helperComponents/ActionsButton/ActionsButton.d.ts +19 -0
  132. package/dist/esm/helperComponents/ActionsButton/ActionsButton.js +22 -0
  133. package/dist/esm/helperComponents/ActionsButton/index.d.ts +1 -0
  134. package/dist/esm/helperComponents/ActionsButton/index.js +1 -0
  135. package/dist/esm/helperComponents/ActionsButton/styles.module.css +3 -0
  136. package/dist/esm/index.d.ts +4 -0
  137. package/dist/esm/index.js +4 -0
  138. package/dist/esm/style.css +483 -0
  139. package/dist/esm/types.d.ts +12 -0
  140. package/dist/esm/types.js +1 -0
  141. package/dist/esm/utils.d.ts +3 -0
  142. package/dist/esm/utils.js +4 -0
  143. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  144. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  145. package/package.json +60 -0
  146. package/src/components/NotificationCard/NotificationCard.tsx +252 -0
  147. package/src/components/NotificationCard/NotificationCardSkeleton.tsx +40 -0
  148. package/src/components/NotificationCard/helpers.tsx +36 -0
  149. package/src/components/NotificationCard/index.ts +2 -0
  150. package/src/components/NotificationCard/styles.module.scss +165 -0
  151. package/src/components/NotificationPanel/NotificationPanel.tsx +56 -0
  152. package/src/components/NotificationPanel/index.ts +1 -0
  153. package/src/components/NotificationPanel/styles.module.scss +15 -0
  154. package/src/components/NotificationPanelContent/NotificationPanelContent.tsx +168 -0
  155. package/src/components/NotificationPanelContent/components/NotificationCardStack/NotificationCardStack.tsx +128 -0
  156. package/src/components/NotificationPanelContent/components/NotificationCardStack/hooks.ts +45 -0
  157. package/src/components/NotificationPanelContent/components/NotificationCardStack/index.ts +1 -0
  158. package/src/components/NotificationPanelContent/components/NotificationCardStack/styles.module.scss +90 -0
  159. package/src/components/NotificationPanelContent/components/NotificationCardStack/utils.ts +11 -0
  160. package/src/components/NotificationPanelContent/components/NotificationPanelBlank/NotificationPanelBlank.tsx +21 -0
  161. package/src/components/NotificationPanelContent/components/NotificationPanelBlank/index.ts +1 -0
  162. package/src/components/NotificationPanelContent/components/NotificationPanelBlank/styles.module.scss +5 -0
  163. package/src/components/NotificationPanelContent/components/NotificationPanelGroup/NotificationPanelGroup.tsx +31 -0
  164. package/src/components/NotificationPanelContent/components/NotificationPanelGroup/index.ts +1 -0
  165. package/src/components/NotificationPanelContent/components/NotificationPanelGroup/styles.module.scss +45 -0
  166. package/src/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettings.tsx +34 -0
  167. package/src/components/NotificationPanelContent/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.tsx +43 -0
  168. package/src/components/NotificationPanelContent/components/NotificationPanelSettings/index.ts +1 -0
  169. package/src/components/NotificationPanelContent/components/index.ts +4 -0
  170. package/src/components/NotificationPanelContent/helperComponents/StackTail/StackTail.tsx +17 -0
  171. package/src/components/NotificationPanelContent/helperComponents/StackTail/index.ts +1 -0
  172. package/src/components/NotificationPanelContent/helperComponents/StackTail/styles.module.scss +85 -0
  173. package/src/components/NotificationPanelContent/helperComponents/index.ts +1 -0
  174. package/src/components/NotificationPanelContent/index.ts +2 -0
  175. package/src/components/NotificationPanelContent/styles.module.scss +116 -0
  176. package/src/components/index.ts +3 -0
  177. package/src/constants.ts +58 -0
  178. package/src/helperComponents/ActionsButton/ActionsButton.tsx +73 -0
  179. package/src/helperComponents/ActionsButton/index.ts +1 -0
  180. package/src/helperComponents/ActionsButton/styles.module.scss +3 -0
  181. package/src/index.ts +4 -0
  182. package/src/types.ts +15 -0
  183. 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
+ }
@@ -0,0 +1 @@
1
+ export * from './NotificationPanelGroup.js';
@@ -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
+ }
@@ -0,0 +1 @@
1
+ export * from './NotificationPanelSettings.js';
@@ -0,0 +1 @@
1
+ export * from './NotificationPanelSettings.js';
@@ -0,0 +1,4 @@
1
+ export * from './NotificationPanelBlank/index.js';
2
+ export * from './NotificationPanelGroup/index.js';
3
+ export * from './NotificationPanelSettings/index.js';
4
+ export * from './NotificationCardStack/index.js';
@@ -0,0 +1,4 @@
1
+ export * from './NotificationPanelBlank/index.js';
2
+ export * from './NotificationPanelGroup/index.js';
3
+ export * from './NotificationPanelSettings/index.js';
4
+ export * from './NotificationCardStack/index.js';
@@ -0,0 +1,6 @@
1
+ type StackTailProps = {
2
+ open: boolean;
3
+ count: number;
4
+ };
5
+ export declare function StackTail({ open, count }: StackTailProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -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';
@@ -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,2 @@
1
+ export * from './NotificationPanelContent.js';
2
+ export * from './components/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './NotificationPanelContent.js';
2
+ export * from './components/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,3 @@
1
+ export * from './NotificationCard/index.js';
2
+ export * from './NotificationPanelContent/index.js';
3
+ export * from './NotificationPanel/index.js';
@@ -0,0 +1,3 @@
1
+ export * from './NotificationCard/index.js';
2
+ export * from './NotificationPanelContent/index.js';
3
+ export * from './NotificationPanel/index.js';
@@ -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';
@@ -0,0 +1,3 @@
1
+ .inlineFlex{
2
+ display:inline-flex;
3
+ }
@@ -0,0 +1,4 @@
1
+ export * from './components/index.js';
2
+ export * from './constants.js';
3
+ export * from './types.js';
4
+ export { setNonce } from '@cloud-ru/ds-scroll';
@@ -0,0 +1,4 @@
1
+ export * from './components/index.js';
2
+ export * from './constants.js';
3
+ export * from './types.js';
4
+ export { setNonce } from '@cloud-ru/ds-scroll';