@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.
Files changed (144) hide show
  1. package/AccessForbidden/AccessForbidden.js +17 -11
  2. package/Alert/Alert.d.ts +1 -2
  3. package/Alert/Alert.js +31 -25
  4. package/ApplicationPreloader/ApplicationPreloader.d.ts +1 -2
  5. package/ApplicationPreloader/ApplicationPreloader.js +5 -4
  6. package/Badge/Badge.js +2 -2
  7. package/Banner/Banner.js +40 -24
  8. package/Button/Button.js +20 -9
  9. package/Button/RemoveButton.js +7 -6
  10. package/Calendar/CalendarDropdown/CalendarDropdown.js +121 -108
  11. package/Calendar/CalendarMonth/CalendarMonth.js +68 -66
  12. package/Calendar/CalendarMonthSlider/CalendarMonthSlider.d.ts +2 -2
  13. package/Calendar/CalendarMonthSlider/CalendarMonthSlider.js +68 -55
  14. package/Calendar/CalendarSuperForm/CalendarSuperForm.js +75 -70
  15. package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.d.ts +2 -2
  16. package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.js +3 -2
  17. package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +106 -88
  18. package/Calendar/CalendarSuperForm/components/CalendarTimeInput.d.ts +1 -2
  19. package/Calendar/CalendarSuperForm/components/CalendarTimeInput.js +2 -2
  20. package/Calendar/CalendarSuperForm/components/CalendarTimezoneSelect.js +3 -2
  21. package/CardMetric/CardChildren.js +9 -6
  22. package/CardMetric/CardCollapse.js +8 -6
  23. package/CardMetric/CardMetric.js +52 -33
  24. package/Checkbox/Checkbox.js +30 -24
  25. package/Chip/Chip.d.ts +6 -7
  26. package/Chip/Chip.js +22 -15
  27. package/CodeEditor/CodeEditor.d.ts +1 -2
  28. package/CodeEditor/CodeEditor.js +2 -2
  29. package/CrashScreen/CrashScreen.js +18 -10
  30. package/DateTimePicker/components/AutosizeInput/AutosizeInput.js +17 -13
  31. package/DateTimePicker/components/DatePicker/DatePicker.js +35 -32
  32. package/DateTimePicker/components/DatePickerField/DatePickerField.js +31 -24
  33. package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +22 -20
  34. package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +29 -24
  35. package/DateTimePicker/components/DecadeView/DecadeView.js +19 -17
  36. package/DateTimePicker/components/Input/Input.js +2 -2
  37. package/DateTimePicker/components/Month/Month.js +51 -35
  38. package/DateTimePicker/components/MonthView/MonthView.js +21 -17
  39. package/DateTimePicker/components/NumberPicker/NumberPicker.js +49 -40
  40. package/DateTimePicker/components/PickerPlate/PickerPlate.js +17 -14
  41. package/DateTimePicker/components/YearView/YearView.js +22 -18
  42. package/Drawer/components/Drawer/Drawer.js +18 -13
  43. package/Drawer/components/Drawer/styles.d.ts +2 -2
  44. package/Drawer/components/Drawer/styles.js +5 -4
  45. package/Drawer/components/DrawerDocs/DrawerDocs.js +25 -20
  46. package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +28 -24
  47. package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +8 -6
  48. package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +6 -4
  49. package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.js +13 -10
  50. package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.js +40 -31
  51. package/EditableField/EditableField.js +55 -43
  52. package/EmailTemplatePreview/EmailTemplatePreview.js +10 -8
  53. package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +28 -22
  54. package/EnhancedInput/EnhancedInput.d.ts +3 -4
  55. package/EnhancedInput/EnhancedInput.js +14 -10
  56. package/EnhancedInput/SearchInput.js +3 -3
  57. package/ExportResult/ExportResult.js +33 -23
  58. package/ExternalImagePreview/ExternalImagePreview.js +24 -20
  59. package/FieldBox/FieldBox.js +50 -37
  60. package/FrequencyCapping/FrequencyCappingEdit.js +41 -33
  61. package/FrequencyCapping/FrequencyCappingInApps.js +41 -33
  62. package/FrequencyCapping/FrequencyCappingReadonly.d.ts +1 -2
  63. package/FrequencyCapping/FrequencyCappingReadonly.js +24 -20
  64. package/FrequencyCapping/components/Condition/index.d.ts +1 -2
  65. package/FrequencyCapping/components/Condition/index.js +24 -20
  66. package/FrequencyCapping/components/Description/index.d.ts +2 -2
  67. package/FrequencyCapping/components/Description/index.js +7 -5
  68. package/FrequencyCapping/components/Settings/EditCappingSettings.js +28 -20
  69. package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +86 -71
  70. package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +1 -2
  71. package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +41 -32
  72. package/GetStartedPage/GetStartedPage.js +44 -25
  73. package/InputFile/InputFile.js +44 -35
  74. package/Link/Link.js +2 -2
  75. package/Modal/components/Modal/Modal.js +17 -12
  76. package/Modal/components/Modal/styles.js +5 -4
  77. package/Modal/components/ModalConfirm/ModalConfirm.js +33 -19
  78. package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +2 -2
  79. package/Modal/components/ModalConfirm/ModalConfirmProvider.js +8 -6
  80. package/Modal/components/ModalTitle/ModalTitle.js +10 -8
  81. package/NotificationInbox/NotificationBar.js +19 -11
  82. package/NotificationInbox/NotificationBell.js +15 -12
  83. package/NotificationInbox/NotificationInbox.js +159 -118
  84. package/NumberPicker/NumberPicker.js +53 -44
  85. package/NumberPicker/components/AutosizeInput/AutosizeInput.js +19 -15
  86. package/PageHeader/components/AutosizeInput/AutosizeInput.js +30 -22
  87. package/PageHeader/components/PageHeader/PageHeader.js +44 -27
  88. package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +51 -34
  89. package/PageHeader/components/PageHeaderError/PageHeaderError.js +17 -10
  90. package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +20 -16
  91. package/Pagination/Pagination.js +60 -49
  92. package/Popover/Popover.js +6 -5
  93. package/ProgressBar/ProgressBar.js +25 -10
  94. package/PushPreview/PushPreview.js +30 -22
  95. package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +22 -15
  96. package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +20 -13
  97. package/Radio/Radio.js +32 -26
  98. package/RadioCard/RadioCard.js +17 -9
  99. package/ReCaptcha/ReCaptcha.js +2 -2
  100. package/RichMessageEditor/EditorEmojiPicker.js +9 -7
  101. package/RichMessageEditor/RichMessageEditor.js +77 -67
  102. package/RichMessageEditor/RichMessageViewer.js +19 -13
  103. package/RichMessageEditor/slate/DynamicContentElement.d.ts +1 -2
  104. package/RichMessageEditor/slate/DynamicContentElement.js +13 -9
  105. package/RichMessageEditor/slate/SlateEditor.js +9 -7
  106. package/RichmediaPreview/RichmediaPreview.js +13 -11
  107. package/Select/Select.js +10 -8
  108. package/SendRate/SendRateEdit.d.ts +1 -2
  109. package/SendRate/SendRateEdit.js +42 -34
  110. package/SendRate/SendRateReadonly.d.ts +1 -2
  111. package/SendRate/SendRateReadonly.js +24 -20
  112. package/SendRate/components/Condition/index.d.ts +1 -2
  113. package/SendRate/components/Condition/index.js +15 -13
  114. package/SendRate/components/Description/index.d.ts +2 -2
  115. package/SendRate/components/Description/index.js +30 -22
  116. package/SendRate/components/Settings/index.d.ts +1 -2
  117. package/SendRate/components/Settings/index.js +20 -14
  118. package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +1 -2
  119. package/SendRate/helpers/getReadonlySendRateHelpers.js +39 -30
  120. package/Skeleton/TextSkeleton.js +5 -4
  121. package/SortButton/SortButton.js +11 -7
  122. package/Spinner/Spinner.js +7 -4
  123. package/StatisticCard/StatisticCard.js +44 -29
  124. package/Switch/Switch.js +16 -13
  125. package/Tabs/components/Tab/Tab.d.ts +3 -4
  126. package/Tabs/components/Tab/Tab.js +6 -4
  127. package/Tabs/components/TabBar/TabBar.d.ts +3 -4
  128. package/Tabs/components/TabBar/TabBar.js +12 -4
  129. package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts +1 -2
  130. package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.js +27 -21
  131. package/Tabs/components/TabBase/TabBase.d.ts +3 -4
  132. package/Tabs/components/TabBase/TabBase.js +11 -6
  133. package/Tabs/components/TabPanel/TabPanel.js +4 -2
  134. package/Tabs/components/Tabs/Tabs.js +8 -4
  135. package/Toast/Toast.js +31 -18
  136. package/Toast/ToastProvider.d.ts +2 -3
  137. package/Toast/ToastProvider.js +10 -8
  138. package/Tooltip/Tooltip.js +2 -2
  139. package/Tooltip/TooltipTrigger.js +13 -11
  140. package/package.json +2 -2
  141. package/polyglot/__tests__/render.test.js +46 -16
  142. package/polyglot/liquid/render.d.ts +2 -2
  143. package/polyglot/liquid/render.js +7 -6
  144. package/polyglot/react.js +7 -5
