@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 } from "react/jsx-runtime";
2
2
  import { Columns } from '@pushwoosh/kit-helpers';
3
3
  import { format, addPeriod, setPeriod, monthName, isSamePeriod } from '../../helpers';
4
4
  import { CellBox, DateInfo } from '../../styles';
@@ -10,23 +10,27 @@ export function YearView(props) {
10
10
  onChange,
11
11
  onSelect
12
12
  } = props;
13
- return React.createElement(PickerPlate, {
13
+ return _jsx(PickerPlate, {
14
14
  onPrev: () => onChange(format(addPeriod(year, 'year', -1), 'year')),
15
15
  onNext: () => onChange(format(addPeriod(year, 'year', 1), 'year')),
16
- slot: React.createElement(DateInfo, null, year)
17
- }, React.createElement(Columns, {
18
- "$sizes": 4,
19
- "$gap": 4,
20
- "$justifyContent": "space-between"
21
- }, Array.from({
22
- length: 12
23
- }).map((_, i) => {
24
- const month = format(setPeriod(year, 'month', i + 1), 'year-month');
25
- return React.createElement(CellBox, {
26
- key: `${year}-${month}`,
27
- height: "59px",
28
- "$isActive": !!activeDay && isSamePeriod(month, activeDay, 'month'),
29
- onClick: () => onSelect(month)
30
- }, monthName(i + 1, 'short'));
31
- })));
16
+ slot: _jsx(DateInfo, {
17
+ children: year
18
+ }),
19
+ children: _jsx(Columns, {
20
+ "$sizes": 4,
21
+ "$gap": 4,
22
+ "$justifyContent": "space-between",
23
+ children: Array.from({
24
+ length: 12
25
+ }).map((_, i) => {
26
+ const month = format(setPeriod(year, 'month', i + 1), 'year-month');
27
+ return _jsx(CellBox, {
28
+ height: "59px",
29
+ "$isActive": !!activeDay && isSamePeriod(month, activeDay, 'month'),
30
+ onClick: () => onSelect(month),
31
+ children: monthName(i + 1, 'short')
32
+ }, `${year}-${month}`);
33
+ })
34
+ })
35
+ });
32
36
  }
