@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,5 @@
1
- import React, { useEffect, useRef, useState } from 'react';
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 React.createElement(RootBox, null, React.createElement(InputBox, null, React.createElement(InputStyled, {
60
- ref: inputRef,
61
- width: width,
62
- value: value,
63
- placeholder: placeholder,
64
- onKeyDown: onKeyDown,
65
- onChange: onChangeHandler,
66
- onBlur: onBlur
67
- }), React.createElement("span", {
68
- ref: hiddenValueRef
69
- }, value), React.createElement("span", {
70
- ref: hiddenPlaceholderRef
71
- }, placeholder)), React.createElement(PromptBox, {
72
- onClick: () => {
73
- var _inputRef$current4;
74
- return (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.focus();
75
- }
76
- }, React.createElement(EditIcon, {
77
- size: "small",
78
- view: "filled"
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
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Columns } from '@pushwoosh/kit-helpers';
3
3
  import { ArrowRoundIcon } from '@pushwoosh/kit-icons';
4
4
  import { H1 } from '@pushwoosh/kit-typography';
@@ -22,30 +22,47 @@ export function PageHeader(props) {
22
22
  } = props;
23
23
  const hasActions = Boolean(onSubmit || onCancel);
24
24
  const hasActionsBox = hasActions || Boolean(moreActions);
25
- return React.createElement(RootBox, null, React.createElement(Columns, {
26
- "$sizes": "minmax(0, 1fr) max-content",
27
- "$gap": 24
28
- }, React.createElement(TitleBox, null, onBack && React.createElement(BackButton, null, React.createElement(Button, {
29
- color: "primary",
30
- view: "ghost",
31
- onClick: onBack
32
- }, React.createElement(ArrowRoundIcon, {
33
- direction: "left",
34
- size: "medium",
35
- view: "filled"
36
- }))), React.createElement(H1, null, title)), hasActionsBox && React.createElement(ActionsBox, null, !!moreActions && React.createElement(MoreActionsBox, {
37
- hasActions: hasActions
38
- }, moreActions), onCancel && React.createElement(Button, {
39
- color: "secondary",
40
- onClick: onCancel
41
- }, cancelText || 'Cancel'), onSubmit && React.createElement(Button, {
42
- color: "primary",
43
- type: "submit",
44
- onClick: onSubmit,
45
- isLoading: !!isLoadingSubmit
46
- }, submitText || 'Create'))), !!error && React.createElement(PageHeaderError, {
47
- error: error,
48
- resolveErrorText: resolveErrorText,
49
- onResolveError: onResolveError
50
- }), !!description && React.createElement(DescriptionBox, null, description));
25
+ return _jsxs(RootBox, {
26
+ children: [_jsxs(Columns, {
27
+ "$sizes": "minmax(0, 1fr) max-content",
28
+ "$gap": 24,
29
+ children: [_jsxs(TitleBox, {
30
+ children: [onBack && _jsx(BackButton, {
31
+ children: _jsx(Button, {
32
+ color: "primary",
33
+ view: "ghost",
34
+ onClick: onBack,
35
+ children: _jsx(ArrowRoundIcon, {
36
+ direction: "left",
37
+ size: "medium",
38
+ view: "filled"
39
+ })
40
+ })
41
+ }), _jsx(H1, {
42
+ children: title
43
+ })]
44
+ }), hasActionsBox && _jsxs(ActionsBox, {
45
+ children: [!!moreActions && _jsx(MoreActionsBox, {
46
+ hasActions: hasActions,
47
+ children: moreActions
48
+ }), onCancel && _jsx(Button, {
49
+ color: "secondary",
50
+ onClick: onCancel,
51
+ children: cancelText || 'Cancel'
52
+ }), onSubmit && _jsx(Button, {
53
+ color: "primary",
54
+ type: "submit",
55
+ onClick: onSubmit,
56
+ isLoading: !!isLoadingSubmit,
57
+ children: submitText || 'Create'
58
+ })]
59
+ })]
60
+ }), !!error && _jsx(PageHeaderError, {
61
+ error: error,
62
+ resolveErrorText: resolveErrorText,
63
+ onResolveError: onResolveError
64
+ }), !!description && _jsx(DescriptionBox, {
65
+ children: description
66
+ })]
67
+ });
51
68
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Columns } from '@pushwoosh/kit-helpers';
3
3
  import { ArrowRoundIcon } from '@pushwoosh/kit-icons';
4
4
  import { Button } from '../../../Button';
@@ -28,40 +28,57 @@ export function PageHeaderEditable(props) {
28
28
  onResolveError
29
29
  } = props;
30
30
  if (isLoading) {
31
- return React.createElement(PageHeaderSkeleton, null);
31
+ return _jsx(PageHeaderSkeleton, {});
32
32
  }
33
33
  const hasActions = Boolean(onSubmit || onCancel);
34
34
  const hasActionsBox = hasActions || Boolean(moreActions);
35
- return React.createElement(RootBox, null, React.createElement(Columns, {
36
- "$sizes": "minmax(0, 1fr) max-content",
37
- "$gap": 24
38
- }, React.createElement(TitleBox, null, onBack && React.createElement(BackButton, null, React.createElement(Button, {
39
- color: "primary",
40
- view: "ghost",
41
- onClick: onBack
42
- }, React.createElement(ArrowRoundIcon, {
43
- direction: "left",
44
- size: "medium",
45
- view: "filled"
46
- }))), React.createElement(AutosizeInputBox, null, title, value !== undefined && React.createElement(AutosizeInput, {
47
- placeholder: placeholder,
48
- maxLength: maxLength,
49
- value: value,
50
- onChange: onChange,
51
- onComplete: onComplete
52
- }))), hasActionsBox && React.createElement(ActionsBox, null, !!moreActions && React.createElement(MoreActionsBox, {
53
- hasActions: hasActions
54
- }, moreActions), onCancel && React.createElement(Button, {
55
- color: "secondary",
56
- onClick: onCancel
57
- }, cancelText || 'Cancel'), onSubmit && React.createElement(Button, {
58
- color: "primary",
59
- type: "submit",
60
- onClick: () => value ? onSubmit(value) : null,
61
- isLoading: !!isLoadingSubmit
62
- }, submitText || 'Create'))), !!error && React.createElement(PageHeaderError, {
63
- error: error,
64
- resolveErrorText: resolveErrorText,
65
- onResolveError: onResolveError
66
- }), !!description && React.createElement(DescriptionBox, null, description));
35
+ return _jsxs(RootBox, {
36
+ children: [_jsxs(Columns, {
37
+ "$sizes": "minmax(0, 1fr) max-content",
38
+ "$gap": 24,
39
+ children: [_jsxs(TitleBox, {
40
+ children: [onBack && _jsx(BackButton, {
41
+ children: _jsx(Button, {
42
+ color: "primary",
43
+ view: "ghost",
44
+ onClick: onBack,
45
+ children: _jsx(ArrowRoundIcon, {
46
+ direction: "left",
47
+ size: "medium",
48
+ view: "filled"
49
+ })
50
+ })
51
+ }), _jsxs(AutosizeInputBox, {
52
+ children: [title, value !== undefined && _jsx(AutosizeInput, {
53
+ placeholder: placeholder,
54
+ maxLength: maxLength,
55
+ value: value,
56
+ onChange: onChange,
57
+ onComplete: onComplete
58
+ })]
59
+ })]
60
+ }), hasActionsBox && _jsxs(ActionsBox, {
61
+ children: [!!moreActions && _jsx(MoreActionsBox, {
62
+ hasActions: hasActions,
63
+ children: moreActions
64
+ }), onCancel && _jsx(Button, {
65
+ color: "secondary",
66
+ onClick: onCancel,
67
+ children: cancelText || 'Cancel'
68
+ }), onSubmit && _jsx(Button, {
69
+ color: "primary",
70
+ type: "submit",
71
+ onClick: () => value ? onSubmit(value) : null,
72
+ isLoading: !!isLoadingSubmit,
73
+ children: submitText || 'Create'
74
+ })]
75
+ })]
76
+ }), !!error && _jsx(PageHeaderError, {
77
+ error: error,
78
+ resolveErrorText: resolveErrorText,
79
+ onResolveError: onResolveError
80
+ }), !!description && _jsx(DescriptionBox, {
81
+ children: description
82
+ })]
83
+ });
67
84
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { DangerTriangleIcon } from '@pushwoosh/kit-icons';
3
3
  import { RootBox, ErrorIconBox, ErrorText, ResolveError } from './styles';
4
4
  export function PageHeaderError(props) {
@@ -7,13 +7,20 @@ export function PageHeaderError(props) {
7
7
  resolveErrorText,
8
8
  onResolveError
9
9
  } = props;
10
- return React.createElement(RootBox, null, React.createElement(ErrorIconBox, null, React.createElement(DangerTriangleIcon, {
11
- color: "white",
12
- size: "small",
13
- view: "filled"
14
- })), React.createElement(ErrorText, null, error), resolveErrorText && onResolveError && React.createElement(ResolveError, {
15
- view: "ghost",
16
- color: "danger",
17
- onClick: onResolveError
18
- }, resolveErrorText));
10
+ return _jsxs(RootBox, {
11
+ children: [_jsx(ErrorIconBox, {
12
+ children: _jsx(DangerTriangleIcon, {
13
+ color: "white",
14
+ size: "small",
15
+ view: "filled"
16
+ })
17
+ }), _jsx(ErrorText, {
18
+ children: error
19
+ }), resolveErrorText && onResolveError && _jsx(ResolveError, {
20
+ view: "ghost",
21
+ color: "danger",
22
+ onClick: onResolveError,
23
+ children: resolveErrorText
24
+ })]
25
+ });
19
26
  }
@@ -1,20 +1,24 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Horizontal } from '@pushwoosh/kit-helpers';
3
3
  import { RootBox, SkeletonStyled } from './styles';
4
4
  export function PageHeaderSkeleton() {
5
- return React.createElement(RootBox, null, React.createElement(Horizontal, {
6
- "$gap": 16
7
- }, React.createElement(SkeletonStyled, null), React.createElement(SkeletonStyled, {
8
- width: 60
9
- }), React.createElement(SkeletonStyled, {
10
- width: 60
11
- })), React.createElement(Horizontal, {
12
- "$gap": 16
13
- }, React.createElement(SkeletonStyled, {
14
- width: 68,
15
- height: 36
16
- }), React.createElement(SkeletonStyled, {
17
- width: 68,
18
- height: 36
19
- })));
5
+ return _jsxs(RootBox, {
6
+ children: [_jsxs(Horizontal, {
7
+ "$gap": 16,
8
+ children: [_jsx(SkeletonStyled, {}), _jsx(SkeletonStyled, {
9
+ width: 60
10
+ }), _jsx(SkeletonStyled, {
11
+ width: 60
12
+ })]
13
+ }), _jsxs(Horizontal, {
14
+ "$gap": 16,
15
+ children: [_jsx(SkeletonStyled, {
16
+ width: 68,
17
+ height: 36
18
+ }), _jsx(SkeletonStyled, {
19
+ width: 68,
20
+ height: 36
21
+ })]
22
+ })]
23
+ });
20
24
  }
@@ -1,4 +1,5 @@
1
- import React, { useCallback } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback } from 'react';
2
3
  import { ArrowIcon } from '@pushwoosh/kit-icons';
3
4
  import { getSafelyNumber } from './helpers';
4
5
  import { PaginationBox, PaginationArrow, PaginationDivider, PaginationButton } from './styles';
@@ -30,55 +31,65 @@ export function Pagination({
30
31
  console.error(`[Pagination]: prop activePage: ${activePage} is not valid!`);
31
32
  return null;
32
33
  }
33
- return React.createElement(PaginationBox, {
34
+ return _jsxs(PaginationBox, {
34
35
  ...rest,
35
- ref: boxRef
36
- }, React.createElement(PaginationArrow, {
37
- value: safelyActivePageNumber - 1,
38
- disabled: isLoading || isDisabledLeftArrow,
39
- onClick: handleChangePage
40
- }, React.createElement(ArrowIcon, {
41
- direction: "left",
42
- size: "medium"
43
- })), shouldShowShowFirstPage && React.createElement(PaginationButton, {
44
- value: 1,
45
- disabled: isLoading,
46
- onClick: handleChangePage
47
- }, 1), shouldShowShowLeftDivider && React.createElement(PaginationDivider, null, "..."), helperArray.map((_, index) => {
48
- const currentIndex = safelyActivePageNumber - adjacentPagesCount + index;
49
- if (currentIndex < 1 || currentIndex > safelyTotalPagesNumber) {
50
- return null;
51
- }
52
- return React.createElement(PaginationButton, {
53
- key: currentIndex,
54
- value: currentIndex,
36
+ ref: boxRef,
37
+ children: [_jsx(PaginationArrow, {
38
+ value: safelyActivePageNumber - 1,
39
+ disabled: isLoading || isDisabledLeftArrow,
40
+ onClick: handleChangePage,
41
+ children: _jsx(ArrowIcon, {
42
+ direction: "left",
43
+ size: "medium"
44
+ })
45
+ }), shouldShowShowFirstPage && _jsx(PaginationButton, {
46
+ value: 1,
55
47
  disabled: isLoading,
56
- onClick: handleChangePage
57
- }, currentIndex);
58
- }), React.createElement(PaginationButton, {
59
- "$isActive": true,
60
- disabled: true
61
- }, safelyActivePageNumber), helperArray.map((_, index) => {
62
- const currentIndex = safelyActivePageNumber + index + 1;
63
- if (currentIndex > safelyTotalPagesNumber) {
64
- return null;
65
- }
66
- return React.createElement(PaginationButton, {
67
- key: currentIndex,
68
- value: currentIndex,
48
+ onClick: handleChangePage,
49
+ children: 1
50
+ }), shouldShowShowLeftDivider && _jsx(PaginationDivider, {
51
+ children: "..."
52
+ }), helperArray.map((_, index) => {
53
+ const currentIndex = safelyActivePageNumber - adjacentPagesCount + index;
54
+ if (currentIndex < 1 || currentIndex > safelyTotalPagesNumber) {
55
+ return null;
56
+ }
57
+ return _jsx(PaginationButton, {
58
+ value: currentIndex,
59
+ disabled: isLoading,
60
+ onClick: handleChangePage,
61
+ children: currentIndex
62
+ }, currentIndex);
63
+ }), _jsx(PaginationButton, {
64
+ "$isActive": true,
65
+ disabled: true,
66
+ children: safelyActivePageNumber
67
+ }), helperArray.map((_, index) => {
68
+ const currentIndex = safelyActivePageNumber + index + 1;
69
+ if (currentIndex > safelyTotalPagesNumber) {
70
+ return null;
71
+ }
72
+ return _jsx(PaginationButton, {
73
+ value: currentIndex,
74
+ disabled: isLoading,
75
+ onClick: handleChangePage,
76
+ children: currentIndex
77
+ }, currentIndex);
78
+ }), shouldShowShowRightDivider && _jsx(PaginationDivider, {
79
+ children: "..."
80
+ }), shouldShowShowLastPage && _jsx(PaginationButton, {
81
+ value: safelyTotalPagesNumber,
69
82
  disabled: isLoading,
70
- onClick: handleChangePage
71
- }, currentIndex);
72
- }), shouldShowShowRightDivider && React.createElement(PaginationDivider, null, "..."), shouldShowShowLastPage && React.createElement(PaginationButton, {
73
- value: safelyTotalPagesNumber,
74
- disabled: isLoading,
75
- onClick: handleChangePage
76
- }, safelyTotalPagesNumber), React.createElement(PaginationArrow, {
77
- value: safelyActivePageNumber + 1,
78
- disabled: isLoading || isDisabledRightArrow,
79
- onClick: handleChangePage
80
- }, React.createElement(ArrowIcon, {
81
- direction: "right",
82
- size: "medium"
83
- })));
83
+ onClick: handleChangePage,
84
+ children: safelyTotalPagesNumber
85
+ }), _jsx(PaginationArrow, {
86
+ value: safelyActivePageNumber + 1,
87
+ disabled: isLoading || isDisabledRightArrow,
88
+ onClick: handleChangePage,
89
+ children: _jsx(ArrowIcon, {
90
+ direction: "right",
91
+ size: "medium"
92
+ })
93
+ })]
94
+ });
84
95
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PopoverContainerPortal, PopoverContainerWindow } from './styles';
3
3
  export function Popover({
4
4
  open,
@@ -10,7 +10,7 @@ export function Popover({
10
10
  windowWidth,
11
11
  children
12
12
  }) {
13
- return React.createElement(PopoverContainerPortal, {
13
+ return _jsx(PopoverContainerPortal, {
14
14
  animation: false,
15
15
  delay: 0,
16
16
  duration: 0,
@@ -20,11 +20,12 @@ export function Popover({
20
20
  zIndex: zIndex,
21
21
  visible: open,
22
22
  className: "popover-container",
23
- content: React.createElement(PopoverContainerWindow, {
23
+ content: _jsx(PopoverContainerWindow, {
24
24
  "$minWidth": windowWidth,
25
25
  "$isLoading": loading,
26
- ref: internalWindowRef
27
- }, open && children),
26
+ ref: internalWindowRef,
27
+ children: open && children
28
+ }),
28
29
  popperOptions: {
29
30
  strategy: 'fixed',
30
31
  modifiers: [{
@@ -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 { Spinner } from '../Spinner';
4
4
  import { Container, LoadingHeader, LoadingText, ProgressLine, ProgressBarActive, ProgressBoxContainer, RightSlotContainer, SpinnerContainer, ProgressLineContainer } from './styles';
@@ -10,13 +10,28 @@ export function ProgressBar({
10
10
  backgroundColor = Color.BRIGHT_LIGHT,
11
11
  showSpinner = true
12
12
  }) {
13
- return React.createElement(Container, null, showSpinner && React.createElement(SpinnerContainer, {
14
- "$backgroundColor": backgroundColor
15
- }, React.createElement(Spinner, {
16
- color: color,
17
- size: "medium"
18
- })), React.createElement(ProgressBoxContainer, null, React.createElement(LoadingHeader, null, React.createElement(LoadingText, null, `${title} ${percentValue}%`), rightSlot && React.createElement(RightSlotContainer, null, rightSlot)), React.createElement(ProgressLineContainer, null, React.createElement(ProgressLine, null, React.createElement(ProgressBarActive, {
19
- "$width": percentValue,
20
- "$color": color
21
- })))));
13
+ return _jsxs(Container, {
14
+ children: [showSpinner && _jsx(SpinnerContainer, {
15
+ "$backgroundColor": backgroundColor,
16
+ children: _jsx(Spinner, {
17
+ color: color,
18
+ size: "medium"
19
+ })
20
+ }), _jsxs(ProgressBoxContainer, {
21
+ children: [_jsxs(LoadingHeader, {
22
+ children: [_jsx(LoadingText, {
23
+ children: `${title} ${percentValue}%`
24
+ }), rightSlot && _jsx(RightSlotContainer, {
25
+ children: rightSlot
26
+ })]
27
+ }), _jsx(ProgressLineContainer, {
28
+ children: _jsx(ProgressLine, {
29
+ children: _jsx(ProgressBarActive, {
30
+ "$width": percentValue,
31
+ "$color": color
32
+ })
33
+ })
34
+ })]
35
+ })]
36
+ });
22
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 { Vertical } from '@pushwoosh/kit-helpers';
3
3
  import { MissedContentPreview } from './components/MissedContentPreview';
4
4
  import { SilentPushPreview } from './components/SilentPushPreview';
@@ -20,35 +20,43 @@ export function PushPreview({
20
20
  const content = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.content) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedContent), language);
21
21
  const icon = (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.icon) || appIcon || PREVIEW_ICON_URL;
22
22
  if (isLoading) {
23
- return React.createElement(PushBox, {
23
+ return _jsx(PushBox, {
24
24
  view: view,
25
25
  "$loading": true
26
26
  });
27
27
  }
28
28
  if (view === 'silent') {
29
- return React.createElement(SilentPushPreview, null);
29
+ return _jsx(SilentPushPreview, {});
30
30
  }
31
31
  if (view === 'missed-content') {
32
- return React.createElement(MissedContentPreview, null);
32
+ return _jsx(MissedContentPreview, {});
33
33
  }
34
- return React.createElement(PushBox, {
34
+ return _jsxs(PushBox, {
35
35
  view: view,
36
36
  "$width": width,
37
- "$loading": isLoading
38
- }, React.createElement(PushIcon, {
39
- alt: title,
40
- src: icon
41
- }), React.createElement(Vertical, null, React.createElement(PushTitle, null, React.createElement(RichMessageViewer, {
42
- value: title,
43
- flat: true
44
- })), view === 'extended' && React.createElement(PushTitle, null, React.createElement(RichMessageViewer, {
45
- value: subtitle,
46
- flat: true
47
- })), React.createElement(PushDescription, {
48
- view: view,
49
- locked: !pushPreset || !content
50
- }, content && React.createElement(RichMessageViewer, {
51
- flat: view === 'compact',
52
- value: content
53
- }), !content && view === 'empty' && 'Select existing or create a new content…', !content && view !== 'empty' && 'Message is empty…')));
37
+ "$loading": isLoading,
38
+ children: [_jsx(PushIcon, {
39
+ alt: title,
40
+ src: icon
41
+ }), _jsxs(Vertical, {
42
+ children: [_jsx(PushTitle, {
43
+ children: _jsx(RichMessageViewer, {
44
+ value: title,
45
+ flat: true
46
+ })
47
+ }), view === 'extended' && _jsx(PushTitle, {
48
+ children: _jsx(RichMessageViewer, {
49
+ value: subtitle,
50
+ flat: true
51
+ })
52
+ }), _jsxs(PushDescription, {
53
+ view: view,
54
+ locked: !pushPreset || !content,
55
+ children: [content && _jsx(RichMessageViewer, {
56
+ flat: view === 'compact',
57
+ value: content
58
+ }), !content && view === 'empty' && 'Select existing or create a new content…', !content && view !== 'empty' && 'Message is empty…']
59
+ })]
60
+ })]
61
+ });
54
62
  }
@@ -1,22 +1,29 @@
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 { Vertical } from '@pushwoosh/kit-helpers';
4
4
  import { CloseIcon } from '@pushwoosh/kit-icons';
5
5
  import { Lang } from '../../polyglot';
6
6
  import { PushBox, IconContainer, PushTitle, PushDescription } from '../../styles';
7
7
  export function MissedContentPreview() {
8
- return React.createElement(PushBox, {
9
- view: "compact"
10
- }, React.createElement(IconContainer, null, React.createElement(CloseIcon, {
11
- size: "small",
12
- color: Color.CLEAR
13
- })), React.createElement(Vertical, null, React.createElement(PushTitle, {
14
- locked: true
15
- }, React.createElement(Lang, {
16
- message: "DUMB.PUSH_PREVIEW.CONTENT_MISSED"
17
- })), React.createElement(PushDescription, {
18
- locked: true
19
- }, React.createElement(Lang, {
20
- message: "DUMB.PUSH_PREVIEW.HINT"
21
- }))));
8
+ return _jsxs(PushBox, {
9
+ view: "compact",
10
+ children: [_jsx(IconContainer, {
11
+ children: _jsx(CloseIcon, {
12
+ size: "small",
13
+ color: Color.CLEAR
14
+ })
15
+ }), _jsxs(Vertical, {
16
+ children: [_jsx(PushTitle, {
17
+ locked: true,
18
+ children: _jsx(Lang, {
19
+ message: "DUMB.PUSH_PREVIEW.CONTENT_MISSED"
20
+ })
21
+ }), _jsx(PushDescription, {
22
+ locked: true,
23
+ children: _jsx(Lang, {
24
+ message: "DUMB.PUSH_PREVIEW.HINT"
25
+ })
26
+ })]
27
+ })]
28
+ });
22
29
  }