@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
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
- import React, { useRef, useState, useEffect } from 'react';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef, useState, useEffect } from 'react';
2
3
  import { Input } from '../Input';
3
4
  import { Hidden } from './styles';
4
5
  export function AutosizeInput(props) {
@@ -20,16 +21,19 @@ export function AutosizeInput(props) {
20
21
  const addWidth = offsetWidth ? 12 : 16;
21
22
  setWidth(offsetWidth + addWidth);
22
23
  }, [value]);
23
- return React.createElement(React.Fragment, null, React.createElement(Input, {
24
- value: value,
25
- placeholder: placeholder,
26
- width: width,
27
- isDisabled: isDisabled,
28
- onChange: onChange,
29
- onKeyUp: onKeyUp,
30
- onKeyDown: onKeyDown,
31
- onBlur: onBlur
32
- }), React.createElement(Hidden, {
33
- ref: ref
34
- }, value || placeholder));
24
+ return _jsxs(_Fragment, {
25
+ children: [_jsx(Input, {
26
+ value: value,
27
+ placeholder: placeholder,
28
+ width: width,
29
+ isDisabled: isDisabled,
30
+ onChange: onChange,
31
+ onKeyUp: onKeyUp,
32
+ onKeyDown: onKeyDown,
33
+ onBlur: onBlur
34
+ }), _jsx(Hidden, {
35
+ ref: ref,
36
+ children: value || placeholder
37
+ })]
38
+ });
35
39
  }
@@ -1,4 +1,5 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
2
3
  import { Vertical } from '@pushwoosh/kit-helpers';
3
4
  import { format } from '../../helpers';
4
5
  import { CalendarBox } from '../../styles';
@@ -23,35 +24,37 @@ export function DatePicker(props) {
23
24
  setView('month');
24
25
  }
25
26
  }, [userInputDay]);
26
- return React.createElement(CalendarBox, {
27
- "$disabled": isDisabled
28
- }, view === 'month' && React.createElement(Vertical, {
29
- "$gap": 16
30
- }, React.createElement(MonthView, {
31
- month: month,
32
- activeDay: value ? format(value, 'year-month-day') : undefined,
33
- userInputDay: userInputDay,
34
- minDate: minDate,
35
- maxDate: maxDate,
36
- onChange: setMonth,
37
- onDaySelect: onChange,
38
- onShowYear: () => setView('year'),
39
- onShowDecade: () => setView('decade')
40
- }), slotAfterMonth && slotAfterMonth()), view === 'year' && React.createElement(YearView, {
41
- year: format(month, 'year'),
42
- activeDay: value ? format(value, 'year-month-day') : undefined,
43
- onChange: setMonth,
44
- onSelect: newMon => {
45
- setMonth(newMon);
46
- setView('month');
47
- }
48
- }), view === 'decade' && React.createElement(DecadeView, {
49
- value: format(month, 'year'),
50
- activeDay: value ? format(value, 'year-month-day') : undefined,
51
- onChange: setMonth,
52
- onSelect: newYear => {
53
- setMonth(newYear);
54
- setView('year');
55
- }
56
- }));
27
+ return _jsxs(CalendarBox, {
28
+ "$disabled": isDisabled,
29
+ children: [view === 'month' && _jsxs(Vertical, {
30
+ "$gap": 16,
31
+ children: [_jsx(MonthView, {
32
+ month: month,
33
+ activeDay: value ? format(value, 'year-month-day') : undefined,
34
+ userInputDay: userInputDay,
35
+ minDate: minDate,
36
+ maxDate: maxDate,
37
+ onChange: setMonth,
38
+ onDaySelect: onChange,
39
+ onShowYear: () => setView('year'),
40
+ onShowDecade: () => setView('decade')
41
+ }), slotAfterMonth && slotAfterMonth()]
42
+ }), view === 'year' && _jsx(YearView, {
43
+ year: format(month, 'year'),
44
+ activeDay: value ? format(value, 'year-month-day') : undefined,
45
+ onChange: setMonth,
46
+ onSelect: newMon => {
47
+ setMonth(newMon);
48
+ setView('month');
49
+ }
50
+ }), view === 'decade' && _jsx(DecadeView, {
51
+ value: format(month, 'year'),
52
+ activeDay: value ? format(value, 'year-month-day') : undefined,
53
+ onChange: setMonth,
54
+ onSelect: newYear => {
55
+ setMonth(newYear);
56
+ setView('year');
57
+ }
58
+ })]
59
+ });
57
60
  }