@@ -0,0 +1,2 @@
1
+ import { type DateTimePickerMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<DateTimePickerMessages>>;
@@ -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
+ Lang
6
+ } = createLang({
7
+ en,
8
+ ru
9
+ });
@@ -0,0 +1,3 @@
1
+ import { type DateTimePickerMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<DateTimePickerMessages>;
@@ -0,0 +1,11 @@
1
+ export const messages = {
2
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SUN': 'Sun',
3
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_MON': 'Mon',
4
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_TUE': 'Tue',
5
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_WED': 'Wed',
6
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_THU': 'Thu',
7
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_FRI': 'Fri',
8
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SAT': 'Sat',
9
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE': 'Select date',
10
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME': 'Select date and time'
11
+ };
@@ -0,0 +1,3 @@
1
+ import { type DateTimePickerMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<DateTimePickerMessages>;
@@ -0,0 +1,11 @@
1
+ export const messages = {
2
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SUN': 'Вс',
3
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_MON': 'Пн',
4
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_TUE': 'Вт',
5
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_WED': 'Ср',
6
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_THU': 'Чт',
7
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_FRI': 'Пт',
8
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SAT': 'Сб',
9
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE': 'Выберите дату',
10
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME': 'Выберите дату и время'
11
+ };
@@ -0,0 +1,12 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type DateTimePickerMessages = {
3
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SUN': NoParams;
4
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_MON': NoParams;
5
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_TUE': NoParams;
6
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_WED': NoParams;
7
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_THU': NoParams;
8
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_FRI': NoParams;
9
+ 'DUMB.DATE_TIME_PICKER.WEEKDAY_SAT': NoParams;
10
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE': NoParams;
11
+ 'DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME': NoParams;
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
- import React, { useRef, useState, useEffect, useCallback } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef, useState, useEffect, useCallback } from 'react';
2
3
  import { createPortal } from 'react-dom';
3
4
  import { drawerSizes } from './maps';
4
5
  import { DrawerBoxTrans, DrawerBox, LockBody, DrawerInner, DrawerContainer } from './styles';
@@ -40,18 +41,22 @@ export function Drawer({
40
41
  handleClose(event);
41
42
  }
42
43
  }, [handleClose, closeOnClickOutside]);
43
- return createPortal(React.createElement(DrawerBoxTrans, {
44
+ return createPortal(_jsx(DrawerBoxTrans, {
44
45
  nodeRef: ref,
45
46
  isOpen: isOpen,
46
- withoutLockScreen: withoutLockScreen
47
- }, React.createElement(DrawerBox, {
48
- ref: ref,
49
- "$zIndex": resolvedZIndex
50
- }, React.createElement(LockBody, null), React.createElement(DrawerInner, {
51
- onMouseDown: handleClickOutside,
52
- "$padding": padding
53
- }, React.createElement(DrawerContainer, {
54
- "$width": drawerSizes[size],
55
- onClick: handleClose
56
- }, children)))), element);
47
+ withoutLockScreen: withoutLockScreen,
48
+ children: _jsxs(DrawerBox, {
49
+ ref: ref,
50
+ "$zIndex": resolvedZIndex,
51
+ children: [_jsx(LockBody, {}), _jsx(DrawerInner, {
52
+ onMouseDown: handleClickOutside,
53
+ "$padding": padding,
54
+ children: _jsx(DrawerContainer, {
55
+ "$width": drawerSizes[size],
56
+ onClick: handleClose,
57
+ children: children
58
+ })
59
+ })]
60
+ })
61
+ }), element);
57
62
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { type FC } from 'react';
2
2
  import type { ContentPadding, DrawerBoxBaseProps, IDrawerBoxTransProps } from './types';
3
3
  export declare const LockBody: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
4
4
  export declare const DrawerBox: import("styled-components").StyledComponent<"div", any, {
@@ -7,7 +7,7 @@ export declare const DrawerBox: import("styled-components").StyledComponent<"div
7
7
  export declare const DrawerInner: import("styled-components").StyledComponent<"div", any, {
8
8
  $padding?: ContentPadding;
9
9
  }, never>;
10
- export declare const DrawerBoxTrans: import("styled-components").StyledComponent<React.FC<DrawerBoxBaseProps>, any, IDrawerBoxTransProps, never>;
10
+ export declare const DrawerBoxTrans: import("styled-components").StyledComponent<FC<DrawerBoxBaseProps>, any, IDrawerBoxTransProps, never>;
11
11
  export declare const DrawerContainer: import("styled-components").StyledComponent<"div", any, {
12
12
  $width: string;
13
13
  }, never>;
@@ -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';
@@ -40,14 +40,15 @@ const DrawerBoxBase = props => {
40
40
  className,
41
41
  children
42
42
  } = props;
43
- return React.createElement(CSSTransition, {
43
+ return _jsx(CSSTransition, {
44
44
  appear: true,
45
45
  unmountOnExit: true,
46
46
  in: isOpen,
47
47
  timeout: animationTimeout,
48
48
  classNames: className,
49
- nodeRef: nodeRef
50
- }, children);
49
+ nodeRef: nodeRef,
50
+ children: children
51
+ });
51
52
  };
52
53
  export const DrawerBoxTrans = styled(DrawerBoxBase).withConfig({
53
54
  displayName: "DrawerBoxTrans",
@@ -1,13 +1,16 @@
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';
3
+ import { DrawerBodyIframe, IframeElement, LoadingBox } from './styles';
2
4
  import { Spinner } from '../../../Spinner';
5
+ import { Lang, useLang } from '../../polyglot';
3
6
  import { Drawer } from '../Drawer';
4
- import { DrawerBodyIframe, IframeElement, LoadingBox } from './styles';
5
7
  export function DrawerDocs(props) {
6
8
  const {
7
9
  isOpen,
8
10
  url,
9
11
  onClose
10
12
  } = props;
13
+ const lang = useLang();
11
14
  const [drawerWidth, setDrawerWidth] = useState(0);
12
15
  const [iframeLoaded, setIframeLoaded] = useState(false);
13
16
  const drawerDocsRef = useRef(null);
@@ -25,21 +28,29 @@ export function DrawerDocs(props) {
25
28
  window.removeEventListener('resize', updateDrawerWidth);
26
29
  };
27
30
  }, [isOpen]);
28
- return React.createElement(Drawer, {
31
+ return _jsx(Drawer, {
29
32
  size: "large",
30
33
  isOpen: isOpen,
31
- onClose: onClose
32
- }, React.createElement(DrawerBodyIframe, {
33
- ref: drawerDocsRef
34
- }, !iframeLoaded && React.createElement(LoadingBox, null, React.createElement(Spinner, {
35
- size: "medium"
36
- }), ' ', "Loading..."), React.createElement(IframeElement, {
37
- src: url,
38
- ref: iframeRef,
39
- title: "Pushwoosh docs",
40
- width: drawerWidth,
41
- height: "95%",
42
- "$isLoaded": iframeLoaded,
43
- onLoad: () => setIframeLoaded(true)
44
- })));
34
+ onClose: onClose,
35
+ children: _jsxs(DrawerBodyIframe, {
36
+ ref: drawerDocsRef,
37
+ children: [!iframeLoaded && _jsxs(LoadingBox, {
38
+ children: [_jsx(Spinner, {
39
+ size: "medium"
40
+ }), ' ', _jsx(Lang, {
41
+ message: "DUMB.DRAWER.DOCS_LOADING"
42
+ })]
43
+ }), _jsx(IframeElement, {
44
+ src: url,
45
+ ref: iframeRef,
46
+ title: lang({
47
+ message: 'DUMB.DRAWER.DOCS_TITLE'
48
+ }),
49
+ width: drawerWidth,
50
+ height: "95%",
51
+ "$isLoaded": iframeLoaded,
52
+ onLoad: () => setIframeLoaded(true)
53
+ })]
54
+ })
55
+ });
45
56
  }
@@ -0,0 +1,2 @@
1
+ import { type DrawerMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<DrawerMessages>>, useLang: () => (props: import("../../polyglot").LangProps<DrawerMessages>) => string;
@@ -0,0 +1,10 @@
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
+ Lang,
6
+ useLang
7
+ } = createLang({
8
+ en,
9
+ ru
10
+ });
@@ -0,0 +1,3 @@
1
+ import { type DrawerMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<DrawerMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.DRAWER.DOCS_LOADING': 'Loading...',
3
+ 'DUMB.DRAWER.DOCS_TITLE': 'Pushwoosh docs'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type DrawerMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<DrawerMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.DRAWER.DOCS_LOADING': 'Загрузка...',
3
+ 'DUMB.DRAWER.DOCS_TITLE': 'Документация Pushwoosh'
4
+ };
@@ -0,0 +1,5 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type DrawerMessages = {
3
+ 'DUMB.DRAWER.DOCS_LOADING': NoParams;
4
+ 'DUMB.DRAWER.DOCS_TITLE': NoParams;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { autoPlacement, size, offset, useFloating } from '@floating-ui/react-dom';
2
- import React, { useState, useEffect, useCallback } from 'react';
3
+ import { useState, useEffect, useCallback } from 'react';
3
4
  import { createPortal, flushSync } from 'react-dom';
4
5
  import { Place } from './styles';
5
6
  import { useLayer } from '../../../hooks';
@@ -75,27 +76,30 @@ export const DropdownMenu = ({
75
76
  }
76
77
  }
77
78
  }, [isOpen, isScrollable, refs.floating]);
