@pushwoosh/dumb-components 1.1.135 → 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 +17 -11
- 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 +18 -10
- package/DateTimePicker/components/AutosizeInput/AutosizeInput.js +17 -13
- package/DateTimePicker/components/DatePicker/DatePicker.js +35 -32
- package/DateTimePicker/components/DatePickerField/DatePickerField.js +31 -24
- package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +22 -20
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +29 -24
- package/DateTimePicker/components/DecadeView/DecadeView.js +19 -17
- package/DateTimePicker/components/Input/Input.js +2 -2
- package/DateTimePicker/components/Month/Month.js +51 -35
- 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/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 +25 -20
- 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 +55 -43
- package/EmailTemplatePreview/EmailTemplatePreview.js +10 -8
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +28 -22
- 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 +33 -19
- package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +2 -2
- package/Modal/components/ModalConfirm/ModalConfirmProvider.js +8 -6
- package/Modal/components/ModalTitle/ModalTitle.js +10 -8
- package/NotificationInbox/NotificationBar.js +19 -11
- package/NotificationInbox/NotificationBell.js +15 -12
- package/NotificationInbox/NotificationInbox.js +159 -118
- 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 +22 -15
- package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +20 -13
- 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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactElement, type PropsWithChildren } from 'react';
|
|
2
2
|
import type { ModalConfirmContextProps } from './types';
|
|
3
|
-
export declare const ModalConfirmContext:
|
|
3
|
+
export declare const ModalConfirmContext: import("react").Context<ModalConfirmContextProps | null>;
|
|
4
4
|
export declare function ModalConfirmProvider(props: PropsWithChildren): ReactElement;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, createContext } from 'react';
|
|
2
3
|
import { ModalConfirm } from './ModalConfirm';
|
|
3
4
|
export const ModalConfirmContext = createContext(null);
|
|
4
5
|
export function ModalConfirmProvider(props) {
|
|
@@ -27,9 +28,10 @@ export function ModalConfirmProvider(props) {
|
|
|
27
28
|
closeModalConfirm
|
|
28
29
|
};
|
|
29
30
|
}, []);
|
|
30
|
-
return
|
|
31
|
-
value: contextValue
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
return _jsxs(ModalConfirmContext.Provider, {
|
|
32
|
+
value: contextValue,
|
|
33
|
+
children: [children, _jsx(ModalConfirm, {
|
|
34
|
+
...modalConfirmParams
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
35
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CloseIcon } from '@pushwoosh/kit-icons';
|
|
3
3
|
import { ModalTitleBox } from './styles';
|
|
4
4
|
import { GhostButton } from '../../../Button';
|
|
@@ -8,11 +8,13 @@ export function ModalTitle(props) {
|
|
|
8
8
|
onClose,
|
|
9
9
|
...rest
|
|
10
10
|
} = props;
|
|
11
|
-
return
|
|
12
|
-
...rest
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
return _jsxs(ModalTitleBox, {
|
|
12
|
+
...rest,
|
|
13
|
+
children: [children, onClose && _jsx(GhostButton, {
|
|
14
|
+
onClick: onClose,
|
|
15
|
+
children: _jsx(CloseIcon, {
|
|
16
|
+
size: "medium"
|
|
17
|
+
})
|
|
18
|
+
})]
|
|
19
|
+
});
|
|
18
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
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
4
|
import { NotificationBarButton, NotificationBarIcon, NotificationBarBadge, NotificationBarText, NotificationBarBadgeText } from './styles';
|
|
@@ -28,18 +28,26 @@ export function NotificationBar({
|
|
|
28
28
|
if (type === 'no-notifications') return Color.MAIN;
|
|
29
29
|
return Color.CLEAR;
|
|
30
30
|
};
|
|
31
|
-
return
|
|
31
|
+
return _jsxs(NotificationBarButton, {
|
|
32
32
|
"$type": type,
|
|
33
33
|
"$isOpened": isOpened,
|
|
34
34
|
"$read": read,
|
|
35
35
|
onClick: onClick,
|
|
36
|
-
type: "button"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
type: "button",
|
|
37
|
+
children: [_jsx(NotificationBarIcon, {
|
|
38
|
+
children: _jsx(NotificationIcon, {
|
|
39
|
+
type: "enabled",
|
|
40
|
+
size: "small",
|
|
41
|
+
view: getIconView(isOpened, shouldUseFilledIcon, hasNotifications),
|
|
42
|
+
color: getIconColor()
|
|
43
|
+
})
|
|
44
|
+
}), _jsx(NotificationBarText, {
|
|
45
|
+
children: "Notification center"
|
|
46
|
+
}), hasNotifications && _jsx(NotificationBarBadge, {
|
|
47
|
+
children: _jsx(NotificationBarBadgeText, {
|
|
48
|
+
"$variant": "h5",
|
|
49
|
+
children: count
|
|
50
|
+
})
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
45
53
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
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
4
|
import { useLang } from './polyglot';
|
|
@@ -18,7 +18,7 @@ export function NotificationBell({
|
|
|
18
18
|
if (severity === 'warning') return Color.WARNING;
|
|
19
19
|
return Color.PRIMARY;
|
|
20
20
|
};
|
|
21
|
-
return
|
|
21
|
+
return _jsxs(NotificationBellButton, {
|
|
22
22
|
"$isOpened": isOpened,
|
|
23
23
|
onClick: onClick,
|
|
24
24
|
type: "button",
|
|
@@ -26,14 +26,17 @@ export function NotificationBell({
|
|
|
26
26
|
message: 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD'
|
|
27
27
|
}) : lang({
|
|
28
28
|
message: 'DUMB.NOTIFICATION_INBOX.TITLE'
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
+
});
|
|
39
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';
|
|
@@ -49,122 +50,162 @@ export function NotificationInbox({
|
|
|
49
50
|
setShowExpandMap(newMap);
|
|
50
51
|
}, [notifications]);
|
|
51
52
|
if (notifications.length === 0 && !isLoading) {
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
+
});
|
|
78
88
|
}
|
|
79
|
-
return
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
+
});
|
|
170
211
|
}
|
|
@@ -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
|
}
|