@pushwoosh/dumb-components 1.1.135 → 1.1.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/AccessForbidden/AccessForbidden.js +17 -11
  2. package/Alert/Alert.d.ts +1 -2
  3. package/Alert/Alert.js +31 -25
  4. package/ApplicationPreloader/ApplicationPreloader.d.ts +1 -2
  5. package/ApplicationPreloader/ApplicationPreloader.js +5 -4
  6. package/Badge/Badge.js +2 -2
  7. package/Banner/Banner.js +40 -24
  8. package/Button/Button.js +20 -9
  9. package/Button/RemoveButton.js +7 -6
  10. package/Calendar/CalendarDropdown/CalendarDropdown.js +121 -108
  11. package/Calendar/CalendarMonth/CalendarMonth.js +68 -66
  12. package/Calendar/CalendarMonthSlider/CalendarMonthSlider.d.ts +2 -2
  13. package/Calendar/CalendarMonthSlider/CalendarMonthSlider.js +68 -55
  14. package/Calendar/CalendarSuperForm/CalendarSuperForm.js +75 -70
  15. package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.d.ts +2 -2
  16. package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.js +3 -2
  17. package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +106 -88
  18. package/Calendar/CalendarSuperForm/components/CalendarTimeInput.d.ts +1 -2
  19. package/Calendar/CalendarSuperForm/components/CalendarTimeInput.js +2 -2
  20. package/Calendar/CalendarSuperForm/components/CalendarTimezoneSelect.js +3 -2
  21. package/CardMetric/CardChildren.js +9 -6
  22. package/CardMetric/CardCollapse.js +8 -6
  23. package/CardMetric/CardMetric.js +52 -33
  24. package/Checkbox/Checkbox.js +30 -24
  25. package/Chip/Chip.d.ts +6 -7
  26. package/Chip/Chip.js +22 -15
  27. package/CodeEditor/CodeEditor.d.ts +1 -2
  28. package/CodeEditor/CodeEditor.js +2 -2
  29. package/CrashScreen/CrashScreen.js +18 -10
  30. package/DateTimePicker/components/AutosizeInput/AutosizeInput.js +17 -13
  31. package/DateTimePicker/components/DatePicker/DatePicker.js +35 -32
  32. package/DateTimePicker/components/DatePickerField/DatePickerField.js +31 -24
  33. package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +22 -20
  34. package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +29 -24
  35. package/DateTimePicker/components/DecadeView/DecadeView.js +19 -17
  36. package/DateTimePicker/components/Input/Input.js +2 -2
  37. package/DateTimePicker/components/Month/Month.js +51 -35
  38. package/DateTimePicker/components/MonthView/MonthView.js +21 -17
  39. package/DateTimePicker/components/NumberPicker/NumberPicker.js +49 -40
  40. package/DateTimePicker/components/PickerPlate/PickerPlate.js +17 -14
  41. package/DateTimePicker/components/YearView/YearView.js +22 -18
  42. package/Drawer/components/Drawer/Drawer.js +18 -13
  43. package/Drawer/components/Drawer/styles.d.ts +2 -2
  44. package/Drawer/components/Drawer/styles.js +5 -4
  45. package/Drawer/components/DrawerDocs/DrawerDocs.js +25 -20
  46. package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +28 -24
  47. package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +8 -6
  48. package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +6 -4
  49. package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.js +13 -10
  50. package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.js +40 -31
  51. package/EditableField/EditableField.js +55 -43
  52. package/EmailTemplatePreview/EmailTemplatePreview.js +10 -8
  53. package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +28 -22
  54. package/EnhancedInput/EnhancedInput.d.ts +3 -4
  55. package/EnhancedInput/EnhancedInput.js +14 -10
  56. package/EnhancedInput/SearchInput.js +3 -3
  57. package/ExportResult/ExportResult.js +33 -23
  58. package/ExternalImagePreview/ExternalImagePreview.js +24 -20
  59. package/FieldBox/FieldBox.js +50 -37
  60. package/FrequencyCapping/FrequencyCappingEdit.js +41 -33
  61. package/FrequencyCapping/FrequencyCappingInApps.js +41 -33
  62. package/FrequencyCapping/FrequencyCappingReadonly.d.ts +1 -2
  63. package/FrequencyCapping/FrequencyCappingReadonly.js +24 -20
  64. package/FrequencyCapping/components/Condition/index.d.ts +1 -2
  65. package/FrequencyCapping/components/Condition/index.js +24 -20
  66. package/FrequencyCapping/components/Description/index.d.ts +2 -2
  67. package/FrequencyCapping/components/Description/index.js +7 -5
  68. package/FrequencyCapping/components/Settings/EditCappingSettings.js +28 -20
  69. package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +86 -71
  70. package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +1 -2
  71. package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +41 -32
  72. package/GetStartedPage/GetStartedPage.js +44 -25
  73. package/InputFile/InputFile.js +44 -35
  74. package/Link/Link.js +2 -2
  75. package/Modal/components/Modal/Modal.js +17 -12
  76. package/Modal/components/Modal/styles.js +5 -4
  77. package/Modal/components/ModalConfirm/ModalConfirm.js +33 -19
  78. package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +2 -2
  79. package/Modal/components/ModalConfirm/ModalConfirmProvider.js +8 -6
  80. package/Modal/components/ModalTitle/ModalTitle.js +10 -8
  81. package/NotificationInbox/NotificationBar.js +19 -11
  82. package/NotificationInbox/NotificationBell.js +15 -12
  83. package/NotificationInbox/NotificationInbox.js +159 -118
  84. package/NumberPicker/NumberPicker.js +53 -44
  85. package/NumberPicker/components/AutosizeInput/AutosizeInput.js +19 -15
  86. package/PageHeader/components/AutosizeInput/AutosizeInput.js +30 -22
  87. package/PageHeader/components/PageHeader/PageHeader.js +44 -27
  88. package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +51 -34
  89. package/PageHeader/components/PageHeaderError/PageHeaderError.js +17 -10
  90. package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +20 -16
  91. package/Pagination/Pagination.js +60 -49
  92. package/Popover/Popover.js +6 -5
  93. package/ProgressBar/ProgressBar.js +25 -10
  94. package/PushPreview/PushPreview.js +30 -22
  95. package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +22 -15
  96. package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +20 -13
  97. package/Radio/Radio.js +32 -26
  98. package/RadioCard/RadioCard.js +17 -9
  99. package/ReCaptcha/ReCaptcha.js +2 -2
  100. package/RichMessageEditor/EditorEmojiPicker.js +9 -7
  101. package/RichMessageEditor/RichMessageEditor.js +77 -67
  102. package/RichMessageEditor/RichMessageViewer.js +19 -13
  103. package/RichMessageEditor/slate/DynamicContentElement.d.ts +1 -2
  104. package/RichMessageEditor/slate/DynamicContentElement.js +13 -9
  105. package/RichMessageEditor/slate/SlateEditor.js +9 -7
  106. package/RichmediaPreview/RichmediaPreview.js +13 -11
  107. package/Select/Select.js +10 -8
  108. package/SendRate/SendRateEdit.d.ts +1 -2
  109. package/SendRate/SendRateEdit.js +42 -34
  110. package/SendRate/SendRateReadonly.d.ts +1 -2
  111. package/SendRate/SendRateReadonly.js +24 -20
  112. package/SendRate/components/Condition/index.d.ts +1 -2
  113. package/SendRate/components/Condition/index.js +15 -13
  114. package/SendRate/components/Description/index.d.ts +2 -2
  115. package/SendRate/components/Description/index.js +30 -22
  116. package/SendRate/components/Settings/index.d.ts +1 -2
  117. package/SendRate/components/Settings/index.js +20 -14
  118. package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +1 -2
  119. package/SendRate/helpers/getReadonlySendRateHelpers.js +39 -30
  120. package/Skeleton/TextSkeleton.js +5 -4
  121. package/SortButton/SortButton.js +11 -7
  122. package/Spinner/Spinner.js +7 -4
  123. package/StatisticCard/StatisticCard.js +44 -29
  124. package/Switch/Switch.js +16 -13
  125. package/Tabs/components/Tab/Tab.d.ts +3 -4
  126. package/Tabs/components/Tab/Tab.js +6 -4
  127. package/Tabs/components/TabBar/TabBar.d.ts +3 -4
  128. package/Tabs/components/TabBar/TabBar.js +12 -4
  129. package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts +1 -2
  130. package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.js +27 -21
  131. package/Tabs/components/TabBase/TabBase.d.ts +3 -4
  132. package/Tabs/components/TabBase/TabBase.js +11 -6
  133. package/Tabs/components/TabPanel/TabPanel.js +4 -2
  134. package/Tabs/components/Tabs/Tabs.js +8 -4
  135. package/Toast/Toast.js +31 -18
  136. package/Toast/ToastProvider.d.ts +2 -3
  137. package/Toast/ToastProvider.js +10 -8
  138. package/Tooltip/Tooltip.js +2 -2
  139. package/Tooltip/TooltipTrigger.js +13 -11
  140. package/package.json +2 -2
  141. package/polyglot/__tests__/render.test.js +46 -16
  142. package/polyglot/liquid/render.d.ts +2 -2
  143. package/polyglot/liquid/render.js +7 -6
  144. package/polyglot/react.js +7 -5