78
- return React.createElement(DropdownContext.Provider, {
79
- value: setIsOpen
80
- }, renderHandler({
81
- onClick: () => {
82
- if (isOpen) {
83
- handleClose();
84
- } else {
85
- setIsOpen(true);
86
- }
87
- },
88
- ref: refs.setReference,
89
- isOpen
90
- }), isOpen && createPortal(React.createElement(DropdownZIndexContext.Provider, {
91
- value: resolvedZIndex
92
- }, React.createElement(Place, {
93
- ref: refs.setFloating,
94
- style: floatingStyles,
95
- "$color": color,
96
- "$width": width ?? undefined,
97
- "$fitContent": windowWidth === null && !fullWidth,
98
- "$scrollable": isScrollable,
99
- "$zIndex": resolvedZIndex
100
- }, renderChildren(children))), document.body));
79
+ return _jsxs(DropdownContext.Provider, {
80
+ value: setIsOpen,
81
+ children: [renderHandler({
82
+ onClick: () => {
83
+ if (isOpen) {
84
+ handleClose();
85
+ } else {
86
+ setIsOpen(true);
87
+ }
88
+ },
89
+ ref: refs.setReference,
90
+ isOpen
91
+ }), isOpen && createPortal(_jsx(DropdownZIndexContext.Provider, {
92
+ value: resolvedZIndex,
93
+ children: _jsx(Place, {
94
+ ref: refs.setFloating,
95
+ style: floatingStyles,
96
+ "$color": color,
97
+ "$width": width ?? undefined,
98
+ "$fitContent": windowWidth === null && !fullWidth,
99
+ "$scrollable": isScrollable,
100
+ "$zIndex": resolvedZIndex,
101
+ children: renderChildren(children)
102
+ })
103
+ }), document.body)]
104
+ });
101
105
  };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Button } from '../../../Button';
