@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.
Files changed (217) hide show
  1. package/AccessForbidden/AccessForbidden.js +19 -5
  2. package/AccessForbidden/polyglot/index.d.ts +2 -0
  3. package/AccessForbidden/polyglot/index.js +10 -0
  4. package/AccessForbidden/polyglot/messages_en.d.ts +3 -0
  5. package/AccessForbidden/polyglot/messages_en.js +4 -0
  6. package/AccessForbidden/polyglot/messages_ru.d.ts +3 -0
  7. package/AccessForbidden/polyglot/messages_ru.js +4 -0
  8. package/AccessForbidden/polyglot/types.d.ts +5 -0
  9. package/AccessForbidden/polyglot/types.js +1 -0
  10. package/Alert/Alert.d.ts +1 -2
  11. package/Alert/Alert.js +31 -25
  12. package/ApplicationPreloader/ApplicationPreloader.d.ts +1 -2
  13. package/ApplicationPreloader/ApplicationPreloader.js +5 -4
  14. package/Badge/Badge.js +2 -2
  15. package/Banner/Banner.js +40 -24
  16. package/Button/Button.js +20 -9
  17. package/Button/RemoveButton.js +7 -6
  18. package/Calendar/CalendarDropdown/CalendarDropdown.js +121 -108
  19. package/Calendar/CalendarMonth/CalendarMonth.js +68 -66
  20. package/Calendar/CalendarMonthSlider/CalendarMonthSlider.d.ts +2 -2
  21. package/Calendar/CalendarMonthSlider/CalendarMonthSlider.js +68 -55
  22. package/Calendar/CalendarSuperForm/CalendarSuperForm.js +75 -70
  23. package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.d.ts +2 -2
  24. package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.js +3 -2
  25. package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +106 -88
  26. package/Calendar/CalendarSuperForm/components/CalendarTimeInput.d.ts +1 -2
  27. package/Calendar/CalendarSuperForm/components/CalendarTimeInput.js +2 -2
  28. package/Calendar/CalendarSuperForm/components/CalendarTimezoneSelect.js +3 -2
  29. package/CardMetric/CardChildren.js +9 -6
  30. package/CardMetric/CardCollapse.js +8 -6
  31. package/CardMetric/CardMetric.js +52 -33
  32. package/Checkbox/Checkbox.js +30 -24
  33. package/Chip/Chip.d.ts +6 -7
  34. package/Chip/Chip.js +22 -15
  35. package/CodeEditor/CodeEditor.d.ts +1 -2
  36. package/CodeEditor/CodeEditor.js +2 -2
  37. package/CrashScreen/CrashScreen.js +19 -6
  38. package/CrashScreen/polyglot/index.d.ts +2 -0
  39. package/CrashScreen/polyglot/index.js +10 -0
  40. package/CrashScreen/polyglot/messages_en.d.ts +3 -0
  41. package/CrashScreen/polyglot/messages_en.js +4 -0
  42. package/CrashScreen/polyglot/messages_ru.d.ts +3 -0
  43. package/CrashScreen/polyglot/messages_ru.js +4 -0
  44. package/CrashScreen/polyglot/types.d.ts +5 -0
  45. package/CrashScreen/polyglot/types.js +1 -0
  46. package/DateTimePicker/components/AutosizeInput/AutosizeInput.js +17 -13
  47. package/DateTimePicker/components/DatePicker/DatePicker.js +35 -32
  48. package/DateTimePicker/components/DatePickerField/DatePickerField.js +32 -22
  49. package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +22 -20
  50. package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +30 -22
  51. package/DateTimePicker/components/DecadeView/DecadeView.js +19 -17
  52. package/DateTimePicker/components/Input/Input.js +2 -2
  53. package/DateTimePicker/components/Month/Month.js +52 -21
  54. package/DateTimePicker/components/MonthView/MonthView.js +21 -17
  55. package/DateTimePicker/components/NumberPicker/NumberPicker.js +49 -40
  56. package/DateTimePicker/components/PickerPlate/PickerPlate.js +17 -14
  57. package/DateTimePicker/components/YearView/YearView.js +22 -18
  58. package/DateTimePicker/polyglot/index.d.ts +2 -0
  59. package/DateTimePicker/polyglot/index.js +9 -0
  60. package/DateTimePicker/polyglot/messages_en.d.ts +3 -0
  61. package/DateTimePicker/polyglot/messages_en.js +11 -0
  62. package/DateTimePicker/polyglot/messages_ru.d.ts +3 -0
  63. package/DateTimePicker/polyglot/messages_ru.js +11 -0
  64. package/DateTimePicker/polyglot/types.d.ts +12 -0
  65. package/DateTimePicker/polyglot/types.js +1 -0
  66. package/Drawer/components/Drawer/Drawer.js +18 -13
  67. package/Drawer/components/Drawer/styles.d.ts +2 -2
  68. package/Drawer/components/Drawer/styles.js +5 -4
  69. package/Drawer/components/DrawerDocs/DrawerDocs.js +28 -17
  70. package/Drawer/polyglot/index.d.ts +2 -0
  71. package/Drawer/polyglot/index.js +10 -0
  72. package/Drawer/polyglot/messages_en.d.ts +3 -0
  73. package/Drawer/polyglot/messages_en.js +4 -0
  74. package/Drawer/polyglot/messages_ru.d.ts +3 -0
  75. package/Drawer/polyglot/messages_ru.js +4 -0
  76. package/Drawer/polyglot/types.d.ts +5 -0
  77. package/Drawer/polyglot/types.js +1 -0
  78. package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +28 -24
  79. package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +8 -6
  80. package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +6 -4
  81. package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.js +13 -10
  82. package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.js +40 -31
  83. package/EditableField/EditableField.js +56 -39
  84. package/EditableField/polyglot/index.d.ts +2 -0
  85. package/EditableField/polyglot/index.js +9 -0
  86. package/EditableField/polyglot/messages_en.d.ts +3 -0
  87. package/EditableField/polyglot/messages_en.js +4 -0
  88. package/EditableField/polyglot/messages_ru.d.ts +3 -0
  89. package/EditableField/polyglot/messages_ru.js +4 -0
  90. package/EditableField/polyglot/types.d.ts +5 -0
  91. package/EditableField/polyglot/types.js +1 -0
  92. package/EmailTemplatePreview/EmailTemplatePreview.js +10 -8
  93. package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +30 -16
  94. package/EmailTemplatePreview/polyglot/index.d.ts +2 -0
  95. package/EmailTemplatePreview/polyglot/index.js +10 -0
  96. package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
  97. package/EmailTemplatePreview/polyglot/messages_en.js +5 -0
  98. package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
  99. package/EmailTemplatePreview/polyglot/messages_ru.js +5 -0
  100. package/EmailTemplatePreview/polyglot/types.d.ts +6 -0
  101. package/EmailTemplatePreview/polyglot/types.js +1 -0
  102. package/EnhancedInput/EnhancedInput.d.ts +3 -4
  103. package/EnhancedInput/EnhancedInput.js +14 -10
  104. package/EnhancedInput/SearchInput.js +3 -3
  105. package/ExportResult/ExportResult.js +33 -23
  106. package/ExternalImagePreview/ExternalImagePreview.js +24 -20
  107. package/FieldBox/FieldBox.js +50 -37
  108. package/FrequencyCapping/FrequencyCappingEdit.js +41 -33
  109. package/FrequencyCapping/FrequencyCappingInApps.js +41 -33
  110. package/FrequencyCapping/FrequencyCappingReadonly.d.ts +1 -2
  111. package/FrequencyCapping/FrequencyCappingReadonly.js +24 -20
  112. package/FrequencyCapping/components/Condition/index.d.ts +1 -2
  113. package/FrequencyCapping/components/Condition/index.js +24 -20
  114. package/FrequencyCapping/components/Description/index.d.ts +2 -2
  115. package/FrequencyCapping/components/Description/index.js +7 -5
  116. package/FrequencyCapping/components/Settings/EditCappingSettings.js +28 -20
  117. package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +86 -71
  118. package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +1 -2
  119. package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +41 -32
  120. package/GetStartedPage/GetStartedPage.js +44 -25
  121. package/InputFile/InputFile.js +44 -35
  122. package/Link/Link.js +2 -2
  123. package/Modal/components/Modal/Modal.js +17 -12
  124. package/Modal/components/Modal/styles.js +5 -4
  125. package/Modal/components/ModalConfirm/ModalConfirm.js +51 -24
  126. package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +2 -2
  127. package/Modal/components/ModalConfirm/ModalConfirmProvider.js +8 -6
  128. package/Modal/components/ModalConfirm/types.d.ts +1 -1
  129. package/Modal/components/ModalTitle/ModalTitle.js +10 -8
  130. package/Modal/polyglot/index.d.ts +2 -0
  131. package/Modal/polyglot/index.js +9 -0
  132. package/Modal/polyglot/messages_en.d.ts +3 -0
  133. package/Modal/polyglot/messages_en.js +6 -0
  134. package/Modal/polyglot/messages_ru.d.ts +3 -0
  135. package/Modal/polyglot/messages_ru.js +6 -0
  136. package/Modal/polyglot/types.d.ts +7 -0
  137. package/Modal/polyglot/types.js +1 -0
  138. package/NotificationInbox/NotificationBar.js +19 -11
  139. package/NotificationInbox/NotificationBell.js +21 -12
  140. package/NotificationInbox/NotificationInbox.js +160 -105
  141. package/NotificationInbox/polyglot/index.d.ts +2 -0
  142. package/NotificationInbox/polyglot/index.js +10 -0
  143. package/NotificationInbox/polyglot/messages_en.d.ts +3 -0
  144. package/NotificationInbox/polyglot/messages_en.js +8 -0
  145. package/NotificationInbox/polyglot/messages_ru.d.ts +3 -0
  146. package/NotificationInbox/polyglot/messages_ru.js +8 -0
  147. package/NotificationInbox/polyglot/types.d.ts +11 -0
  148. package/NotificationInbox/polyglot/types.js +1 -0
  149. package/NumberPicker/NumberPicker.js +53 -44
  150. package/NumberPicker/components/AutosizeInput/AutosizeInput.js +19 -15
  151. package/PageHeader/components/AutosizeInput/AutosizeInput.js +30 -22
  152. package/PageHeader/components/PageHeader/PageHeader.js +44 -27
  153. package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +51 -34
  154. package/PageHeader/components/PageHeaderError/PageHeaderError.js +17 -10
  155. package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +20 -16
  156. package/Pagination/Pagination.js +60 -49
  157. package/Popover/Popover.js +6 -5
  158. package/ProgressBar/ProgressBar.js +25 -10
  159. package/PushPreview/PushPreview.js +30 -22
  160. package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +23 -11
  161. package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +20 -13
  162. package/PushPreview/polyglot/index.d.ts +2 -0
  163. package/PushPreview/polyglot/index.js +9 -0
  164. package/PushPreview/polyglot/messages_en.d.ts +3 -0
  165. package/PushPreview/polyglot/messages_en.js +4 -0
  166. package/PushPreview/polyglot/messages_ru.d.ts +3 -0
  167. package/PushPreview/polyglot/messages_ru.js +4 -0
  168. package/PushPreview/polyglot/types.d.ts +5 -0
  169. package/PushPreview/polyglot/types.js +1 -0
  170. package/Radio/Radio.js +32 -26
  171. package/RadioCard/RadioCard.js +17 -9
  172. package/ReCaptcha/ReCaptcha.js +2 -2
  173. package/RichMessageEditor/EditorEmojiPicker.js +9 -7
  174. package/RichMessageEditor/RichMessageEditor.js +77 -67
  175. package/RichMessageEditor/RichMessageViewer.js +19 -13
  176. package/RichMessageEditor/slate/DynamicContentElement.d.ts +1 -2
  177. package/RichMessageEditor/slate/DynamicContentElement.js +13 -9
  178. package/RichMessageEditor/slate/SlateEditor.js +9 -7
  179. package/RichmediaPreview/RichmediaPreview.js +13 -11
  180. package/Select/Select.js +10 -8
  181. package/SendRate/SendRateEdit.d.ts +1 -2
  182. package/SendRate/SendRateEdit.js +42 -34
  183. package/SendRate/SendRateReadonly.d.ts +1 -2
  184. package/SendRate/SendRateReadonly.js +24 -20
  185. package/SendRate/components/Condition/index.d.ts +1 -2
  186. package/SendRate/components/Condition/index.js +15 -13
  187. package/SendRate/components/Description/index.d.ts +2 -2
  188. package/SendRate/components/Description/index.js +30 -22
  189. package/SendRate/components/Settings/index.d.ts +1 -2
  190. package/SendRate/components/Settings/index.js +20 -14
  191. package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +1 -2
  192. package/SendRate/helpers/getReadonlySendRateHelpers.js +39 -30
  193. package/Skeleton/TextSkeleton.js +5 -4
  194. package/SortButton/SortButton.js +11 -7
  195. package/Spinner/Spinner.js +7 -4
  196. package/StatisticCard/StatisticCard.js +44 -29
  197. package/Switch/Switch.js +16 -13
  198. package/Tabs/components/Tab/Tab.d.ts +3 -4
  199. package/Tabs/components/Tab/Tab.js +6 -4
  200. package/Tabs/components/TabBar/TabBar.d.ts +3 -4
  201. package/Tabs/components/TabBar/TabBar.js +12 -4
  202. package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts +1 -2
  203. package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.js +27 -21
  204. package/Tabs/components/TabBase/TabBase.d.ts +3 -4
  205. package/Tabs/components/TabBase/TabBase.js +11 -6
  206. package/Tabs/components/TabPanel/TabPanel.js +4 -2
  207. package/Tabs/components/Tabs/Tabs.js +8 -4
  208. package/Toast/Toast.js +31 -18
  209. package/Toast/ToastProvider.d.ts +2 -3
  210. package/Toast/ToastProvider.js +10 -8
  211. package/Tooltip/Tooltip.js +2 -2
  212. package/Tooltip/TooltipTrigger.js +13 -11
  213. package/package.json +2 -2
  214. package/polyglot/__tests__/render.test.js +46 -16
  215. package/polyglot/liquid/render.d.ts +2 -2
  216. package/polyglot/liquid/render.js +7 -6
  217. package/polyglot/react.js +7 -5
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Horizontal } from '@pushwoosh/kit-helpers';
3
3
  import { HelpRoundIcon } from '@pushwoosh/kit-icons';
