@pushwoosh/dumb-components 1.0.1 → 1.0.2
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/DropdownMenu/components/DropdownMenu/DropdownMenu.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +27 -0
- package/DropdownMenu/components/DropdownMenu/hooks.d.ts +4 -0
- package/DropdownMenu/components/DropdownMenu/hooks.js +10 -0
- package/DropdownMenu/components/DropdownMenu/index.d.ts +2 -0
- package/DropdownMenu/components/DropdownMenu/index.js +2 -0
- package/DropdownMenu/components/DropdownMenu/types.d.ts +23 -0
- package/DropdownMenu/components/DropdownMenu/types.js +1 -0
- package/DropdownMenu/components/DropdownMenuContainer/DropdownMenuContainer.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuContainer/DropdownMenuContainer.js +79 -0
- package/DropdownMenu/components/DropdownMenuContainer/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuContainer/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuContainer/maps.d.ts +26 -0
- package/DropdownMenu/components/DropdownMenuContainer/maps.js +11 -0
- package/DropdownMenu/components/DropdownMenuContainer/styles.d.ts +35 -0
- package/DropdownMenu/components/DropdownMenuContainer/styles.js +109 -0
- package/DropdownMenu/components/DropdownMenuContainer/types.d.ts +19 -0
- package/DropdownMenu/components/DropdownMenuContainer/types.js +1 -0
- package/DropdownMenu/components/DropdownMenuGroup/DropdownMenuGroup.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuGroup/DropdownMenuGroup.js +12 -0
- package/DropdownMenu/components/DropdownMenuGroup/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuGroup/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuGroup/styles.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuGroup/styles.js +7 -0
- package/DropdownMenu/components/DropdownMenuGroup/types.d.ts +5 -0
- package/DropdownMenu/components/DropdownMenuGroup/types.js +1 -0
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.d.ts +5 -0
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +38 -0
- package/DropdownMenu/components/DropdownMenuItem/index.d.ts +2 -0
- package/DropdownMenu/components/DropdownMenuItem/index.js +2 -0
- package/DropdownMenu/components/DropdownMenuItem/styles.d.ts +5 -0
- package/DropdownMenu/components/DropdownMenuItem/styles.js +73 -0
- package/DropdownMenu/components/DropdownMenuItem/types.d.ts +24 -0
- package/DropdownMenu/components/DropdownMenuItem/types.js +1 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/DropdownMenuItemCheckbox.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/DropdownMenuItemCheckbox.js +9 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/styles.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/styles.js +8 -0
- package/DropdownMenu/components/DropdownMenuItemPick/DropdownMenuItemPick.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuItemPick/DropdownMenuItemPick.js +16 -0
- package/DropdownMenu/components/DropdownMenuItemPick/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuItemPick/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuItemPick/styles.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuItemPick/styles.js +8 -0
- package/DropdownMenu/components/DropdownMenuItemPick/types.d.ts +2 -0
- package/DropdownMenu/components/DropdownMenuItemPick/types.js +1 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/DropdownMenuItemRadio.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/DropdownMenuItemRadio.js +9 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/styles.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/styles.js +8 -0
- package/DropdownMenu/components/DropdownMenuNested/DropdownMenuNested.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuNested/DropdownMenuNested.js +69 -0
- package/DropdownMenu/components/DropdownMenuNested/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuNested/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuNested/styles.d.ts +8 -0
- package/DropdownMenu/components/DropdownMenuNested/styles.js +35 -0
- package/DropdownMenu/components/DropdownMenuNested/types.d.ts +6 -0
- package/DropdownMenu/components/DropdownMenuNested/types.js +1 -0
- package/DropdownMenu/components/DropdownMenuWindow/DropdownMenuWindow.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuWindow/DropdownMenuWindow.js +12 -0
- package/DropdownMenu/components/DropdownMenuWindow/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuWindow/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuWindow/styles.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuWindow/styles.js +7 -0
- package/DropdownMenu/components/DropdownMenuWindow/types.d.ts +5 -0
- package/DropdownMenu/components/DropdownMenuWindow/types.js +1 -0
- package/DropdownMenu/index.d.ts +9 -0
- package/DropdownMenu/index.js +9 -0
- package/ExportResult/ExportResult.js +1 -1
- package/InputFile/InputFile.d.ts +3 -0
- package/InputFile/InputFile.js +88 -0
- package/InputFile/index.d.ts +1 -0
- package/InputFile/index.js +1 -0
- package/InputFile/styles.d.ts +5 -0
- package/InputFile/styles.js +29 -0
- package/InputFile/types.d.ts +25 -0
- package/InputFile/types.js +1 -0
- package/Link/Link.d.ts +5 -0
- package/Link/Link.js +12 -0
- package/Link/index.d.ts +1 -0
- package/Link/index.js +1 -0
- package/Link/styles.d.ts +1 -0
- package/Link/styles.js +7 -0
- package/Link/types.d.ts +21 -0
- package/Link/types.js +1 -0
- package/Modal/components/Modal/Modal.d.ts +3 -0
- package/Modal/components/Modal/Modal.js +51 -0
- package/Modal/components/Modal/index.d.ts +1 -0
- package/Modal/components/Modal/index.js +1 -0
- package/Modal/components/Modal/maps.d.ts +6 -0
- package/Modal/components/Modal/maps.js +6 -0
- package/Modal/components/Modal/styles.d.ts +13 -0
- package/Modal/components/Modal/styles.js +45 -0
- package/Modal/components/Modal/types.d.ts +13 -0
- package/Modal/components/Modal/types.js +1 -0
- package/Modal/components/ModalConfirm/ModalConfirm.d.ts +3 -0
- package/Modal/components/ModalConfirm/ModalConfirm.js +54 -0
- package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +4 -0
- package/Modal/components/ModalConfirm/ModalConfirmProvider.js +35 -0
- package/Modal/components/ModalConfirm/hooks.d.ts +2 -0
- package/Modal/components/ModalConfirm/hooks.js +9 -0
- package/Modal/components/ModalConfirm/index.d.ts +3 -0
- package/Modal/components/ModalConfirm/index.js +3 -0
- package/Modal/components/ModalConfirm/types.d.ts +20 -0
- package/Modal/components/ModalConfirm/types.js +1 -0
- package/Modal/components/ModalContent/index.d.ts +1 -0
- package/Modal/components/ModalContent/index.js +1 -0
- package/Modal/components/ModalContent/styled.d.ts +19 -0
- package/Modal/components/ModalContent/styled.js +29 -0
- package/Modal/components/ModalTitle/ModalTitle.d.ts +3 -0
- package/Modal/components/ModalTitle/ModalTitle.js +18 -0
- package/Modal/components/ModalTitle/index.d.ts +1 -0
- package/Modal/components/ModalTitle/index.js +1 -0
- package/Modal/components/ModalTitle/styles.d.ts +1 -0
- package/Modal/components/ModalTitle/styles.js +8 -0
- package/Modal/components/ModalTitle/types.d.ts +5 -0
- package/Modal/components/ModalTitle/types.js +1 -0
- package/Modal/index.d.ts +4 -0
- package/Modal/index.js +4 -0
- package/PageHeader/components/AutosizeInput/AutosizeInput.d.ts +3 -0
- package/PageHeader/components/AutosizeInput/AutosizeInput.js +80 -0
- package/PageHeader/components/AutosizeInput/constants.d.ts +2 -0
- package/PageHeader/components/AutosizeInput/constants.js +2 -0
- package/PageHeader/components/AutosizeInput/index.d.ts +1 -0
- package/PageHeader/components/AutosizeInput/index.js +1 -0
- package/PageHeader/components/AutosizeInput/styles.d.ts +5 -0
- package/PageHeader/components/AutosizeInput/styles.js +20 -0
- package/PageHeader/components/AutosizeInput/types.d.ts +10 -0
- package/PageHeader/components/AutosizeInput/types.js +1 -0
- package/PageHeader/components/PageHeader/PageHeader.d.ts +3 -0
- package/PageHeader/components/PageHeader/PageHeader.js +51 -0
- package/PageHeader/components/PageHeader/index.d.ts +1 -0
- package/PageHeader/components/PageHeader/index.js +1 -0
- package/PageHeader/components/PageHeader/styles.d.ts +9 -0
- package/PageHeader/components/PageHeader/styles.js +29 -0
- package/PageHeader/components/PageHeader/types.d.ts +15 -0
- package/PageHeader/components/PageHeader/types.js +1 -0
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.d.ts +3 -0
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +67 -0
- package/PageHeader/components/PageHeaderEditable/index.d.ts +1 -0
- package/PageHeader/components/PageHeaderEditable/index.js +1 -0
- package/PageHeader/components/PageHeaderEditable/styles.d.ts +10 -0
- package/PageHeader/components/PageHeaderEditable/styles.js +33 -0
- package/PageHeader/components/PageHeaderEditable/types.d.ts +21 -0
- package/PageHeader/components/PageHeaderEditable/types.js +1 -0
- package/PageHeader/components/PageHeaderError/PageHeaderError.d.ts +3 -0
- package/PageHeader/components/PageHeaderError/PageHeaderError.js +19 -0
- package/PageHeader/components/PageHeaderError/index.d.ts +1 -0
- package/PageHeader/components/PageHeaderError/index.js +1 -0
- package/PageHeader/components/PageHeaderError/styles.d.ts +6 -0
- package/PageHeader/components/PageHeaderError/styles.js +20 -0
- package/PageHeader/components/PageHeaderError/types.d.ts +5 -0
- package/PageHeader/components/PageHeaderError/types.js +1 -0
- package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.d.ts +2 -0
- package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +20 -0
- package/PageHeader/components/PageHeaderSkeleton/index.d.ts +1 -0
- package/PageHeader/components/PageHeaderSkeleton/index.js +1 -0
- package/PageHeader/components/PageHeaderSkeleton/styles.d.ts +5 -0
- package/PageHeader/components/PageHeaderSkeleton/styles.js +15 -0
- package/PageHeader/index.d.ts +3 -0
- package/PageHeader/index.js +3 -0
- package/Pagination/Pagination.d.ts +3 -0
- package/Pagination/Pagination.js +85 -0
- package/Pagination/helpers.d.ts +1 -0
- package/Pagination/helpers.js +4 -0
- package/Pagination/index.d.ts +1 -0
- package/Pagination/index.js +1 -0
- package/Pagination/styles.d.ts +8 -0
- package/Pagination/styles.js +35 -0
- package/Pagination/types.d.ts +9 -0
- package/Pagination/types.js +1 -0
- package/ProgressBar/ProgressBar.js +1 -1
- package/PushPreview/PushPreview.js +1 -1
- package/ReCaptcha/ReCaptcha.d.ts +2 -0
- package/ReCaptcha/ReCaptcha.js +8 -0
- package/ReCaptcha/constants.d.ts +3 -0
- package/ReCaptcha/constants.js +4 -0
- package/ReCaptcha/helpers.d.ts +1 -0
- package/ReCaptcha/helpers.js +15 -0
- package/ReCaptcha/hooks.d.ts +2 -0
- package/ReCaptcha/hooks.js +66 -0
- package/ReCaptcha/index.d.ts +3 -0
- package/ReCaptcha/index.js +3 -0
- package/ReCaptcha/styles.d.ts +1 -0
- package/ReCaptcha/styles.js +5 -0
- package/ReCaptcha/types.d.ts +8 -0
- package/ReCaptcha/types.js +1 -0
- package/Skeleton/TextSkeleton.d.ts +3 -0
- package/Skeleton/TextSkeleton.js +16 -0
- package/Skeleton/index.d.ts +2 -0
- package/Skeleton/index.js +2 -0
- package/Skeleton/styles.d.ts +4 -0
- package/Skeleton/styles.js +33 -0
- package/Skeleton/types.d.ts +16 -0
- package/Skeleton/types.js +1 -0
- package/SortButton/SortButton.d.ts +6 -0
- package/SortButton/SortButton.js +33 -0
- package/SortButton/constants.d.ts +2 -0
- package/SortButton/constants.js +1 -0
- package/SortButton/index.d.ts +1 -0
- package/SortButton/index.js +1 -0
- package/SortButton/maps.d.ts +10 -0
- package/SortButton/maps.js +15 -0
- package/SortButton/styles.d.ts +3 -0
- package/SortButton/styles.js +9 -0
- package/SortButton/types.d.ts +14 -0
- package/SortButton/types.js +1 -0
- package/StatisticCard/StatisticCard.js +1 -1
- package/Switch/Switch.d.ts +3 -0
- package/Switch/Switch.js +23 -0
- package/Switch/index.d.ts +1 -0
- package/Switch/index.js +1 -0
- package/Switch/styles.d.ts +5 -0
- package/Switch/styles.js +62 -0
- package/Switch/types.d.ts +15 -0
- package/Switch/types.js +1 -0
- package/Toast/Toast.d.ts +3 -0
- package/Toast/Toast.js +62 -0
- package/Toast/ToastProvider.d.ts +4 -0
- package/Toast/ToastProvider.js +45 -0
- package/Toast/constants.d.ts +8 -0
- package/Toast/constants.js +8 -0
- package/Toast/hooks.d.ts +2 -0
- package/Toast/hooks.js +9 -0
- package/Toast/index.d.ts +3 -0
- package/Toast/index.js +3 -0
- package/Toast/styles.d.ts +8 -0
- package/Toast/styles.js +23 -0
- package/Toast/types.d.ts +28 -0
- package/Toast/types.js +1 -0
- package/index.d.ts +10 -0
- package/index.js +10 -0
- package/package.json +1 -3
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Columns } from '@pushwoosh/kit-helpers';
|
|
3
|
+
import { ArrowRoundIcon } from '@pushwoosh/kit-icons';
|
|
4
|
+
import { Button } from '../../../Button';
|
|
5
|
+
import { AutosizeInput } from '../AutosizeInput';
|
|
6
|
+
import { PageHeaderError } from '../PageHeaderError';
|
|
7
|
+
import { PageHeaderSkeleton } from '../PageHeaderSkeleton';
|
|
8
|
+
import { RootBox, BackButton, TitleBox, DescriptionBox, AutosizeInputBox, ActionsBox, MoreActionsBox } from './styles';
|
|
9
|
+
export function PageHeaderEditable(props) {
|
|
10
|
+
const {
|
|
11
|
+
title,
|
|
12
|
+
description,
|
|
13
|
+
error,
|
|
14
|
+
resolveErrorText,
|
|
15
|
+
value,
|
|
16
|
+
maxLength,
|
|
17
|
+
placeholder,
|
|
18
|
+
submitText,
|
|
19
|
+
cancelText,
|
|
20
|
+
isLoading,
|
|
21
|
+
isLoadingSubmit,
|
|
22
|
+
moreActions,
|
|
23
|
+
onBack,
|
|
24
|
+
onChange,
|
|
25
|
+
onComplete,
|
|
26
|
+
onSubmit,
|
|
27
|
+
onCancel,
|
|
28
|
+
onResolveError
|
|
29
|
+
} = props;
|
|
30
|
+
if (isLoading) {
|
|
31
|
+
return React.createElement(PageHeaderSkeleton, null);
|
|
32
|
+
}
|
|
33
|
+
const hasActions = Boolean(onSubmit || onCancel);
|
|
34
|
+
const hasActionsBox = hasActions || Boolean(moreActions);
|
|
35
|
+
return React.createElement(RootBox, null, React.createElement(Columns, {
|
|
36
|
+
"$sizes": "minmax(0, 1fr) max-content",
|
|
37
|
+
"$gap": 24
|
|
38
|
+
}, React.createElement(TitleBox, null, onBack && React.createElement(BackButton, null, React.createElement(Button, {
|
|
39
|
+
color: "primary",
|
|
40
|
+
view: "ghost",
|
|
41
|
+
onClick: onBack
|
|
42
|
+
}, React.createElement(ArrowRoundIcon, {
|
|
43
|
+
direction: "left",
|
|
44
|
+
size: "medium",
|
|
45
|
+
view: "filled"
|
|
46
|
+
}))), React.createElement(AutosizeInputBox, null, title, value !== undefined && React.createElement(AutosizeInput, {
|
|
47
|
+
placeholder: placeholder,
|
|
48
|
+
maxLength: maxLength,
|
|
49
|
+
value: value,
|
|
50
|
+
onChange: onChange,
|
|
51
|
+
onComplete: onComplete
|
|
52
|
+
}))), hasActionsBox && React.createElement(ActionsBox, null, !!moreActions && React.createElement(MoreActionsBox, {
|
|
53
|
+
hasActions: hasActions
|
|
54
|
+
}, moreActions), onCancel && React.createElement(Button, {
|
|
55
|
+
color: "secondary",
|
|
56
|
+
onClick: onCancel
|
|
57
|
+
}, cancelText || 'Cancel'), onSubmit && React.createElement(Button, {
|
|
58
|
+
color: "primary",
|
|
59
|
+
type: "submit",
|
|
60
|
+
onClick: () => value ? onSubmit(value) : null,
|
|
61
|
+
isLoading: !!isLoadingSubmit
|
|
62
|
+
}, submitText || 'Create'))), !!error && React.createElement(PageHeaderError, {
|
|
63
|
+
error: error,
|
|
64
|
+
resolveErrorText: resolveErrorText,
|
|
65
|
+
onResolveError: onResolveError
|
|
66
|
+
}), !!description && React.createElement(DescriptionBox, null, description));
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageHeaderEditable } from './PageHeaderEditable';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageHeaderEditable } from './PageHeaderEditable';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { H2, Paragraph } from '@pushwoosh/kit-typography';
|
|
2
|
+
export declare const RootBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const BackButton: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const TitleBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const AutosizeInputBox: import("styled-components").StyledComponent<typeof H2, any, {}, never>;
|
|
6
|
+
export declare const ActionsBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const MoreActionsBox: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
+
hasActions: boolean;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const DescriptionBox: import("styled-components").StyledComponent<typeof Paragraph, any, {}, never>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Spacing } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { H2, Paragraph } from '@pushwoosh/kit-typography';
|
|
4
|
+
export const RootBox = styled.div.withConfig({
|
|
5
|
+
displayName: "RootBox",
|
|
6
|
+
componentId: "sc-19rm2yr-0"
|
|
7
|
+
})(["display:flex;flex-direction:column;"]);
|
|
8
|
+
export const BackButton = styled.div.withConfig({
|
|
9
|
+
displayName: "BackButton",
|
|
10
|
+
componentId: "sc-19rm2yr-1"
|
|
11
|
+
})(["min-width:36px;max-width:36px;& button{border:0;padding:0;}"]);
|
|
12
|
+
export const TitleBox = styled.div.withConfig({
|
|
13
|
+
displayName: "TitleBox",
|
|
14
|
+
componentId: "sc-19rm2yr-2"
|
|
15
|
+
})(["display:flex;align-items:center;justify-content:start;flex-shrink:0;gap:", ";"], Spacing.S3);
|
|
16
|
+
export const AutosizeInputBox = styled(H2).withConfig({
|
|
17
|
+
displayName: "AutosizeInputBox",
|
|
18
|
+
componentId: "sc-19rm2yr-3"
|
|
19
|
+
})(["display:flex;align-items:center;justify-content:start;overflow:hidden;gap:", ";"], Spacing.S3);
|
|
20
|
+
export const ActionsBox = styled.div.withConfig({
|
|
21
|
+
displayName: "ActionsBox",
|
|
22
|
+
componentId: "sc-19rm2yr-4"
|
|
23
|
+
})(["display:flex;justify-content:flex-end;gap:", ";"], Spacing.S3);
|
|
24
|
+
export const MoreActionsBox = styled.div.withConfig({
|
|
25
|
+
displayName: "MoreActionsBox",
|
|
26
|
+
componentId: "sc-19rm2yr-5"
|
|
27
|
+
})(["display:flex;margin-right:", ";"], ({
|
|
28
|
+
hasActions
|
|
29
|
+
}) => hasActions ? Spacing.S5 : '0');
|
|
30
|
+
export const DescriptionBox = styled(Paragraph).withConfig({
|
|
31
|
+
displayName: "DescriptionBox",
|
|
32
|
+
componentId: "sc-19rm2yr-6"
|
|
33
|
+
})(["margin-top:", ";"], Spacing.S5);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
export interface PageHeaderEditableProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
resolveErrorText?: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
maxLength?: number;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
submitText?: string;
|
|
11
|
+
cancelText?: string;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
isLoadingSubmit?: boolean;
|
|
14
|
+
moreActions?: ReactElement;
|
|
15
|
+
onBack?: () => void;
|
|
16
|
+
onChange?: (value: string) => void;
|
|
17
|
+
onComplete?: (value: string) => void;
|
|
18
|
+
onSubmit?: (value: string) => void;
|
|
19
|
+
onCancel?: () => void;
|
|
20
|
+
onResolveError?: () => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DangerTriangleIcon } from '@pushwoosh/kit-icons';
|
|
3
|
+
import { RootBox, ErrorIconBox, ErrorText, ResolveError } from './styles';
|
|
4
|
+
export function PageHeaderError(props) {
|
|
5
|
+
const {
|
|
6
|
+
error,
|
|
7
|
+
resolveErrorText,
|
|
8
|
+
onResolveError
|
|
9
|
+
} = props;
|
|
10
|
+
return React.createElement(RootBox, null, React.createElement(ErrorIconBox, null, React.createElement(DangerTriangleIcon, {
|
|
11
|
+
color: "white",
|
|
12
|
+
size: "small",
|
|
13
|
+
view: "filled"
|
|
14
|
+
})), React.createElement(ErrorText, null, error), resolveErrorText && onResolveError && React.createElement(ResolveError, {
|
|
15
|
+
view: "ghost",
|
|
16
|
+
color: "danger",
|
|
17
|
+
onClick: onResolveError
|
|
18
|
+
}, resolveErrorText));
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageHeaderError } from './PageHeaderError';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageHeaderError } from './PageHeaderError';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { H4 } from '@pushwoosh/kit-typography';
|
|
2
|
+
import { Button } from '../../../Button';
|
|
3
|
+
export declare const RootBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const ErrorIconBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const ErrorText: import("styled-components").StyledComponent<typeof H4, any, {}, never>;
|
|
6
|
+
export declare const ResolveError: typeof Button;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Color, Spacing, FontSize, FontWeight, LineHeight } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { H4 } from '@pushwoosh/kit-typography';
|
|
4
|
+
import { Button } from '../../../Button';
|
|
5
|
+
export const RootBox = styled.div.withConfig({
|
|
6
|
+
displayName: "RootBox",
|
|
7
|
+
componentId: "sc-1lsctcc-0"
|
|
8
|
+
})(["display:flex;align-items:center;padding-right:", ";margin-top:", ";background:", ";"], Spacing.S3, Spacing.S5, Color.DANGER_LIGHT);
|
|
9
|
+
export const ErrorIconBox = styled.div.withConfig({
|
|
10
|
+
displayName: "ErrorIconBox",
|
|
11
|
+
componentId: "sc-1lsctcc-1"
|
|
12
|
+
})(["display:flex;align-items:center;justify-content:center;width:32px;height:36px;padding:", ";border-radius:4px 0 0 4px;background:", ";"], Spacing.S3, Color.DANGER);
|
|
13
|
+
export const ErrorText = styled(H4).withConfig({
|
|
14
|
+
displayName: "ErrorText",
|
|
15
|
+
componentId: "sc-1lsctcc-2"
|
|
16
|
+
})(["padding:", " ", ";"], Spacing.S3, Spacing.S4);
|
|
17
|
+
export const ResolveError = styled(Button).withConfig({
|
|
18
|
+
displayName: "ResolveError",
|
|
19
|
+
componentId: "sc-1lsctcc-3"
|
|
20
|
+
})(["margin-left:auto;font-size:", ";line-height:", ";font-weight:", ";text-transform:uppercase;&:hover{background:transparent;}"], FontSize.SMALL, LineHeight.SMALL, FontWeight.BOLD);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
3
|
+
import { RootBox, SkeletonStyled } from './styles';
|
|
4
|
+
export function PageHeaderSkeleton() {
|
|
5
|
+
return React.createElement(RootBox, null, React.createElement(Horizontal, {
|
|
6
|
+
"$gap": 16
|
|
7
|
+
}, React.createElement(SkeletonStyled, null), React.createElement(SkeletonStyled, {
|
|
8
|
+
width: 60
|
|
9
|
+
}), React.createElement(SkeletonStyled, {
|
|
10
|
+
width: 60
|
|
11
|
+
})), React.createElement(Horizontal, {
|
|
12
|
+
"$gap": 16
|
|
13
|
+
}, React.createElement(SkeletonStyled, {
|
|
14
|
+
width: 68,
|
|
15
|
+
height: 36
|
|
16
|
+
}), React.createElement(SkeletonStyled, {
|
|
17
|
+
width: 68,
|
|
18
|
+
height: 36
|
|
19
|
+
})));
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageHeaderSkeleton } from './PageHeaderSkeleton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageHeaderSkeleton } from './PageHeaderSkeleton';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import styled, { keyframes } from 'styled-components';
|
|
2
|
+
import { Color, Spacing, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
|
+
const animation = keyframes(["0%{opacity:0.2;}50%{opacity:0.1;}100%{opacity:0.2;}"]);
|
|
4
|
+
export const RootBox = styled.div.withConfig({
|
|
5
|
+
displayName: "RootBox",
|
|
6
|
+
componentId: "sc-1idyyj7-0"
|
|
7
|
+
})(["display:flex;align-items:center;justify-content:space-between;"]);
|
|
8
|
+
export const SkeletonStyled = styled.div.withConfig({
|
|
9
|
+
displayName: "SkeletonStyled",
|
|
10
|
+
componentId: "sc-1idyyj7-1"
|
|
11
|
+
})(["width:", ";height:", ";padding:", " 0;background:", ";border-radius:", ";animation:", " 1s ease-in-out infinite;opacity:0.1;"], ({
|
|
12
|
+
width
|
|
13
|
+
}) => width ? `${width}px` : Spacing.S7, ({
|
|
14
|
+
height
|
|
15
|
+
}) => height ? `${height}px` : Spacing.S7, Spacing.S1, Color.SOFT, ShapeRadius.CONTROL, animation);
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { ArrowIcon } from '@pushwoosh/kit-icons';
|
|
3
|
+
import { getSafelyNumber } from './helpers';
|
|
4
|
+
import { PaginationBox, PaginationArrow, PaginationDivider, PaginationButton } from './styles';
|
|
5
|
+
export function Pagination(props) {
|
|
6
|
+
const {
|
|
7
|
+
boxRef,
|
|
8
|
+
activePage,
|
|
9
|
+
totalPages,
|
|
10
|
+
adjacentPagesCount = 2,
|
|
11
|
+
isLoading = false,
|
|
12
|
+
onChangePage,
|
|
13
|
+
...rest
|
|
14
|
+
} = props;
|
|
15
|
+
const safelyActivePageNumber = getSafelyNumber(activePage);
|
|
16
|
+
const safelyTotalPagesNumber = getSafelyNumber(totalPages);
|
|
17
|
+
const handleChangePage = useCallback(event => {
|
|
18
|
+
onChangePage(getSafelyNumber(event.currentTarget.value));
|
|
19
|
+
}, [onChangePage]);
|
|
20
|
+
const isValidActivePage = safelyActivePageNumber >= 1 && safelyActivePageNumber <= safelyTotalPagesNumber;
|
|
21
|
+
const helperArray = Array.from({
|
|
22
|
+
length: adjacentPagesCount
|
|
23
|
+
});
|
|
24
|
+
const isDisabledLeftArrow = safelyActivePageNumber === 1;
|
|
25
|
+
const isDisabledRightArrow = safelyActivePageNumber >= safelyTotalPagesNumber;
|
|
26
|
+
const shouldShowShowFirstPage = safelyActivePageNumber - adjacentPagesCount - 1 > 0;
|
|
27
|
+
const shouldShowShowLeftDivider = safelyActivePageNumber - adjacentPagesCount - 2 > 0;
|
|
28
|
+
const shouldShowShowLastPage = safelyTotalPagesNumber - safelyActivePageNumber > adjacentPagesCount;
|
|
29
|
+
const shouldShowShowRightDivider = safelyTotalPagesNumber - safelyActivePageNumber - 1 > adjacentPagesCount;
|
|
30
|
+
if (!isValidActivePage) {
|
|
31
|
+
console.error(`[Pagination]: prop activePage: ${activePage} is not valid!`);
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return React.createElement(PaginationBox, {
|
|
35
|
+
...rest,
|
|
36
|
+
ref: boxRef
|
|
37
|
+
}, React.createElement(PaginationArrow, {
|
|
38
|
+
value: safelyActivePageNumber - 1,
|
|
39
|
+
disabled: isLoading || isDisabledLeftArrow,
|
|
40
|
+
onClick: handleChangePage
|
|
41
|
+
}, React.createElement(ArrowIcon, {
|
|
42
|
+
direction: "left",
|
|
43
|
+
size: "medium"
|
|
44
|
+
})), shouldShowShowFirstPage && React.createElement(PaginationButton, {
|
|
45
|
+
value: 1,
|
|
46
|
+
disabled: isLoading,
|
|
47
|
+
onClick: handleChangePage
|
|
48
|
+
}, 1), shouldShowShowLeftDivider && React.createElement(PaginationDivider, null, "..."), helperArray.map((_, index) => {
|
|
49
|
+
const currentIndex = safelyActivePageNumber - adjacentPagesCount + index;
|
|
50
|
+
if (currentIndex < 1 || currentIndex > safelyTotalPagesNumber) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return React.createElement(PaginationButton, {
|
|
54
|
+
key: currentIndex,
|
|
55
|
+
value: currentIndex,
|
|
56
|
+
disabled: isLoading,
|
|
57
|
+
onClick: handleChangePage
|
|
58
|
+
}, currentIndex);
|
|
59
|
+
}), React.createElement(PaginationButton, {
|
|
60
|
+
"$isActive": true,
|
|
61
|
+
disabled: true
|
|
62
|
+
}, safelyActivePageNumber), helperArray.map((_, index) => {
|
|
63
|
+
const currentIndex = safelyActivePageNumber + index + 1;
|
|
64
|
+
if (currentIndex > safelyTotalPagesNumber) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return React.createElement(PaginationButton, {
|
|
68
|
+
key: currentIndex,
|
|
69
|
+
value: currentIndex,
|
|
70
|
+
disabled: isLoading,
|
|
71
|
+
onClick: handleChangePage
|
|
72
|
+
}, currentIndex);
|
|
73
|
+
}), shouldShowShowRightDivider && React.createElement(PaginationDivider, null, "..."), shouldShowShowLastPage && React.createElement(PaginationButton, {
|
|
74
|
+
value: safelyTotalPagesNumber,
|
|
75
|
+
disabled: isLoading,
|
|
76
|
+
onClick: handleChangePage
|
|
77
|
+
}, safelyTotalPagesNumber), React.createElement(PaginationArrow, {
|
|
78
|
+
value: safelyActivePageNumber + 1,
|
|
79
|
+
disabled: isLoading || isDisabledRightArrow,
|
|
80
|
+
onClick: handleChangePage
|
|
81
|
+
}, React.createElement(ArrowIcon, {
|
|
82
|
+
direction: "right",
|
|
83
|
+
size: "medium"
|
|
84
|
+
})));
|
|
85
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getSafelyNumber: (input: string | number) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pagination } from './Pagination';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pagination } from './Pagination';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PaginationBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const PaginationArrow: import("styled-components").StyledComponent<"button", any, {
|
|
3
|
+
$isActive?: boolean;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const PaginationDivider: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const PaginationButton: import("styled-components").StyledComponent<"button", any, {
|
|
7
|
+
$isActive?: boolean;
|
|
8
|
+
}, never>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Color, FontSize, FontWeight, ShapeRadius, Spacing, UnitSize } from '@pushwoosh/kit-constants';
|
|
3
|
+
const PaginationControl = styled.button.withConfig({
|
|
4
|
+
displayName: "PaginationControl",
|
|
5
|
+
componentId: "sc-o79vko-0"
|
|
6
|
+
})(["height:", ";appearance:none;border:1px solid ", ";border-right:none;background-color:", ";color:", ";font-weight:", ";font-size:", ";&:hover{background-color:", ";color:", ";}&:disabled{background-color:", ";color:", ";}user-select:none;"], UnitSize.FIELD_HEIGHT, Color.DIVIDER, Color.CLEAR, Color.MAIN, FontWeight.MEDIUM, FontSize.REGULAR, ({
|
|
7
|
+
$isActive
|
|
8
|
+
}) => $isActive ? Color.MAIN : Color.BRIGHT_LIGHT, ({
|
|
9
|
+
$isActive
|
|
10
|
+
}) => $isActive ? Color.CLEAR : Color.PRIMARY_HOVER, Color.CLEAR, Color.PHANTOM);
|
|
11
|
+
export const PaginationBox = styled.div.withConfig({
|
|
12
|
+
displayName: "PaginationBox",
|
|
13
|
+
componentId: "sc-o79vko-1"
|
|
14
|
+
})(["display:flex;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;"]);
|
|
15
|
+
export const PaginationArrow = styled(PaginationControl).withConfig({
|
|
16
|
+
displayName: "PaginationArrow",
|
|
17
|
+
componentId: "sc-o79vko-2"
|
|
18
|
+
})(["padding:0 ", ";&:first-child{border-radius:", " 0 0 ", ";}&:last-child{border-right:1px solid ", ";border-radius:0 ", " ", " 0;}user-select:none;"], Spacing.S2, ShapeRadius.CONTROL, ShapeRadius.CONTROL, Color.DIVIDER, ShapeRadius.CONTROL, ShapeRadius.CONTROL);
|
|
19
|
+
export const PaginationDivider = styled.div.withConfig({
|
|
20
|
+
displayName: "PaginationDivider",
|
|
21
|
+
componentId: "sc-o79vko-3"
|
|
22
|
+
})(["display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;width:32px;height:", ";color:", ";background-color:", ";border:1px solid ", ";border-right:none;box-sizing:border-box;user-select:none;"], UnitSize.FIELD_HEIGHT, Color.LOCKED, Color.FROZEN, Color.DIVIDER);
|
|
23
|
+
export const PaginationButton = styled(PaginationControl).withConfig({
|
|
24
|
+
displayName: "PaginationButton",
|
|
25
|
+
componentId: "sc-o79vko-4"
|
|
26
|
+
})(["padding:0 ", ";&:disabled{background-color:", ";color:", ";}"], Spacing.S4, ({
|
|
27
|
+
$isActive
|
|
28
|
+
}) => $isActive ? Color.MAIN : Color.CLEAR, ({
|
|
29
|
+
$isActive
|
|
30
|
+
}) => $isActive ? Color.CLEAR : Color.MAIN);
|
|
31
|
+
PaginationBox.displayName = 'PaginationBox';
|
|
32
|
+
PaginationControl.displayName = 'PaginationControl';
|
|
33
|
+
PaginationArrow.displayName = 'PaginationArrow';
|
|
34
|
+
PaginationDivider.displayName = 'PaginationDivider';
|
|
35
|
+
PaginationButton.displayName = 'PaginationButton';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Ref } from 'react';
|
|
2
|
+
export type PaginationProps = Omit<JSX.IntrinsicElements['div'], 'ref'> & {
|
|
3
|
+
readonly boxRef?: Ref<HTMLDivElement>;
|
|
4
|
+
readonly activePage: string | number;
|
|
5
|
+
readonly totalPages: string | number;
|
|
6
|
+
readonly adjacentPagesCount?: number;
|
|
7
|
+
readonly isLoading?: boolean;
|
|
8
|
+
readonly onChangePage: (page: number) => any;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
|
-
import { Spinner } from '
|
|
3
|
+
import { Spinner } from '../Spinner';
|
|
4
4
|
import { Container, LoadingHeader, LoadingText, ProgressLine, ProgressBarActive, ProgressBoxContainer, RightSlotContainer, SpinnerContainer, ProgressLineContainer } from './styles';
|
|
5
5
|
export function ProgressBar(props) {
|
|
6
6
|
const {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Columns } from '@pushwoosh/kit-helpers';
|
|
3
|
-
import { Spinner } from '
|
|
3
|
+
import { Spinner } from '../Spinner';
|
|
4
4
|
import { PREVIEW_ICON_URL } from './constants';
|
|
5
5
|
import { getLocalizedContent } from './helpers';
|
|
6
6
|
import { LoadingBox, PushBox, AppIcon, PushContent, PushTitleBox, PushTitleText, PushDate, PushDescription } from './styles';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const RECAPTCHA_KEY = '6LdS7DYUAAAAABVgt0djIBoyyMQ0oDAUl7jt1Mxh';
|
|
2
|
+
// onload script: https://www.google.com/recaptcha/api.js?onload=recaptchaOnLoad&render=explicit'
|
|
3
|
+
export const RECAPTCHA_SCRIPT_URL = 'https://www.google.com/recaptcha/api.js?render=explicit';
|
|
4
|
+
export const RECAPTCHA_CONTAINER_ID = 'g-recaptcha';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function asyncScriptLoad(scriptUrl: string): Promise<Event | void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export async function asyncScriptLoad(scriptUrl) {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
const isAlreadyLoaded = document.querySelector(`script[src="${scriptUrl}"]`);
|
|
4
|
+
if (isAlreadyLoaded) {
|
|
5
|
+
resolve();
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
const script = document.createElement('script');
|
|
9
|
+
script.src = scriptUrl;
|
|
10
|
+
script.async = true;
|
|
11
|
+
document.body.appendChild(script);
|
|
12
|
+
script.onload = resolve;
|
|
13
|
+
script.onerror = reject;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback, useRef } from 'react';
|
|
2
|
+
import { RECAPTCHA_KEY, RECAPTCHA_SCRIPT_URL, RECAPTCHA_CONTAINER_ID } from './constants';
|
|
3
|
+
import { asyncScriptLoad } from './helpers';
|
|
4
|
+
export function useRecaptcha() {
|
|
5
|
+
var _window;
|
|
6
|
+
const promiseRef = useRef({});
|
|
7
|
+
const [isRecaptchaLoaded, setRecaptchaLoaded] = useState(!!((_window = window) !== null && _window !== void 0 && (_window = _window.grecaptcha) !== null && _window !== void 0 && _window.render));
|
|
8
|
+
const [widgetID, setWidgetID] = useState(null);
|
|
9
|
+
const [isRecaptchaReady, setRecaptchaReady] = useState(!!(isRecaptchaLoaded && widgetID));
|
|
10
|
+
const [recaptchaErrorCode, setRecaptchaErrorCode] = useState(''); // RIEXXX - ReCaptcha Internal Error
|
|
11
|
+
const [intervalID, setIntervalID] = useState(0);
|
|
12
|
+
// Load external script effect, fires once
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
asyncScriptLoad(RECAPTCHA_SCRIPT_URL).catch(() => setRecaptchaErrorCode('RIE001'));
|
|
15
|
+
}, []);
|
|
16
|
+
// Set interval while library download and initialize
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const newInterval = window.setInterval(() => {
|
|
19
|
+
var _window2;
|
|
20
|
+
if ((_window2 = window) !== null && _window2 !== void 0 && (_window2 = _window2.grecaptcha) !== null && _window2 !== void 0 && _window2.render) {
|
|
21
|
+
setRecaptchaLoaded(true);
|
|
22
|
+
}
|
|
23
|
+
}, 500);
|
|
24
|
+
setIntervalID(newInterval);
|
|
25
|
+
return () => {
|
|
26
|
+
clearInterval(newInterval);
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
29
|
+
// Render recaptcha widget when script loaded, stop interval
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (isRecaptchaLoaded && widgetID === null) {
|
|
32
|
+
clearInterval(intervalID);
|
|
33
|
+
try {
|
|
34
|
+
const widget = window.grecaptcha.render(RECAPTCHA_CONTAINER_ID, {
|
|
35
|
+
sitekey: RECAPTCHA_KEY,
|
|
36
|
+
size: 'invisible',
|
|
37
|
+
callback: token => {
|
|
38
|
+
var _promiseRef$current;
|
|
39
|
+
return (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 ? void 0 : _promiseRef$current.resolve(token);
|
|
40
|
+
}
|
|
41
|
+
// 'expired-callback': () => {},
|
|
42
|
+
// 'error-callback': () => {},
|
|
43
|
+
});
|
|
44
|
+
setWidgetID(widget);
|
|
45
|
+
setRecaptchaReady(true);
|
|
46
|
+
} catch {
|
|
47
|
+
setRecaptchaErrorCode('RIE002');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, [isRecaptchaLoaded, widgetID, intervalID, promiseRef]);
|
|
51
|
+
// async function to get recaptcha token, resolves by resolveAction callback
|
|
52
|
+
const getRecaptchaToken = useCallback(async () => new Promise((resolve, reject) => {
|
|
53
|
+
try {
|
|
54
|
+
window.grecaptcha.reset(widgetID);
|
|
55
|
+
window.grecaptcha.execute(widgetID);
|
|
56
|
+
promiseRef.current.resolve = resolve;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
reject(error);
|
|
59
|
+
}
|
|
60
|
+
}), [widgetID, promiseRef]);
|
|
61
|
+
return {
|
|
62
|
+
isRecaptchaReady,
|
|
63
|
+
recaptchaErrorCode,
|
|
64
|
+
getRecaptchaToken
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RecaptchaElement: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|