@@ -1,4 +1,5 @@
1
- import React, { 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 { CellBox, DayHeader } from './styles';
4
5
  import { addPeriod, differenceInDays, getLastDayOfMonth, getFirstDayOfWeek, isSamePeriod, compareStructs, pickDateStruct } from '../helpers';
@@ -36,74 +37,75 @@ export const CalendarMonth = ({
36
37
  };
37
38
  }, []);
38
39
  const dayLabels = firstDayOfWeek === 0 ? ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] : ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'];
39
- return React.createElement(Columns, {
40
+ return _jsxs(Columns, {
40
41
  "$sizes": 7,
41
- "$gap": 2
42
- }, dayLabels.map(l => React.createElement(DayHeader, {
43
- key: l
44
- }, l)), Array.from({
45
- length: days
46
- }).map((_, i) => {
47
- const curDay = addPeriod(firstDayDate, 'day', i);
48
- let variant;
49
- if (!isSamePeriod(month, curDay, 'month')) {
50
- if (periodFrom && periodTo && compareStructs(periodFrom, periodTo) !== 0 && !isSamePeriod(periodFrom, periodTo, 'month')) {
51
- const currentMonthStruct = {
52
- year: month.year,
53
- month: month.month,
54
- day: 1
55
- };
56
- const outdatedMonthStruct = {
57
- year: curDay.year,
58
- month: curDay.month,
59
- day: 1
60
- };
61
- const periodFromMonthStruct = {
62
- year: periodFrom.year,
63
- month: periodFrom.month,
64
- day: 1
65
- };
66
- const periodToMonthStruct = {
67
- year: periodTo.year,
68
- month: periodTo.month,
69
- day: 1
70
- };
71
- const isCurrentMonthInPeriod = compareStructs(currentMonthStruct, periodFromMonthStruct) >= 0 && compareStructs(currentMonthStruct, periodToMonthStruct) <= 0;
72
- const isOutdatedMonthInPeriod = compareStructs(outdatedMonthStruct, periodFromMonthStruct) >= 0 && compareStructs(outdatedMonthStruct, periodToMonthStruct) <= 0;
73
- if (isCurrentMonthInPeriod && isOutdatedMonthInPeriod) {
74
- variant = 'periodOutdated';
42
+ "$gap": 2,
43
+ children: [dayLabels.map(l => _jsx(DayHeader, {
44
+ children: l
45
+ }, l)), Array.from({
46
+ length: days
47
+ }).map((_, i) => {
48
+ const curDay = addPeriod(firstDayDate, 'day', i);
49
+ let variant;
50
+ if (!isSamePeriod(month, curDay, 'month')) {
51
+ if (periodFrom && periodTo && compareStructs(periodFrom, periodTo) !== 0 && !isSamePeriod(periodFrom, periodTo, 'month')) {
52
+ const currentMonthStruct = {
53
+ year: month.year,
54
+ month: month.month,
55
+ day: 1
56
+ };
57
+ const outdatedMonthStruct = {
58
+ year: curDay.year,
59
+ month: curDay.month,
60
+ day: 1
61
+ };
62
+ const periodFromMonthStruct = {
63
+ year: periodFrom.year,
64
+ month: periodFrom.month,
65
+ day: 1
66
+ };
67
+ const periodToMonthStruct = {
68
+ year: periodTo.year,
69
+ month: periodTo.month,
70
+ day: 1
71
+ };
72
+ const isCurrentMonthInPeriod = compareStructs(currentMonthStruct, periodFromMonthStruct) >= 0 && compareStructs(currentMonthStruct, periodToMonthStruct) <= 0;
73
+ const isOutdatedMonthInPeriod = compareStructs(outdatedMonthStruct, periodFromMonthStruct) >= 0 && compareStructs(outdatedMonthStruct, periodToMonthStruct) <= 0;
74
+ if (isCurrentMonthInPeriod && isOutdatedMonthInPeriod) {
75
+ variant = 'periodOutdated';
76
+ } else {
77
+ variant = 'outdated';
78
+ }
75
79
  } else {
76
80
  variant = 'outdated';
77
81
  }
78
- } else {
79
- variant = 'outdated';
80
- }
81
- } else if (disableOnAndBefore && compareStructs(curDay, disableOnAndBefore) <= 0 || disableOnAndAfter && compareStructs(curDay, disableOnAndAfter) >= 0 || disablePeriod && compareStructs(curDay, disablePeriod[0]) >= 0 && compareStructs(curDay, disablePeriod[1]) <= 0) {
82
- if (periodFrom && isSamePeriod(curDay, periodFrom, 'day')) {
83
- variant = 'selectedDisabled';
84
- } else {
85
- variant = 'disabled';
82
+ } else if (disableOnAndBefore && compareStructs(curDay, disableOnAndBefore) <= 0 || disableOnAndAfter && compareStructs(curDay, disableOnAndAfter) >= 0 || disablePeriod && compareStructs(curDay, disablePeriod[0]) >= 0 && compareStructs(curDay, disablePeriod[1]) <= 0) {
83
+ if (periodFrom && isSamePeriod(curDay, periodFrom, 'day')) {
84
+ variant = 'selectedDisabled';
85
+ } else {
86
+ variant = 'disabled';
87
+ }
88
+ } else if (selectedDay && isSamePeriod(curDay, selectedDay, 'day')) {
89
+ variant = 'selected';
90
+ } else if (periodFrom && periodTo && isSamePeriod(periodFrom, periodTo, 'day') && isSamePeriod(curDay, periodFrom, 'day')) {
91
+ variant = 'selected';
92
+ } else if (periodFrom && isSamePeriod(curDay, periodFrom, 'day')) {
93
+ variant = 'periodFrom';
94
+ } else if (periodTo && isSamePeriod(curDay, periodTo, 'day')) {
95
+ variant = 'periodTo';
96
+ } else if (highlightDay && isSamePeriod(curDay, highlightDay, 'day')) {
97
+ variant = 'highlighted';
98
+ } else if (periodFrom && periodTo && compareStructs(curDay, periodFrom) > 0 && compareStructs(curDay, periodTo) < 0) {
99
+ variant = 'period';
86
100
  }
87
- } else if (selectedDay && isSamePeriod(curDay, selectedDay, 'day')) {
88
- variant = 'selected';
89
- } else if (periodFrom && periodTo && isSamePeriod(periodFrom, periodTo, 'day') && isSamePeriod(curDay, periodFrom, 'day')) {
90
- variant = 'selected';
91
- } else if (periodFrom && isSamePeriod(curDay, periodFrom, 'day')) {
92
- variant = 'periodFrom';
93
- } else if (periodTo && isSamePeriod(curDay, periodTo, 'day')) {
94
- variant = 'periodTo';
95
- } else if (highlightDay && isSamePeriod(curDay, highlightDay, 'day')) {
96
- variant = 'highlighted';
97
- } else if (periodFrom && periodTo && compareStructs(curDay, periodFrom) > 0 && compareStructs(curDay, periodTo) < 0) {
98
- variant = 'period';
99
- }
100
- return React.createElement(CellBox, {
101
- key: `${curDay.year}-${curDay.month}-${curDay.day}`,
102
- "$variant": variant,
103
- "$isToday": isSamePeriod(curDay, today, 'day'),
104
- onClick: () => onDaySelect(pickDateStruct(curDay)),
105
- onMouseEnter: onDayMouseEnter ? () => onDayMouseEnter(curDay) : undefined,
106
- onMouseLeave: onDayMouseLeave ? () => onDayMouseLeave(curDay) : undefined
107
- }, curDay.day);
108
- }));
101
+ return _jsx(CellBox, {
102
+ "$variant": variant,
103
+ "$isToday": isSamePeriod(curDay, today, 'day'),
104
+ onClick: () => onDaySelect(pickDateStruct(curDay)),
105
+ onMouseEnter: onDayMouseEnter ? () => onDayMouseEnter(curDay) : undefined,
106
+ onMouseLeave: onDayMouseLeave ? () => onDayMouseLeave(curDay) : undefined,
107
+ children: curDay.day
108
+ }, `${curDay.year}-${curDay.month}-${curDay.day}`);
109
+ })]
110
+ });
109
111
  };
@@ -1,4 +1,4 @@
1
- import React, { type FC } from 'react';
1
+ import { type FC, type ReactNode } from 'react';
2
2
  import { type MonthCommonProps } from '../CalendarMonth/types';
3
3
  import { type DateStruct } from '../types';
4
4
  export interface CalendarMonthSliderProps extends MonthCommonProps {
@@ -6,6 +6,6 @@ export interface CalendarMonthSliderProps extends MonthCommonProps {
6
6
  monthWidth?: number;
7
7
  gap?: number;
8
8
  visibleCount?: number;
9
- renderAfter?: () => React.ReactNode;
9
+ renderAfter?: () => ReactNode;
10
10
  }
11
11
  export declare const CalendarMonthSlider: FC<CalendarMonthSliderProps>;
@@ -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 { Horizontal, usePersistentFunction, Vertical } from '@pushwoosh/kit-helpers';
3
4
  import { ArrowIcon } from '@pushwoosh/kit-icons';
4
5
  import { Root, Viewport, Strip, Panel, NavButtonLeft, NavButtonRight, StyledSelect } from './styles';
@@ -79,63 +80,75 @@ export const CalendarMonthSlider = ({
79
80
  length: 11
80
81
  }, (_, i) => currentYear - 5 + i);
81
82
  const viewportWidth = `${visibleCount * monthWidth + gap * (visibleCount - 1)}px`;
82
- return React.createElement(Root, {
83
+ return _jsxs(Root, {
83
84
  style: {
84
85
  ['--slider-width']: viewportWidth,
85
86
  ['--col-width']: `${monthWidth}px`,
86
87
  ['--gap']: `${gap}px`,
87
88
  ['--shift']: `${shiftPx}px`
88
- }
89
- }, React.createElement(Viewport, null, React.createElement(Strip, {
90
- withTransition: inTransition,
91
- onTransitionEnd: () => {
92
- toBaseline(anchor);
93
- }
94
- }, panels.map((p, i) =>
95
- // eslint-disable-next-line react/no-array-index-key
96
- React.createElement(Panel, {
97
- key: `${p.year}-${p.month}-${i}`
98
- }, React.createElement(Vertical, {
99
- "$gap": 4
100
- }, React.createElement(Horizontal, {
101
- "$justifyContent": "center",
102
- "$gap": 6
103
- }, React.createElement(StyledSelect, {
104
- value: p.month,
105
- onChange: e => handleMonthChange(e, i, p)
106
- }, Array.from({
107
- length: 12
108
- }, (_, idx) => React.createElement("option", {
109
- key: idx + 1,
110
- value: idx + 1
111
- }, monthName(idx + 1, 'long')))), React.createElement(StyledSelect, {
112
- value: p.year,
113
- onChange: e => handleYearChange(e, i, p)
114
- }, yearOptions.map(year => React.createElement("option", {
115
- key: year,
116
- value: year
117
- }, year)))), React.createElement(CalendarMonth, {
118
- month: p,
119
- ...monthProps
120
- })))))), React.createElement(NavButtonLeft, null, React.createElement(Button, {
121
- color: "secondary",
122
- size: "compact",
123
- view: "ghost",
124
- icon: React.createElement(ArrowIcon, {
125
- size: "small",
126
- direction: "left"
127
- }),
128
- onClick: animateBackward,
129
- isDisabled: inTransition
130
- })), React.createElement(NavButtonRight, null, React.createElement(Button, {
131
- color: "secondary",
132
- size: "compact",
133
- view: "ghost",
134
- icon: React.createElement(ArrowIcon, {
135
- size: "small",
136
- direction: "right"
137
- }),
138
- onClick: animateForward,
139
- isDisabled: inTransition
140
- })), renderAfter === null || renderAfter === void 0 ? void 0 : renderAfter());
89
+ },
90
+ children: [_jsx(Viewport, {
91
+ children: _jsx(Strip, {
92
+ withTransition: inTransition,
93
+ onTransitionEnd: () => {
94
+ toBaseline(anchor);
95
+ },
96
+ children: panels.map((p, i) =>
97
+ // eslint-disable-next-line react/no-array-index-key
98
+ _jsx(Panel, {
99
+ children: _jsxs(Vertical, {
100
+ "$gap": 4,
101
+ children: [_jsxs(Horizontal, {
102
+ "$justifyContent": "center",
103
+ "$gap": 6,
104
+ children: [_jsx(StyledSelect, {
105
+ value: p.month,
106
+ onChange: e => handleMonthChange(e, i, p),
107
+ children: Array.from({
108
+ length: 12
109
+ }, (_, idx) => _jsx("option", {
110
+ value: idx + 1,
111
+ children: monthName(idx + 1, 'long')
112
+ }, idx + 1))
113
+ }), _jsx(StyledSelect, {
114
+ value: p.year,
115
+ onChange: e => handleYearChange(e, i, p),
116
+ children: yearOptions.map(year => _jsx("option", {
117
+ value: year,
118
+ children: year
119
+ }, year))
120
+ })]
121
+ }), _jsx(CalendarMonth, {
122
+ month: p,
123
+ ...monthProps
124
+ })]
125
+ })
126
+ }, `${p.year}-${p.month}-${i}`))
127
+ })
128
+ }), _jsx(NavButtonLeft, {
129
+ children: _jsx(Button, {
130
+ color: "secondary",
131
+ size: "compact",
132
+ view: "ghost",
133
+ icon: _jsx(ArrowIcon, {
134
+ size: "small",
135
+ direction: "left"
136
+ }),
137
+ onClick: animateBackward,
138
+ isDisabled: inTransition
139
+ })
140
+ }), _jsx(NavButtonRight, {
141
+ children: _jsx(Button, {
142
+ color: "secondary",
143
+ size: "compact",
144
+ view: "ghost",
145
+ icon: _jsx(ArrowIcon, {
146
+ size: "small",
147
+ direction: "right"
148
+ }),
149
+ onClick: animateForward,
150
+ isDisabled: inTransition
151
+ })
152
+ }), renderAfter === null || renderAfter === void 0 ? void 0 : renderAfter()]
153
+ });
141
154
  };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Color } from '@pushwoosh/kit-constants';