4
4
  import { getCappingChipText } from './getCappingChipText';
@@ -9,42 +9,51 @@ import { CappingTypes } from '../types';
9
9
  export function getReadonlyCappingLabel(cappingOption, isGlobalCappingDisabled, capping, globalCapping, isInJourney, lang) {
10
10
  const tooltip = getReadonlyTooltip(cappingOption, isInJourney, lang);
11
11
  if (cappingOption === CappingTypes.CUSTOM) {
12
- return React.createElement(React.Fragment, null, lang({
13
- message: 'DUMB.FREQUENCY_CAPPING.RO.CUSTOM_LABEL'
14
- }), React.createElement(ChipFrequencyCapping, {
15
- text: getCappingChipText(lang, capping.messages, capping.days),
16
- tooltip: tooltip
17
- }));
12
+ return _jsxs(_Fragment, {
13
+ children: [lang({
14
+ message: 'DUMB.FREQUENCY_CAPPING.RO.CUSTOM_LABEL'
15
+ }), _jsx(ChipFrequencyCapping, {
16
+ text: getCappingChipText(lang, capping.messages, capping.days),
17
+ tooltip: tooltip
18
+ })]
19
+ });
18
20
  }
19
21
  if (cappingOption === CappingTypes.IGNORE) {
20
- return React.createElement(Horizontal, {
22
+ return _jsxs(Horizontal, {
21
23
  "$alignItems": "center",
22
24
  "$gap": 4,
23
- "$justifyContent": "start"
24
- }, lang({
25
- message: 'DUMB.FREQUENCY_CAPPING.RO.IGNORE_LABEL'
26
- }), React.createElement(Tooltip, {
27
- content: tooltip,
28
- position: "top-middle"
29
- }, React.createElement(IconWrapper, {
30
- "$padding": "4px 0"
31
- }, React.createElement(HelpRoundIcon, {
32
- size: "small",
33
- view: "lined"
34
- }))));
25
+ "$justifyContent": "start",
26
+ children: [lang({
27
+ message: 'DUMB.FREQUENCY_CAPPING.RO.IGNORE_LABEL'
28
+ }), _jsx(Tooltip, {
29
+ content: tooltip,
30
+ position: "top-middle",
31
+ children: _jsx(IconWrapper, {
32
+ "$padding": "4px 0",
33
+ children: _jsx(HelpRoundIcon, {
34
+ size: "small",
35
+ view: "lined"
36
+ })
37
+ })
38
+ })]
39
+ });
35
40
  }
36
- return isGlobalCappingDisabled ? React.createElement(React.Fragment, null, lang({
37
- message: 'DUMB.FREQUENCY_CAPPING.RO.GLOBAL_LABEL'
38
- }), React.createElement(ChipFrequencyCapping, {
39
- text: getCappingChipText(lang, 0, 0)
40
- }), lang({
41
- message: 'DUMB.FREQUENCY_CAPPING.RO.BECAUSE_UNSET'
42
- })) : React.createElement(React.Fragment, null, lang({
43
- message: 'DUMB.FREQUENCY_CAPPING.RO.GLOBAL_LABEL'
44
- }), React.createElement(ChipFrequencyCapping, {
45
- text: getCappingChipText(lang, globalCapping.count, globalCapping.days),
46
- tooltip: tooltip
47
- }));
41
+ return isGlobalCappingDisabled ? _jsxs(_Fragment, {
42
+ children: [lang({
43
+ message: 'DUMB.FREQUENCY_CAPPING.RO.GLOBAL_LABEL'
44
+ }), _jsx(ChipFrequencyCapping, {
45
+ text: getCappingChipText(lang, 0, 0)
46
+ }), lang({
47
+ message: 'DUMB.FREQUENCY_CAPPING.RO.BECAUSE_UNSET'
48
+ })]
49
+ }) : _jsxs(_Fragment, {
50
+ children: [lang({
51
+ message: 'DUMB.FREQUENCY_CAPPING.RO.GLOBAL_LABEL'
52
+ }), _jsx(ChipFrequencyCapping, {
53
+ text: getCappingChipText(lang, globalCapping.count, globalCapping.days),
54
+ tooltip: tooltip
55
+ })]
56
+ });
48
57
  }
