@cloud-ru/ds-uikit-product-notification 1.0.11-preview-5926424e.0 → 1.0.11
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 +4 -0
- package/README.md +187 -244
- package/dist/cjs/components/NotificationPanel/NotificationPanel.d.ts +13 -47
- package/dist/cjs/components/NotificationPanel/NotificationPanel.js +8 -38
- package/dist/cjs/components/NotificationPanel/index.d.ts +0 -1
- package/dist/cjs/components/NotificationPanel/index.js +0 -1
- package/dist/cjs/components/NotificationPanel/styles.module.css +4 -32
- package/dist/cjs/components/NotificationPanelContent/NotificationPanelContent.d.ts +45 -0
- package/dist/cjs/components/NotificationPanelContent/NotificationPanelContent.js +43 -0
- package/dist/{esm/components/NotificationPanel → cjs/components/NotificationPanelContent}/components/NotificationPanelBlank/styles.module.css +1 -1
- 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 +1 -0
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/style.css +81 -11
- package/dist/esm/components/NotificationPanel/NotificationPanel.d.ts +13 -47
- package/dist/esm/components/NotificationPanel/NotificationPanel.js +10 -40
- package/dist/esm/components/NotificationPanel/index.d.ts +0 -1
- package/dist/esm/components/NotificationPanel/index.js +0 -1
- package/dist/esm/components/NotificationPanel/styles.module.css +4 -32
- package/dist/esm/components/NotificationPanelContent/NotificationPanelContent.d.ts +45 -0
- package/dist/esm/components/NotificationPanelContent/NotificationPanelContent.js +37 -0
- package/dist/{cjs/components/NotificationPanel → esm/components/NotificationPanelContent}/components/NotificationPanelBlank/styles.module.css +1 -1
- 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 +1 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/style.css +81 -11
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +20 -19
- package/src/components/NotificationPanel/NotificationPanel.tsx +20 -156
- package/src/components/NotificationPanel/index.ts +0 -1
- package/src/components/NotificationPanel/styles.module.scss +7 -35
- package/src/components/NotificationPanelContent/NotificationPanelContent.tsx +168 -0
- package/src/components/NotificationPanelContent/components/NotificationPanelBlank/styles.module.scss +5 -0
- package/src/components/NotificationPanelContent/index.ts +2 -0
- package/src/components/NotificationPanelContent/styles.module.scss +116 -0
- package/src/components/index.ts +1 -0
- package/src/components/NotificationPanel/components/NotificationPanelBlank/styles.module.scss +0 -4
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/NotificationCardStack.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/NotificationCardStack.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/hooks.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/hooks.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/index.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/index.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/styles.module.css +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/utils.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/utils.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelBlank/NotificationPanelBlank.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelBlank/NotificationPanelBlank.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelBlank/index.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelBlank/index.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/NotificationPanelGroup.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/NotificationPanelGroup.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/index.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/index.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/styles.module.css +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/NotificationPanelSettings.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/index.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/index.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/index.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/components/index.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/StackTail.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/StackTail.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/index.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/index.js +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/styles.module.css +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/helperComponents/index.d.ts +0 -0
- /package/dist/cjs/components/{NotificationPanel → NotificationPanelContent}/helperComponents/index.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/NotificationCardStack.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/NotificationCardStack.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/hooks.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/hooks.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/index.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/index.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/styles.module.css +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/utils.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/utils.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelBlank/NotificationPanelBlank.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelBlank/NotificationPanelBlank.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelBlank/index.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelBlank/index.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/NotificationPanelGroup.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/NotificationPanelGroup.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/index.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/index.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/styles.module.css +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/NotificationPanelSettings.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/NotificationPanelSettings.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/index.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/index.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/index.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/components/index.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/StackTail.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/StackTail.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/index.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/index.js +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/styles.module.css +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/helperComponents/index.d.ts +0 -0
- /package/dist/esm/components/{NotificationPanel → NotificationPanelContent}/helperComponents/index.js +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/NotificationCardStack.tsx +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/hooks.ts +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/index.ts +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/styles.module.scss +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationCardStack/utils.ts +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelBlank/NotificationPanelBlank.tsx +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelBlank/index.ts +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/NotificationPanelGroup.tsx +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/index.ts +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelGroup/styles.module.scss +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/NotificationPanelSettings.tsx +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/NotificationPanelSettingsDroplist.tsx +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/NotificationPanelSettings/index.ts +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/components/index.ts +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/StackTail.tsx +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/index.ts +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/helperComponents/StackTail/styles.module.scss +0 -0
- /package/src/components/{NotificationPanel → NotificationPanelContent}/helperComponents/index.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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.0.11 (2026-08-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ds/uikit-product-notification
|
|
9
|
+
|
|
6
10
|
## 1.0.10 (2026-08-28)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @ds/uikit-product-notification
|
package/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# Notification
|
|
2
2
|
|
|
3
|
-
`@cloud-ru/ds-uikit-product-notification` — Пакет уведомлений — карточка NotificationCard
|
|
3
|
+
`@cloud-ru/ds-uikit-product-notification` — Пакет уведомлений — карточка NotificationCard, лента NotificationPanelContent со стеками и группами и адаптивная обёртка NotificationPanel (drawer на desktop, bottom-sheet на mobile).
|
|
4
4
|
|
|
5
|
-
Пакет `@cloud-ru/ds-uikit-product-notification` собирает ленту уведомлений из
|
|
5
|
+
Пакет `@cloud-ru/ds-uikit-product-notification` собирает ленту уведомлений из трёх уровней: одиночная карточка, контейнер-лента и адаптивная обёртка для открытия ленты в drawer или bottom-sheet.
|
|
6
6
|
|
|
7
7
|
- ****NotificationCard**** — одиночная карточка уведомления: тип (`appearance`), состояние `unread`, ссылка, дата, кнопки действий и меню.
|
|
8
|
-
- ****
|
|
8
|
+
- ****NotificationPanelContent**** — контейнер ленты: заголовок, фильтры, кнопка «прочитать все», слот-список карточек и состояния `loading` / `blank`. Namespace-субкомпоненты `Group`, `Stack`, `Blank`.
|
|
9
|
+
- ****NotificationPanel**** — адаптивная обёртка панели: на desktop открывает её в drawer, на mobile — в bottom-sheet (выбор по `layoutType`).
|
|
9
10
|
|
|
10
11
|
## Установка
|
|
11
12
|
|
|
@@ -14,7 +15,7 @@ pnpm add @cloud-ru/ds-uikit-product-notification
|
|
|
14
15
|
```
|
|
15
16
|
|
|
16
17
|
```ts
|
|
17
|
-
import { NotificationCard, NotificationPanel } from '@cloud-ru/ds-uikit-product-notification'
|
|
18
|
+
import { NotificationCard, NotificationPanelContent, NotificationPanel } from '@cloud-ru/ds-uikit-product-notification'
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
## NotificationCard
|
|
@@ -25,7 +26,7 @@ import { NotificationCard, NotificationPanel } from '@cloud-ru/ds-uikit-product-
|
|
|
25
26
|
|
|
26
27
|
### Когда использовать
|
|
27
28
|
|
|
28
|
-
- Элемент ленты внутри **`
|
|
29
|
+
- Элемент ленты внутри **`NotificationPanelContent`**.
|
|
29
30
|
- Отдельная карточка статуса операции (деплой, бэкап, инцидент) в произвольном контейнере.
|
|
30
31
|
|
|
31
32
|
### Анатомия
|
|
@@ -236,49 +237,34 @@ export function DeployFailureCard() {
|
|
|
236
237
|
| `loading` | `boolean \| undefined` | — | Состояние загрузки |
|
|
237
238
|
| `minWidth` | `boolean \| undefined` | — | Минимальная ширина контейнера (`min-width` из токена размера). По умолчанию `true`. <br/> `false` — кнопка сжимается по контенту вместо фиксированного минимума. |
|
|
238
239
|
|
|
239
|
-
##
|
|
240
|
+
## NotificationPanelContent
|
|
240
241
|
|
|
241
|
-
|
|
242
|
+
Контейнер ленты уведомлений с заголовком, фильтрами, кнопкой «прочитать все», слотом-списком карточек и состояниями loading/blank. Namespace-субкомпоненты Stack/Group/Blank — композиции для слота content.
|
|
242
243
|
|
|
243
|
-
|
|
244
|
+
Контейнер ленты уведомлений. Содержит заголовок, опциональные фильтры (segmented control, chip toggle), кнопку «прочитать все», слот-список карточек и состояния `loading` / `blank`.
|
|
244
245
|
|
|
245
|
-
Namespace `
|
|
246
|
+
Namespace `NotificationPanelContent.{Blank, Group, Stack}` — субкомпоненты-композиции для слота `content`.
|
|
246
247
|
|
|
247
248
|
### Когда использовать
|
|
248
249
|
|
|
249
|
-
- Лента
|
|
250
|
-
-
|
|
250
|
+
- Лента уведомлений в центре экрана или на отдельной странице.
|
|
251
|
+
- Контент внутри **`NotificationPanel`**.
|
|
251
252
|
|
|
252
253
|
### Анатомия
|
|
253
254
|
|
|
254
|
-
#### Layout type (default `desktop`)
|
|
255
|
-
|
|
256
|
-
Раскладка приходит из `AdaptiveProvider` и определяет поверхность:
|
|
257
|
-
|
|
258
|
-
- `desktop` — drawer (Figma `notificationDrawer`).
|
|
259
|
-
- `mobile` — bottom-sheet (Figma `notificationBottomSheet`), `chipToggle` в этой раскладке не показывается.
|
|
260
|
-
|
|
261
|
-
#### Position (default `right`)
|
|
262
|
-
|
|
263
|
-
Сторона, с которой выезжает панель. Только desktop.
|
|
264
|
-
|
|
265
|
-
#### Width (default `s`)
|
|
266
|
-
|
|
267
|
-
Ширина панели. Только desktop.
|
|
268
|
-
|
|
269
255
|
#### Panel state
|
|
270
256
|
|
|
271
|
-
Состояния
|
|
257
|
+
Состояния панели (соответствуют Figma variant `content`):
|
|
272
258
|
|
|
273
259
|
- `content` — стандартный список карточек через слот `content`.
|
|
274
260
|
- `loading` — `loading={true}` показывает скелетоны (`skeletonsAmount`, default `2`).
|
|
275
|
-
- `blank` — `content={<
|
|
261
|
+
- `blank` — `content={<NotificationPanelContent.Blank />}` для пустого состояния и состояния ошибки.
|
|
276
262
|
|
|
277
263
|
#### Субкомпоненты слота `content`
|
|
278
264
|
|
|
279
|
-
- `
|
|
280
|
-
- `
|
|
281
|
-
- `
|
|
265
|
+
- `NotificationPanelContent.Group` — группа карточек с заголовком.
|
|
266
|
+
- `NotificationPanelContent.Stack` — стек схлопывающихся карточек. Стек из одной карточки рендерится без обёртки.
|
|
267
|
+
- `NotificationPanelContent.Blank` — пустое состояние (используется и для ошибки — с иконкой и текстом).
|
|
282
268
|
|
|
283
269
|
### Примеры использования
|
|
284
270
|
|
|
@@ -287,71 +273,64 @@ Namespace `NotificationPanel.{Blank, Group, Stack}` — субкомпонент
|
|
|
287
273
|
Список карточек через слот content, readAllButton помечает все прочитанными, onVisible — каждую при прокрутке.
|
|
288
274
|
|
|
289
275
|
```tsx
|
|
290
|
-
import {
|
|
291
|
-
import { APPEARANCE, NotificationCard, NotificationPanel } from '@cloud-ru/ds-uikit-product-notification';
|
|
276
|
+
import { APPEARANCE, NotificationCard, NotificationPanelContent } from '@cloud-ru/ds-uikit-product-notification';
|
|
292
277
|
import { useState } from 'react';
|
|
293
278
|
|
|
294
279
|
export function PanelBasic() {
|
|
295
|
-
const [open, setOpen] = useState(false);
|
|
296
280
|
const [readIds, setReadIds] = useState<Set<string>>(new Set());
|
|
297
281
|
const markRead = (id: string) => setReadIds(prev => (prev.has(id) ? prev : new Set(prev).add(id)));
|
|
298
282
|
|
|
299
283
|
return (
|
|
300
|
-
<
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
/>
|
|
351
|
-
</>
|
|
352
|
-
}
|
|
353
|
-
/>
|
|
354
|
-
</div>
|
|
284
|
+
<NotificationPanelContent
|
|
285
|
+
title='Уведомления'
|
|
286
|
+
readAllButton={{
|
|
287
|
+
label: 'Прочитать всё',
|
|
288
|
+
onClick: () => setReadIds(new Set(['inc-4821', 'quota-var-data', 'deploy-9217', 'backup-1729'])),
|
|
289
|
+
}}
|
|
290
|
+
content={
|
|
291
|
+
<>
|
|
292
|
+
<NotificationCard
|
|
293
|
+
id='inc-4821'
|
|
294
|
+
label='INC-4821'
|
|
295
|
+
appearance={APPEARANCE.Error}
|
|
296
|
+
title='Кластер k8s-prod-1 деградирован'
|
|
297
|
+
description='3 из 5 нод недоступны последние 6 минут.'
|
|
298
|
+
date='03:14'
|
|
299
|
+
link={{ label: 'Открыть инцидент', href: '/incidents/INC-4821' }}
|
|
300
|
+
unread={!readIds.has('inc-4821')}
|
|
301
|
+
onVisible={markRead}
|
|
302
|
+
/>
|
|
303
|
+
<NotificationCard
|
|
304
|
+
id='quota-var-data'
|
|
305
|
+
label='Storage'
|
|
306
|
+
appearance={APPEARANCE.Warning}
|
|
307
|
+
title='Лимит дисковой квоты'
|
|
308
|
+
description='Использовано 92% /var/data — осталось 38 ГБ из 480 ГБ.'
|
|
309
|
+
date='02:50'
|
|
310
|
+
unread={!readIds.has('quota-var-data')}
|
|
311
|
+
onVisible={markRead}
|
|
312
|
+
/>
|
|
313
|
+
<NotificationCard
|
|
314
|
+
id='deploy-9217'
|
|
315
|
+
label='api-gateway · v2.18.3'
|
|
316
|
+
appearance={APPEARANCE.Error}
|
|
317
|
+
title='Деплой не прошёл health-check'
|
|
318
|
+
description='Readiness probe вернул 503 на 4 из 6 подов.'
|
|
319
|
+
date='вчера · 23:11'
|
|
320
|
+
unread={!readIds.has('deploy-9217')}
|
|
321
|
+
onVisible={markRead}
|
|
322
|
+
/>
|
|
323
|
+
<NotificationCard
|
|
324
|
+
id='backup-1729'
|
|
325
|
+
label='Backup'
|
|
326
|
+
appearance={APPEARANCE.Success}
|
|
327
|
+
title='Резервная копия завершена'
|
|
328
|
+
description='Бэкап БД prod-1 (412 ГБ) загружен в s3://backups-prod/.'
|
|
329
|
+
date='вчера · 14:32'
|
|
330
|
+
/>
|
|
331
|
+
</>
|
|
332
|
+
}
|
|
333
|
+
/>
|
|
355
334
|
);
|
|
356
335
|
}
|
|
357
336
|
```
|
|
@@ -361,34 +340,25 @@ export function PanelBasic() {
|
|
|
361
340
|
loading + skeletonsAmount={4} вместо слота content; фильтры и readAllButton остаются на месте.
|
|
362
341
|
|
|
363
342
|
```tsx
|
|
364
|
-
import {
|
|
365
|
-
import { NotificationPanel } from '@cloud-ru/ds-uikit-product-notification';
|
|
366
|
-
import { useState } from 'react';
|
|
343
|
+
import { NotificationPanelContent } from '@cloud-ru/ds-uikit-product-notification';
|
|
367
344
|
|
|
368
345
|
export function PanelLoading() {
|
|
369
|
-
const [open, setOpen] = useState(false);
|
|
370
|
-
|
|
371
346
|
return (
|
|
372
|
-
<
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
onChange: () => {},
|
|
388
|
-
}}
|
|
389
|
-
readAllButton={{ label: 'Прочитать всё', onClick: () => {} }}
|
|
390
|
-
/>
|
|
391
|
-
</div>
|
|
347
|
+
<NotificationPanelContent
|
|
348
|
+
title='Уведомления'
|
|
349
|
+
loading
|
|
350
|
+
skeletonsAmount={4}
|
|
351
|
+
segments={{
|
|
352
|
+
items: [
|
|
353
|
+
{ value: 'all', label: 'Все' },
|
|
354
|
+
{ value: 'unread', label: 'Непрочитанные' },
|
|
355
|
+
{ value: 'mentions', label: 'Упоминания' },
|
|
356
|
+
],
|
|
357
|
+
value: 'all',
|
|
358
|
+
onChange: () => {},
|
|
359
|
+
}}
|
|
360
|
+
readAllButton={{ label: 'Прочитать всё', onClick: () => {} }}
|
|
361
|
+
/>
|
|
392
362
|
);
|
|
393
363
|
}
|
|
394
364
|
```
|
|
@@ -398,8 +368,7 @@ export function PanelLoading() {
|
|
|
398
368
|
Segments + chipToggle + settings + readAll, Group для критичных, Stack для повторяющихся алертов квоты по нескольким хостам.
|
|
399
369
|
|
|
400
370
|
```tsx
|
|
401
|
-
import {
|
|
402
|
-
import { APPEARANCE, NotificationCard, NotificationPanel } from '@cloud-ru/ds-uikit-product-notification';
|
|
371
|
+
import { APPEARANCE, NotificationCard, NotificationPanelContent } from '@cloud-ru/ds-uikit-product-notification';
|
|
403
372
|
import { useMemo, useState } from 'react';
|
|
404
373
|
|
|
405
374
|
type Filter = 'all' | 'unread' | 'mentions';
|
|
@@ -407,7 +376,6 @@ type Filter = 'all' | 'unread' | 'mentions';
|
|
|
407
376
|
type CardId = 'inc-4821' | 'deploy-9217' | 'stack-quota' | 'mention-1' | 'backup-1729';
|
|
408
377
|
|
|
409
378
|
export function PanelFull() {
|
|
410
|
-
const [open, setOpen] = useState(false);
|
|
411
379
|
const [filter, setFilter] = useState<Filter>('all');
|
|
412
380
|
const [importantOnly, setImportantOnly] = useState(false);
|
|
413
381
|
const [muted, setMuted] = useState(false);
|
|
@@ -439,21 +407,21 @@ export function PanelFull() {
|
|
|
439
407
|
|
|
440
408
|
const attentionVisible = visible.inc || visible.deploy;
|
|
441
409
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
410
|
+
if (muted) {
|
|
411
|
+
return (
|
|
412
|
+
<NotificationPanelContent
|
|
413
|
+
title='Уведомления'
|
|
414
|
+
settings={{
|
|
415
|
+
button: { onClick: () => setMuted(false) },
|
|
416
|
+
actions: [{ content: { label: 'Снять заглушение' }, onClick: () => setMuted(false) }],
|
|
417
|
+
}}
|
|
418
|
+
content={<NotificationPanelContent.Blank />}
|
|
419
|
+
/>
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return (
|
|
424
|
+
<NotificationPanelContent
|
|
457
425
|
title='Уведомления'
|
|
458
426
|
segments={{
|
|
459
427
|
items: [
|
|
@@ -484,7 +452,7 @@ export function PanelFull() {
|
|
|
484
452
|
content={
|
|
485
453
|
<>
|
|
486
454
|
{attentionVisible && (
|
|
487
|
-
<
|
|
455
|
+
<NotificationPanelContent.Group title='Требуют внимания'>
|
|
488
456
|
{visible.inc && (
|
|
489
457
|
<NotificationCard
|
|
490
458
|
id='inc-4821'
|
|
@@ -515,12 +483,12 @@ export function PanelFull() {
|
|
|
515
483
|
onVisible={markRead}
|
|
516
484
|
/>
|
|
517
485
|
)}
|
|
518
|
-
</
|
|
486
|
+
</NotificationPanelContent.Group>
|
|
519
487
|
)}
|
|
520
488
|
|
|
521
489
|
{visible.quota && (
|
|
522
490
|
<>
|
|
523
|
-
<
|
|
491
|
+
<NotificationPanelContent.Stack
|
|
524
492
|
title='Лимит дисковой квоты · 3 хоста'
|
|
525
493
|
unread={isUnread('stack-quota')}
|
|
526
494
|
actions={[
|
|
@@ -553,7 +521,7 @@ export function PanelFull() {
|
|
|
553
521
|
description='Использовано 84% — осталось 76 ГБ из 480 ГБ.'
|
|
554
522
|
date='вчера · 23:50'
|
|
555
523
|
/>
|
|
556
|
-
</
|
|
524
|
+
</NotificationPanelContent.Stack>
|
|
557
525
|
</>
|
|
558
526
|
)}
|
|
559
527
|
|
|
@@ -587,129 +555,29 @@ export function PanelFull() {
|
|
|
587
555
|
}
|
|
588
556
|
/>
|
|
589
557
|
);
|
|
590
|
-
|
|
591
|
-
return (
|
|
592
|
-
<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
593
|
-
<Button label='Уведомления' view='outline' appearance='neutral' onClick={() => setOpen(true)} />
|
|
594
|
-
{panel}
|
|
595
|
-
</div>
|
|
596
|
-
);
|
|
597
|
-
}
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
#### Открытие из кнопки в шапке
|
|
601
|
-
|
|
602
|
-
Триггер со счётчиком непрочитанных и useState для open/close.
|
|
603
|
-
|
|
604
|
-
```tsx
|
|
605
|
-
import { Button } from '@cloud-ru/ds-button';
|
|
606
|
-
import { APPEARANCE, NotificationCard, NotificationPanel } from '@cloud-ru/ds-uikit-product-notification';
|
|
607
|
-
import { useMemo, useState } from 'react';
|
|
608
|
-
|
|
609
|
-
export function PanelScenario() {
|
|
610
|
-
const [open, setOpen] = useState(false);
|
|
611
|
-
const [readIds, setReadIds] = useState<Set<string>>(new Set());
|
|
612
|
-
|
|
613
|
-
const unreadCount = useMemo(() => ['inc-4821', 'deploy-9217'].filter(id => !readIds.has(id)).length, [readIds]);
|
|
614
|
-
|
|
615
|
-
const markRead = (id: string) => setReadIds(prev => (prev.has(id) ? prev : new Set(prev).add(id)));
|
|
616
|
-
|
|
617
|
-
return (
|
|
618
|
-
<div
|
|
619
|
-
style={{
|
|
620
|
-
display: 'flex',
|
|
621
|
-
justifyContent: 'flex-end',
|
|
622
|
-
alignItems: 'center',
|
|
623
|
-
padding: '12px 16px',
|
|
624
|
-
minHeight: 56,
|
|
625
|
-
}}
|
|
626
|
-
>
|
|
627
|
-
<Button
|
|
628
|
-
label={unreadCount > 0 ? `Уведомления · ${unreadCount}` : 'Уведомления'}
|
|
629
|
-
view='outline'
|
|
630
|
-
appearance='neutral'
|
|
631
|
-
onClick={() => setOpen(true)}
|
|
632
|
-
/>
|
|
633
|
-
<NotificationPanel
|
|
634
|
-
open={open}
|
|
635
|
-
onClose={() => setOpen(false)}
|
|
636
|
-
title='Уведомления'
|
|
637
|
-
readAllButton={{
|
|
638
|
-
label: 'Прочитать всё',
|
|
639
|
-
onClick: () => setReadIds(new Set(['inc-4821', 'deploy-9217'])),
|
|
640
|
-
}}
|
|
641
|
-
content={
|
|
642
|
-
<>
|
|
643
|
-
<NotificationCard
|
|
644
|
-
id='inc-4821'
|
|
645
|
-
label='INC-4821'
|
|
646
|
-
appearance={APPEARANCE.Error}
|
|
647
|
-
title='Кластер k8s-prod-1 деградирован'
|
|
648
|
-
description='3 из 5 нод недоступны последние 6 минут.'
|
|
649
|
-
date='03:14'
|
|
650
|
-
link={{ label: 'Открыть инцидент', href: '/incidents/INC-4821' }}
|
|
651
|
-
unread={!readIds.has('inc-4821')}
|
|
652
|
-
onVisible={markRead}
|
|
653
|
-
/>
|
|
654
|
-
<NotificationCard
|
|
655
|
-
id='deploy-9217'
|
|
656
|
-
label='api-gateway · v2.18.3'
|
|
657
|
-
appearance={APPEARANCE.Error}
|
|
658
|
-
title='Деплой не прошёл health-check'
|
|
659
|
-
description='Readiness probe вернул 503 на 4 из 6 подов.'
|
|
660
|
-
date='02:50'
|
|
661
|
-
primaryButton={{ label: 'Повторить', onClick: () => markRead('deploy-9217') }}
|
|
662
|
-
secondaryButton={{
|
|
663
|
-
label: 'Логи',
|
|
664
|
-
onClick: () => window.open('/logs/api-gateway/2.18.3', '_blank'),
|
|
665
|
-
}}
|
|
666
|
-
unread={!readIds.has('deploy-9217')}
|
|
667
|
-
onVisible={markRead}
|
|
668
|
-
/>
|
|
669
|
-
<NotificationCard
|
|
670
|
-
id='backup-1729'
|
|
671
|
-
label='Backup'
|
|
672
|
-
appearance={APPEARANCE.Success}
|
|
673
|
-
title='Резервная копия завершена'
|
|
674
|
-
description='prod-1 (412 ГБ) → s3://backups-prod/2026-05-26/'
|
|
675
|
-
date='вчера · 14:32'
|
|
676
|
-
/>
|
|
677
|
-
</>
|
|
678
|
-
}
|
|
679
|
-
/>
|
|
680
|
-
</div>
|
|
681
|
-
);
|
|
682
558
|
}
|
|
683
559
|
```
|
|
684
560
|
|
|
685
561
|
### Props
|
|
686
562
|
|
|
687
|
-
####
|
|
563
|
+
#### NotificationPanelContent
|
|
688
564
|
|
|
689
|
-
**
|
|
565
|
+
**NotificationPanelContentProps**
|
|
690
566
|
|
|
691
567
|
| Prop | Type | Default | Description |
|
|
692
568
|
|------|------|---------|-------------|
|
|
693
|
-
| `chipToggle` | `{ label: string; checked: boolean; onChange(checked: boolean): void; }` | — | Переключатель для
|
|
694
|
-
| `className` | `string` | — |
|
|
695
|
-
| `
|
|
696
|
-
| `container` | `string \| HTMLElement` | — | Контейнер в котором будет рендерится Drawer. По-умолчанию - body |
|
|
697
|
-
| `content` | `ReactNode` | — | Контент для отрисовки (e.g NotificationCard \| NotificationPanel.Blank) |
|
|
569
|
+
| `chipToggle` | `{ label: string; checked: boolean; onChange(checked: boolean): void; }` | — | Переключатель для фильтрации |
|
|
570
|
+
| `className` | `string` | — | |
|
|
571
|
+
| `content` | `ReactNode` | — | Контент для отрисовки (e.g NotificationCard \| NotificationPanelContent.Blank) |
|
|
698
572
|
| `data-test-id` | `string` | — | |
|
|
699
573
|
| `loading` | `boolean` | — | Состояние загрузки |
|
|
700
|
-
| `onClose` | `() => void` | — | Колбэк закрытия |
|
|
701
|
-
| `open` | `boolean` | — | Управление состоянием показан/не показан. |
|
|
702
|
-
| `position` | `"bottom"` \| `"left"` \| `"right"` \| `"top"` | `right` | Расположение |
|
|
703
574
|
| `readAllButton` | `ButtonProps` \| `TooltipProps` | — | Кнопка в "шапке" панели |
|
|
704
|
-
| `rootClassName` | `string` | — | CSS-класс для корневого элемента |
|
|
705
575
|
| `scrollContainerRef` | `RefObject<HTMLElement>` | — | Ссылка на контейнер, который скроллится |
|
|
706
576
|
| `scrollEndRef` | `RefObject<HTMLDivElement>` | — | Ссылка на элемент, обозначающий самый конец прокручиваемого списка |
|
|
707
577
|
| `segments` | `SegmentControlProps` | — | Сегменты для фильтрации |
|
|
708
578
|
| `settings` | `NotificationPanelSettingsProps` | — | Кнопка настроек и выпадающий список |
|
|
709
|
-
| `showBlackout` | `boolean` | `true` | Отображение темной подложки |
|
|
710
579
|
| `skeletonsAmount` | `number` | `2` | Количество скелетонов карточек для отображения при загрузке |
|
|
711
580
|
| `title` | `string` | — | Заголовок панели |
|
|
712
|
-
| `width` | `Width` | `s` | Ширина (только при position: "left" \| "right") |
|
|
713
581
|
|
|
714
582
|
##### Related types
|
|
715
583
|
|
|
@@ -731,7 +599,7 @@ export function PanelScenario() {
|
|
|
731
599
|
| `button` | `ButtonProps` | — | Кнопка дополнительного действия панели |
|
|
732
600
|
| `size` | `"m"` \| `"s"` | — | |
|
|
733
601
|
|
|
734
|
-
####
|
|
602
|
+
#### NotificationPanelContent.Stack
|
|
735
603
|
|
|
736
604
|
**NotificationCardStackProps**
|
|
737
605
|
|
|
@@ -757,7 +625,7 @@ export function PanelScenario() {
|
|
|
757
625
|
| `onClick` | `((e: MouseEvent<HTMLElement>) => void) \| undefined` | — | Колбек обработки клика |
|
|
758
626
|
| `tagLabel` | `string \| undefined` | — | Лейбл-тег справа от текста |
|
|
759
627
|
|
|
760
|
-
####
|
|
628
|
+
#### NotificationPanelContent.Group
|
|
761
629
|
|
|
762
630
|
**NotificationPanelGroupProps**
|
|
763
631
|
|
|
@@ -768,7 +636,7 @@ export function PanelScenario() {
|
|
|
768
636
|
| `data-test-id` | `string` | — | |
|
|
769
637
|
| `title` | `string` | — | Заголовок группы |
|
|
770
638
|
|
|
771
|
-
####
|
|
639
|
+
#### NotificationPanelContent.Blank
|
|
772
640
|
|
|
773
641
|
**NotificationPanelBlankProps**
|
|
774
642
|
|
|
@@ -779,3 +647,78 @@ export function PanelScenario() {
|
|
|
779
647
|
| `data-test-id` | `string` | — | |
|
|
780
648
|
| `icon` | `IconPredefinedProps` | — | Иконка |
|
|
781
649
|
| `title` | `string` | — | Заголовок |
|
|
650
|
+
|
|
651
|
+
## NotificationPanel
|
|
652
|
+
|
|
653
|
+
Адаптивная обёртка панели уведомлений — на desktop открывает NotificationPanelContent в drawer, на mobile в bottom-sheet (выбор по layoutType).
|
|
654
|
+
|
|
655
|
+
Адаптивная обёртка **`NotificationPanelContent`**. На desktop открывает панель в drawer, на mobile — в bottom-sheet. Выбор раскладки — по `layoutType` (как у `Widget` / `Toolbar`).
|
|
656
|
+
|
|
657
|
+
Контент передаётся пропом `content` как элемент `<NotificationPanelContent />`, а не как пропсы.
|
|
658
|
+
|
|
659
|
+
### Когда использовать
|
|
660
|
+
|
|
661
|
+
- Лента уведомлений, открываемая из иконки в шапке или тулбаре.
|
|
662
|
+
- Один и тот же контент панели на desktop и mobile без дублирования разметки.
|
|
663
|
+
|
|
664
|
+
### Анатомия
|
|
665
|
+
|
|
666
|
+
#### Layout type (default `desktop`)
|
|
667
|
+
|
|
668
|
+
Тип раскладки определяет обёртку:
|
|
669
|
+
|
|
670
|
+
- `desktop` — drawer (Figma `notificationDrawer`).
|
|
671
|
+
- `mobile` — bottom-sheet (Figma `notificationBottomSheet`).
|
|
672
|
+
|
|
673
|
+
#### Position (default `right`)
|
|
674
|
+
|
|
675
|
+
Сторона, с которой выезжает drawer. Только для `desktop`.
|
|
676
|
+
|
|
677
|
+
#### Width (default `s`)
|
|
678
|
+
|
|
679
|
+
Ширина drawer. Только для `desktop`.
|
|
680
|
+
|
|
681
|
+
### Props
|
|
682
|
+
|
|
683
|
+
**NotificationPanelProps**
|
|
684
|
+
|
|
685
|
+
| Prop | Type | Default | Description |
|
|
686
|
+
|------|------|---------|-------------|
|
|
687
|
+
| `className` | `string` | — | CSS-класс для элемента с контентом |
|
|
688
|
+
| `closeOnPopstate` | `boolean` | — | Закрывать дровер при перемещении по истории браузера |
|
|
689
|
+
| `container` | `string \| HTMLElement` | — | Контейнер в котором будет рендерится Drawer. По-умолчанию - body |
|
|
690
|
+
| `content` | `NotificationPanelContentProps` | — | Контент панели (`NotificationPanelContent`), отображаемый внутри обёртки |
|
|
691
|
+
| `data-test-id` | `string` | — | |
|
|
692
|
+
| `onClose` | `() => void` | — | Колбэк закрытия |
|
|
693
|
+
| `open` | `boolean` | — | Управление состоянием показан/не показан. |
|
|
694
|
+
| `position` | `"bottom"` \| `"left"` \| `"right"` \| `"top"` | `right` | Расположение |
|
|
695
|
+
| `rootClassName` | `string` | — | CSS-класс для корневого элемента |
|
|
696
|
+
| `showBlackout` | `boolean` | `true` | Отображение темной подложки |
|
|
697
|
+
| `width` | `Width` | `s` | Ширина (только при position: "left" \| "right") |
|
|
698
|
+
|
|
699
|
+
##### Related types
|
|
700
|
+
|
|
701
|
+
**NotificationPanelContentProps**
|
|
702
|
+
|
|
703
|
+
| Prop | Type | Default | Description |
|
|
704
|
+
|------|------|---------|-------------|
|
|
705
|
+
| `chipToggle` | `{ label: string; checked: boolean; onChange(checked: boolean): void; } \| undefined` | — | Переключатель для фильтрации |
|
|
706
|
+
| `className` | `string \| undefined` | — | |
|
|
707
|
+
| `content` | `string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| null \| undefined` | — | Контент для отрисовки (e.g NotificationCard \| NotificationPanelContent.Blank) |
|
|
708
|
+
| `data-test-id` | `string \| undefined` | — | |
|
|
709
|
+
| `loading` | `boolean \| undefined` | — | Состояние загрузки |
|
|
710
|
+
| `readAllButton` | `ButtonProps` \| `TooltipProps` | — | Кнопка в "шапке" панели |
|
|
711
|
+
| `scrollContainerRef` | `RefObject<HTMLElement> \| undefined` | — | Ссылка на контейнер, который скроллится |
|
|
712
|
+
| `scrollEndRef` | `RefObject<HTMLDivElement> \| undefined` | — | Ссылка на элемент, обозначающий самый конец прокручиваемого списка |
|
|
713
|
+
| `segments` | `SegmentControlProps` | — | Сегменты для фильтрации |
|
|
714
|
+
| `settings` | `NotificationPanelSettingsProps` | — | Кнопка настроек и выпадающий список |
|
|
715
|
+
| `skeletonsAmount` | `number \| undefined` | — | Количество скелетонов карточек для отображения при загрузке |
|
|
716
|
+
| `title` | `string` | — | Заголовок панели |
|
|
717
|
+
|
|
718
|
+
**NotificationPanelSettingsProps**
|
|
719
|
+
|
|
720
|
+
| Prop | Type | Default | Description |
|
|
721
|
+
|------|------|---------|-------------|
|
|
722
|
+
| `actions` | `Action` | — | Дополнительные действия панели |
|
|
723
|
+
| `button` | `ButtonProps` | — | Кнопка дополнительного действия панели |
|
|
724
|
+
| `size` | `"m"` \| `"s"` | — | |
|