@propellerads/kyc-form 1.0.2 → 3.0.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ #### `3.0.0`
2
+ * Marked react, react-dom and styled-components (and @types) as peerDependencies
3
+ * Upgraded @propellerads/textarea to 3.0.0
4
+
5
+ #### `2.1.0`
6
+
7
+ * User can write feedback in textarea as well
8
+
9
+ #### `2.0.0`
10
+
11
+ * edit dependencies, add build
12
+
13
+ #### `1.0.3`
14
+
15
+ * Add `validator` prop
16
+
1
17
  #### `1.0.2`
2
18
 
3
19
  * KYCForm fixes
@@ -0,0 +1,7 @@
1
+ import { KYCFormItemFileExtraPartProps, KYCFormItemFileProps, KYCFormItemTextProps } from './types';
2
+ declare const _default: {
3
+ KYCFormItemFileExtraPart: (props: KYCFormItemFileExtraPartProps) => JSX.Element;
4
+ KYCFormItemFile: (props: KYCFormItemFileProps) => JSX.Element;
5
+ KYCFormItemText: (props: KYCFormItemTextProps) => JSX.Element;
6
+ };
7
+ export default _default;
@@ -0,0 +1,10 @@
1
+ declare const StyledKYCFormItem: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ declare const StyledKYCFormItemFileTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ declare const StyledKYCFormItemFilePreview: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ declare const StyledKYCFormItemFilePreviewName: import("styled-components").StyledComponent<"span", any, {}, never>;
5
+ declare const StyledKYCFormItemFilePreviewRemove: import("styled-components").StyledComponent<"span", any, {}, never>;
6
+ declare const StyledKYCFormItemFileUploaderContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ declare const StyledKYCFormItemFileExtraPart: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ declare const StyledKYCDocumentPartImgMiniature: import("styled-components").StyledComponent<"img", any, {}, never>;
9
+ declare const StyledKYCDocumentPartIconMiniature: import("styled-components").StyledComponent<"div", any, {}, never>;
10
+ export { StyledKYCFormItem, StyledKYCFormItemFilePreview, StyledKYCFormItemFilePreviewName, StyledKYCFormItemFilePreviewRemove, StyledKYCFormItemFileTitle, StyledKYCFormItemFileUploaderContainer, StyledKYCFormItemFileExtraPart, StyledKYCDocumentPartImgMiniature, StyledKYCDocumentPartIconMiniature, };
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { KYCFileData, KYCFile } from '../document.types';
3
+ import { UploaderLabels } from '../labels.types';
4
+ export interface KYCDocumentPartMiniatureProps {
5
+ data?: KYCFileData;
6
+ }
7
+ export interface KYCFormItemFileExtraPartProps {
8
+ elementId: string;
9
+ title?: string;
10
+ uploaderLabels: UploaderLabels;
11
+ onFileAdd: (file: File) => void;
12
+ }
13
+ export interface KYCFormItemFileProps extends KYCFile {
14
+ title?: string;
15
+ name?: string;
16
+ elementId: string;
17
+ uploaderLabels: UploaderLabels;
18
+ error?: string;
19
+ onFileChange: (file: File) => void;
20
+ onFileRemove: () => void;
21
+ }
22
+ export interface KYCFormItemTextProps {
23
+ value: string | undefined;
24
+ onFeedbackChange: (data: string) => void;
25
+ }
26
+ declare class KYCFormItemFileExtraPart extends React.Component<KYCFormItemFileExtraPartProps> {
27
+ }
28
+ declare class KYCFormItemFile extends React.Component<KYCFormItemFileProps> {
29
+ }
30
+ declare const _default: {
31
+ KYCFormItemFileExtraPart: typeof KYCFormItemFileExtraPart;
32
+ KYCFormItemFile: typeof KYCFormItemFile;
33
+ };
34
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { KYCErrorLabelProps } from './types';
2
+ declare const KYCErrorLabel: (props: KYCErrorLabelProps) => JSX.Element;
3
+ export default KYCErrorLabel;
@@ -0,0 +1,4 @@
1
+ declare const StyledKYCErrorLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ declare const StyledKYCErrorLabelIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
3
+ declare const StyledKYCErrorLabelText: import("styled-components").StyledComponent<"span", any, {}, never>;
4
+ export { StyledKYCErrorLabel, StyledKYCErrorLabelIcon, StyledKYCErrorLabelText, };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface KYCErrorLabelProps {
3
+ label: string;
4
+ isDocumentPartError: boolean;
5
+ }
6
+ export default class KYCErrorLabel extends React.Component<KYCErrorLabelProps> {
7
+ }
@@ -0,0 +1,3 @@
1
+ import { KYCFormItemProps } from './types';
2
+ declare const KYCFormItem: (props: KYCFormItemProps) => JSX.Element;
3
+ export default KYCFormItem;
@@ -0,0 +1,4 @@
1
+ declare const StyledKYCFormItem: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ declare const StyledKYCFormItemTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ declare const StyledKYCFormItemDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export { StyledKYCFormItem, StyledKYCFormItemTitle, StyledKYCFormItemDescription, };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { KYCDocument } from '../document.types';
3
+ import { UploaderLabels, DocumentLabels } from '../labels.types';
4
+ export interface KYCFormItemProps extends KYCDocument {
5
+ uploaderLabels: UploaderLabels;
6
+ documentLabels?: DocumentLabels;
7
+ elementId: string;
8
+ index: number;
9
+ errors?: Record<string, string>;
10
+ onDocumentChange: (document: KYCDocument) => void;
11
+ }
12
+ export default class KYCFormItem extends React.Component<KYCFormItemProps> {
13
+ }
@@ -0,0 +1,9 @@
1
+ import { KYCSucessScreenProps, KYCFailScreenProps } from './types';
2
+ import { MAX_FILE_SIZE, MAX_EXTRA_PARTS_COUNT, ACCEPT_FORMATS, PDF_MIME_TYPE, AVAILABLE_EXTRA_PARTS_DOCUMENTS } from '../constants';
3
+ import { DOCUMENT_TYPES, PART_TYPES } from '../document.types';
4
+ declare const _default: {
5
+ KYCSucessScreen: (props: KYCSucessScreenProps) => JSX.Element;
6
+ KYCFailScreen: (props: KYCFailScreenProps) => JSX.Element;
7
+ };
8
+ export default _default;
9
+ export { MAX_FILE_SIZE, MAX_EXTRA_PARTS_COUNT, ACCEPT_FORMATS, DOCUMENT_TYPES, PART_TYPES, PDF_MIME_TYPE, AVAILABLE_EXTRA_PARTS_DOCUMENTS, };
@@ -0,0 +1,6 @@
1
+ declare const StyledKYCSucessScreen: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ declare const StyledKYCSucessScreenItem: import("styled-components").StyledComponent<"span", any, {}, never>;
3
+ declare const StyledKYCSucessScreenSuppport: import("styled-components").StyledComponent<"span", any, {}, never>;
4
+ declare const StyledKYCFailScreen: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ declare const StyledKYCFailScreenItem: import("styled-components").StyledComponent<"span", any, {}, never>;
6
+ export { StyledKYCSucessScreen, StyledKYCSucessScreenItem, StyledKYCSucessScreenSuppport, StyledKYCFailScreen, StyledKYCFailScreenItem, };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ export interface KYCSucessScreenProps {
3
+ elementId: string;
4
+ title: string;
5
+ description?: React.ReactChildren | string | React.ComponentElement<any, any>;
6
+ support?: React.ReactChildren | string | React.ComponentElement<any, any>;
7
+ }
8
+ export interface KYCFailScreenProps {
9
+ elementId: string;
10
+ title: string;
11
+ support?: React.ReactChildren | string | React.ComponentElement<any, any>;
12
+ }
13
+ declare class KYCSucessScreen extends React.Component<KYCSucessScreenProps> {
14
+ }
15
+ declare class KYCFailScreen extends React.Component<KYCFailScreenProps> {
16
+ }
17
+ declare const _default: {
18
+ KYCSucessScreen: typeof KYCSucessScreen;
19
+ KYCFailScreen: typeof KYCFailScreen;
20
+ };
21
+ export default _default;
@@ -0,0 +1 @@
1
+ declare module '*';
@@ -0,0 +1,15 @@
1
+ import { DOCUMENT_TYPES, PART_TYPES } from './document.types';
2
+ export declare const MAX_FILE_SIZE = 5242880;
3
+ export declare const MAX_EXTRA_PARTS_COUNT = 15;
4
+ export declare const PDF_MIME_TYPE = "application/pdf";
5
+ export declare const HEIC_MIME_TYPE = "image/heic";
6
+ export declare const ACCEPT_FORMATS: string;
7
+ export declare const AVAILABLE_EXTRA_PARTS_DOCUMENTS: DOCUMENT_TYPES[];
8
+ export declare const OPTIONAL_DOCUMENT_PARTS: {
9
+ id: {
10
+ parts: PART_TYPES[];
11
+ };
12
+ id_extra: {
13
+ parts: PART_TYPES[];
14
+ };
15
+ };
@@ -0,0 +1,31 @@
1
+ export declare enum DOCUMENT_TYPES {
2
+ ID = "id",
3
+ UB = "ub",
4
+ ID_EXTRA = "id_extra",
5
+ CARD = "bank_card",
6
+ PAYMENT_SYSTEM_SCREEN = "payment_system_screen",
7
+ ONLINE_BANKING_STATEMENT = "online_banking_statement",
8
+ COMPANY_REGISTRATION_DOCUMENT = "company_registration_document",
9
+ SELFIE_WITH_ID_CARD = "selfie_with_id_card_or_bank_card",
10
+ FEEDBACK = "feedback"
11
+ }
12
+ export declare enum PART_TYPES {
13
+ ID_FRONT = "id_front",
14
+ ID_BACK = "id_back",
15
+ UB = "ub_item",
16
+ CARD = "card_item",
17
+ PAYMENT_SYSTEM_SCREEN = "screen_item",
18
+ ONLINE_BANKING_STATEMENT = "obs_item",
19
+ COMPANY_REGISTRATION_DOCUMENT = "crd_item",
20
+ SELFIE_WITH_ID_CARD = "selfie_item",
21
+ FEEDBACK = "feedback"
22
+ }
23
+ export declare type KYCFileData = string | undefined;
24
+ export declare type KYCFile = {
25
+ type: PART_TYPES;
26
+ data?: KYCFileData;
27
+ };
28
+ export declare type KYCDocument = {
29
+ type: DOCUMENT_TYPES;
30
+ parts: KYCFile[];
31
+ };
@@ -0,0 +1,10 @@
1
+ import { MAX_FILE_SIZE, MAX_EXTRA_PARTS_COUNT, ACCEPT_FORMATS, PDF_MIME_TYPE, OPTIONAL_DOCUMENT_PARTS, AVAILABLE_EXTRA_PARTS_DOCUMENTS } from './constants';
2
+ import { DOCUMENT_TYPES, PART_TYPES } from './document.types';
3
+ import { KYCFormProps } from './types';
4
+ declare const KYCForm: {
5
+ (props: KYCFormProps): JSX.Element;
6
+ SucessScreen: (props: import("./KYCStatusScreen/types").KYCSucessScreenProps) => JSX.Element;
7
+ FailScreen: (props: import("./KYCStatusScreen/types").KYCFailScreenProps) => JSX.Element;
8
+ };
9
+ export default KYCForm;
10
+ export { MAX_FILE_SIZE, MAX_EXTRA_PARTS_COUNT, ACCEPT_FORMATS, DOCUMENT_TYPES, PART_TYPES, PDF_MIME_TYPE, OPTIONAL_DOCUMENT_PARTS, AVAILABLE_EXTRA_PARTS_DOCUMENTS, };
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./kyc-form.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./kyc-form.cjs.development.js')
8
+ }