@@ -1,4 +1,4 @@
1
- import React, { type ReactElement, type PropsWithChildren } from 'react';
1
+ import { type ReactElement, type PropsWithChildren } from 'react';
2
2
  import type { ModalConfirmContextProps } from './types';
3
- export declare const ModalConfirmContext: React.Context<ModalConfirmContextProps | null>;
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 React, { useState, useMemo, createContext } from 'react';
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 React.createElement(ModalConfirmContext.Provider, {
31
- value: contextValue
32
- }, children, React.createElement(ModalConfirm, {
33
- ...modalConfirmParams
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 React from 'react';
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 React.createElement(ModalTitleBox, {
12
- ...rest
13
- }, children, onClose && React.createElement(GhostButton, {
14
- onClick: onClose
15
- }, React.createElement(CloseIcon, {
16
- size: "medium"
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 React from 'react';
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 React.createElement(NotificationBarButton, {
31
+ return _jsxs(NotificationBarButton, {
32
32
  "$type": type,
33
33
  "$isOpened": isOpened,
34
34
  "$read": read,
35
35
  onClick: onClick,
36
- type: "button"
37
- }, React.createElement(NotificationBarIcon, null, React.createElement(NotificationIcon, {
38
- type: "enabled",
39
- size: "small",
40
- view: getIconView(isOpened, shouldUseFilledIcon, hasNotifications),
41
- color: getIconColor()
42
- })), React.createElement(NotificationBarText, null, "Notification center"), hasNotifications && React.createElement(NotificationBarBadge, null, React.createElement(NotificationBarBadgeText, {
43
- "$variant": "h5"
44
- }, count)));
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 React from 'react';
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 React.createElement(NotificationBellButton, {
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
- }, React.createElement(NotificationIcon, {
31
- size: "medium",
32
- type: "enabled",
33
- view: isOpened ? 'filled' : 'lined',
34
- color: "currentColor"
35
- }), showBadge && React.createElement(NotificationBellBadge, null, React.createElement(NotificationBellBadgeDot, {
36
- "$color": getBadgeColor(),
37
- "$isDot": true
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 React, { useRef, useState, useLayoutEffect, useCallback } from 'react';
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 React.createElement(NotificationInboxContainer, null, React.createElement(NotificationInboxHeader, null, React.createElement(NotificationInboxTitle, {
53
- "$variant": "h4",
54
- "$color": Color.MAIN
55
- }, React.createElement(Lang, {
56
- message: "DUMB.NOTIFICATION_INBOX.TITLE"
57
- }))), React.createElement(Vertical, {
58
- "$alignItems": "center",
59
- "$gap": 24,
60
- "$padding": "24px"
61
- }, React.createElement(NotificationInboxEmptyIcon, {
62
- alt: emptyStateTitle,
63
- src: emptyNotificationsIcon
64
- }), React.createElement(Vertical, {
65
- "$alignItems": "center",
66
- "$gap": 6,
67
- "$padding": "24px",
68
- "$justifyContent": "center",
69
- "$justifyItems": "center",
70
- "$alignContent": "center"
71
- }, React.createElement(NotificationInboxEmptyText, {
72
- "$variant": "h4",
73
- "$color": Color.LOCKED
74
- }, emptyStateTitle), React.createElement(NotificationInboxEmptyText, {
75
- "$variant": "footnote",
76
- "$color": Color.LOCKED
77
- }, emptyStateDescription))));
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 React.createElement(NotificationInboxContainer, null, React.createElement(NotificationInboxHeader, null, React.createElement(NotificationInboxTitle, {
80
- "$variant": "h4",
81
- "$color": Color.MAIN
82
- }, React.createElement("span", null, React.createElement(Lang, {
83
- message: "DUMB.NOTIFICATION_INBOX.TITLE"
84
- })), unreadCount > 0 && React.createElement(React.Fragment, null, ' ', React.createElement(Text, {
85
- "$variant": "h4",
86
- "$color": Color.LOCKED
87
- }, React.createElement(Lang, {
88
- message: "DUMB.NOTIFICATION_INBOX.UNREAD",
89
- count: unreadCount
90
- }))))), React.createElement(NotificationInboxList, {
91
- "data-notification-list": true
92
- }, notifications.map(notification => {
93
- const isRead = notification.isRead ?? false;
94
- const badgeColor = badgeColorMap[notification.severity] || 'gray';
95
- const showExpandButton = showExpandMap[notification.id] ?? false;
96
- return React.createElement(NotificationItem, {
97
- key: notification.id,
98
- onClick: () => handleNotificationClick(notification)
99
- }, React.createElement(NotificationIndicator, {
100
- "$isRead": isRead
101
- }), React.createElement(Vertical, {
102
- "$gap": 8
103
- }, React.createElement(Vertical, null, React.createElement(NotificationHeader, null, React.createElement(Horizontal, {
104
- "$gap": 4,
105
- "$alignItems": "center"
106
- }, React.createElement(Text, {
107
- "$variant": "footnote",
108
- "$color": Color.LOCKED
109
- }, formatTimestamp(notification.timestamp)), notification.projectName && React.createElement(React.Fragment, null, React.createElement(Text, {
110
- "$color": Color.LOCKED
111
- }, "\u2022"), React.createElement(Text, {
112
- "$variant": "footnote",
113
- "$color": Color.LOCKED
114
- }, notification.projectName))), (notification.severity === 'critical' || notification.severity === 'warning') && React.createElement(Badge, {
115
- color: badgeColor,
116
- isSaturated: false
117
- }, notification.severity.toUpperCase())), React.createElement(Text, {
118
- "$variant": "h4",
119
- "$color": Color.MAIN
120
- }, notification.title), notification.description && React.createElement(NotificationDescription, {
121
- as: "div",
122
- ref: element => descriptionRefs.current[notification.id] = element || null,
123
- "$variant": "standard",
124
- "$color": Color.MAIN,
125
- "$visibleLines": VISIBLE_LINES,
126
- "$expanded": expandedId === notification.id
127
- }, notification.description)), (notification.actionButton || showExpandButton) && React.createElement(Horizontal, {
128
- "$alignItems": "center",
129
- "$justifyContent": "start",
130
- "$gap": 12
131
- }, notification.actionButton && React.createElement(NotificationActionLink, {
132
- "$isPrimary": true,
133
- onClick: e => {
134
- var _notification$actionB;
135
- e.stopPropagation();
136
- (_notification$actionB = notification.actionButton) === null || _notification$actionB === void 0 || _notification$actionB.onClick();
137
- }
138
- }, notification.actionButton.label), showExpandButton && React.createElement(NotificationActionLink, {
139
- onClick: e => {
140
- e.stopPropagation();
141
- setExpandedId(prev => prev === notification.id ? null : notification.id);
142
- }
143
- }, expandedId === notification.id ? React.createElement(Lang, {
144
- message: "DUMB.NOTIFICATION_INBOX.COLLAPSE"
145
- }) : React.createElement(Lang, {
146
- message: "DUMB.NOTIFICATION_INBOX.EXPAND"
147
- })))));
148
- }), hasMore && isLoading && React.createElement(Horizontal, {
149
- ref: loadMoreRef,
150
- "$alignItems": "center",
151
- "$justifyContent": "center",
152
- "$padding": 16,
153
- "$gap": 8
154
- }, React.createElement(Spinner, {
155
- size: "small",
156
- color: Color.LOCKED
157
- }), React.createElement(Text, {
158
- "$variant": "footnote",
159
- "$color": Color.LOCKED
160
- }, React.createElement(Lang, {
161
- message: "DUMB.NOTIFICATION_INBOX.LOADING_MORE"
162
- }))), isLoading && notifications.length === 0 && !hasMore && React.createElement(Horizontal, {
163
- "$justifyContent": "center",
164
- "$alignItems": "center",
165
- "$padding": "16px 0"
166
- }, React.createElement(Spinner, {
167
- size: "medium",
168
- color: Color.LOCKED
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 React, { useRef, useState, useEffect } from 'react';
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 React.createElement(SingleInputFrame, {
81
+ return _jsxs(SingleInputFrame, {
81
82
  ref: ref,
82
83
  "$hasHint": !!hint,
83
- "$isDisabled": isDisabled
84
- }, React.createElement(InputComponent, {
85
- value: localValue,
86
- placeholder: placeholder,
87
- isDisabled: isDisabled,
88
- disabled: isDisabled,
89
- onChange: handleChange,
90
- onKeyDown: handleKeyDown,
91
- onKeyUp: resetAutoDiff,
92
- onBlur: event => {
93
- if (!event.target.value && value === undefined) {
94
- return;
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
- let blurValue = intVal(event.target.value);
97
- const minValueValid = minValue === undefined || blurValue >= minValue;
98
- const maxValueValid = maxValue === undefined || blurValue <= maxValue;
99
- if (!maxValueValid) {
100
- blurValue = maxValue;
101
- } else if (!minValueValid) {
102
- blurValue = minValue;
103
- }
104
- onChange(blurValue);
105
- setLocalValue(`${blurValue}`);
106
- }
107
- }), hint && React.createElement(Hint, null, hint), React.createElement(Vertical, {
108
- "$gap": 1
109
- }, React.createElement("div", null, React.createElement(ChevronIcon, {
110
- direction: "up",
111
- size: "small",
112
- "aria-disabled": "true",
113
- onClick: () => onChangeDiff(step),
114
- onMouseDown: () => setAutoDiff(step),
115
- onMouseUp: resetAutoDiff,
116
- onMouseLeave: resetAutoDiff
117
- })), React.createElement("div", null, React.createElement(ChevronIcon, {
118
- size: "small",
119
- direction: "down",
120
- "aria-disabled": isDisabled,
121
- onClick: () => onChangeDiff(-1 * step),
122
- onMouseDown: () => setAutoDiff(-1 * step),
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 React, { useRef, useState, useEffect } from 'react';
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 React.createElement(React.Fragment, null, React.createElement(InputStyled, {
24
- style: {
25
- width
26
- },
27
- value: value,
28
- placeholder: placeholder,
29
- disabled: isDisabled,
30
- onChange: onChange,
31
- onKeyUp: onKeyUp,
32
- onKeyDown: onKeyDown,
33
- onBlur: onBlur
34
- }), React.createElement(Hidden, {
35
- ref: hiddenRef
36
- }, value || placeholder));
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
  }