49
58
  function getReadonlyTooltip(cappingOption, isInJourney, lang) {
50
59
  if (cappingOption === CappingTypes.IGNORE) {
@@ -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 { Vertical } from '@pushwoosh/kit-helpers';
4
4
  import { CheckRoundIcon, LockIcon } from '@pushwoosh/kit-icons';
@@ -14,29 +14,48 @@ export function GetStartedPage(props) {
14
14
  checkList = [],
15
15
  actions = null
16
16
  } = props;
17
- return React.createElement(GradientBackground, null, React.createElement(Wrapper, null, React.createElement(ContentBox, null, React.createElement(Vertical, {
18
- "$gap": 16
19
- }, React.createElement(Vertical, {
20
- "$gap": 4
21
- }, React.createElement(H1, null, title), React.createElement(Paragraph, null, description)), !!checkList.length && React.createElement(UnorderedList, null, checkList.map(text => React.createElement(UnorderedListItem, {
22
- key: `item-${text}`
23
- }, React.createElement(UnorderedListIcon, null, React.createElement(CheckRoundIcon, {
24
- color: Color.SUCCESS,
25
- size: "small",
26
- type: "fill",
27
- view: "filled"
28
- })), React.createElement(UnorderedListText, null, text))))), (helpText || actions) && React.createElement(Vertical, {
29
- "$gap": 16
30
- }, helpText && React.createElement(Banner, {
31
- type: "info",
32
- view: "ghost",
33
- title: helpText,
34
- icon: React.createElement(LockIcon, {
35
- view: "filled",
36
- size: "small"
17
+ return _jsx(GradientBackground, {
18
+ children: _jsxs(Wrapper, {
19
+ children: [_jsxs(ContentBox, {
20
+ children: [_jsxs(Vertical, {
21
+ "$gap": 16,
22
+ children: [_jsxs(Vertical, {
23
+ "$gap": 4,
24
+ children: [_jsx(H1, {
25
+ children: title
26
+ }), _jsx(Paragraph, {
27
+ children: description
28
+ })]
29
+ }), !!checkList.length && _jsx(UnorderedList, {
30
+ children: checkList.map(text => _jsxs(UnorderedListItem, {
31
+ children: [_jsx(UnorderedListIcon, {
32
+ children: _jsx(CheckRoundIcon, {
33
+ color: Color.SUCCESS,
34
+ size: "small",
35
+ type: "fill",
36
+ view: "filled"
37
+ })
38
+ }), _jsx(UnorderedListText, {
39
+ children: text
40
+ })]
41
+ }, `item-${text}`))
42
+ })]
43
+ }), (helpText || actions) && _jsxs(Vertical, {
44
+ "$gap": 16,
45
+ children: [helpText && _jsx(Banner, {
46
+ type: "info",
47
+ view: "ghost",
48
+ title: helpText,
49
+ icon: _jsx(LockIcon, {
50
+ view: "filled",
51
+ size: "small"
52
+ })
53
+ }), actions]
54
+ })]
55
+ }), _jsx(Image, {
56
+ alt: title,
57
+ src: image
58
+ })]
37
59
  })
38
- }), actions)), React.createElement(Image, {
39
- alt: title,
40
- src: image
41
- })));
60
+ });
42
61
  }
@@ -1,4 +1,5 @@
1
- import React, { useRef } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef } from 'react';
2
3
  import { Color } from '@pushwoosh/kit-constants';
3
4
  import { AttachmentIcon } from '@pushwoosh/kit-icons';
4
5
  import { Button } from '../Button';
@@ -49,39 +50,47 @@ export function InputFile({
49
50
  };
50
51
  reader.readAsDataURL(file);
51
52
  };
52
- return React.createElement(FieldBox, {
53
+ return _jsxs(FieldBox, {
53
54
  title: label,
54
- error: errorText
55
- }, React.createElement(InputFileFieldsStyled, null, React.createElement(InputFileInputHiddenStyled, {
56
- ref: fieldRef,
57
- id: fileId,
58
- type: "file",
59
- disabled: disabled,
60
- accept: accept,
61
- onChange: uploadFile,
62
- value: ""
63
- }), React.createElement(InputFileInputStyled, {
64
- id: textId,
65
- type: "text",
66
- disabled: disabled,
67
- placeholder: placeholder,
68
- value: fileName,
69
- readOnly: true,
70
- color: errorText ? Color.DANGER : Color.FORM
71
- }), React.createElement(InputFileButtonStyled, null, React.createElement(Button, {
72
- id: buttonId,
73
- type: "button",
74
- color: "secondary",
75
- size: "field",
76
- view: "shape",
77
- isDisabled: disabled,
78
- onClick: () => {
79
- var _fieldRef$current;
80
- return fieldRef === null || fieldRef === void 0 || (_fieldRef$current = fieldRef.current) === null || _fieldRef$current === void 0 ? void 0 : _fieldRef$current.click();
81
- },
82
- icon: React.createElement(AttachmentIcon, {
83
- size: "medium",
84
- view: "lined"
85
- })
86
- }, buttonText))), !!errorText && React.createElement(InputFileErrorStyled, null, errorText));
55
+ error: errorText,
56
+ children: [_jsxs(InputFileFieldsStyled, {
57
+ children: [_jsx(InputFileInputHiddenStyled, {
58
+ ref: fieldRef,
59
+ id: fileId,
60
+ type: "file",
61
+ disabled: disabled,
62
+ accept: accept,
63
+ onChange: uploadFile,
64
+ value: ""
65
+ }), _jsx(InputFileInputStyled, {
66
+ id: textId,
67
+ type: "text",
68
+ disabled: disabled,
69
+ placeholder: placeholder,
70
+ value: fileName,
71
+ readOnly: true,
72
+ color: errorText ? Color.DANGER : Color.FORM
73
+ }), _jsx(InputFileButtonStyled, {
74
+ children: _jsx(Button, {
75
+ id: buttonId,
76
+ type: "button",
77
+ color: "secondary",
78
+ size: "field",
79
+ view: "shape",
80
+ isDisabled: disabled,
81
+ onClick: () => {
82
+ var _fieldRef$current;
83
+ return fieldRef === null || fieldRef === void 0 || (_fieldRef$current = fieldRef.current) === null || _fieldRef$current === void 0 ? void 0 : _fieldRef$current.click();
84
+ },
85
+ icon: _jsx(AttachmentIcon, {
86
+ size: "medium",
87
+ view: "lined"
88
+ }),
89
+ children: buttonText
90
+ })
91
+ })]
92
+ }), !!errorText && _jsx(InputFileErrorStyled, {
93
+ children: errorText
94
+ })]
95
+ });
87
96
  }
package/Link/Link.js CHANGED
@@ -1,11 +1,11 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { LinkBox } from './styles';
3
3
  export function Link(props) {
4
4
  const {
5
5
  boxRef,
6
6
  ...rest
7
7
  } = props;
8
- return React.createElement(LinkBox, {
8
+ return _jsx(LinkBox, {
9
9
  ...rest,
10
10
  ref: boxRef
11
11
  });
@@ -1,4 +1,5 @@
1
- import React, { useState, useCallback, useEffect, useRef } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useCallback, useEffect, useRef } from 'react';
2
3
  import { createPortal } from 'react-dom';
3
4
  import { modalSizes } from './maps';
4
5
  import { LockBody, ModalBox, ModalBoxTrans, ModalContainer, ModalInner } from './styles';
@@ -33,16 +34,20 @@ export function Modal(props) {
33
34
  (_document$body$lastCh = document.body.lastChild) === null || _document$body$lastCh === void 0 || _document$body$lastCh.after(element);
34
35
  return () => element.remove();
35
36
  }, [element]);
36
- return createPortal(React.createElement(ModalBoxTrans, {
37
+ return createPortal(_jsx(ModalBoxTrans, {
37
38
  nodeRef: ref,
38
- isOpen: isOpen
39
- }, React.createElement(ModalBox, {
40
- ref: ref,
41
- "$zIndex": resolvedZIndex
42
- }, React.createElement(LockBody, null), React.createElement(ModalInner, {
43
- onMouseDown: handleClose
44
- }, React.createElement(ModalContainer, {
45
- "$width": modalSizes[size],
46
- onClick: handleClose
47
- }, typeof children === 'function' ? children() : children)))), element);
39
+ isOpen: isOpen,
40
+ children: _jsxs(ModalBox, {
41
+ ref: ref,
42
+ "$zIndex": resolvedZIndex,
43
+ children: [_jsx(LockBody, {}), _jsx(ModalInner, {
44
+ onMouseDown: handleClose,
45
+ children: _jsx(ModalContainer, {
46
+ "$width": modalSizes[size],
47
+ onClick: handleClose,
48
+ children: typeof children === 'function' ? children() : children
49
+ })
50
+ })]
51
+ })
52
+ }), element);
48
53
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CSSTransition } from 'react-transition-group';
3
3
  import styled, { createGlobalStyle } from 'styled-components';
4
4
  import { ShapeRadius } from '@pushwoosh/kit-constants';
@@ -21,14 +21,15 @@ function ModalBoxBase(props) {
21
21
  className,
22
22
  children
23
23
  } = props;
24
- return React.createElement(CSSTransition, {
24
+ return _jsx(CSSTransition, {
25
25
  appear: true,
26
26
  in: isOpen,
27
27
  timeout: animationTimeout,
28
28
  classNames: className,
29
29
  unmountOnExit: true,
30
- nodeRef: nodeRef
31
- }, children);
30
+ nodeRef: nodeRef,
31
+ children: children
32
+ });
32
33
  }
