@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,9 +1,23 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import accessForbiddenImage from './assets/AccessForbidden.svg?url';
3
+ import { Lang, useLang } from './polyglot';
3
4
  import { RootBox, ImageBox, TitleBox, DescriptionBox } from './styles';
4
5
  export function AccessForbidden() {
5
- return React.createElement(RootBox, null, React.createElement(ImageBox, {
6
- alt: "Access forbidden",
7
- src: accessForbiddenImage
8
- }), React.createElement(TitleBox, null, "Access forbidden"), React.createElement(DescriptionBox, null, "You do not have permission to access this page. Please contact your administrator for assistance."));
6
+ const lang = useLang();
7
+ return _jsxs(RootBox, {
8
+ children: [_jsx(ImageBox, {
9
+ alt: lang({
10
+ message: 'DUMB.ACCESS_FORBIDDEN.TITLE'
11
+ }),
12
+ src: accessForbiddenImage
13
+ }), _jsx(TitleBox, {
14
+ children: _jsx(Lang, {
15
+ message: "DUMB.ACCESS_FORBIDDEN.TITLE"
16
+ })
17
+ }), _jsx(DescriptionBox, {
18
+ children: _jsx(Lang, {
19
+ message: "DUMB.ACCESS_FORBIDDEN.DESCRIPTION"
20
+ })
21
+ })]
22
+ });
9
23
  }