@@ -1,7 +1,9 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { useFloating, offset, autoPlacement } from '@floating-ui/react-dom';
2
- import React, { useState, useEffect } from 'react';
3
+ import { useState, useEffect } from 'react';
3
4
  import { CalendarIcon } from '@pushwoosh/kit-icons';
4
5
  import { format, monthName, get } from '../../helpers';
6
+ import { Lang } from '../../polyglot';
5
7
  import { InputFrame } from '../../styles';
6
8
  import { DatePicker } from '../DatePicker';
7
9
  export function DatePickerField(props) {
@@ -47,25 +49,33 @@ export function DatePickerField(props) {
47
49
  setShowPicker(false);
48
50
  }
49
51
  };
50
- return React.createElement(React.Fragment, null, React.createElement(InputFrame, {
51
- ref: refs.setReference,
52
- "$gap": 8,
53
- "$error": error,
54
- "$empty": !value,
55
- onClick: () => setShowPicker(!showPicker)
56
- }, React.createElement(CalendarIcon, {
57
- size: "medium",
58
- view: "lined"
59
- }), value ? React.createElement(React.Fragment, null, format(value, 'day '), monthName(get(value, 'month'), 'long'), format(value, ' year')) : 'Select date'), showPicker && React.createElement("div", {
60
- ref: refs.setFloating,
61
- style: {
62
- ...floatingStyles,
63
- zIndex
64
- }
65
- }, React.createElement(DatePicker, {
66
- value: value,
67
- minDate: minDate,
68
- maxDate: maxDate,
69
- onChange: onSelect
70
- })));
52
+ return _jsxs(_Fragment, {
53
+ children: [_jsxs(InputFrame, {
54
+ ref: refs.setReference,
55
+ "$gap": 8,
56
+ "$error": error,
57
+ "$empty": !value,
58
+ onClick: () => setShowPicker(!showPicker),
59
+ children: [_jsx(CalendarIcon, {
60
+ size: "medium",
61
+ view: "lined"
62
+ }), value ? _jsxs(_Fragment, {
63
+ children: [format(value, 'day '), monthName(get(value, 'month'), 'long'), format(value, ' year')]
64
+ }) : _jsx(Lang, {
65
+ message: "DUMB.DATE_TIME_PICKER.SELECT_DATE"
66
+ })]
67
+ }), showPicker && _jsx("div", {
68
+ ref: refs.setFloating,
69
+ style: {
70
+ ...floatingStyles,
71
+ zIndex
72
+ },
73
+ children: _jsx(DatePicker, {
74
+ value: value,
75
+ minDate: minDate,
76
+ maxDate: maxDate,
77
+ onChange: onSelect
78
+ })
79
+ })]
80
+ });
71
81
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Collapse, Horizontal } from '@pushwoosh/kit-helpers';
3
3
  import { format, createUTCDate } from '../../helpers';
4
4
  import { DatePicker } from '../DatePicker';
@@ -29,29 +29,31 @@ export function DateTimePicker(props) {
29
29
  date.setUTCSeconds(seconds);
30
30
  onChange(date.toUTCString());
31
31
  };