33
34
  export const ModalBoxTrans = styled(ModalBoxBase).withConfig({
34
35
  displayName: "ModalBoxTrans",
@@ -1,23 +1,35 @@
1
- import React, { useState, useCallback } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useCallback } from 'react';
2
3
  import { Vertical, Horizontal } from '@pushwoosh/kit-helpers';
3
4
  import { Banner } from '../../../Banner';
4
5
  import { Button } from '../../../Button';
6
+ import { useLang } from '../../polyglot';
5
7
  import { Modal } from '../Modal';
6
8
  import { ModalHeader, ModalBody, ModalFooter } from '../ModalContent';
7
9
  import { ModalTitle } from '../ModalTitle';
8
10
  export function ModalConfirm(props) {
11
+ const lang = useLang();
9
12
  const {
10
13
  isOpen,
11
- title = 'Confirm action',
14
+ title,
12
15
  size = 'small',
13
16
  description = '',
14
- confirmButtonText = 'Confirm',
15
- cancelButtonText = 'Cancel',
17
+ confirmButtonText,
18
+ cancelButtonText,
16
19
  confirmButtonColor = 'primary',
17
20
  callback,
18
21
  onAccept,
19
22
  onCancel
20
23
  } = props;
24
+ const resolvedTitle = title ?? lang({
25
+ message: 'DUMB.MODAL.CONFIRM_TITLE'
26
+ });
27
+ const resolvedConfirmText = confirmButtonText ?? lang({
28
+ message: 'DUMB.MODAL.CONFIRM'
29
+ });
30
+ const resolvedCancelText = cancelButtonText ?? lang({
31
+ message: 'DUMB.MODAL.CANCEL'
32
+ });
21
33
  const [isLoading, setIsLoading] = useState(false);
22
34
  const [errorMessage, setErrorMessage] = useState('');
23
35
  const handleConfirm = useCallback(async () => {
@@ -27,29 +39,44 @@ export function ModalConfirm(props) {
27
39
  await (callback === null || callback === void 0 ? void 0 : callback());
28
40
  await onAccept();
29
41
  } catch (error) {
30
- setErrorMessage((error === null || error === void 0 ? void 0 : error.message) || 'Unexpected error occurred');
42
+ setErrorMessage((error === null || error === void 0 ? void 0 : error.message) || lang({
43
+ message: 'DUMB.MODAL.UNEXPECTED_ERROR'
44
+ }));
31
45
  } finally {
32
46
  setIsLoading(false);
33
47
  }
34
- }, [callback, onAccept]);
35
- return React.createElement(Modal, {
48
+ }, [callback, onAccept, lang]);
49
+ return _jsxs(Modal, {
36
50
  size: size,
37
51
  isOpen: isOpen,
38
- onClose: onCancel
39
- }, React.createElement(ModalHeader, null, React.createElement(Vertical, {
40
- "$gap": 8
41
- }, React.createElement(ModalTitle, null, title), errorMessage && React.createElement(Banner, {
42
- type: "error",
43
- title: errorMessage
44
- }))), description && React.createElement(ModalBody, null, description), React.createElement(ModalFooter, null, React.createElement(Horizontal, {
45
- "$justifyContent": "end",
46
- "$gap": 8
47
- }, React.createElement(Button, {
48
- color: "secondary",
49
- onClick: onCancel
50
- }, cancelButtonText), React.createElement(Button, {
51
- color: confirmButtonColor,
52
- isLoading: isLoading,
53
- onClick: handleConfirm
54
- }, confirmButtonText))));
52
+ onClose: onCancel,
53
+ children: [_jsx(ModalHeader, {
54
+ children: _jsxs(Vertical, {
55
+ "$gap": 8,
56
+ children: [_jsx(ModalTitle, {
57
+ children: resolvedTitle
58
+ }), errorMessage && _jsx(Banner, {
59
+ type: "error",
60
+ title: errorMessage
61
+ })]
62
+ })
63
+ }), description && _jsx(ModalBody, {
64
+ children: description
65
+ }), _jsx(ModalFooter, {
66
+ children: _jsxs(Horizontal, {
67
+ "$justifyContent": "end",
68
+ "$gap": 8,
69
+ children: [_jsx(Button, {
70
+ color: "secondary",
71
+ onClick: onCancel,
72
+ children: resolvedCancelText
73
+ }), _jsx(Button, {
74
+ color: confirmButtonColor,
75
+ isLoading: isLoading,
76
+ onClick: handleConfirm,
77
+ children: resolvedConfirmText
78
+ })]
79
+ })
80
+ })]
81
+ });
55
82
  }
