@pushwoosh/dumb-components 1.1.134 → 1.1.136
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/AccessForbidden/AccessForbidden.js +19 -5
- package/AccessForbidden/polyglot/index.d.ts +2 -0
- package/AccessForbidden/polyglot/index.js +10 -0
- package/AccessForbidden/polyglot/messages_en.d.ts +3 -0
- package/AccessForbidden/polyglot/messages_en.js +4 -0
- package/AccessForbidden/polyglot/messages_ru.d.ts +3 -0
- package/AccessForbidden/polyglot/messages_ru.js +4 -0
- package/AccessForbidden/polyglot/types.d.ts +5 -0
- package/AccessForbidden/polyglot/types.js +1 -0
- package/Alert/Alert.d.ts +1 -2
- package/Alert/Alert.js +31 -25
- package/ApplicationPreloader/ApplicationPreloader.d.ts +1 -2
- package/ApplicationPreloader/ApplicationPreloader.js +5 -4
- package/Badge/Badge.js +2 -2
- package/Banner/Banner.js +40 -24
- package/Button/Button.js +20 -9
- package/Button/RemoveButton.js +7 -6
- package/Calendar/CalendarDropdown/CalendarDropdown.js +121 -108
- package/Calendar/CalendarMonth/CalendarMonth.js +68 -66
- package/Calendar/CalendarMonthSlider/CalendarMonthSlider.d.ts +2 -2
- package/Calendar/CalendarMonthSlider/CalendarMonthSlider.js +68 -55
- package/Calendar/CalendarSuperForm/CalendarSuperForm.js +75 -70
- package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.d.ts +2 -2
- package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.js +3 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +106 -88
- package/Calendar/CalendarSuperForm/components/CalendarTimeInput.d.ts +1 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimeInput.js +2 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimezoneSelect.js +3 -2
- package/CardMetric/CardChildren.js +9 -6
- package/CardMetric/CardCollapse.js +8 -6
- package/CardMetric/CardMetric.js +52 -33
- package/Checkbox/Checkbox.js +30 -24
- package/Chip/Chip.d.ts +6 -7
- package/Chip/Chip.js +22 -15
- package/CodeEditor/CodeEditor.d.ts +1 -2
- package/CodeEditor/CodeEditor.js +2 -2
- package/CrashScreen/CrashScreen.js +19 -6
- package/CrashScreen/polyglot/index.d.ts +2 -0
- package/CrashScreen/polyglot/index.js +10 -0
- package/CrashScreen/polyglot/messages_en.d.ts +3 -0
- package/CrashScreen/polyglot/messages_en.js +4 -0
- package/CrashScreen/polyglot/messages_ru.d.ts +3 -0
- package/CrashScreen/polyglot/messages_ru.js +4 -0
- package/CrashScreen/polyglot/types.d.ts +5 -0
- package/CrashScreen/polyglot/types.js +1 -0
- package/DateTimePicker/components/AutosizeInput/AutosizeInput.js +17 -13
- package/DateTimePicker/components/DatePicker/DatePicker.js +35 -32
- package/DateTimePicker/components/DatePickerField/DatePickerField.js +32 -22
- package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +22 -20
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +30 -22
- package/DateTimePicker/components/DecadeView/DecadeView.js +19 -17
- package/DateTimePicker/components/Input/Input.js +2 -2
- package/DateTimePicker/components/Month/Month.js +52 -21
- package/DateTimePicker/components/MonthView/MonthView.js +21 -17
- package/DateTimePicker/components/NumberPicker/NumberPicker.js +49 -40
- package/DateTimePicker/components/PickerPlate/PickerPlate.js +17 -14
- package/DateTimePicker/components/YearView/YearView.js +22 -18
- package/DateTimePicker/polyglot/index.d.ts +2 -0
- package/DateTimePicker/polyglot/index.js +9 -0
- package/DateTimePicker/polyglot/messages_en.d.ts +3 -0
- package/DateTimePicker/polyglot/messages_en.js +11 -0
- package/DateTimePicker/polyglot/messages_ru.d.ts +3 -0
- package/DateTimePicker/polyglot/messages_ru.js +11 -0
- package/DateTimePicker/polyglot/types.d.ts +12 -0
- package/DateTimePicker/polyglot/types.js +1 -0
- package/Drawer/components/Drawer/Drawer.js +18 -13
- package/Drawer/components/Drawer/styles.d.ts +2 -2
- package/Drawer/components/Drawer/styles.js +5 -4
- package/Drawer/components/DrawerDocs/DrawerDocs.js +28 -17
- package/Drawer/polyglot/index.d.ts +2 -0
- package/Drawer/polyglot/index.js +10 -0
- package/Drawer/polyglot/messages_en.d.ts +3 -0
- package/Drawer/polyglot/messages_en.js +4 -0
- package/Drawer/polyglot/messages_ru.d.ts +3 -0
- package/Drawer/polyglot/messages_ru.js +4 -0
- package/Drawer/polyglot/types.d.ts +5 -0
- package/Drawer/polyglot/types.js +1 -0
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +28 -24
- package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +8 -6
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +6 -4
- package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.js +13 -10
- package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.js +40 -31
- package/EditableField/EditableField.js +56 -39
- package/EditableField/polyglot/index.d.ts +2 -0
- package/EditableField/polyglot/index.js +9 -0
- package/EditableField/polyglot/messages_en.d.ts +3 -0
- package/EditableField/polyglot/messages_en.js +4 -0
- package/EditableField/polyglot/messages_ru.d.ts +3 -0
- package/EditableField/polyglot/messages_ru.js +4 -0
- package/EditableField/polyglot/types.d.ts +5 -0
- package/EditableField/polyglot/types.js +1 -0
- package/EmailTemplatePreview/EmailTemplatePreview.js +10 -8
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +30 -16
- package/EmailTemplatePreview/polyglot/index.d.ts +2 -0
- package/EmailTemplatePreview/polyglot/index.js +10 -0
- package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_en.js +5 -0
- package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_ru.js +5 -0
- package/EmailTemplatePreview/polyglot/types.d.ts +6 -0
- package/EmailTemplatePreview/polyglot/types.js +1 -0
- package/EnhancedInput/EnhancedInput.d.ts +3 -4
- package/EnhancedInput/EnhancedInput.js +14 -10
- package/EnhancedInput/SearchInput.js +3 -3
- package/ExportResult/ExportResult.js +33 -23
- package/ExternalImagePreview/ExternalImagePreview.js +24 -20
- package/FieldBox/FieldBox.js +50 -37
- package/FrequencyCapping/FrequencyCappingEdit.js +41 -33
- package/FrequencyCapping/FrequencyCappingInApps.js +41 -33
- package/FrequencyCapping/FrequencyCappingReadonly.d.ts +1 -2
- package/FrequencyCapping/FrequencyCappingReadonly.js +24 -20
- package/FrequencyCapping/components/Condition/index.d.ts +1 -2
- package/FrequencyCapping/components/Condition/index.js +24 -20
- package/FrequencyCapping/components/Description/index.d.ts +2 -2
- package/FrequencyCapping/components/Description/index.js +7 -5
- package/FrequencyCapping/components/Settings/EditCappingSettings.js +28 -20
- package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +86 -71
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +1 -2
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +41 -32
- package/GetStartedPage/GetStartedPage.js +44 -25
- package/InputFile/InputFile.js +44 -35
- package/Link/Link.js +2 -2
- package/Modal/components/Modal/Modal.js +17 -12
- package/Modal/components/Modal/styles.js +5 -4
- package/Modal/components/ModalConfirm/ModalConfirm.js +51 -24
- package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +2 -2
- package/Modal/components/ModalConfirm/ModalConfirmProvider.js +8 -6
- package/Modal/components/ModalConfirm/types.d.ts +1 -1
- package/Modal/components/ModalTitle/ModalTitle.js +10 -8
- package/Modal/polyglot/index.d.ts +2 -0
- package/Modal/polyglot/index.js +9 -0
- package/Modal/polyglot/messages_en.d.ts +3 -0
- package/Modal/polyglot/messages_en.js +6 -0
- package/Modal/polyglot/messages_ru.d.ts +3 -0
- package/Modal/polyglot/messages_ru.js +6 -0
- package/Modal/polyglot/types.d.ts +7 -0
- package/Modal/polyglot/types.js +1 -0
- package/NotificationInbox/NotificationBar.js +19 -11
- package/NotificationInbox/NotificationBell.js +21 -12
- package/NotificationInbox/NotificationInbox.js +160 -105
- package/NotificationInbox/polyglot/index.d.ts +2 -0
- package/NotificationInbox/polyglot/index.js +10 -0
- package/NotificationInbox/polyglot/messages_en.d.ts +3 -0
- package/NotificationInbox/polyglot/messages_en.js +8 -0
- package/NotificationInbox/polyglot/messages_ru.d.ts +3 -0
- package/NotificationInbox/polyglot/messages_ru.js +8 -0
- package/NotificationInbox/polyglot/types.d.ts +11 -0
- package/NotificationInbox/polyglot/types.js +1 -0
- package/NumberPicker/NumberPicker.js +53 -44
- package/NumberPicker/components/AutosizeInput/AutosizeInput.js +19 -15
- package/PageHeader/components/AutosizeInput/AutosizeInput.js +30 -22
- package/PageHeader/components/PageHeader/PageHeader.js +44 -27
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +51 -34
- package/PageHeader/components/PageHeaderError/PageHeaderError.js +17 -10
- package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +20 -16
- package/Pagination/Pagination.js +60 -49
- package/Popover/Popover.js +6 -5
- package/ProgressBar/ProgressBar.js +25 -10
- package/PushPreview/PushPreview.js +30 -22
- package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +23 -11
- package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +20 -13
- package/PushPreview/polyglot/index.d.ts +2 -0
- package/PushPreview/polyglot/index.js +9 -0
- package/PushPreview/polyglot/messages_en.d.ts +3 -0
- package/PushPreview/polyglot/messages_en.js +4 -0
- package/PushPreview/polyglot/messages_ru.d.ts +3 -0
- package/PushPreview/polyglot/messages_ru.js +4 -0
- package/PushPreview/polyglot/types.d.ts +5 -0
- package/PushPreview/polyglot/types.js +1 -0
- package/Radio/Radio.js +32 -26
- package/RadioCard/RadioCard.js +17 -9
- package/ReCaptcha/ReCaptcha.js +2 -2
- package/RichMessageEditor/EditorEmojiPicker.js +9 -7
- package/RichMessageEditor/RichMessageEditor.js +77 -67
- package/RichMessageEditor/RichMessageViewer.js +19 -13
- package/RichMessageEditor/slate/DynamicContentElement.d.ts +1 -2
- package/RichMessageEditor/slate/DynamicContentElement.js +13 -9
- package/RichMessageEditor/slate/SlateEditor.js +9 -7
- package/RichmediaPreview/RichmediaPreview.js +13 -11
- package/Select/Select.js +10 -8
- package/SendRate/SendRateEdit.d.ts +1 -2
- package/SendRate/SendRateEdit.js +42 -34
- package/SendRate/SendRateReadonly.d.ts +1 -2
- package/SendRate/SendRateReadonly.js +24 -20
- package/SendRate/components/Condition/index.d.ts +1 -2
- package/SendRate/components/Condition/index.js +15 -13
- package/SendRate/components/Description/index.d.ts +2 -2
- package/SendRate/components/Description/index.js +30 -22
- package/SendRate/components/Settings/index.d.ts +1 -2
- package/SendRate/components/Settings/index.js +20 -14
- package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +1 -2
- package/SendRate/helpers/getReadonlySendRateHelpers.js +39 -30
- package/Skeleton/TextSkeleton.js +5 -4
- package/SortButton/SortButton.js +11 -7
- package/Spinner/Spinner.js +7 -4
- package/StatisticCard/StatisticCard.js +44 -29
- package/Switch/Switch.js +16 -13
- package/Tabs/components/Tab/Tab.d.ts +3 -4
- package/Tabs/components/Tab/Tab.js +6 -4
- package/Tabs/components/TabBar/TabBar.d.ts +3 -4
- package/Tabs/components/TabBar/TabBar.js +12 -4
- package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts +1 -2
- package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.js +27 -21
- package/Tabs/components/TabBase/TabBase.d.ts +3 -4
- package/Tabs/components/TabBase/TabBase.js +11 -6
- package/Tabs/components/TabPanel/TabPanel.js +4 -2
- package/Tabs/components/Tabs/Tabs.js +8 -4
- package/Toast/Toast.js +31 -18
- package/Toast/ToastProvider.d.ts +2 -3
- package/Toast/ToastProvider.js +10 -8
- package/Tooltip/Tooltip.js +2 -2
- package/Tooltip/TooltipTrigger.js +13 -11
- package/package.json +2 -2
- package/polyglot/__tests__/render.test.js +46 -16
- package/polyglot/liquid/render.d.ts +2 -2
- package/polyglot/liquid/render.js +7 -6
- package/polyglot/react.js +7 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { NotificationIcon } from '@pushwoosh/kit-icons';
|
|
4
|
+
import { useLang } from './polyglot';
|
|
4
5
|
import { NotificationBellButton, NotificationBellBadge, NotificationBellBadgeDot } from './styles';
|
|
5
6
|
export function NotificationBell({
|
|
6
7
|
count = 0,
|
|
@@ -8,6 +9,7 @@ export function NotificationBell({
|
|
|
8
9
|
isOpened = false,
|
|
9
10
|
onClick
|
|
10
11
|
}) {
|
|
12
|
+
const lang = useLang();
|
|
11
13
|
const hasNotifications = count > 0;
|
|
12
14
|
const showBadge = hasNotifications || severity;
|
|
13
15
|
const getBadgeColor = () => {
|
|
@@ -16,18 +18,25 @@ export function NotificationBell({
|
|
|
16
18
|
if (severity === 'warning') return Color.WARNING;
|
|
17
19
|
return Color.PRIMARY;
|
|
18
20
|
};
|
|
19
|
-
return
|
|
21
|
+
return _jsxs(NotificationBellButton, {
|
|
20
22
|
"$isOpened": isOpened,
|
|
21
23
|
onClick: onClick,
|
|
22
24
|
type: "button",
|
|
23
|
-
"aria-label": hasNotifications ?
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
"aria-label": hasNotifications ? lang({
|
|
26
|
+
message: 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD'
|
|
27
|
+
}) : lang({
|
|
28
|
+
message: 'DUMB.NOTIFICATION_INBOX.TITLE'
|
|
29
|
+
}),
|
|
30
|
+
children: [_jsx(NotificationIcon, {
|
|
31
|
+
size: "medium",
|
|
32
|
+
type: "enabled",
|
|
33
|
+
view: isOpened ? 'filled' : 'lined',
|
|
34
|
+
color: "currentColor"
|
|
35
|
+
}), showBadge && _jsx(NotificationBellBadge, {
|
|
36
|
+
children: _jsx(NotificationBellBadgeDot, {
|
|
37
|
+
"$color": getBadgeColor(),
|
|
38
|
+
"$isDot": true
|
|
39
|
+
})
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
33
42
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useLayoutEffect, useCallback } from 'react';
|
|
2
3
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
4
|
import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
4
5
|
import { Text } from '@pushwoosh/kit-typography';
|
|
@@ -8,6 +9,7 @@ import { useInfiniteScroll } from './useInfiniteScroll';
|
|
|
8
9
|
import { Badge } from '../Badge';
|
|
9
10
|
import { Spinner } from '../Spinner';
|
|
10
11
|
import emptyNotificationsIcon from './assets/EmptyNotifications.svg?url';
|
|
12
|
+
import { Lang } from './polyglot';
|
|
11
13
|
import { NotificationInboxContainer, NotificationInboxHeader, NotificationInboxTitle, NotificationInboxList, NotificationItem, NotificationIndicator, NotificationHeader, NotificationDescription, NotificationActionLink, NotificationInboxEmptyIcon, NotificationInboxEmptyText } from './styles';
|
|
12
14
|
export function NotificationInbox({
|
|
13
15
|
notifications,
|
|
@@ -48,109 +50,162 @@ export function NotificationInbox({
|
|
|
48
50
|
setShowExpandMap(newMap);
|
|
49
51
|
}, [notifications]);
|
|
50
52
|
if (notifications.length === 0 && !isLoading) {
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
53
|
+
return _jsxs(NotificationInboxContainer, {
|
|
54
|
+
children: [_jsx(NotificationInboxHeader, {
|
|
55
|
+
children: _jsx(NotificationInboxTitle, {
|
|
56
|
+
"$variant": "h4",
|
|
57
|
+
"$color": Color.MAIN,
|
|
58
|
+
children: _jsx(Lang, {
|
|
59
|
+
message: "DUMB.NOTIFICATION_INBOX.TITLE"
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
}), _jsxs(Vertical, {
|
|
63
|
+
"$alignItems": "center",
|
|
64
|
+
"$gap": 24,
|
|
65
|
+
"$padding": "24px",
|
|
66
|
+
children: [_jsx(NotificationInboxEmptyIcon, {
|
|
67
|
+
alt: emptyStateTitle,
|
|
68
|
+
src: emptyNotificationsIcon
|
|
69
|
+
}), _jsxs(Vertical, {
|
|
70
|
+
"$alignItems": "center",
|
|
71
|
+
"$gap": 6,
|
|
72
|
+
"$padding": "24px",
|
|
73
|
+
"$justifyContent": "center",
|
|
74
|
+
"$justifyItems": "center",
|
|
75
|
+
"$alignContent": "center",
|
|
76
|
+
children: [_jsx(NotificationInboxEmptyText, {
|
|
77
|
+
"$variant": "h4",
|
|
78
|
+
"$color": Color.LOCKED,
|
|
79
|
+
children: emptyStateTitle
|
|
80
|
+
}), _jsx(NotificationInboxEmptyText, {
|
|
81
|
+
"$variant": "footnote",
|
|
82
|
+
"$color": Color.LOCKED,
|
|
83
|
+
children: emptyStateDescription
|
|
84
|
+
})]
|
|
85
|
+
})]
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
75
88
|
}
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
89
|
+
return _jsxs(NotificationInboxContainer, {
|
|
90
|
+
children: [_jsx(NotificationInboxHeader, {
|
|
91
|
+
children: _jsxs(NotificationInboxTitle, {
|
|
92
|
+
"$variant": "h4",
|
|
93
|
+
"$color": Color.MAIN,
|
|
94
|
+
children: [_jsx("span", {
|
|
95
|
+
children: _jsx(Lang, {
|
|
96
|
+
message: "DUMB.NOTIFICATION_INBOX.TITLE"
|
|
97
|
+
})
|
|
98
|
+
}), unreadCount > 0 && _jsxs(_Fragment, {
|
|
99
|
+
children: [' ', _jsx(Text, {
|
|
100
|
+
"$variant": "h4",
|
|
101
|
+
"$color": Color.LOCKED,
|
|
102
|
+
children: _jsx(Lang, {
|
|
103
|
+
message: "DUMB.NOTIFICATION_INBOX.UNREAD",
|
|
104
|
+
count: unreadCount
|
|
105
|
+
})
|
|
106
|
+
})]
|
|
107
|
+
})]
|
|
108
|
+
})
|
|
109
|
+
}), _jsxs(NotificationInboxList, {
|
|
110
|
+
"data-notification-list": true,
|
|
111
|
+
children: [notifications.map(notification => {
|
|
112
|
+
const isRead = notification.isRead ?? false;
|
|
113
|
+
const badgeColor = badgeColorMap[notification.severity] || 'gray';
|
|
114
|
+
const showExpandButton = showExpandMap[notification.id] ?? false;
|
|
115
|
+
return _jsxs(NotificationItem, {
|
|
116
|
+
onClick: () => handleNotificationClick(notification),
|
|
117
|
+
children: [_jsx(NotificationIndicator, {
|
|
118
|
+
"$isRead": isRead
|
|
119
|
+
}), _jsxs(Vertical, {
|
|
120
|
+
"$gap": 8,
|
|
121
|
+
children: [_jsxs(Vertical, {
|
|
122
|
+
children: [_jsxs(NotificationHeader, {
|
|
123
|
+
children: [_jsxs(Horizontal, {
|
|
124
|
+
"$gap": 4,
|
|
125
|
+
"$alignItems": "center",
|
|
126
|
+
children: [_jsx(Text, {
|
|
127
|
+
"$variant": "footnote",
|
|
128
|
+
"$color": Color.LOCKED,
|
|
129
|
+
children: formatTimestamp(notification.timestamp)
|
|
130
|
+
}), notification.projectName && _jsxs(_Fragment, {
|
|
131
|
+
children: [_jsx(Text, {
|
|
132
|
+
"$color": Color.LOCKED,
|
|
133
|
+
children: "\u2022"
|
|
134
|
+
}), _jsx(Text, {
|
|
135
|
+
"$variant": "footnote",
|
|
136
|
+
"$color": Color.LOCKED,
|
|
137
|
+
children: notification.projectName
|
|
138
|
+
})]
|
|
139
|
+
})]
|
|
140
|
+
}), (notification.severity === 'critical' || notification.severity === 'warning') && _jsx(Badge, {
|
|
141
|
+
color: badgeColor,
|
|
142
|
+
isSaturated: false,
|
|
143
|
+
children: notification.severity.toUpperCase()
|
|
144
|
+
})]
|
|
145
|
+
}), _jsx(Text, {
|
|
146
|
+
"$variant": "h4",
|
|
147
|
+
"$color": Color.MAIN,
|
|
148
|
+
children: notification.title
|
|
149
|
+
}), notification.description && _jsx(NotificationDescription, {
|
|
150
|
+
as: "div",
|
|
151
|
+
ref: element => descriptionRefs.current[notification.id] = element || null,
|
|
152
|
+
"$variant": "standard",
|
|
153
|
+
"$color": Color.MAIN,
|
|
154
|
+
"$visibleLines": VISIBLE_LINES,
|
|
155
|
+
"$expanded": expandedId === notification.id,
|
|
156
|
+
children: notification.description
|
|
157
|
+
})]
|
|
158
|
+
}), (notification.actionButton || showExpandButton) && _jsxs(Horizontal, {
|
|
159
|
+
"$alignItems": "center",
|
|
160
|
+
"$justifyContent": "start",
|
|
161
|
+
"$gap": 12,
|
|
162
|
+
children: [notification.actionButton && _jsx(NotificationActionLink, {
|
|
163
|
+
"$isPrimary": true,
|
|
164
|
+
onClick: e => {
|
|
165
|
+
var _notification$actionB;
|
|
166
|
+
e.stopPropagation();
|
|
167
|
+
(_notification$actionB = notification.actionButton) === null || _notification$actionB === void 0 || _notification$actionB.onClick();
|
|
168
|
+
},
|
|
169
|
+
children: notification.actionButton.label
|
|
170
|
+
}), showExpandButton && _jsx(NotificationActionLink, {
|
|
171
|
+
onClick: e => {
|
|
172
|
+
e.stopPropagation();
|
|
173
|
+
setExpandedId(prev => prev === notification.id ? null : notification.id);
|
|
174
|
+
},
|
|
175
|
+
children: expandedId === notification.id ? _jsx(Lang, {
|
|
176
|
+
message: "DUMB.NOTIFICATION_INBOX.COLLAPSE"
|
|
177
|
+
}) : _jsx(Lang, {
|
|
178
|
+
message: "DUMB.NOTIFICATION_INBOX.EXPAND"
|
|
179
|
+
})
|
|
180
|
+
})]
|
|
181
|
+
})]
|
|
182
|
+
})]
|
|
183
|
+
}, notification.id);
|
|
184
|
+
}), hasMore && isLoading && _jsxs(Horizontal, {
|
|
185
|
+
ref: loadMoreRef,
|
|
186
|
+
"$alignItems": "center",
|
|
187
|
+
"$justifyContent": "center",
|
|
188
|
+
"$padding": 16,
|
|
189
|
+
"$gap": 8,
|
|
190
|
+
children: [_jsx(Spinner, {
|
|
191
|
+
size: "small",
|
|
192
|
+
color: Color.LOCKED
|
|
193
|
+
}), _jsx(Text, {
|
|
194
|
+
"$variant": "footnote",
|
|
195
|
+
"$color": Color.LOCKED,
|
|
196
|
+
children: _jsx(Lang, {
|
|
197
|
+
message: "DUMB.NOTIFICATION_INBOX.LOADING_MORE"
|
|
198
|
+
})
|
|
199
|
+
})]
|
|
200
|
+
}), isLoading && notifications.length === 0 && !hasMore && _jsx(Horizontal, {
|
|
201
|
+
"$justifyContent": "center",
|
|
202
|
+
"$alignItems": "center",
|
|
203
|
+
"$padding": "16px 0",
|
|
204
|
+
children: _jsx(Spinner, {
|
|
205
|
+
size: "medium",
|
|
206
|
+
color: Color.LOCKED
|
|
207
|
+
})
|
|
208
|
+
})]
|
|
209
|
+
})]
|
|
210
|
+
});
|
|
156
211
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'DUMB.NOTIFICATION_INBOX.TITLE': 'Notifications',
|
|
3
|
+
'DUMB.NOTIFICATION_INBOX.UNREAD': '{{count}} unread',
|
|
4
|
+
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Collapse',
|
|
5
|
+
'DUMB.NOTIFICATION_INBOX.EXPAND': 'Expand',
|
|
6
|
+
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Loading more…',
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'You have unread notifications'
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'DUMB.NOTIFICATION_INBOX.TITLE': 'Уведомления',
|
|
3
|
+
'DUMB.NOTIFICATION_INBOX.UNREAD': '{{count}} {{count | pluralize: "непрочитанное", "непрочитанных", "непрочитанных"}}',
|
|
4
|
+
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Свернуть',
|
|
5
|
+
'DUMB.NOTIFICATION_INBOX.EXPAND': 'Развернуть',
|
|
6
|
+
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Загрузка…',
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Есть непрочитанные уведомления'
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NoParams } from '../../polyglot';
|
|
2
|
+
export type NotificationInboxMessages = {
|
|
3
|
+
'DUMB.NOTIFICATION_INBOX.TITLE': NoParams;
|
|
4
|
+
'DUMB.NOTIFICATION_INBOX.UNREAD': {
|
|
5
|
+
count: number;
|
|
6
|
+
};
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.COLLAPSE': NoParams;
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.EXPAND': NoParams;
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': NoParams;
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': NoParams;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect } from 'react';
|
|
2
3
|
import { Vertical, useMount, usePersistentFunction } from '@pushwoosh/kit-helpers';
|
|
3
4
|
import { ChevronIcon } from '@pushwoosh/kit-icons';
|
|
4
5
|
import { AutosizeInput } from './components/AutosizeInput';
|
|
@@ -77,50 +78,58 @@ export function NumberPicker({
|
|
|
77
78
|
};
|
|
78
79
|
const resetAutoDiff = () => setAutoDiff(0);
|
|
79
80
|
const InputComponent = autoSize ? AutosizeInput : InputStyled;
|
|
80
|
-
return
|
|
81
|
+
return _jsxs(SingleInputFrame, {
|
|
81
82
|
ref: ref,
|
|
82
83
|
"$hasHint": !!hint,
|
|
83
|
-
"$isDisabled": isDisabled
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
"$isDisabled": isDisabled,
|
|
85
|
+
children: [_jsx(InputComponent, {
|
|
86
|
+
value: localValue,
|
|
87
|
+
placeholder: placeholder,
|
|
88
|
+
isDisabled: isDisabled,
|
|
89
|
+
disabled: isDisabled,
|
|
90
|
+
onChange: handleChange,
|
|
91
|
+
onKeyDown: handleKeyDown,
|
|
92
|
+
onKeyUp: resetAutoDiff,
|
|
93
|
+
onBlur: event => {
|
|
94
|
+
if (!event.target.value && value === undefined) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
let blurValue = intVal(event.target.value);
|
|
98
|
+
const minValueValid = minValue === undefined || blurValue >= minValue;
|
|
99
|
+
const maxValueValid = maxValue === undefined || blurValue <= maxValue;
|
|
100
|
+
if (!maxValueValid) {
|
|
101
|
+
blurValue = maxValue;
|
|
102
|
+
} else if (!minValueValid) {
|
|
103
|
+
blurValue = minValue;
|
|
104
|
+
}
|
|
105
|
+
onChange(blurValue);
|
|
106
|
+
setLocalValue(`${blurValue}`);
|
|
95
107
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
onMouseUp: resetAutoDiff,
|
|
124
|
-
onMouseLeave: resetAutoDiff
|
|
125
|
-
}))));
|
|
108
|
+
}), hint && _jsx(Hint, {
|
|
109
|
+
children: hint
|
|
110
|
+
}), _jsxs(Vertical, {
|
|
111
|
+
"$gap": 1,
|
|
112
|
+
children: [_jsx("div", {
|
|
113
|
+
children: _jsx(ChevronIcon, {
|
|
114
|
+
direction: "up",
|
|
115
|
+
size: "small",
|
|
116
|
+
"aria-disabled": "true",
|
|
117
|
+
onClick: () => onChangeDiff(step),
|
|
118
|
+
onMouseDown: () => setAutoDiff(step),
|
|
119
|
+
onMouseUp: resetAutoDiff,
|
|
120
|
+
onMouseLeave: resetAutoDiff
|
|
121
|
+
})
|
|
122
|
+
}), _jsx("div", {
|
|
123
|
+
children: _jsx(ChevronIcon, {
|
|
124
|
+
size: "small",
|
|
125
|
+
direction: "down",
|
|
126
|
+
"aria-disabled": isDisabled,
|
|
127
|
+
onClick: () => onChangeDiff(-1 * step),
|
|
128
|
+
onMouseDown: () => setAutoDiff(-1 * step),
|
|
129
|
+
onMouseUp: resetAutoDiff,
|
|
130
|
+
onMouseLeave: resetAutoDiff
|
|
131
|
+
})
|
|
132
|
+
})]
|
|
133
|
+
})]
|
|
134
|
+
});
|
|
126
135
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect } from 'react';
|
|
2
3
|
import { minimalWidth } from './constants';
|
|
3
4
|
import { Hidden } from './styles';
|
|
4
5
|
import { InputStyled } from '../../styles';
|
|
@@ -20,18 +21,21 @@ export function AutosizeInput(props) {
|
|
|
20
21
|
} = hiddenRef.current;
|
|
21
22
|
setWidth(hiddenWidth + minimalWidth);
|
|
22
23
|
}, [value]);
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
return _jsxs(_Fragment, {
|
|
25
|
+
children: [_jsx(InputStyled, {
|
|
26
|
+
style: {
|
|
27
|
+
width
|
|
28
|
+
},
|
|
29
|
+
value: value,
|
|
30
|
+
placeholder: placeholder,
|
|
31
|
+
disabled: isDisabled,
|
|
32
|
+
onChange: onChange,
|
|
33
|
+
onKeyUp: onKeyUp,
|
|
34
|
+
onKeyDown: onKeyDown,
|
|
35
|
+
onBlur: onBlur
|
|
36
|
+
}), _jsx(Hidden, {
|
|
37
|
+
ref: hiddenRef,
|
|
38
|
+
children: value || placeholder
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
37
41
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
3
|
import { EditIcon } from '@pushwoosh/kit-icons';
|
|
3
4
|
import { DEFAULT_EMPTY_VALUE, WIDTH_EMPTY_VALUE } from './constants';
|
|
4
5
|
import { RootBox, InputBox, InputStyled, PromptBox } from './styles';
|
|
@@ -56,25 +57,32 @@ export function AutosizeInput(props) {
|
|
|
56
57
|
return onComplete === null || onComplete === void 0 ? void 0 : onComplete(inputRef === null || inputRef === void 0 || (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.value);
|
|
57
58
|
}, 100);
|
|
58
59
|
};
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
60
|
+
return _jsxs(RootBox, {
|
|
61
|
+
children: [_jsxs(InputBox, {
|
|
62
|
+
children: [_jsx(InputStyled, {
|
|
63
|
+
ref: inputRef,
|
|
64
|
+
width: width,
|
|
65
|
+
value: value,
|
|
66
|
+
placeholder: placeholder,
|
|
67
|
+
onKeyDown: onKeyDown,
|
|
68
|
+
onChange: onChangeHandler,
|
|
69
|
+
onBlur: onBlur
|
|
70
|
+
}), _jsx("span", {
|
|
71
|
+
ref: hiddenValueRef,
|
|
72
|
+
children: value
|
|
73
|
+
}), _jsx("span", {
|
|
74
|
+
ref: hiddenPlaceholderRef,
|
|
75
|
+
children: placeholder
|
|
76
|
+
})]
|
|
77
|
+
}), _jsx(PromptBox, {
|
|
78
|
+
onClick: () => {
|
|
79
|
+
var _inputRef$current4;
|
|
80
|
+
return (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.focus();
|
|
81
|
+
},
|
|
82
|
+
children: _jsx(EditIcon, {
|
|
83
|
+
size: "small",
|
|
84
|
+
view: "filled"
|
|
85
|
+
})
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
80
88
|
}
|