3
3
  import { Vertical } from '@pushwoosh/kit-helpers';
4
4
  import { Text } from '@pushwoosh/kit-typography';
@@ -23,80 +23,85 @@ export const CalendarSuperForm = props => {
23
23
  } = props;
24
24
  const isRangePicker = mode === 'range-date' || mode === 'range-datetime';
25
25
  const withTime = mode === 'single-datetime' || mode === 'range-datetime';
26
- return React.createElement(Vertical, {
27
- "$gap": 8
28
- }, React.createElement(CalendarRangePicker, {
29
- disableOnAndBefore: disableOnAndBefore,
30
- disableOnAndAfter: disableOnAndAfter,
31
- minDays: minDays,
32
- maxDays: maxDays,
33
- value: isRangePicker ? value : value ? [value] : [],
34
- onChange: val => {
35
- if (isRangePicker) {
36
- if (withTime) {
37
- if (val.length === 2) {
38
- onChange([{
39
- ...val[0],
40
- hour: 0,
41
- minute: 0,
42
- second: 0,
43
- millisecond: 0
44
- }, {
45
- ...val[1],
46
- hour: 23,
47
- minute: 59,
48
- second: 59,
49
- millisecond: 999
50
- }]);
51
- } else if (val.length === 1) {
52
- onChange([{
26
+ return _jsx(Vertical, {
27
+ "$gap": 8,
28
+ children: _jsx(CalendarRangePicker, {
29
+ disableOnAndBefore: disableOnAndBefore,
30
+ disableOnAndAfter: disableOnAndAfter,
31
+ minDays: minDays,
32
+ maxDays: maxDays,
33
+ value: isRangePicker ? value : value ? [value] : [],
34
+ onChange: val => {
35
+ if (isRangePicker) {
36
+ if (withTime) {
37
+ if (val.length === 2) {
38
+ onChange([{
39
+ ...val[0],
40
+ hour: 0,
41
+ minute: 0,
42
+ second: 0,
43
+ millisecond: 0
44
+ }, {
45
+ ...val[1],
46
+ hour: 23,
47
+ minute: 59,
48
+ second: 59,
49
+ millisecond: 999
50
+ }]);
51
+ } else if (val.length === 1) {
52
+ onChange([{
53
+ hour: 0,
54
+ minute: 0,
55
+ second: 0,
56
+ millisecond: 0,
57
+ ...val[0]
58
+ }]);
59
+ }
60
+ } else {
61
+ onChange(val);
62
+ }
63
+ } else if (val[0]) {
64
+ if (withTime) {
65
+ onChange({
53
66
  hour: 0,
54
67
  minute: 0,
55
68
  second: 0,
56
69
  millisecond: 0,
70
+ ...value,
57
71
  ...val[0]
58
- }]);
72
+ });
73
+ } else {
74
+ onChange(val[0]);
59
75
  }
60
- } else {
61
- onChange(val);
62
- }
63
- } else if (val[0]) {
64
- if (withTime) {
65
- onChange({
66
- hour: 0,
67
- minute: 0,
68
- second: 0,
69
- millisecond: 0,
70
- ...value,
71
- ...val[0]
72
- });
73
- } else {
74
- onChange(val[0]);
75
- }
76
- }
77
- },
78
- singleMode: !isRangePicker,
79
- visibleCount: visibleCount !== undefined ? visibleCount : isRangePicker ? 2 : 1,
80
- monthWidth: monthWidth,
81
- gap: gap,
82
- renderAfter: withTime || maxDays && maxDays > 0 || footerContent ? () => {
83
- return React.createElement(Vertical, {
84
- "$gap": 8,
85
- "$margin": {
86
- top: 16
87
76
  }
88
- }, React.createElement(Vertical, null, maxDays && maxDays > 0 && React.createElement(Text, {
89
- "$variant": "footnote",
90
- "$color": Color.LOCKED
91
- }, `Max length: ${maxDays} days`), footerContent), withTime && timezone && onChangeTimezone && React.createElement(CalendarTimeAndTimezoneSection, {
92
- isRangePicker: isRangePicker,
93
- value: value,
94
- onChange: onChange,
95
- timezone: timezone,
96
- onChangeTimezone: onChangeTimezone,
97
- visibleCount: visibleCount
98
- }));
99
- } : undefined,
100
- firstDayOfWeek: firstDayOfWeek
101
- }));
77
+ },
78
+ singleMode: !isRangePicker,
79
+ visibleCount: visibleCount !== undefined ? visibleCount : isRangePicker ? 2 : 1,
80
+ monthWidth: monthWidth,
81
+ gap: gap,
82
+ renderAfter: withTime || maxDays && maxDays > 0 || footerContent ? () => {
83
+ return _jsxs(Vertical, {
84
+ "$gap": 8,
85
+ "$margin": {
86
+ top: 16
87
+ },
88
+ children: [_jsxs(Vertical, {
89
+ children: [maxDays && maxDays > 0 && _jsx(Text, {
90
+ "$variant": "footnote",
91
+ "$color": Color.LOCKED,
92
+ children: `Max length: ${maxDays} days`
93
+ }), footerContent]
94
+ }), withTime && timezone && onChangeTimezone && _jsx(CalendarTimeAndTimezoneSection, {
95
+ isRangePicker: isRangePicker,
96
+ value: value,
97
+ onChange: onChange,
98
+ timezone: timezone,
99
+ onChangeTimezone: onChangeTimezone,
100
+ visibleCount: visibleCount
101
+ })]
102
+ });
103
+ } : undefined,
104
+ firstDayOfWeek: firstDayOfWeek
105
+ })
106
+ });
102
107
  };
@@ -1,4 +1,4 @@
1
- import React, { type FC } from 'react';
1
+ import { type FC, type ReactNode } from 'react';
2
2
  import { type DateStruct } from '../../../types';
3
3
  export type RangePickerValue = [DateStruct, DateStruct] | [DateStruct] | [];
4
4
  type CalendarRangePickerProps = {
@@ -12,7 +12,7 @@ type CalendarRangePickerProps = {
12
12
  minDays?: number;
13
13
  maxDays?: number;
14
14
  onChange: (range: RangePickerValue) => void;
15
- renderAfter?: () => React.ReactNode;
15
+ renderAfter?: () => ReactNode;
16
16
  firstDayOfWeek?: 0 | 1;
17
17
  };
18
18
  export declare const CalendarRangePicker: FC<CalendarRangePickerProps>;
@@ -1,4 +1,5 @@
1
- import React, { useRef } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRef } from 'react';
2
3
  import { getDisabledRanges } from './getDisabledRanges';
3
4
  import { CalendarMonthSlider } from '../../../CalendarMonthSlider/CalendarMonthSlider';
4
5
  import { compareStructs } from '../../../helpers';
@@ -25,7 +26,7 @@ export const CalendarRangePicker = ({
25
26
  day: d.getDate()
26
27
  };
27
28
  }
28
- return React.createElement(CalendarMonthSlider, {
29
+ return _jsx(CalendarMonthSlider, {
29
30
  startMonth: startMonthRef.current,
30
31
  visibleCount: visibleCount,
31
32
  monthWidth: monthWidth,