@@ -0,0 +1,2 @@
1
+ import { type AccessForbiddenMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("../../polyglot").LangProps<AccessForbiddenMessages>>, useLang: () => (props: import("../../polyglot").LangProps<AccessForbiddenMessages>) => 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 AccessForbiddenMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<AccessForbiddenMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.ACCESS_FORBIDDEN.TITLE': 'Access forbidden',
3
+ 'DUMB.ACCESS_FORBIDDEN.DESCRIPTION': 'You do not have permission to access this page. Please contact your administrator for assistance.'
4
+ };
@@ -0,0 +1,3 @@
1
+ import { type AccessForbiddenMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<AccessForbiddenMessages>;
@@ -0,0 +1,4 @@
1
+ export const messages = {
2
+ 'DUMB.ACCESS_FORBIDDEN.TITLE': 'Доступ запрещён',
3
+ 'DUMB.ACCESS_FORBIDDEN.DESCRIPTION': 'У вас нет прав для доступа к этой странице. Обратитесь к администратору за помощью.'
4
+ };
@@ -0,0 +1,5 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type AccessForbiddenMessages = {
3
+ 'DUMB.ACCESS_FORBIDDEN.TITLE': NoParams;
4
+ 'DUMB.ACCESS_FORBIDDEN.DESCRIPTION': NoParams;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
package/Alert/Alert.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import React from 'react';
2
1
  import type { AlertProps } from './types';
3
- export declare const Alert: ({ isExpandedDefault, title, type, children }: AlertProps) => React.JSX.Element;
2
+ export declare const Alert: ({ isExpandedDefault, title, type, children }: AlertProps) => import("react/jsx-runtime").JSX.Element;
package/Alert/Alert.js CHANGED
@@ -1,4 +1,5 @@
1
- import React, { useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
2
3
  import { ShapeRadius } from '@pushwoosh/kit-constants';
3
4
  import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
4
5
  import { ChevronIcon } from '@pushwoosh/kit-icons';
@@ -17,29 +18,34 @@ export const Alert = ({
17
18
  iconColor,
18
19
  bgColor
19
20
  } = AlertTypeMap[type];
20
- return React.createElement(Container, {
21
+ return _jsxs(Container, {
21
22
  "$borderRadius": ShapeRadius.SECTION,
22
- "$bgColor": bgColor
23
- }, React.createElement(AccordionHeader, {
24
- onClick: () => canCollapse && setIsExpanded(!isExpanded),
25
- "$canCollapse": canCollapse,
26
- "$justifyContent": "space-between",
27
- "$alignItems": "center",
28
- "$gap": 8,
29
- "$padding": "8px 12px 8px 16px"
30
- }, React.createElement(Horizontal, {
31
- "$gap": 8
32
- }, React.createElement(Icon, {
33
- size: "small",
34
- view: "lined",
35
- color: iconColor
36
- }), title), canCollapse && React.createElement(Horizontal, {
37
- "$justifyContent": "center"
38
- }, React.createElement(ChevronIcon, {
39
- size: "small",
40
- direction: isExpanded ? 'up' : 'down',
41
- color: iconColor
42
- }))), isExpanded && React.createElement(Vertical, {
43
- "$padding": "0 16px 16px"
44
- }, children));
23
+ "$bgColor": bgColor,
24
+ children: [_jsxs(AccordionHeader, {
25
+ onClick: () => canCollapse && setIsExpanded(!isExpanded),
26
+ "$canCollapse": canCollapse,
27
+ "$justifyContent": "space-between",
28
+ "$alignItems": "center",
29
+ "$gap": 8,
30
+ "$padding": "8px 12px 8px 16px",
31
+ children: [_jsxs(Horizontal, {
32
+ "$gap": 8,
33
+ children: [_jsx(Icon, {
34
+ size: "small",
35
+ view: "lined",
36
+ color: iconColor
37
+ }), title]
38
+ }), canCollapse && _jsx(Horizontal, {
39
+ "$justifyContent": "center",
40
+ children: _jsx(ChevronIcon, {
41
+ size: "small",
42
+ direction: isExpanded ? 'up' : 'down',
43
+ color: iconColor
44
+ })
45
+ })]
46
+ }), isExpanded && _jsx(Vertical, {
47
+ "$padding": "0 16px 16px",
48
+ children: children
49
+ })]
50
+ });
45
51
  };
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
1
  export type ApplicationPreloaderProps = {
3
2
  fullscreen?: boolean;
4
3
  };
5
- export declare function ApplicationPreloader({ fullscreen }: ApplicationPreloaderProps): React.JSX.Element;
4
+ export declare function ApplicationPreloader({ fullscreen }: ApplicationPreloaderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,10 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ApplicationPreloaderBox, ApplicationPreloaderAnimation } from './styles';
3
3
  export function ApplicationPreloader({
4
4
  fullscreen = true
5
5
  }) {
6
- return React.createElement(ApplicationPreloaderBox, {
7
- "$fullscreen": fullscreen
8
- }, React.createElement(ApplicationPreloaderAnimation, null));
6
+ return _jsx(ApplicationPreloaderBox, {
7
+ "$fullscreen": fullscreen,
8
+ children: _jsx(ApplicationPreloaderAnimation, {})
9
+ });
9
10
  }
package/Badge/Badge.js CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { BadgeBox } from './styles';
3
3
  export function Badge(props) {
4
4
  const {
@@ -7,7 +7,7 @@ export function Badge(props) {
7
7
  isSaturated,
8
8
  ...rest
9
9
  } = props;
10
- return React.createElement(BadgeBox, {
10
+ return _jsx(BadgeBox, {
11
11
  ...rest,
12
12
  ref: boxRef,
13
13
  "$color": color,
package/Banner/Banner.js CHANGED
@@ -1,4 +1,5 @@
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 } from '@pushwoosh/kit-helpers';
3
4
  import { CloseIcon } from '@pushwoosh/kit-icons';
4
5
  import { H4 } from '@pushwoosh/kit-typography';
@@ -50,32 +51,47 @@ export function Banner(props) {
50
51
  if (!isOpen) {
51
52
  return null;
52
53
  }
53
- return React.createElement(BannerBox, {
54
+ return _jsxs(BannerBox, {
54
55
  ...rest,
55
56
  "$isOpen": isOpen,
56
57
  "$isLoading": isLoading,
57
58
  ref: boxRef,
58
59
  "$type": type,
59
- className: className
60
- }, React.createElement(IconContainer, null, icon || React.createElement(DefaultIcon, {
61
- size: "small",
62
- view: "filled"
63
- })), React.createElement(BannerContent, {
64
- "$hasChildren": !!children
65
- }, React.createElement(H4, null, title), children && React.createElement("div", null, children)), action && React.createElement(Vertical, {
66
- "$padding": "0 8px 0 0",
67
- "$alignContent": "center"
68
- }, React.createElement(ActionButton, {
69
- onClick: handleAction,
70
- "$isPressed": isActionPressed,
71
- "$isLoading": isLoading
72
- }, React.createElement("span", null, action.buttonText), isLoading && React.createElement(BannerSpinner, null, React.createElement(Spinner, {
73
- size: "small",
74
- color: SpinnerColor
75
- })))), canBeClosed && React.createElement(CloseButton, {
76
- onClick: handleClose,
77
- "$isPressed": isClosePressed
78
- }, React.createElement(CloseIcon, {
79
- size: "small"
80
- })));
60
+ className: className,
61
+ children: [_jsx(IconContainer, {
62
+ children: icon || _jsx(DefaultIcon, {
63
+ size: "small",
64
+ view: "filled"
65
+ })
66
+ }), _jsxs(BannerContent, {
67
+ "$hasChildren": !!children,
68
+ children: [_jsx(H4, {
69
+ children: title
70
+ }), children && _jsx("div", {
71
+ children: children
72
+ })]
73
+ }), action && _jsx(Vertical, {
74
+ "$padding": "0 8px 0 0",
75
+ "$alignContent": "center",
76
+ children: _jsxs(ActionButton, {
77
+ onClick: handleAction,
78
+ "$isPressed": isActionPressed,
79
+ "$isLoading": isLoading,
80
+ children: [_jsx("span", {
81
+ children: action.buttonText
82
+ }), isLoading && _jsx(BannerSpinner, {
83
+ children: _jsx(Spinner, {
84
+ size: "small",
85
+ color: SpinnerColor
86
+ })
87
+ })]
88
+ })
89
+ }), canBeClosed && _jsx(CloseButton, {
90
+ onClick: handleClose,
91
+ "$isPressed": isClosePressed,
92
+ children: _jsx(CloseIcon, {
93
+ size: "small"
94
+ })
95
+ })]
96
+ });
81
97
  }
package/Button/Button.js CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Spinner } from '../Spinner';
3
3
  import { ButtonPropsToButtonBoxMap, SpinnerSizeByButtonSizeMap } from './maps';
4
4
  import { ButtonIcon, ButtonSpinner, ButtonContent } from './styles';
@@ -27,7 +27,7 @@ export function Button(props) {
27
27
  return null;
28
28
  }
29
29
  const isShowOverlaySpinner = !!children && !icon && view !== 'ghost' && isLoading;
30
- return React.createElement(ButtonBox, {
30
+ return _jsxs(ButtonBox, {
31
31
  ...rest,
32
32
  type: type,
33
33
  disabled: isDisabled,
@@ -38,11 +38,22 @@ export function Button(props) {
38
38
  "$hasLeftIcon": !!icon,
39
39
  "$hasRightIcon": !!rightIcon,
40
40
  "$hasContent": !!children,
41
- ref: boxRef
42
- }, icon && React.createElement(ButtonIcon, null, isLoading ? React.createElement(Spinner, {
43
- size: SpinnerSizeByButtonSizeMap[size]
44
- }) : icon), children && React.createElement(ButtonContent, null, React.createElement("div", null, children)), rightIcon && React.createElement(ButtonIcon, null, rightIcon), isShowOverlaySpinner && React.createElement(ButtonSpinner, null, React.createElement(Spinner, {
45
- color: "danger",
46
- size: SpinnerSizeByButtonSizeMap[size]
47
- })));
41
+ ref: boxRef,
42
+ children: [icon && _jsx(ButtonIcon, {
43
+ children: isLoading ? _jsx(Spinner, {
44
+ size: SpinnerSizeByButtonSizeMap[size]
45
+ }) : icon
46
+ }), children && _jsx(ButtonContent, {
47
+ children: _jsx("div", {
48
+ children: children
49
+ })
50
+ }), rightIcon && _jsx(ButtonIcon, {
51
+ children: rightIcon
52
+ }), isShowOverlaySpinner && _jsx(ButtonSpinner, {
53
+ children: _jsx(Spinner, {
54
+ color: "danger",
55
+ size: SpinnerSizeByButtonSizeMap[size]
56
+ })
57
+ })]
58
+ });
48
59
  }
@@ -1,10 +1,11 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CloseIcon } from '@pushwoosh/kit-icons';
3
3
  import { RemoveButtonBox } from './styles';
4
4
  export function RemoveButton(props) {
5
- return React.createElement(RemoveButtonBox, {
6
- ...props
7
- }, React.createElement(CloseIcon, {
8
- size: "small"
9
- }));
5
+ return _jsx(RemoveButtonBox, {
6
+ ...props,
7
+ children: _jsx(CloseIcon, {
8
+ size: "small"
9
+ })
10
+ });
10
11
  }
@@ -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 { Color } from '@pushwoosh/kit-constants';
3
4
  import { Horizontal, useClickAway, Vertical } from '@pushwoosh/kit-helpers';
4
5
  import { CalendarIcon } from '@pushwoosh/kit-icons';
@@ -61,111 +62,123 @@ export const CalendarDropdown = props => {
61
62
  } else {
62
63
  buttonText = stringifyValue(value, withTime, timezone);
63
64
  }
64
- return React.createElement(Horizontal, {
65
- "$justifyContent": "start"
66
- }, React.createElement(Button, {
67
- boxRef: buttonRef,
68
- type: "button",
69
- view: buttonView,
70
- size: buttonSize,
71
- color: buttonColor,
72
- icon: React.createElement(CalendarIcon, {
73
- size: buttonSize === 'compact' ? 'small' : 'medium',
74
- view: "lined"
75
- }),
76
- onClick: () => isOpen ? closePopover() : openPopover(),
77
- isOpen: isOpen
78
- }, buttonTextCustom ?? buttonText), React.createElement(Popover, {
79
- open: isOpen,
80
- anchorEl: buttonRef,
81
- internalWindowRef: popoverRef,
82
- windowWidth: isRangePicker ? 500 : 260,
83
- position: "bottom-start",
84
- zIndex: 10010
85
- }, React.createElement(PopoverContent, {
86
- "$isShaking": isShaking,
87
- onAnimationEnd: () => setIsShaking(false)
88
- }, React.createElement(Vertical, null, presets && presets.length > 0 && React.createElement(PresetsContainer, null, presets.map((preset, i) => React.createElement(Chip, {
89
- key: i,
90
- onClick: () => onChangeHandler(preset.value)
91
- }, preset.label))), React.createElement(Horizontal, {
92
- "$padding": 16,
93
- "$border": {
94
- bottom: `1px solid ${Color.DIVIDER}`
95
- }
96
- }, mode === 'single-date' && React.createElement(CalendarSuperForm, {
97
- mode: "single-date",
98
- ...calendarProps,
99
- value: value,
100
- onChange: onChangeHandler
101
- }), mode === 'single-datetime' && React.createElement(CalendarSuperForm, {
102
- mode: "single-datetime",
103
- ...calendarProps,
104
- value: value,
105
- onChange: onChangeHandler,
106
- timezone: timezone,
107
- onChangeTimezone: val => {
108
- setTimezone(val);
109
- if ('onChangeTimezone' in calendarProps) {
110
- calendarProps.onChangeTimezone(val);
111
- }
112
- }
113
- }), mode === 'range-date' && React.createElement(CalendarSuperForm, {
114
- mode: "range-date",
115
- ...calendarProps,
116
- value: value,
117
- onChange: onChangeHandler
118
- }), mode === 'range-datetime' && React.createElement(CalendarSuperForm, {
119
- mode: "range-datetime",
120
- ...calendarProps,
121
- value: value,
122
- onChange: onChangeHandler,
123
- timezone: timezone,
124
- onChangeTimezone: val => {
125
- setTimezone(val);
126
- if ('onChangeTimezone' in calendarProps) {
127
- calendarProps.onChangeTimezone(val);
128
- }
129
- }
130
- })), React.createElement(Horizontal, {
131
- "$padding": 16,
132
- "$justifyContent": "end",
133
- "$gap": 8
134
- }, React.createElement(Button, {
135
- color: "secondary",
136
- size: "compact",
137
- onClick: () => {
138
- if (noValue) {
139
- closePopover();
140
- } else {
141
- setValue(isRangePicker ? [] : undefined);
142
- setTimezone(initialTimezone);
143
- }
144
- }
145
- }, noValue ? React.createElement(Lang, {
146
- message: "DUMB.CALENDAR.CANCEL"
147
- }) : React.createElement(Lang, {
148
- message: "DUMB.CALENDAR.RESET"
149
- })), React.createElement(Button, {
150
- color: "primary",
151
- size: "compact",
152
- onClick: () => {
153
- let isInvalid;
154
- if (isRangePicker) {
155
- const range = value;
156
- const length = (range === null || range === void 0 ? void 0 : range.length) ?? 0;
157
- isInvalid = allowEmpty ? length === 1 : length !== 2;
158
- } else {
159
- isInvalid = allowEmpty ? false : !value;
160
- }
161
- if (isInvalid) {
162
- setIsShaking(true);
163
- } else {
164
- props.onSubmit(value, timezone);
165
- closePopover();
166
- }
167
- }
168
- }, React.createElement(Lang, {
169
- message: "DUMB.CALENDAR.APPLY"
170
- })))))));
65
+ return _jsxs(Horizontal, {
66
+ "$justifyContent": "start",
67
+ children: [_jsx(Button, {
68
+ boxRef: buttonRef,
69
+ type: "button",
70
+ view: buttonView,
71
+ size: buttonSize,
72
+ color: buttonColor,
73
+ icon: _jsx(CalendarIcon, {
74
+ size: buttonSize === 'compact' ? 'small' : 'medium',
75
+ view: "lined"
76
+ }),
77
+ onClick: () => isOpen ? closePopover() : openPopover(),
78
+ isOpen: isOpen,
79
+ children: buttonTextCustom ?? buttonText
80
+ }), _jsx(Popover, {
81
+ open: isOpen,
82
+ anchorEl: buttonRef,
83
+ internalWindowRef: popoverRef,
84
+ windowWidth: isRangePicker ? 500 : 260,
85
+ position: "bottom-start",
86
+ zIndex: 10010,
87
+ children: _jsx(PopoverContent, {
88
+ "$isShaking": isShaking,
89
+ onAnimationEnd: () => setIsShaking(false),
90
+ children: _jsxs(Vertical, {
91
+ children: [presets && presets.length > 0 && _jsx(PresetsContainer, {
92
+ children: presets.map((preset, i) => _jsx(Chip, {
93
+ onClick: () => onChangeHandler(preset.value),
94
+ children: preset.label
95
+ }, i))
96
+ }), _jsxs(Horizontal, {
97
+ "$padding": 16,
98
+ "$border": {
99
+ bottom: `1px solid ${Color.DIVIDER}`
100
+ },
101
+ children: [mode === 'single-date' && _jsx(CalendarSuperForm, {
102
+ mode: "single-date",
103
+ ...calendarProps,
104
+ value: value,
105
+ onChange: onChangeHandler
106
+ }), mode === 'single-datetime' && _jsx(CalendarSuperForm, {
107
+ mode: "single-datetime",
108
+ ...calendarProps,
109
+ value: value,
110
+ onChange: onChangeHandler,
111
+ timezone: timezone,
112
+ onChangeTimezone: val => {
113
+ setTimezone(val);
114
+ if ('onChangeTimezone' in calendarProps) {
115
+ calendarProps.onChangeTimezone(val);
116
+ }
117
+ }
118
+ }), mode === 'range-date' && _jsx(CalendarSuperForm, {
119
+ mode: "range-date",
120
+ ...calendarProps,
121
+ value: value,
122
+ onChange: onChangeHandler
123
+ }), mode === 'range-datetime' && _jsx(CalendarSuperForm, {
124
+ mode: "range-datetime",
125
+ ...calendarProps,
126
+ value: value,
127
+ onChange: onChangeHandler,
128
+ timezone: timezone,
129
+ onChangeTimezone: val => {
130
+ setTimezone(val);
131
+ if ('onChangeTimezone' in calendarProps) {
132
+ calendarProps.onChangeTimezone(val);
133
+ }
134
+ }
135
+ })]
136
+ }), _jsxs(Horizontal, {
137
+ "$padding": 16,
138
+ "$justifyContent": "end",
139
+ "$gap": 8,
140
+ children: [_jsx(Button, {
141
+ color: "secondary",
142
+ size: "compact",
143
+ onClick: () => {
144
+ if (noValue) {
145
+ closePopover();
146
+ } else {
147
+ setValue(isRangePicker ? [] : undefined);
148
+ setTimezone(initialTimezone);
149
+ }
150
+ },
151
+ children: noValue ? _jsx(Lang, {
152
+ message: "DUMB.CALENDAR.CANCEL"
153
+ }) : _jsx(Lang, {
154
+ message: "DUMB.CALENDAR.RESET"
155
+ })
156
+ }), _jsx(Button, {
157
+ color: "primary",
158
+ size: "compact",
159
+ onClick: () => {
160
+ let isInvalid;
161
+ if (isRangePicker) {
162
+ const range = value;
163
+ const length = (range === null || range === void 0 ? void 0 : range.length) ?? 0;
164
+ isInvalid = allowEmpty ? length === 1 : length !== 2;
165
+ } else {
166
+ isInvalid = allowEmpty ? false : !value;
167
+ }
168
+ if (isInvalid) {
169
+ setIsShaking(true);
170
+ } else {
171
+ props.onSubmit(value, timezone);
172
+ closePopover();
173
+ }
174
+ },
175
+ children: _jsx(Lang, {
176
+ message: "DUMB.CALENDAR.APPLY"
177
+ })
178
+ })]
179
+ })]
180
+ })
181
+ })
182
+ })]
183
+ });
171
184
  };