32
- return React.createElement(DatePicker, {
32
+ return _jsx(DatePicker, {
33
33
  value: format(date, 'year-month-dayThour:minute:second'),
34
34
  userInputDay: userInputDay,
35
35
  minDate: minDate,
36
36
  maxDate: maxDate,
37
37
  onChange: handleChange,
38
- slotAfterMonth: () => React.createElement(Collapse, {
39
- expanded: !!value
40
- }, React.createElement(Horizontal, {
41
- "$padding": "0 16px",
42
- "$gap": 8
43
- }, React.createElement(NumberPicker, {
44
- placeholder: "00",
45
- value: date.getUTCHours(),
46
- onChange: handleChangeHour
47
- }), React.createElement(NumberPicker, {
48
- placeholder: "00",
49
- value: date.getUTCMinutes(),
50
- onChange: handleChangeMinutes
51
- }), React.createElement(NumberPicker, {
52
- placeholder: "00",
53
- value: date.getUTCSeconds(),
54
- onChange: handleChangeSeconds
55
- })))
38
+ slotAfterMonth: () => _jsx(Collapse, {
39
+ expanded: !!value,
40
+ children: _jsxs(Horizontal, {
41
+ "$padding": "0 16px",
42
+ "$gap": 8,
43
+ children: [_jsx(NumberPicker, {
44
+ placeholder: "00",
45
+ value: date.getUTCHours(),
46
+ onChange: handleChangeHour
47
+ }), _jsx(NumberPicker, {
48
+ placeholder: "00",
49
+ value: date.getUTCMinutes(),
50
+ onChange: handleChangeMinutes
51
+ }), _jsx(NumberPicker, {
52
+ placeholder: "00",
53
+ value: date.getUTCSeconds(),
54
+ onChange: handleChangeSeconds
55
+ })]
56
+ })
57
+ })
56
58
  });
57
59
  }
@@ -1,7 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  import { useFloating, offset, autoPlacement } from '@floating-ui/react-dom';
2
- import React, { useState, useEffect } from 'react';
3
+ import { useState, useEffect } from 'react';
3
4
  import { CalendarIcon } from '@pushwoosh/kit-icons';
4
5
  import { useUTCDate } from './helpers';
6
+ import { Lang } from '../../polyglot';
5
7
  import { InputFrame } from '../../styles';
6
8
  import { DateTimePicker } from '../DateTimePicker';
7
9
  export function DateTimePickerField(props) {
@@ -54,25 +56,31 @@ export function DateTimePickerField(props) {
54
56
  hours,
55
57
  minutes
56
58
  } = useUTCDate(value);
57
- return React.createElement(React.Fragment, null, React.createElement(InputFrame, {
58
- ref: refs.setReference,
59
- "$empty": !value,
60
- "$error": error,
61
- "$gap": 8,
62
- onClick: () => setShowPicker(!showPicker)
63
- }, React.createElement(CalendarIcon, {
64
- size: "medium",
65
- view: "lined"
66
- }), value ? `${day} ${month} ${year} ${hours}:${minutes}` : 'Select date and time'), showPicker && React.createElement("div", {
67
- ref: refs.setFloating,
68
- style: {
69
- ...floatingStyles,
70
- zIndex
71
- }
72
- }, React.createElement(DateTimePicker, {
73
- value: value,
74
- minDate: minDate,
75
- maxDate: maxDate,
76
- onChange: onSelect
77
- })));
59
+ return _jsxs(_Fragment, {
60
+ children: [_jsxs(InputFrame, {
61
+ ref: refs.setReference,
62
+ "$empty": !value,
63
+ "$error": error,
64
+ "$gap": 8,
65
+ onClick: () => setShowPicker(!showPicker),
66
+ children: [_jsx(CalendarIcon, {
67
+ size: "medium",
68
+ view: "lined"
69
+ }), value ? `${day} ${month} ${year} ${hours}:${minutes}` : _jsx(Lang, {
70
+ message: "DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME"
71
+ })]
72
+ }), showPicker && _jsx("div", {
73
+ ref: refs.setFloating,
74
+ style: {
75
+ ...floatingStyles,
76
+ zIndex
77
+ },
78
+ children: _jsx(DateTimePicker, {
79
+ value: value,
80
+ minDate: minDate,
81
+ maxDate: maxDate,
82
+ onChange: onSelect
83
+ })
84
+ })]
85
+ });
78
86
  }
@@ -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, parseStringToArray, addPeriod, setPeriod } from '../../helpers';
4
4
  import { CellBox } from '../../styles';