@@ -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
  }
@@ -3,7 +3,7 @@ import { type modalSizes } from '../Modal/maps';
3
3
  export type ConfirmButtonColor = 'primary' | 'secondary' | 'danger';
4
4
  export interface ModalConfirmProps {
5
5
  isOpen: boolean;
6
- title: string;
6
+ title?: string;
7
7
  size?: keyof typeof modalSizes;
8
8
  description?: ReactNode;
9
9
  confirmButtonText?: string;
@@ -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
  }
@@ -0,0 +1,2 @@
1
+ import { type ModalMessages } from './types';
2
+ export declare const useLang: () => (props: import("../../polyglot").LangProps<ModalMessages>) => string;
@@ -0,0 +1,9 @@
1
+ import { messages as en } from './messages_en';
2
+ import { messages as ru } from './messages_ru';
3
+ import { createLang } from '../../polyglot';
4
+ export const {
5
+ useLang
6
+ } = createLang({
7
+ en,
8
+ ru
9
+ });
@@ -0,0 +1,3 @@
1
+ import { type ModalMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ModalMessages>;
@@ -0,0 +1,6 @@
1
+ export const messages = {
2
+ 'DUMB.MODAL.UNEXPECTED_ERROR': 'Unexpected error occurred',
3
+ 'DUMB.MODAL.CONFIRM_TITLE': 'Confirm action',
4
+ 'DUMB.MODAL.CONFIRM': 'Confirm',
5
+ 'DUMB.MODAL.CANCEL': 'Cancel'
6
+ };
@@ -0,0 +1,3 @@
1
+ import { type ModalMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ModalMessages>;
@@ -0,0 +1,6 @@
1
+ export const messages = {
2
+ 'DUMB.MODAL.UNEXPECTED_ERROR': 'Произошла непредвиденная ошибка',
3
+ 'DUMB.MODAL.CONFIRM_TITLE': 'Подтвердите действие',
4
+ 'DUMB.MODAL.CONFIRM': 'Подтвердить',
5
+ 'DUMB.MODAL.CANCEL': 'Отмена'
6
+ };
@@ -0,0 +1,7 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type ModalMessages = {
3
+ 'DUMB.MODAL.UNEXPECTED_ERROR': NoParams;
4
+ 'DUMB.MODAL.CONFIRM_TITLE': NoParams;
5
+ 'DUMB.MODAL.CONFIRM': NoParams;
6
+ 'DUMB.MODAL.CANCEL': NoParams;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -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
  }