3
3
  import { DropdownMenu } from '../DropdownMenu';
4
4
  export const DropdownMenuButton = ({
@@ -13,7 +13,7 @@ export const DropdownMenuButton = ({
13
13
  children,
14
14
  ...buttonProps
15
15
  }) => {
16
- return React.createElement(DropdownMenu, {
16
+ return _jsx(DropdownMenu, {
17
17
  isScrollable: isScrollable,
18
18
  openOnMount: openOnMount,
19
19
  menuZIndex: menuZIndex,
@@ -23,13 +23,15 @@ export const DropdownMenuButton = ({
23
23
  ref,
24
24
  onClick,
25
25
  isOpen
26
- }) => React.createElement(Button, {
26
+ }) => _jsx(Button, {
27
27
  ...buttonProps,
28
28
  boxRef: ref,
29
29
  onClick: onClick,
30
30
  isOpen: isOpen,
31
31
  isDisabled: isDisabled,
32
- isLoading: isLoading
33
- }, label)
34
- }, children);
32
+ isLoading: isLoading,
33
+ children: label
34
+ }),
35
+ children: children
36
+ });
35
37
  };
@@ -1,4 +1,5 @@
1
- import React, { useContext } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext } from 'react';
2
3
  import { DropdownMenuItemStyled } from './styles';
3
4
  import { DropdownContext } from '../../context';
