@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.
- package/AccessForbidden/AccessForbidden.js +19 -5
- package/AccessForbidden/polyglot/index.d.ts +2 -0
- package/AccessForbidden/polyglot/index.js +10 -0
- package/AccessForbidden/polyglot/messages_en.d.ts +3 -0
- package/AccessForbidden/polyglot/messages_en.js +4 -0
- package/AccessForbidden/polyglot/messages_ru.d.ts +3 -0
- package/AccessForbidden/polyglot/messages_ru.js +4 -0
- package/AccessForbidden/polyglot/types.d.ts +5 -0
- package/AccessForbidden/polyglot/types.js +1 -0
- package/Alert/Alert.d.ts +1 -2
- package/Alert/Alert.js +31 -25
- package/ApplicationPreloader/ApplicationPreloader.d.ts +1 -2
- package/ApplicationPreloader/ApplicationPreloader.js +5 -4
- package/Badge/Badge.js +2 -2
- package/Banner/Banner.js +40 -24
- package/Button/Button.js +20 -9
- package/Button/RemoveButton.js +7 -6
- package/Calendar/CalendarDropdown/CalendarDropdown.js +121 -108
- package/Calendar/CalendarMonth/CalendarMonth.js +68 -66
- package/Calendar/CalendarMonthSlider/CalendarMonthSlider.d.ts +2 -2
- package/Calendar/CalendarMonthSlider/CalendarMonthSlider.js +68 -55
- package/Calendar/CalendarSuperForm/CalendarSuperForm.js +75 -70
- package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.d.ts +2 -2
- package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.js +3 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +106 -88
- package/Calendar/CalendarSuperForm/components/CalendarTimeInput.d.ts +1 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimeInput.js +2 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimezoneSelect.js +3 -2
- package/CardMetric/CardChildren.js +9 -6
- package/CardMetric/CardCollapse.js +8 -6
- package/CardMetric/CardMetric.js +52 -33
- package/Checkbox/Checkbox.js +30 -24
- package/Chip/Chip.d.ts +6 -7
- package/Chip/Chip.js +22 -15
- package/CodeEditor/CodeEditor.d.ts +1 -2
- package/CodeEditor/CodeEditor.js +2 -2
- package/CrashScreen/CrashScreen.js +19 -6
- package/CrashScreen/polyglot/index.d.ts +2 -0
- package/CrashScreen/polyglot/index.js +10 -0
- package/CrashScreen/polyglot/messages_en.d.ts +3 -0
- package/CrashScreen/polyglot/messages_en.js +4 -0
- package/CrashScreen/polyglot/messages_ru.d.ts +3 -0
- package/CrashScreen/polyglot/messages_ru.js +4 -0
- package/CrashScreen/polyglot/types.d.ts +5 -0
- package/CrashScreen/polyglot/types.js +1 -0
- package/DateTimePicker/components/AutosizeInput/AutosizeInput.js +17 -13
- package/DateTimePicker/components/DatePicker/DatePicker.js +35 -32
- package/DateTimePicker/components/DatePickerField/DatePickerField.js +32 -22
- package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +22 -20
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +30 -22
- package/DateTimePicker/components/DecadeView/DecadeView.js +19 -17
- package/DateTimePicker/components/Input/Input.js +2 -2
- package/DateTimePicker/components/Month/Month.js +52 -21
- package/DateTimePicker/components/MonthView/MonthView.js +21 -17
- package/DateTimePicker/components/NumberPicker/NumberPicker.js +49 -40
- package/DateTimePicker/components/PickerPlate/PickerPlate.js +17 -14
- package/DateTimePicker/components/YearView/YearView.js +22 -18
- package/DateTimePicker/polyglot/index.d.ts +2 -0
- package/DateTimePicker/polyglot/index.js +9 -0
- package/DateTimePicker/polyglot/messages_en.d.ts +3 -0
- package/DateTimePicker/polyglot/messages_en.js +11 -0
- package/DateTimePicker/polyglot/messages_ru.d.ts +3 -0
- package/DateTimePicker/polyglot/messages_ru.js +11 -0
- package/DateTimePicker/polyglot/types.d.ts +12 -0
- package/DateTimePicker/polyglot/types.js +1 -0
- package/Drawer/components/Drawer/Drawer.js +18 -13
- package/Drawer/components/Drawer/styles.d.ts +2 -2
- package/Drawer/components/Drawer/styles.js +5 -4
- package/Drawer/components/DrawerDocs/DrawerDocs.js +28 -17
- package/Drawer/polyglot/index.d.ts +2 -0
- package/Drawer/polyglot/index.js +10 -0
- package/Drawer/polyglot/messages_en.d.ts +3 -0
- package/Drawer/polyglot/messages_en.js +4 -0
- package/Drawer/polyglot/messages_ru.d.ts +3 -0
- package/Drawer/polyglot/messages_ru.js +4 -0
- package/Drawer/polyglot/types.d.ts +5 -0
- package/Drawer/polyglot/types.js +1 -0
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +28 -24
- package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +8 -6
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +6 -4
- package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.js +13 -10
- package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.js +40 -31
- package/EditableField/EditableField.js +56 -39
- package/EditableField/polyglot/index.d.ts +2 -0
- package/EditableField/polyglot/index.js +9 -0
- package/EditableField/polyglot/messages_en.d.ts +3 -0
- package/EditableField/polyglot/messages_en.js +4 -0
- package/EditableField/polyglot/messages_ru.d.ts +3 -0
- package/EditableField/polyglot/messages_ru.js +4 -0
- package/EditableField/polyglot/types.d.ts +5 -0
- package/EditableField/polyglot/types.js +1 -0
- package/EmailTemplatePreview/EmailTemplatePreview.js +10 -8
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +30 -16
- package/EmailTemplatePreview/polyglot/index.d.ts +2 -0
- package/EmailTemplatePreview/polyglot/index.js +10 -0
- package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_en.js +5 -0
- package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_ru.js +5 -0
- package/EmailTemplatePreview/polyglot/types.d.ts +6 -0
- package/EmailTemplatePreview/polyglot/types.js +1 -0
- package/EnhancedInput/EnhancedInput.d.ts +3 -4
- package/EnhancedInput/EnhancedInput.js +14 -10
- package/EnhancedInput/SearchInput.js +3 -3
- package/ExportResult/ExportResult.js +33 -23
- package/ExternalImagePreview/ExternalImagePreview.js +24 -20
- package/FieldBox/FieldBox.js +50 -37
- package/FrequencyCapping/FrequencyCappingEdit.js +41 -33
- package/FrequencyCapping/FrequencyCappingInApps.js +41 -33
- package/FrequencyCapping/FrequencyCappingReadonly.d.ts +1 -2
- package/FrequencyCapping/FrequencyCappingReadonly.js +24 -20
- package/FrequencyCapping/components/Condition/index.d.ts +1 -2
- package/FrequencyCapping/components/Condition/index.js +24 -20
- package/FrequencyCapping/components/Description/index.d.ts +2 -2
- package/FrequencyCapping/components/Description/index.js +7 -5
- package/FrequencyCapping/components/Settings/EditCappingSettings.js +28 -20
- package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +86 -71
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +1 -2
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +41 -32
- package/GetStartedPage/GetStartedPage.js +44 -25
- package/InputFile/InputFile.js +44 -35
- package/Link/Link.js +2 -2
- package/Modal/components/Modal/Modal.js +17 -12
- package/Modal/components/Modal/styles.js +5 -4
- package/Modal/components/ModalConfirm/ModalConfirm.js +51 -24
- package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +2 -2
- package/Modal/components/ModalConfirm/ModalConfirmProvider.js +8 -6
- package/Modal/components/ModalConfirm/types.d.ts +1 -1
- package/Modal/components/ModalTitle/ModalTitle.js +10 -8
- package/Modal/polyglot/index.d.ts +2 -0
- package/Modal/polyglot/index.js +9 -0
- package/Modal/polyglot/messages_en.d.ts +3 -0
- package/Modal/polyglot/messages_en.js +6 -0
- package/Modal/polyglot/messages_ru.d.ts +3 -0
- package/Modal/polyglot/messages_ru.js +6 -0
- package/Modal/polyglot/types.d.ts +7 -0
- package/Modal/polyglot/types.js +1 -0
- package/NotificationInbox/NotificationBar.js +19 -11
- package/NotificationInbox/NotificationBell.js +21 -12
- package/NotificationInbox/NotificationInbox.js +160 -105
- package/NotificationInbox/polyglot/index.d.ts +2 -0
- package/NotificationInbox/polyglot/index.js +10 -0
- package/NotificationInbox/polyglot/messages_en.d.ts +3 -0
- package/NotificationInbox/polyglot/messages_en.js +8 -0
- package/NotificationInbox/polyglot/messages_ru.d.ts +3 -0
- package/NotificationInbox/polyglot/messages_ru.js +8 -0
- package/NotificationInbox/polyglot/types.d.ts +11 -0
- package/NotificationInbox/polyglot/types.js +1 -0
- package/NumberPicker/NumberPicker.js +53 -44
- package/NumberPicker/components/AutosizeInput/AutosizeInput.js +19 -15
- package/PageHeader/components/AutosizeInput/AutosizeInput.js +30 -22
- package/PageHeader/components/PageHeader/PageHeader.js +44 -27
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +51 -34
- package/PageHeader/components/PageHeaderError/PageHeaderError.js +17 -10
- package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +20 -16
- package/Pagination/Pagination.js +60 -49
- package/Popover/Popover.js +6 -5
- package/ProgressBar/ProgressBar.js +25 -10
- package/PushPreview/PushPreview.js +30 -22
- package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +23 -11
- package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +20 -13
- package/PushPreview/polyglot/index.d.ts +2 -0
- package/PushPreview/polyglot/index.js +9 -0
- package/PushPreview/polyglot/messages_en.d.ts +3 -0
- package/PushPreview/polyglot/messages_en.js +4 -0
- package/PushPreview/polyglot/messages_ru.d.ts +3 -0
- package/PushPreview/polyglot/messages_ru.js +4 -0
- package/PushPreview/polyglot/types.d.ts +5 -0
- package/PushPreview/polyglot/types.js +1 -0
- package/Radio/Radio.js +32 -26
- package/RadioCard/RadioCard.js +17 -9
- package/ReCaptcha/ReCaptcha.js +2 -2
- package/RichMessageEditor/EditorEmojiPicker.js +9 -7
- package/RichMessageEditor/RichMessageEditor.js +77 -67
- package/RichMessageEditor/RichMessageViewer.js +19 -13
- package/RichMessageEditor/slate/DynamicContentElement.d.ts +1 -2
- package/RichMessageEditor/slate/DynamicContentElement.js +13 -9
- package/RichMessageEditor/slate/SlateEditor.js +9 -7
- package/RichmediaPreview/RichmediaPreview.js +13 -11
- package/Select/Select.js +10 -8
- package/SendRate/SendRateEdit.d.ts +1 -2
- package/SendRate/SendRateEdit.js +42 -34
- package/SendRate/SendRateReadonly.d.ts +1 -2
- package/SendRate/SendRateReadonly.js +24 -20
- package/SendRate/components/Condition/index.d.ts +1 -2
- package/SendRate/components/Condition/index.js +15 -13
- package/SendRate/components/Description/index.d.ts +2 -2
- package/SendRate/components/Description/index.js +30 -22
- package/SendRate/components/Settings/index.d.ts +1 -2
- package/SendRate/components/Settings/index.js +20 -14
- package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +1 -2
- package/SendRate/helpers/getReadonlySendRateHelpers.js +39 -30
- package/Skeleton/TextSkeleton.js +5 -4
- package/SortButton/SortButton.js +11 -7
- package/Spinner/Spinner.js +7 -4
- package/StatisticCard/StatisticCard.js +44 -29
- package/Switch/Switch.js +16 -13
- package/Tabs/components/Tab/Tab.d.ts +3 -4
- package/Tabs/components/Tab/Tab.js +6 -4
- package/Tabs/components/TabBar/TabBar.d.ts +3 -4
- package/Tabs/components/TabBar/TabBar.js +12 -4
- package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts +1 -2
- package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.js +27 -21
- package/Tabs/components/TabBase/TabBase.d.ts +3 -4
- package/Tabs/components/TabBase/TabBase.js +11 -6
- package/Tabs/components/TabPanel/TabPanel.js +4 -2
- package/Tabs/components/Tabs/Tabs.js +8 -4
- package/Toast/Toast.js +31 -18
- package/Toast/ToastProvider.d.ts +2 -3
- package/Toast/ToastProvider.js +10 -8
- package/Tooltip/Tooltip.js +2 -2
- package/Tooltip/TooltipTrigger.js +13 -11
- package/package.json +2 -2
- package/polyglot/__tests__/render.test.js +46 -16
- package/polyglot/liquid/render.d.ts +2 -2
- package/polyglot/liquid/render.js +7 -6
- package/polyglot/react.js +7 -5
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 @@
|
|
|
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) =>
|
|
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
|
|
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
|
|
21
|
+
return _jsxs(Container, {
|
|
21
22
|
"$borderRadius": ShapeRadius.SECTION,
|
|
22
|
-
"$bgColor": bgColor
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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):
|
|
4
|
+
export declare function ApplicationPreloader({ fullscreen }: ApplicationPreloaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
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
|
|
7
|
-
"$fullscreen": fullscreen
|
|
8
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
}
|
package/Button/RemoveButton.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
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
|
|
6
|
-
...props
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
return _jsx(RemoveButtonBox, {
|
|
6
|
+
...props,
|
|
7
|
+
children: _jsx(CloseIcon, {
|
|
8
|
+
size: "small"
|
|
9
|
+
})
|
|
10
|
+
});
|
|
10
11
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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
|
|
65
|
-
"$justifyContent": "start"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
};
|