@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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { HelpRoundIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { getCappingChipText } from './getCappingChipText';
|
|
@@ -9,42 +9,51 @@ import { CappingTypes } from '../types';
|
|
|
9
9
|
export function getReadonlyCappingLabel(cappingOption, isGlobalCappingDisabled, capping, globalCapping, isInJourney, lang) {
|
|
10
10
|
const tooltip = getReadonlyTooltip(cappingOption, isInJourney, lang);
|
|
11
11
|
if (cappingOption === CappingTypes.CUSTOM) {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
return _jsxs(_Fragment, {
|
|
13
|
+
children: [lang({
|
|
14
|
+
message: 'DUMB.FREQUENCY_CAPPING.RO.CUSTOM_LABEL'
|
|
15
|
+
}), _jsx(ChipFrequencyCapping, {
|
|
16
|
+
text: getCappingChipText(lang, capping.messages, capping.days),
|
|
17
|
+
tooltip: tooltip
|
|
18
|
+
})]
|
|
19
|
+
});
|
|
18
20
|
}
|
|
19
21
|
if (cappingOption === CappingTypes.IGNORE) {
|
|
20
|
-
return
|
|
22
|
+
return _jsxs(Horizontal, {
|
|
21
23
|
"$alignItems": "center",
|
|
22
24
|
"$gap": 4,
|
|
23
|
-
"$justifyContent": "start"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
"$justifyContent": "start",
|
|
26
|
+
children: [lang({
|
|
27
|
+
message: 'DUMB.FREQUENCY_CAPPING.RO.IGNORE_LABEL'
|
|
28
|
+
}), _jsx(Tooltip, {
|
|
29
|
+
content: tooltip,
|
|
30
|
+
position: "top-middle",
|
|
31
|
+
children: _jsx(IconWrapper, {
|
|
32
|
+
"$padding": "4px 0",
|
|
33
|
+
children: _jsx(HelpRoundIcon, {
|
|
34
|
+
size: "small",
|
|
35
|
+
view: "lined"
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
35
40
|
}
|
|
36
|
-
return isGlobalCappingDisabled ?
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
return isGlobalCappingDisabled ? _jsxs(_Fragment, {
|
|
42
|
+
children: [lang({
|
|
43
|
+
message: 'DUMB.FREQUENCY_CAPPING.RO.GLOBAL_LABEL'
|
|
44
|
+
}), _jsx(ChipFrequencyCapping, {
|
|
45
|
+
text: getCappingChipText(lang, 0, 0)
|
|
46
|
+
}), lang({
|
|
47
|
+
message: 'DUMB.FREQUENCY_CAPPING.RO.BECAUSE_UNSET'
|
|
48
|
+
})]
|
|
49
|
+
}) : _jsxs(_Fragment, {
|
|
50
|
+
children: [lang({
|
|
51
|
+
message: 'DUMB.FREQUENCY_CAPPING.RO.GLOBAL_LABEL'
|
|
52
|
+
}), _jsx(ChipFrequencyCapping, {
|
|
53
|
+
text: getCappingChipText(lang, globalCapping.count, globalCapping.days),
|
|
54
|
+
tooltip: tooltip
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
48
57
|
}
|
|
49
58
|
function getReadonlyTooltip(cappingOption, isInJourney, lang) {
|
|
50
59
|
if (cappingOption === CappingTypes.IGNORE) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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 { CheckRoundIcon, LockIcon } from '@pushwoosh/kit-icons';
|
|
@@ -14,29 +14,48 @@ export function GetStartedPage(props) {
|
|
|
14
14
|
checkList = [],
|
|
15
15
|
actions = null
|
|
16
16
|
} = props;
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
17
|
+
return _jsx(GradientBackground, {
|
|
18
|
+
children: _jsxs(Wrapper, {
|
|
19
|
+
children: [_jsxs(ContentBox, {
|
|
20
|
+
children: [_jsxs(Vertical, {
|
|
21
|
+
"$gap": 16,
|
|
22
|
+
children: [_jsxs(Vertical, {
|
|
23
|
+
"$gap": 4,
|
|
24
|
+
children: [_jsx(H1, {
|
|
25
|
+
children: title
|
|
26
|
+
}), _jsx(Paragraph, {
|
|
27
|
+
children: description
|
|
28
|
+
})]
|
|
29
|
+
}), !!checkList.length && _jsx(UnorderedList, {
|
|
30
|
+
children: checkList.map(text => _jsxs(UnorderedListItem, {
|
|
31
|
+
children: [_jsx(UnorderedListIcon, {
|
|
32
|
+
children: _jsx(CheckRoundIcon, {
|
|
33
|
+
color: Color.SUCCESS,
|
|
34
|
+
size: "small",
|
|
35
|
+
type: "fill",
|
|
36
|
+
view: "filled"
|
|
37
|
+
})
|
|
38
|
+
}), _jsx(UnorderedListText, {
|
|
39
|
+
children: text
|
|
40
|
+
})]
|
|
41
|
+
}, `item-${text}`))
|
|
42
|
+
})]
|
|
43
|
+
}), (helpText || actions) && _jsxs(Vertical, {
|
|
44
|
+
"$gap": 16,
|
|
45
|
+
children: [helpText && _jsx(Banner, {
|
|
46
|
+
type: "info",
|
|
47
|
+
view: "ghost",
|
|
48
|
+
title: helpText,
|
|
49
|
+
icon: _jsx(LockIcon, {
|
|
50
|
+
view: "filled",
|
|
51
|
+
size: "small"
|
|
52
|
+
})
|
|
53
|
+
}), actions]
|
|
54
|
+
})]
|
|
55
|
+
}), _jsx(Image, {
|
|
56
|
+
alt: title,
|
|
57
|
+
src: image
|
|
58
|
+
})]
|
|
37
59
|
})
|
|
38
|
-
})
|
|
39
|
-
alt: title,
|
|
40
|
-
src: image
|
|
41
|
-
})));
|
|
60
|
+
});
|
|
42
61
|
}
|
package/InputFile/InputFile.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
2
3
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
4
|
import { AttachmentIcon } from '@pushwoosh/kit-icons';
|
|
4
5
|
import { Button } from '../Button';
|
|
@@ -49,39 +50,47 @@ export function InputFile({
|
|
|
49
50
|
};
|
|
50
51
|
reader.readAsDataURL(file);
|
|
51
52
|
};
|
|
52
|
-
return
|
|
53
|
+
return _jsxs(FieldBox, {
|
|
53
54
|
title: label,
|
|
54
|
-
error: errorText
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
55
|
+
error: errorText,
|
|
56
|
+
children: [_jsxs(InputFileFieldsStyled, {
|
|
57
|
+
children: [_jsx(InputFileInputHiddenStyled, {
|
|
58
|
+
ref: fieldRef,
|
|
59
|
+
id: fileId,
|
|
60
|
+
type: "file",
|
|
61
|
+
disabled: disabled,
|
|
62
|
+
accept: accept,
|
|
63
|
+
onChange: uploadFile,
|
|
64
|
+
value: ""
|
|
65
|
+
}), _jsx(InputFileInputStyled, {
|
|
66
|
+
id: textId,
|
|
67
|
+
type: "text",
|
|
68
|
+
disabled: disabled,
|
|
69
|
+
placeholder: placeholder,
|
|
70
|
+
value: fileName,
|
|
71
|
+
readOnly: true,
|
|
72
|
+
color: errorText ? Color.DANGER : Color.FORM
|
|
73
|
+
}), _jsx(InputFileButtonStyled, {
|
|
74
|
+
children: _jsx(Button, {
|
|
75
|
+
id: buttonId,
|
|
76
|
+
type: "button",
|
|
77
|
+
color: "secondary",
|
|
78
|
+
size: "field",
|
|
79
|
+
view: "shape",
|
|
80
|
+
isDisabled: disabled,
|
|
81
|
+
onClick: () => {
|
|
82
|
+
var _fieldRef$current;
|
|
83
|
+
return fieldRef === null || fieldRef === void 0 || (_fieldRef$current = fieldRef.current) === null || _fieldRef$current === void 0 ? void 0 : _fieldRef$current.click();
|
|
84
|
+
},
|
|
85
|
+
icon: _jsx(AttachmentIcon, {
|
|
86
|
+
size: "medium",
|
|
87
|
+
view: "lined"
|
|
88
|
+
}),
|
|
89
|
+
children: buttonText
|
|
90
|
+
})
|
|
91
|
+
})]
|
|
92
|
+
}), !!errorText && _jsx(InputFileErrorStyled, {
|
|
93
|
+
children: errorText
|
|
94
|
+
})]
|
|
95
|
+
});
|
|
87
96
|
}
|
package/Link/Link.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { LinkBox } from './styles';
|
|
3
3
|
export function Link(props) {
|
|
4
4
|
const {
|
|
5
5
|
boxRef,
|
|
6
6
|
...rest
|
|
7
7
|
} = props;
|
|
8
|
-
return
|
|
8
|
+
return _jsx(LinkBox, {
|
|
9
9
|
...rest,
|
|
10
10
|
ref: boxRef
|
|
11
11
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback, useEffect, useRef } from 'react';
|
|
2
3
|
import { createPortal } from 'react-dom';
|
|
3
4
|
import { modalSizes } from './maps';
|
|
4
5
|
import { LockBody, ModalBox, ModalBoxTrans, ModalContainer, ModalInner } from './styles';
|
|
@@ -33,16 +34,20 @@ export function Modal(props) {
|
|
|
33
34
|
(_document$body$lastCh = document.body.lastChild) === null || _document$body$lastCh === void 0 || _document$body$lastCh.after(element);
|
|
34
35
|
return () => element.remove();
|
|
35
36
|
}, [element]);
|
|
36
|
-
return createPortal(
|
|
37
|
+
return createPortal(_jsx(ModalBoxTrans, {
|
|
37
38
|
nodeRef: ref,
|
|
38
|
-
isOpen: isOpen
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
isOpen: isOpen,
|
|
40
|
+
children: _jsxs(ModalBox, {
|
|
41
|
+
ref: ref,
|
|
42
|
+
"$zIndex": resolvedZIndex,
|
|
43
|
+
children: [_jsx(LockBody, {}), _jsx(ModalInner, {
|
|
44
|
+
onMouseDown: handleClose,
|
|
45
|
+
children: _jsx(ModalContainer, {
|
|
46
|
+
"$width": modalSizes[size],
|
|
47
|
+
onClick: handleClose,
|
|
48
|
+
children: typeof children === 'function' ? children() : children
|
|
49
|
+
})
|
|
50
|
+
})]
|
|
51
|
+
})
|
|
52
|
+
}), element);
|
|
48
53
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { CSSTransition } from 'react-transition-group';
|
|
3
3
|
import styled, { createGlobalStyle } from 'styled-components';
|
|
4
4
|
import { ShapeRadius } from '@pushwoosh/kit-constants';
|
|
@@ -21,14 +21,15 @@ function ModalBoxBase(props) {
|
|
|
21
21
|
className,
|
|
22
22
|
children
|
|
23
23
|
} = props;
|
|
24
|
-
return
|
|
24
|
+
return _jsx(CSSTransition, {
|
|
25
25
|
appear: true,
|
|
26
26
|
in: isOpen,
|
|
27
27
|
timeout: animationTimeout,
|
|
28
28
|
classNames: className,
|
|
29
29
|
unmountOnExit: true,
|
|
30
|
-
nodeRef: nodeRef
|
|
31
|
-
|
|
30
|
+
nodeRef: nodeRef,
|
|
31
|
+
children: children
|
|
32
|
+
});
|
|
32
33
|
}
|
|
33
34
|
export const ModalBoxTrans = styled(ModalBoxBase).withConfig({
|
|
34
35
|
displayName: "ModalBoxTrans",
|
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback } from 'react';
|
|
2
3
|
import { Vertical, Horizontal } from '@pushwoosh/kit-helpers';
|
|
3
4
|
import { Banner } from '../../../Banner';
|
|
4
5
|
import { Button } from '../../../Button';
|
|
6
|
+
import { useLang } from '../../polyglot';
|
|
5
7
|
import { Modal } from '../Modal';
|
|
6
8
|
import { ModalHeader, ModalBody, ModalFooter } from '../ModalContent';
|
|
7
9
|
import { ModalTitle } from '../ModalTitle';
|
|
8
10
|
export function ModalConfirm(props) {
|
|
11
|
+
const lang = useLang();
|
|
9
12
|
const {
|
|
10
13
|
isOpen,
|
|
11
|
-
title
|
|
14
|
+
title,
|
|
12
15
|
size = 'small',
|
|
13
16
|
description = '',
|
|
14
|
-
confirmButtonText
|
|
15
|
-
cancelButtonText
|
|
17
|
+
confirmButtonText,
|
|
18
|
+
cancelButtonText,
|
|
16
19
|
confirmButtonColor = 'primary',
|
|
17
20
|
callback,
|
|
18
21
|
onAccept,
|
|
19
22
|
onCancel
|
|
20
23
|
} = props;
|
|
24
|
+
const resolvedTitle = title ?? lang({
|
|
25
|
+
message: 'DUMB.MODAL.CONFIRM_TITLE'
|
|
26
|
+
});
|
|
27
|
+
const resolvedConfirmText = confirmButtonText ?? lang({
|
|
28
|
+
message: 'DUMB.MODAL.CONFIRM'
|
|
29
|
+
});
|
|
30
|
+
const resolvedCancelText = cancelButtonText ?? lang({
|
|
31
|
+
message: 'DUMB.MODAL.CANCEL'
|
|
32
|
+
});
|
|
21
33
|
const [isLoading, setIsLoading] = useState(false);
|
|
22
34
|
const [errorMessage, setErrorMessage] = useState('');
|
|
23
35
|
const handleConfirm = useCallback(async () => {
|
|
@@ -27,29 +39,44 @@ export function ModalConfirm(props) {
|
|
|
27
39
|
await (callback === null || callback === void 0 ? void 0 : callback());
|
|
28
40
|
await onAccept();
|
|
29
41
|
} catch (error) {
|
|
30
|
-
setErrorMessage((error === null || error === void 0 ? void 0 : error.message) ||
|
|
42
|
+
setErrorMessage((error === null || error === void 0 ? void 0 : error.message) || lang({
|
|
43
|
+
message: 'DUMB.MODAL.UNEXPECTED_ERROR'
|
|
44
|
+
}));
|
|
31
45
|
} finally {
|
|
32
46
|
setIsLoading(false);
|
|
33
47
|
}
|
|
34
|
-
}, [callback, onAccept]);
|
|
35
|
-
return
|
|
48
|
+
}, [callback, onAccept, lang]);
|
|
49
|
+
return _jsxs(Modal, {
|
|
36
50
|
size: size,
|
|
37
51
|
isOpen: isOpen,
|
|
38
|
-
onClose: onCancel
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
onClose: onCancel,
|
|
53
|
+
children: [_jsx(ModalHeader, {
|
|
54
|
+
children: _jsxs(Vertical, {
|
|
55
|
+
"$gap": 8,
|
|
56
|
+
children: [_jsx(ModalTitle, {
|
|
57
|
+
children: resolvedTitle
|
|
58
|
+
}), errorMessage && _jsx(Banner, {
|
|
59
|
+
type: "error",
|
|
60
|
+
title: errorMessage
|
|
61
|
+
})]
|
|
62
|
+
})
|
|
63
|
+
}), description && _jsx(ModalBody, {
|
|
64
|
+
children: description
|
|
65
|
+
}), _jsx(ModalFooter, {
|
|
66
|
+
children: _jsxs(Horizontal, {
|
|
67
|
+
"$justifyContent": "end",
|
|
68
|
+
"$gap": 8,
|
|
69
|
+
children: [_jsx(Button, {
|
|
70
|
+
color: "secondary",
|
|
71
|
+
onClick: onCancel,
|
|
72
|
+
children: resolvedCancelText
|
|
73
|
+
}), _jsx(Button, {
|
|
74
|
+
color: confirmButtonColor,
|
|
75
|
+
isLoading: isLoading,
|
|
76
|
+
onClick: handleConfirm,
|
|
77
|
+
children: resolvedConfirmText
|
|
78
|
+
})]
|
|
79
|
+
})
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
55
82
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactElement, type PropsWithChildren } from 'react';
|
|
2
2
|
import type { ModalConfirmContextProps } from './types';
|
|
3
|
-
export declare const ModalConfirmContext:
|
|
3
|
+
export declare const ModalConfirmContext: import("react").Context<ModalConfirmContextProps | null>;
|
|
4
4
|
export declare function ModalConfirmProvider(props: PropsWithChildren): ReactElement;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, createContext } from 'react';
|
|
2
3
|
import { ModalConfirm } from './ModalConfirm';
|
|
3
4
|
export const ModalConfirmContext = createContext(null);
|
|
4
5
|
export function ModalConfirmProvider(props) {
|
|
@@ -27,9 +28,10 @@ export function ModalConfirmProvider(props) {
|
|
|
27
28
|
closeModalConfirm
|
|
28
29
|
};
|
|
29
30
|
}, []);
|
|
30
|
-
return
|
|
31
|
-
value: contextValue
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
return _jsxs(ModalConfirmContext.Provider, {
|
|
32
|
+
value: contextValue,
|
|
33
|
+
children: [children, _jsx(ModalConfirm, {
|
|
34
|
+
...modalConfirmParams
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
35
37
|
}
|
|
@@ -3,7 +3,7 @@ import { type modalSizes } from '../Modal/maps';
|
|
|
3
3
|
export type ConfirmButtonColor = 'primary' | 'secondary' | 'danger';
|
|
4
4
|
export interface ModalConfirmProps {
|
|
5
5
|
isOpen: boolean;
|
|
6
|
-
title
|
|
6
|
+
title?: string;
|
|
7
7
|
size?: keyof typeof modalSizes;
|
|
8
8
|
description?: ReactNode;
|
|
9
9
|
confirmButtonText?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CloseIcon } from '@pushwoosh/kit-icons';
|
|
3
3
|
import { ModalTitleBox } from './styles';
|
|
4
4
|
import { GhostButton } from '../../../Button';
|
|
@@ -8,11 +8,13 @@ export function ModalTitle(props) {
|
|
|
8
8
|
onClose,
|
|
9
9
|
...rest
|
|
10
10
|
} = props;
|
|
11
|
-
return
|
|
12
|
-
...rest
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
return _jsxs(ModalTitleBox, {
|
|
12
|
+
...rest,
|
|
13
|
+
children: [children, onClose && _jsx(GhostButton, {
|
|
14
|
+
onClick: onClose,
|
|
15
|
+
children: _jsx(CloseIcon, {
|
|
16
|
+
size: "medium"
|
|
17
|
+
})
|
|
18
|
+
})]
|
|
19
|
+
});
|
|
18
20
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { NotificationIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { NotificationBarButton, NotificationBarIcon, NotificationBarBadge, NotificationBarText, NotificationBarBadgeText } from './styles';
|
|
@@ -28,18 +28,26 @@ export function NotificationBar({
|
|
|
28
28
|
if (type === 'no-notifications') return Color.MAIN;
|
|
29
29
|
return Color.CLEAR;
|
|
30
30
|
};
|
|
31
|
-
return
|
|
31
|
+
return _jsxs(NotificationBarButton, {
|
|
32
32
|
"$type": type,
|
|
33
33
|
"$isOpened": isOpened,
|
|
34
34
|
"$read": read,
|
|
35
35
|
onClick: onClick,
|
|
36
|
-
type: "button"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
type: "button",
|
|
37
|
+
children: [_jsx(NotificationBarIcon, {
|
|
38
|
+
children: _jsx(NotificationIcon, {
|
|
39
|
+
type: "enabled",
|
|
40
|
+
size: "small",
|
|
41
|
+
view: getIconView(isOpened, shouldUseFilledIcon, hasNotifications),
|
|
42
|
+
color: getIconColor()
|
|
43
|
+
})
|
|
44
|
+
}), _jsx(NotificationBarText, {
|
|
45
|
+
children: "Notification center"
|
|
46
|
+
}), hasNotifications && _jsx(NotificationBarBadge, {
|
|
47
|
+
children: _jsx(NotificationBarBadgeText, {
|
|
48
|
+
"$variant": "h5",
|
|
49
|
+
children: count
|
|
50
|
+
})
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
45
53
|
}
|