@@ -13,21 +13,23 @@ export function DecadeView(props) {
13
13
  const [activeDayYear] = parseStringToArray(activeDay || '');
14
14
  const valueYear = +value;
15
15
  const firstYear = valueYear - valueYear % 12;
16
- return React.createElement(PickerPlate, {
16
+ return _jsx(PickerPlate, {
17
17
  onPrev: () => onChange(format(addPeriod(value, 'year', -12), 'year')),
18
- onNext: () => onChange(format(addPeriod(value, 'year', 12), 'year'))
19
- }, React.createElement(Columns, {
20
- "$sizes": 4,
21
- "$gap": 4
22
- }, Array.from({
23
- length: 12
24
- }).map((_, i) => {
25
- const year = firstYear + i;
26
- return React.createElement(CellBox, {
27
- key: year,
28
- height: "59px",
29
- "$isActive": year === activeDayYear,
30
- onClick: () => onSelect(format(setPeriod(value, 'year', year), 'year'))
31
- }, year);
32
- })));
18
+ onNext: () => onChange(format(addPeriod(value, 'year', 12), 'year')),
19
+ children: _jsx(Columns, {
20
+ "$sizes": 4,
21
+ "$gap": 4,
22
+ children: Array.from({
23
+ length: 12
24
+ }).map((_, i) => {
25
+ const year = firstYear + i;
26
+ return _jsx(CellBox, {
27
+ height: "59px",
28
+ "$isActive": year === activeDayYear,
29
+ onClick: () => onSelect(format(setPeriod(value, 'year', year), 'year')),
30
+ children: year
31
+ }, year);
32
+ })
33
+ })
34
+ });
33
35
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { InputStyled } from './styles';
3
3
  export function Input(props) {
4
4
  const {
@@ -6,7 +6,7 @@ export function Input(props) {
6
6
  isDisabled,
7
7
  ...rest
8
8
  } = props;
9
- return React.createElement(InputStyled, {
9
+ return _jsx(InputStyled, {
10
10
  type: "text",
11
11
  disabled: isDisabled,
12
12
  style: {
@@ -1,6 +1,8 @@
1
- import React, { useMemo } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
2
3
  import { Columns } from '@pushwoosh/kit-helpers';
3
4
  import { format, firstDayOfWeek, parseStringToDate, differenceInDays, isSamePeriod, isInRange } from '../../helpers';
5
+ import { Lang } from '../../polyglot';
4
6
  import { CellBox, DayHeader } from '../../styles';
5
7
  export function Month(props) {
6
8
  const {
@@ -23,25 +25,54 @@ export function Month(props) {
23
25
  const daysInCalendar = differenceInDays(firstDayOfLastWeek, firstDayOfFirstWeek) + 7;
24
26
  return [firstDayOfFirstWeek, daysInCalendar];
25
27
  }, [month]);
26
- return React.createElement(Columns, {
28
+ return _jsxs(Columns, {
27
29
  "$sizes": 7,
28
- "$gap": 4
29
- }, React.createElement(DayHeader, null, "Sun"), React.createElement(DayHeader, null, "Mon"), React.createElement(DayHeader, null, "Tue"), React.createElement(DayHeader, null, "Wed"), React.createElement(DayHeader, null, "Thu"), React.createElement(DayHeader, null, "Fri"), React.createElement(DayHeader, null, "Sat"), Array.from({
30
- length: days
31
- }).map((_, i) => {
32
- const curDay = new Date(Date.UTC(firstDayDate.getUTCFullYear(), firstDayDate.getUTCMonth(), firstDayDate.getUTCDate() + i));
33
- const isDisabled = isInRange({
34
- value: curDay,
35
- minDate: minDate,
36
- maxDate: maxDate
37
- });
38
- return React.createElement(CellBox, {
39
- key: `${curDay}`,
40
- "$isActive": !!activeDay && isSamePeriod(curDay, activeDay, 'day'),
41
- "$isDisabled": isDisabled,
42
- "$secondary": !isSamePeriod(month, curDay, 'month'),
43
- "$secondActive": !!userInputDay && isSamePeriod(curDay, userInputDay, 'day'),
44
- onClick: () => onDaySelect(format(curDay, 'year-month-day'))
45
- }, curDay.getUTCDate());
46
- }));
30
+ "$gap": 4,
31
+ children: [_jsx(DayHeader, {
32
+ children: _jsx(Lang, {
33
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_SUN"
34
+ })
35
+ }), _jsx(DayHeader, {
36
+ children: _jsx(Lang, {
37
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_MON"
38
+ })
39
+ }), _jsx(DayHeader, {
40
+ children: _jsx(Lang, {
41
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_TUE"
42
+ })
43
+ }), _jsx(DayHeader, {
44
+ children: _jsx(Lang, {
45
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_WED"
46
+ })
47
+ }), _jsx(DayHeader, {
48
+ children: _jsx(Lang, {
49
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_THU"
50
+ })
51
+ }), _jsx(DayHeader, {
52
+ children: _jsx(Lang, {
53
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_FRI"
54
+ })
55
+ }), _jsx(DayHeader, {
56
+ children: _jsx(Lang, {
57
+ message: "DUMB.DATE_TIME_PICKER.WEEKDAY_SAT"
58
+ })
59
+ }), Array.from({
60
+ length: days
61
+ }).map((_, i) => {
62
+ const curDay = new Date(Date.UTC(firstDayDate.getUTCFullYear(), firstDayDate.getUTCMonth(), firstDayDate.getUTCDate() + i));
63
+ const isDisabled = isInRange({
64
+ value: curDay,
65
+ minDate: minDate,
66
+ maxDate: maxDate
67
+ });
68
+ return _jsx(CellBox, {
69
+ "$isActive": !!activeDay && isSamePeriod(curDay, activeDay, 'day'),
70
+ "$isDisabled": isDisabled,
71
+ "$secondary": !isSamePeriod(month, curDay, 'month'),
72
+ "$secondActive": !!userInputDay && isSamePeriod(curDay, userInputDay, 'day'),
73
+ onClick: () => onDaySelect(format(curDay, 'year-month-day')),
74
+ children: curDay.getUTCDate()
75
+ }, `${curDay}`);
76
+ })]
77
+ });
47
78
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Horizontal } from '@pushwoosh/kit-helpers';
3
3
  import { addPeriod, format, monthName } from '../../helpers';
4
4
  import { DateInfo } from '../../styles';
@@ -16,22 +16,26 @@ export function MonthView(props) {
16
16
  onShowDecade,
17
17
  onChange
18
18
  } = props;
19
- return React.createElement(PickerPlate, {
19
+ return _jsx(PickerPlate, {
20
20
  onPrev: () => onChange(format(addPeriod(month, 'month', -1), 'year-month')),
21
21
  onNext: () => onChange(format(addPeriod(month, 'month', 1), 'year-month')),
22
- slot: React.createElement(Horizontal, {
23
- "$gap": 4
24
- }, React.createElement(DateInfo, {
25
- onClick: onShowYear
26
- }, monthName(+format(month, 'month'))), React.createElement(DateInfo, {
27
- onClick: onShowDecade
28
- }, format(month, 'year')))
29
- }, React.createElement(Month, {
30
- month: month,
31
- activeDay: activeDay,
32
- userInputDay: userInputDay,
33
- minDate: minDate,
34
- maxDate: maxDate,
35
- onDaySelect: onDaySelect
36
- }));
22
+ slot: _jsxs(Horizontal, {
23
+ "$gap": 4,
24
+ children: [_jsx(DateInfo, {
25
+ onClick: onShowYear,
26
+ children: monthName(+format(month, 'month'))
27
+ }), _jsx(DateInfo, {
28
+ onClick: onShowDecade,
29
+ children: format(month, 'year')
30
+ })]
31
+ }),
32
+ children: _jsx(Month, {
33
+ month: month,
34
+ activeDay: activeDay,
35
+ userInputDay: userInputDay,
36
+ minDate: minDate,
37
+ maxDate: maxDate,
38
+ onDaySelect: onDaySelect
39
+ })
40
+ });
37
41
  }
@@ -1,4 +1,5 @@
1
- import React, { useRef, useState, useEffect } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef, useState, useEffect } from 'react';
2
3
  import { Vertical, useMount, usePersistentFunction } from '@pushwoosh/kit-helpers';
3
4
  import { ChevronIcon } from '@pushwoosh/kit-icons';
4
5
  import { intVal, isStringInteger } from './helpers';
@@ -79,46 +80,54 @@ export function NumberPicker({
79
80
  };
80
81
  const resetAutoDiff = () => setAutoDiff(0);
81
82
  const InputComponent = autoSize ? AutosizeInput : Input;
82
- return React.createElement(SingleInputFrame, {
83
+ return _jsxs(SingleInputFrame, {
83
84
  ref: ref,
84
85
  "$hasHint": !!hint,
85
- "$isDisabled": isDisabled
86
- }, React.createElement(InputComponent, {
87
- value: localValue,
88
- placeholder: placeholder,
89
- isDisabled: isDisabled,
90
- onChange: handleChange,
91
- onKeyDown: handleKeyDown,
92
- onKeyUp: resetAutoDiff,
93
- onBlur: event => {
94
- let blurValue = intVal(event.target.value);
95
- const minValueValid = minValue === undefined || blurValue >= minValue;
96
- const maxValueValid = maxValue === undefined || blurValue <= maxValue;
97
- if (!maxValueValid) {
98
- blurValue = maxValue;
99
- } else if (!minValueValid) {
100
- blurValue = minValue;
86
+ "$isDisabled": isDisabled,
87
+ children: [_jsx(InputComponent, {
88
+ value: localValue,
89
+ placeholder: placeholder,
90
+ isDisabled: isDisabled,
91
+ onChange: handleChange,
92
+ onKeyDown: handleKeyDown,
93
+ onKeyUp: resetAutoDiff,
94
+ onBlur: event => {
95
+ let blurValue = intVal(event.target.value);
96
+ const minValueValid = minValue === undefined || blurValue >= minValue;
97
+ const maxValueValid = maxValue === undefined || blurValue <= maxValue;
98
+ if (!maxValueValid) {
99
+ blurValue = maxValue;
100
+ } else if (!minValueValid) {
101
+ blurValue = minValue;
102
+ }
103
+ onChange(blurValue);
104
+ setLocalValue(blurValue.toString());
101
105
  }
102
- onChange(blurValue);
103
- setLocalValue(blurValue.toString());
104
- }
105
- }), hint && React.createElement(Hint, null, hint), React.createElement(Vertical, {
106
- "$gap": 1
107
- }, React.createElement("div", null, React.createElement(ChevronIcon, {
108
- direction: "up",
109
- size: "small",
110
- "aria-disabled": "true",
111
- onClick: () => onChangeDiff(step),
112
- onMouseDown: () => setAutoDiff(step),
113
- onMouseUp: resetAutoDiff,
114
- onMouseLeave: resetAutoDiff
115
- })), React.createElement("div", null, React.createElement(ChevronIcon, {
116
- size: "small",
117
- direction: "down",
118
- "aria-disabled": isDisabled,
119
- onClick: () => onChangeDiff(-1 * step),
120
- onMouseDown: () => setAutoDiff(-1 * step),
121
- onMouseUp: resetAutoDiff,
122
- onMouseLeave: resetAutoDiff
123
- }))));
106
+ }), hint && _jsx(Hint, {
107
+ children: hint
108
+ }), _jsxs(Vertical, {
109
+ "$gap": 1,
110
+ children: [_jsx("div", {
111
+ children: _jsx(ChevronIcon, {
112
+ direction: "up",
113
+ size: "small",
114
+ "aria-disabled": "true",
115
+ onClick: () => onChangeDiff(step),
116
+ onMouseDown: () => setAutoDiff(step),
117
+ onMouseUp: resetAutoDiff,
118
+ onMouseLeave: resetAutoDiff
119
+ })
120
+ }), _jsx("div", {
121
+ children: _jsx(ChevronIcon, {
122
+ size: "small",
123
+ direction: "down",
124
+ "aria-disabled": isDisabled,
125
+ onClick: () => onChangeDiff(-1 * step),
126
+ onMouseDown: () => setAutoDiff(-1 * step),
127
+ onMouseUp: resetAutoDiff,
128
+ onMouseLeave: resetAutoDiff
129
+ })
130
+ })]
131
+ })]
132
+ });
124
133
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Vertical, Horizontal } from '@pushwoosh/kit-helpers';
3
3
  import { Arrow } from './styles';
4
4
  export function PickerPlate(props) {
@@ -8,17 +8,20 @@ export function PickerPlate(props) {
8
8
  onPrev,
9
9
  onNext
10
10
  } = props;
11
- return React.createElement(Vertical, {
12
- "$gap": 16
13
- }, React.createElement(Horizontal, {
14
- "$justifyContent": "space-between"
15
- }, slot, React.createElement(Horizontal, {
16
- "$gap": 4
17
- }, React.createElement(Arrow, {
18
- direction: "left",
19
- onClick: onPrev
20
- }), React.createElement(Arrow, {
21
- direction: "right",
22
- onClick: onNext
23
- }))), children);
11
+ return _jsxs(Vertical, {
12
+ "$gap": 16,
13
+ children: [_jsxs(Horizontal, {
14
+ "$justifyContent": "space-between",
15
+ children: [slot, _jsxs(Horizontal, {
16
+ "$gap": 4,
17
+ children: [_jsx(Arrow, {
18
+ direction: "left",
19
+ onClick: onPrev
20
+ }), _jsx(Arrow, {
21
+ direction: "right",
22
+ onClick: onNext
23
+ })]
24
+ })]
25
+ }), children]
26
+ });
24
27
  }