4
5
  export const DropdownMenuItem = ({
@@ -15,7 +16,7 @@ export const DropdownMenuItem = ({
15
16
  console.error('DropdownMenuItem must be inside DropdownMenu');
16
17
  }
17
18
  }
18
- return React.createElement(DropdownMenuItemStyled, {
19
+ return _jsx(DropdownMenuItemStyled, {
19
20
  "$active": isActive,
20
21
  "$danger": isDanger,
21
22
  onClick: () => {
@@ -25,6 +26,7 @@ export const DropdownMenuItem = ({
25
26
  onClick();
26
27
  },
27
28
  disabled: disabled,
28
- "data-active": isActive || undefined
29
- }, children);
29
+ "data-active": isActive || undefined,
30
+ children: children
31
+ });
30
32
  };
@@ -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 { Horizontal } from '@pushwoosh/kit-helpers';
4
4
  import { Text } from '@pushwoosh/kit-typography';
@@ -8,13 +8,16 @@ export const DropdownMenuSection = ({
8
8
  bgColor,
9
9
  children
10
10
  }) => {
11
- return React.createElement(DropdownMenuSectionRoot, {
12
- "$bgColor": bgColor
13
- }, title && React.createElement(Horizontal, {
14
- "$padding": "8px 12px"
15
- }, React.createElement(Text, {
16
- "$variant": "h5",
17
- "$color": Color.LOCKED,
18
- "$uppercase": true
19
- }, title)), children);
11
+ return _jsxs(DropdownMenuSectionRoot, {
12
+ "$bgColor": bgColor,
13
+ children: [title && _jsx(Horizontal, {
14
+ "$padding": "8px 12px",
15
+ children: _jsx(Text, {
16
+ "$variant": "h5",
17
+ "$color": Color.LOCKED,
18
+ "$uppercase": true,
19
+ children: title
20
+ })
21
+ }), children]
22
+ });
20
23
  };
@@ -1,5 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { flip, shift, useFloating } from '@floating-ui/react-dom';
2
- import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
3
+ import { useCallback, useContext, useEffect, useRef, useState } from 'react';
3
4
  import { createPortal } from 'react-dom';
4
5
  import { ChevronIcon } from '@pushwoosh/kit-icons';
5
6
  import { SubmenuTriggerInner } from './styles';
@@ -58,34 +59,42 @@ export const DropdownMenuSubmenu = ({
58
59
  setIsOpen(false);
59
60
  parentClose === null || parentClose === void 0 || parentClose(false);
60
61
  }, [parentClose]);
61
- return React.createElement(DropdownContext.Provider, {
62
- value: closeChain
63
- }, React.createElement(DropdownZIndexContext.Provider, {
64
- value: submenuZIndex
65
- }, React.createElement(DropdownMenuItemStyled, {
66
- ref: refs.setReference,
67
- type: "button",
68
- "$active": isOpen,
69
- "$danger": isDanger,
70
- disabled: disabled,
71
- onMouseEnter: scheduleOpen,
72
- onMouseLeave: scheduleClose,
73
- onClick: () => {
74
- if (disabled) return;
75
- clearTimers();
76
- openedByClick.current = !isOpen;
77
- setIsOpen(prev => !prev);
78
- }
79
- }, React.createElement(SubmenuTriggerInner, null, React.createElement("span", null, label), React.createElement(ChevronIcon, {
80
- direction: "right",
81
- size: "small"
82
- }))), isOpen && createPortal(React.createElement(Place, {
83
- ref: refs.setFloating,
84
- style: floatingStyles,
85
- "$fitContent": true,
86
- "$zIndex": submenuZIndex,
87
- onMouseEnter: clearTimers,
88
- onMouseLeave: scheduleClose,
89
- onClick: e => e.stopPropagation()
90
- }, renderChildren(children)), document.body)));
62
+ return _jsx(DropdownContext.Provider, {
63
+ value: closeChain,
64
+ children: _jsxs(DropdownZIndexContext.Provider, {
65
+ value: submenuZIndex,
66
+ children: [_jsx(DropdownMenuItemStyled, {
67
+ ref: refs.setReference,
68
+ type: "button",
69
+ "$active": isOpen,
70
+ "$danger": isDanger,
71
+ disabled: disabled,
72
+ onMouseEnter: scheduleOpen,
73
+ onMouseLeave: scheduleClose,
74
+ onClick: () => {
75
+ if (disabled) return;
76
+ clearTimers();
77
+ openedByClick.current = !isOpen;
78
+ setIsOpen(prev => !prev);
79
+ },
80
+ children: _jsxs(SubmenuTriggerInner, {
81
+ children: [_jsx("span", {
82
+ children: label
83
+ }), _jsx(ChevronIcon, {
84
+ direction: "right",
85
+ size: "small"
86
+ })]
87
+ })
88
+ }), isOpen && createPortal(_jsx(Place, {
89
+ ref: refs.setFloating,
90
+ style: floatingStyles,
91
+ "$fitContent": true,
92
+ "$zIndex": submenuZIndex,
93
+ onMouseEnter: clearTimers,
94
+ onMouseLeave: scheduleClose,
95
+ onClick: e => e.stopPropagation(),
96
+ children: renderChildren(children)
97
+ }), document.body)]
98
+ })
99
+ });
91
100
  };