@propellerads/kyc-form 5.0.0 → 5.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/README.md +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +339 -358
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,400 +1,381 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
import e, { ButtonVariant as t } from "@propellerads/button";
|
|
2
|
+
import { useEffect as n, useState as r } from "react";
|
|
3
|
+
import { Close as i, Color as a, Delete as o, Insert as s, Pdf as c, Size as l } from "@propellerads/icon";
|
|
4
|
+
import u, { Direction as d } from "@propellerads/image-uploader";
|
|
5
|
+
import f from "@propellerads/textarea";
|
|
6
|
+
import p from "styled-components";
|
|
7
|
+
import { black as m, borderRadius as h, errorColor as g, fontNormal as _, fontSmall as v, gray50 as y, gray95 as b, spacing as x, white as S } from "@propellerads/stylevariables";
|
|
8
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
9
|
+
import T from "@propellerads/success-label";
|
|
10
|
+
//#region src/document.types.ts
|
|
11
|
+
var E = {
|
|
12
|
+
Id: "id",
|
|
13
|
+
Ub: "ub",
|
|
14
|
+
IdExtra: "id_extra",
|
|
15
|
+
Card: "bank_card",
|
|
16
|
+
PaymentSystemScreen: "payment_system_screen",
|
|
17
|
+
OnlineBankingStatement: "online_banking_statement",
|
|
18
|
+
CompanyRegistrationDocument: "company_registration_document",
|
|
19
|
+
SelfieWithIdCard: "selfie_with_id_card_or_bank_card",
|
|
20
|
+
PaypalDetailsPage: "pay_pal_details_page",
|
|
21
|
+
BankWireDetails: "bank_wire_details",
|
|
22
|
+
TransactionConfirmation: "transaction_confirmation",
|
|
23
|
+
Other: "other",
|
|
24
|
+
Feedback: "feedback"
|
|
25
|
+
}, D = {
|
|
26
|
+
IdFront: "id_front",
|
|
27
|
+
IdBack: "id_back",
|
|
28
|
+
Ub: "ub_item",
|
|
29
|
+
Card: "card_item",
|
|
30
|
+
PaymentSystemScreen: "screen_item",
|
|
31
|
+
OnlineBankingStatement: "obs_item",
|
|
32
|
+
CompanyRegistrationDocument: "crd_item",
|
|
33
|
+
SelfieWithIdCard: "selfie_item",
|
|
34
|
+
PaypalDetailsPageImage: "pay_pal_details_page_image",
|
|
35
|
+
BankWireDetailsPage: "bank_wire_details_image",
|
|
36
|
+
TransactionConfirmationImage: "transaction_confirmation_image",
|
|
37
|
+
OtherImage: "other_image",
|
|
38
|
+
Feedback: "feedback"
|
|
39
|
+
}, O = 5242880, ee = 3, k = "application/pdf", A = "image/heic", j = {
|
|
40
|
+
"image/png": [".png"],
|
|
41
|
+
"image/jpeg": [
|
|
42
|
+
".jpg",
|
|
43
|
+
".jpe",
|
|
44
|
+
".jpeg"
|
|
45
|
+
],
|
|
46
|
+
[k]: [".pdf"],
|
|
47
|
+
[A]: [".heic"]
|
|
48
|
+
}, M = [
|
|
49
|
+
E.Card,
|
|
50
|
+
E.Card,
|
|
51
|
+
E.PaypalDetailsPage,
|
|
52
|
+
E.BankWireDetails,
|
|
53
|
+
E.TransactionConfirmation,
|
|
54
|
+
E.SelfieWithIdCard,
|
|
55
|
+
E.PaymentSystemScreen,
|
|
56
|
+
E.Other
|
|
57
|
+
], te = {
|
|
58
|
+
[E.Id]: { parts: [D.IdBack] },
|
|
59
|
+
[E.IdExtra]: { parts: [D.IdBack] }
|
|
60
|
+
}, N = p.div`
|
|
60
61
|
display: flex;
|
|
61
62
|
align-items: center;
|
|
62
|
-
color: ${
|
|
63
|
-
margin-top: ${
|
|
64
|
-
margin-bottom: ${
|
|
65
|
-
`,
|
|
63
|
+
color: ${g};
|
|
64
|
+
margin-top: ${x * 2}px;
|
|
65
|
+
margin-bottom: ${x * 4}px;
|
|
66
|
+
`, P = p.span`
|
|
66
67
|
display: flex;
|
|
67
68
|
align-items: center;
|
|
68
69
|
justify-content: center;
|
|
69
70
|
width: 14px;
|
|
70
71
|
height: 14px;
|
|
71
72
|
border-radius: 100%;
|
|
72
|
-
background-color: ${
|
|
73
|
+
background-color: ${g};
|
|
73
74
|
|
|
74
75
|
&:before {
|
|
75
|
-
font-size: ${
|
|
76
|
-
color: ${
|
|
76
|
+
font-size: ${v};
|
|
77
|
+
color: ${S};
|
|
77
78
|
content: '!';
|
|
78
79
|
}
|
|
79
|
-
`,
|
|
80
|
-
margin-left: ${
|
|
81
|
-
`,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
margin-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
`, F = p.span`
|
|
81
|
+
margin-left: ${x * 2}px;
|
|
82
|
+
`, I = (e) => /* @__PURE__ */ w(N, { children: [e.isDocumentPartError ? /* @__PURE__ */ C(P, {}) : /* @__PURE__ */ C(i, {
|
|
83
|
+
color: a.Error,
|
|
84
|
+
hoverColor: a.Error,
|
|
85
|
+
size: l.Small
|
|
86
|
+
}), /* @__PURE__ */ C(F, { children: e.label })] }), L = (e) => M.includes(e), ne = (e, t) => L(e) && t.every((e) => !!e.data) && t.length < 3 && t.length > 0, R = (e) => e?.match(/[^:]\w+\/[\w-+\d.]+(?=;|,)/)?.[0], z = (e) => R(e) === k, re = (e) => R(e) === A, B = (e, t) => t.every((t) => t.data !== e?.data), ie = async (e) => {
|
|
87
|
+
let t = new FileReader();
|
|
88
|
+
return new Promise((n, r) => {
|
|
89
|
+
t.onload = () => n(t.result), t.onerror = (e) => r(e), t.readAsDataURL(e);
|
|
90
|
+
});
|
|
91
|
+
}, V = p.div`
|
|
92
|
+
margin-top: ${x * 4}px;
|
|
93
|
+
margin-left: ${x * 4}px;
|
|
94
|
+
`, H = p.div`
|
|
95
|
+
margin-bottom: ${x}px;
|
|
96
|
+
`, U = p.div`
|
|
95
97
|
display: flex;
|
|
96
98
|
align-items: center;
|
|
97
|
-
background-color: ${
|
|
98
|
-
padding: ${
|
|
99
|
-
border-radius: ${
|
|
100
|
-
`,
|
|
99
|
+
background-color: ${b};
|
|
100
|
+
padding: ${x * 2}px;
|
|
101
|
+
border-radius: ${h}px;
|
|
102
|
+
`, W = p.span`
|
|
101
103
|
width: 100%;
|
|
102
|
-
margin-left: ${
|
|
103
|
-
margin-right: ${
|
|
104
|
-
`,
|
|
104
|
+
margin-left: ${x * 4}px;
|
|
105
|
+
margin-right: ${x * 2}px;
|
|
106
|
+
`, G = p.span`
|
|
105
107
|
cursor: pointer !important;
|
|
106
|
-
margin-right: ${
|
|
107
|
-
`,
|
|
108
|
+
margin-right: ${x * 2}px;
|
|
109
|
+
`, K = p.div`
|
|
108
110
|
height: 66px;
|
|
109
|
-
`,
|
|
111
|
+
`, q = p.div`
|
|
110
112
|
display: flex;
|
|
111
113
|
flex-direction: column;
|
|
112
|
-
margin-top: ${
|
|
113
|
-
margin-left: ${
|
|
114
|
-
`,
|
|
114
|
+
margin-top: ${x * 4}px;
|
|
115
|
+
margin-left: ${x * 4}px;
|
|
116
|
+
`, J = p.img`
|
|
115
117
|
width: auto;
|
|
116
118
|
max-width: 204px;
|
|
117
119
|
height: 50px;
|
|
118
120
|
object-fit: contain;
|
|
119
|
-
border-radius: ${
|
|
120
|
-
`,
|
|
121
|
+
border-radius: ${h}px;
|
|
122
|
+
`, ae = p.div`
|
|
121
123
|
display: flex;
|
|
122
124
|
align-items: center;
|
|
123
125
|
justify-content: center;
|
|
124
126
|
min-width: 50px;
|
|
125
127
|
height: 50px;
|
|
126
|
-
border-radius: ${
|
|
127
|
-
background-color: ${
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
128
|
+
border-radius: ${h}px;
|
|
129
|
+
background-color: ${S};
|
|
130
|
+
`, oe = (e) => {
|
|
131
|
+
let { data: t } = e, n = z(t), r = re(t);
|
|
132
|
+
return n || r ? /* @__PURE__ */ w(ae, { children: [n && /* @__PURE__ */ C(c, {
|
|
133
|
+
color: a.Gray,
|
|
134
|
+
hoverColor: a.Gray
|
|
135
|
+
}), r && /* @__PURE__ */ C(s, {
|
|
136
|
+
color: a.Gray,
|
|
137
|
+
hoverColor: a.Gray
|
|
138
|
+
})] }) : /* @__PURE__ */ C(J, { src: t });
|
|
139
|
+
}, Y = {
|
|
140
|
+
KYCFormItemFileExtraPart: (e) => {
|
|
141
|
+
let { elementId: t, title: n, uploaderLabels: r, onFileAdd: i } = e;
|
|
142
|
+
return /* @__PURE__ */ w(q, {
|
|
143
|
+
id: t,
|
|
144
|
+
children: [n && /* @__PURE__ */ C(H, { children: n }), /* @__PURE__ */ C(K, { children: /* @__PURE__ */ C(u, {
|
|
145
|
+
title: r.title,
|
|
146
|
+
action: r.action,
|
|
147
|
+
maxSize: O,
|
|
148
|
+
acceptFormats: j,
|
|
149
|
+
elementId: `${t}_uploader`,
|
|
150
|
+
direction: d.Row,
|
|
151
|
+
onDrop: (e) => {
|
|
152
|
+
let [t] = e;
|
|
153
|
+
t && i(t);
|
|
154
|
+
}
|
|
155
|
+
}) })]
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
KYCFormItemFile: (e) => {
|
|
159
|
+
let { name: t, title: n, data: r, error: i, elementId: s, uploaderLabels: c, onFileChange: l, onFileRemove: f } = e;
|
|
160
|
+
return /* @__PURE__ */ w(V, {
|
|
161
|
+
id: s,
|
|
162
|
+
children: [
|
|
163
|
+
n && /* @__PURE__ */ C(H, { children: n }),
|
|
164
|
+
r ? /* @__PURE__ */ w(U, { children: [
|
|
165
|
+
/* @__PURE__ */ C(oe, { data: r }),
|
|
166
|
+
/* @__PURE__ */ C(W, { children: t }),
|
|
167
|
+
/* @__PURE__ */ C(G, {
|
|
168
|
+
onClick: f,
|
|
169
|
+
children: /* @__PURE__ */ C(o, {
|
|
170
|
+
color: a.Blue,
|
|
171
|
+
hoverColor: a.Blue
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
] }) : /* @__PURE__ */ C(K, { children: /* @__PURE__ */ C(u, {
|
|
175
|
+
title: c.title,
|
|
176
|
+
action: c.action,
|
|
177
|
+
maxSize: O,
|
|
178
|
+
acceptFormats: j,
|
|
179
|
+
elementId: `${s}_uploader`,
|
|
180
|
+
direction: d.Row,
|
|
181
|
+
onDrop: (e) => {
|
|
182
|
+
let [t] = e;
|
|
183
|
+
t && l(t);
|
|
184
|
+
}
|
|
185
|
+
}) }),
|
|
186
|
+
i && /* @__PURE__ */ C(I, {
|
|
187
|
+
label: i,
|
|
188
|
+
isDocumentPartError: !0
|
|
189
|
+
})
|
|
190
|
+
]
|
|
191
|
+
});
|
|
192
|
+
},
|
|
193
|
+
KYCFormItemText: (e) => {
|
|
194
|
+
let { onFeedbackChange: t, value: n = "" } = e, r = (e) => t(e);
|
|
195
|
+
return /* @__PURE__ */ C(V, { children: /* @__PURE__ */ C(f, {
|
|
196
|
+
onChange: r,
|
|
197
|
+
onBlur: r,
|
|
198
|
+
value: n,
|
|
199
|
+
errors: [],
|
|
200
|
+
name: "kyc-client-comments",
|
|
201
|
+
elementId: "kyc-feedback-textarea"
|
|
202
|
+
}) });
|
|
203
|
+
}
|
|
204
|
+
}, se = p.div`
|
|
205
|
+
margin-top: ${x * 6}px;
|
|
206
|
+
`, ce = p.div`
|
|
207
|
+
font-size: ${_}px;
|
|
200
208
|
font-weight: bold;
|
|
201
|
-
color: ${
|
|
202
|
-
margin-bottom: ${
|
|
203
|
-
`,
|
|
204
|
-
font-size: ${
|
|
205
|
-
color: ${
|
|
206
|
-
margin-left: ${
|
|
207
|
-
`,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}),
|
|
280
|
-
y && D && /* @__PURE__ */ n(
|
|
281
|
-
T.KYCFormItemFileExtraPart,
|
|
282
|
-
{
|
|
283
|
-
elementId: `${u}_extra`,
|
|
284
|
-
title: w,
|
|
285
|
-
uploaderLabels: i,
|
|
286
|
-
onFileAdd: (t) => M(s.length, t)
|
|
287
|
-
}
|
|
288
|
-
)
|
|
289
|
-
] });
|
|
290
|
-
}, Ge = c.div`
|
|
209
|
+
color: ${m};
|
|
210
|
+
margin-bottom: ${x}px;
|
|
211
|
+
`, le = p.div`
|
|
212
|
+
font-size: ${v}px;
|
|
213
|
+
color: ${y};
|
|
214
|
+
margin-left: ${x * 4}px;
|
|
215
|
+
`, X = (e, t) => `[${e}].parts[${t}].data`, ue = (e) => {
|
|
216
|
+
let { type: t, index: n, uploaderLabels: i, documentLabels: a, elementId: o, parts: s, errors: c, onDocumentChange: l } = e, [u, d] = r(/* @__PURE__ */ new Map()), f = ne(t, s), p = a?.parts, m = s[0], h = m ? p?.[m.type]?.title : void 0, [g, _] = r(/* @__PURE__ */ new Map()), v = (e) => {
|
|
217
|
+
let t = new Map(u);
|
|
218
|
+
t.set(X(n, e), i.oversizeError), d(t);
|
|
219
|
+
}, y = (e) => {
|
|
220
|
+
let t = new Map(u);
|
|
221
|
+
t.delete(X(n, e)), d(t);
|
|
222
|
+
}, b = (e, n, r) => {
|
|
223
|
+
let i = {
|
|
224
|
+
...e,
|
|
225
|
+
data: r
|
|
226
|
+
}, a = [...s];
|
|
227
|
+
a.splice(n, 1, i), l({
|
|
228
|
+
type: t,
|
|
229
|
+
parts: a
|
|
230
|
+
});
|
|
231
|
+
}, x = async (e, t) => {
|
|
232
|
+
if (!t) {
|
|
233
|
+
v(e);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
let n = s[e] ?? s[0];
|
|
237
|
+
if (!n) return;
|
|
238
|
+
let r = await ie(t);
|
|
239
|
+
b(n, e, r);
|
|
240
|
+
let i = new Map(g);
|
|
241
|
+
i.set(r, t.name), _(i), y(e);
|
|
242
|
+
}, S = (e) => {
|
|
243
|
+
let t = s[e];
|
|
244
|
+
if (!t) return;
|
|
245
|
+
b(t, e);
|
|
246
|
+
let n = s[e], r = new Map(g);
|
|
247
|
+
n?.data && B(n, s) && r.delete(n?.data), _(r), y(e);
|
|
248
|
+
}, T = (e) => {
|
|
249
|
+
if (e) return g.get(e);
|
|
250
|
+
}, E = (e, t) => {
|
|
251
|
+
let n = s[e] ?? s[0];
|
|
252
|
+
n && b(n, e, t);
|
|
253
|
+
};
|
|
254
|
+
return /* @__PURE__ */ w(se, {
|
|
255
|
+
id: o,
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ C(ce, { children: `${n + 1}. ${a?.title}` }),
|
|
258
|
+
a?.description && /* @__PURE__ */ C(le, { children: a?.description }),
|
|
259
|
+
s.map((e, r) => {
|
|
260
|
+
let a = `kyc-form_item_file_${e.type}`, l = L(t), d = p?.[e.type], f = l ? void 0 : d?.title;
|
|
261
|
+
L(t) && e.data && (a = `${a}_${e.data?.substr(-32)}`, B(e, s) || (a = `${a}_${r}`));
|
|
262
|
+
let m = c?.[X(n, r)], h = u.get(X(n, r));
|
|
263
|
+
return e.type === D.Feedback ? /* @__PURE__ */ C(Y.KYCFormItemText, {
|
|
264
|
+
value: e.data,
|
|
265
|
+
onFeedbackChange: (e) => E(r, e)
|
|
266
|
+
}, a) : /* @__PURE__ */ C(Y.KYCFormItemFile, {
|
|
267
|
+
title: f,
|
|
268
|
+
data: e.data,
|
|
269
|
+
type: e.type,
|
|
270
|
+
name: T(e.data),
|
|
271
|
+
uploaderLabels: i,
|
|
272
|
+
error: h || m,
|
|
273
|
+
elementId: `${o}_part_${e.type}_${r}`,
|
|
274
|
+
onFileChange: (e) => x(r, e),
|
|
275
|
+
onFileRemove: () => S(r)
|
|
276
|
+
}, a);
|
|
277
|
+
}),
|
|
278
|
+
f && m && /* @__PURE__ */ C(Y.KYCFormItemFileExtraPart, {
|
|
279
|
+
elementId: `${o}_extra`,
|
|
280
|
+
title: h,
|
|
281
|
+
uploaderLabels: i,
|
|
282
|
+
onFileAdd: (e) => x(s.length, e)
|
|
283
|
+
})
|
|
284
|
+
]
|
|
285
|
+
});
|
|
286
|
+
}, de = p.div`
|
|
291
287
|
display: flex;
|
|
292
288
|
flex-direction: column;
|
|
293
|
-
`,
|
|
294
|
-
margin-bottom: ${
|
|
295
|
-
`,
|
|
296
|
-
color: ${
|
|
297
|
-
`,
|
|
289
|
+
`, Z = p.span`
|
|
290
|
+
margin-bottom: ${x * 8}px;
|
|
291
|
+
`, fe = p.span`
|
|
292
|
+
color: ${y};
|
|
293
|
+
`, pe = p.div`
|
|
298
294
|
display: flex;
|
|
299
295
|
flex-direction: column;
|
|
300
|
-
`,
|
|
301
|
-
margin-bottom: ${
|
|
302
|
-
`,
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
296
|
+
`, me = p.span`
|
|
297
|
+
margin-bottom: ${x * 6}px;
|
|
298
|
+
`, Q = {
|
|
299
|
+
KYCSuccessScreen: (e) => {
|
|
300
|
+
let { elementId: t, title: n, description: r, support: i } = e;
|
|
301
|
+
return /* @__PURE__ */ w(de, {
|
|
302
|
+
id: t,
|
|
303
|
+
children: [
|
|
304
|
+
/* @__PURE__ */ C(Z, { children: /* @__PURE__ */ C(T, {
|
|
305
|
+
show: !0,
|
|
306
|
+
elementId: `${t}_success`,
|
|
307
|
+
children: n
|
|
308
|
+
}) }),
|
|
309
|
+
r && /* @__PURE__ */ C(Z, { children: r }),
|
|
310
|
+
i && /* @__PURE__ */ C(fe, { children: i })
|
|
311
|
+
]
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
KYCFailScreen: (e) => {
|
|
315
|
+
let { elementId: t, title: n, support: r } = e;
|
|
316
|
+
return /* @__PURE__ */ w(pe, {
|
|
317
|
+
id: t,
|
|
318
|
+
children: [/* @__PURE__ */ C(me, { children: /* @__PURE__ */ C(I, {
|
|
319
|
+
label: n,
|
|
320
|
+
isDocumentPartError: !1
|
|
321
|
+
}) }), r]
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
}, he = p.div`
|
|
319
325
|
display: flex;
|
|
320
326
|
flex-direction: column;
|
|
321
327
|
align-items: flex-start;
|
|
322
328
|
width: 100%;
|
|
323
|
-
`,
|
|
324
|
-
font-size: ${
|
|
325
|
-
`,
|
|
329
|
+
`, ge = p.div`
|
|
330
|
+
font-size: ${_}px;
|
|
331
|
+
`, _e = p.div`
|
|
326
332
|
width: 100%;
|
|
327
|
-
margin-bottom: ${
|
|
328
|
-
`,
|
|
333
|
+
margin-bottom: ${x * 6}px;
|
|
334
|
+
`, ve = p.div`
|
|
329
335
|
display: flex;
|
|
330
336
|
justify-content: flex-end;
|
|
331
337
|
width: 100%;
|
|
332
|
-
`,
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
},
|
|
371
|
-
b
|
|
372
|
-
);
|
|
373
|
-
}) }),
|
|
374
|
-
/* @__PURE__ */ n(tt, { children: /* @__PURE__ */ n(
|
|
375
|
-
pe,
|
|
376
|
-
{
|
|
377
|
-
elementId: `${e}_button`,
|
|
378
|
-
type: ue.Primary,
|
|
379
|
-
isDisabled: D,
|
|
380
|
-
isLoading: P || !1,
|
|
381
|
-
onClick: () => $(y),
|
|
382
|
-
children: i
|
|
383
|
-
}
|
|
384
|
-
) })
|
|
385
|
-
] });
|
|
386
|
-
};
|
|
387
|
-
ae.SuccessScreen = ie.KYCSuccessScreen;
|
|
388
|
-
ae.FailScreen = ie.KYCFailScreen;
|
|
389
|
-
export {
|
|
390
|
-
Q as ACCEPT_FORMATS,
|
|
391
|
-
$e as AVAILABLE_EXTRA_PARTS_DOCUMENTS,
|
|
392
|
-
g as DocumentType,
|
|
393
|
-
xe as MAX_EXTRA_PARTS_COUNT,
|
|
394
|
-
q as MAX_FILE_SIZE,
|
|
395
|
-
mt as OPTIONAL_DOCUMENT_PARTS,
|
|
396
|
-
Z as PDF_MIME_TYPE,
|
|
397
|
-
L as PartType,
|
|
398
|
-
ae as default
|
|
338
|
+
`, $ = (i) => {
|
|
339
|
+
let { elementId: a, title: o, uploadButtonLabel: s, uploaderLabels: c, documentsLabels: l, documents: u, errors: d, isLoading: f, validator: p, onUploadClick: m } = i, [h, g] = r(u), [_, v] = r(!0);
|
|
340
|
+
n(() => {
|
|
341
|
+
g(u);
|
|
342
|
+
}, [u]), n(() => {
|
|
343
|
+
v(!p(h));
|
|
344
|
+
}, [h, p]);
|
|
345
|
+
let y = (e, t) => {
|
|
346
|
+
let n = [...h];
|
|
347
|
+
n.splice(e, 1, t), g(n);
|
|
348
|
+
};
|
|
349
|
+
return /* @__PURE__ */ w(he, {
|
|
350
|
+
id: a,
|
|
351
|
+
children: [
|
|
352
|
+
o && /* @__PURE__ */ C(ge, { children: o }),
|
|
353
|
+
/* @__PURE__ */ C(_e, { children: h.map((e, t) => {
|
|
354
|
+
let n = `kyc-form_item_${e.type}_${t}`;
|
|
355
|
+
return /* @__PURE__ */ C(ue, {
|
|
356
|
+
index: t,
|
|
357
|
+
type: e.type,
|
|
358
|
+
parts: e.parts,
|
|
359
|
+
documentLabels: l[e.type],
|
|
360
|
+
uploaderLabels: c,
|
|
361
|
+
errors: d,
|
|
362
|
+
elementId: `${a}_item_${e.type}`,
|
|
363
|
+
onDocumentChange: (e) => y(t, e)
|
|
364
|
+
}, n);
|
|
365
|
+
}) }),
|
|
366
|
+
/* @__PURE__ */ C(ve, { children: /* @__PURE__ */ C(e, {
|
|
367
|
+
id: `${a}_button`,
|
|
368
|
+
variant: t.Primary,
|
|
369
|
+
isDisabled: _,
|
|
370
|
+
isLoading: f || !1,
|
|
371
|
+
onClick: () => m(h),
|
|
372
|
+
children: s
|
|
373
|
+
}) })
|
|
374
|
+
]
|
|
375
|
+
});
|
|
399
376
|
};
|
|
400
|
-
|
|
377
|
+
$.SuccessScreen = Q.KYCSuccessScreen, $.FailScreen = Q.KYCFailScreen;
|
|
378
|
+
//#endregion
|
|
379
|
+
export { j as ACCEPT_FORMATS, M as AVAILABLE_EXTRA_PARTS_DOCUMENTS, E as DocumentType, ee as MAX_EXTRA_PARTS_COUNT, O as MAX_FILE_SIZE, te as OPTIONAL_DOCUMENT_PARTS, k as PDF_MIME_TYPE, D as PartType, $ as default };
|
|
380
|
+
|
|
381
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/document.types.ts","../src/constants.ts","../src/KYCErrorLabel/style.tsx","../src/KYCErrorLabel/index.tsx","../src/utils.ts","../src/KYCDocumentParts/style.tsx","../src/KYCDocumentParts/index.tsx","../src/KYCFormItem/style.tsx","../src/KYCFormItem/index.tsx","../src/KYCStatusScreen/style.tsx","../src/KYCStatusScreen/index.tsx","../src/style.tsx","../src/index.tsx"],"sourcesContent":["export const DocumentType = {\n Id: 'id',\n Ub: 'ub',\n IdExtra: 'id_extra',\n Card: 'bank_card',\n PaymentSystemScreen: 'payment_system_screen',\n OnlineBankingStatement: 'online_banking_statement',\n CompanyRegistrationDocument: 'company_registration_document',\n SelfieWithIdCard: 'selfie_with_id_card_or_bank_card',\n PaypalDetailsPage: 'pay_pal_details_page',\n BankWireDetails: 'bank_wire_details',\n TransactionConfirmation: 'transaction_confirmation',\n Other: 'other',\n Feedback: 'feedback',\n} as const;\nexport type DocumentType = (typeof DocumentType)[keyof typeof DocumentType];\n\nexport const PartType = {\n IdFront: 'id_front',\n IdBack: 'id_back',\n Ub: 'ub_item',\n Card: 'card_item',\n PaymentSystemScreen: 'screen_item',\n OnlineBankingStatement: 'obs_item',\n CompanyRegistrationDocument: 'crd_item',\n SelfieWithIdCard: 'selfie_item',\n PaypalDetailsPageImage: 'pay_pal_details_page_image',\n BankWireDetailsPage: 'bank_wire_details_image',\n TransactionConfirmationImage: 'transaction_confirmation_image',\n OtherImage: 'other_image',\n Feedback: 'feedback',\n} as const;\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport type KYCFileData = string | undefined;\n\nexport type KYCFile = {\n type: PartType;\n data?: KYCFileData;\n};\n\nexport type KYCDocument = {\n type: DocumentType;\n parts: KYCFile[];\n};\n","import type {ImageUploaderProps} from '@propellerads/image-uploader';\nimport {DocumentType, PartType} from './document.types';\n\nexport const MAX_FILE_SIZE = 5242880;\n\nexport const MAX_EXTRA_PARTS_COUNT = 3;\n\nexport const PDF_MIME_TYPE = 'application/pdf';\nexport const HEIC_MIME_TYPE = 'image/heic';\nexport const ACCEPT_FORMATS: ImageUploaderProps['acceptFormats'] = {\n 'image/png': ['.png'],\n 'image/jpeg': ['.jpg', '.jpe', '.jpeg'],\n [PDF_MIME_TYPE]: ['.pdf'],\n [HEIC_MIME_TYPE]: ['.heic'],\n};\n\nexport const AVAILABLE_EXTRA_PARTS_DOCUMENTS: DocumentType[] = [\n DocumentType.Card,\n DocumentType.Card,\n DocumentType.PaypalDetailsPage,\n DocumentType.BankWireDetails,\n DocumentType.TransactionConfirmation,\n DocumentType.SelfieWithIdCard,\n DocumentType.PaymentSystemScreen,\n DocumentType.Other,\n];\n\nexport const OPTIONAL_DOCUMENT_PARTS = {\n [DocumentType.Id]: {\n parts: [PartType.IdBack],\n },\n [DocumentType.IdExtra]: {\n parts: [PartType.IdBack],\n },\n};\n","import styled from 'styled-components';\nimport {fontSmall, spacing, white, errorColor} from '@propellerads/stylevariables';\n\nconst StyledKYCErrorLabel = styled.div`\n display: flex;\n align-items: center;\n color: ${errorColor};\n margin-top: ${spacing * 2}px;\n margin-bottom: ${spacing * 4}px;\n`;\n\nconst StyledKYCErrorLabelIcon = styled.span`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n border-radius: 100%;\n background-color: ${errorColor};\n\n &:before {\n font-size: ${fontSmall};\n color: ${white};\n content: '!';\n }\n`;\n\nconst StyledKYCErrorLabelText = styled.span`\n margin-left: ${spacing * 2}px;\n`;\n\nexport {StyledKYCErrorLabel, StyledKYCErrorLabelIcon, StyledKYCErrorLabelText};\n","import {Close, Color, Size} from '@propellerads/icon';\nimport {StyledKYCErrorLabel, StyledKYCErrorLabelIcon, StyledKYCErrorLabelText} from './style';\nimport {KYCErrorLabelProps} from './types';\n\nconst KYCErrorLabel = (props: KYCErrorLabelProps) => (\n <StyledKYCErrorLabel>\n {props.isDocumentPartError ? (\n <StyledKYCErrorLabelIcon />\n ) : (\n <Close color={Color.Error} hoverColor={Color.Error} size={Size.Small} />\n )}\n <StyledKYCErrorLabelText>{props.label}</StyledKYCErrorLabelText>\n </StyledKYCErrorLabel>\n);\n\nexport default KYCErrorLabel;\n","import {AVAILABLE_EXTRA_PARTS_DOCUMENTS, HEIC_MIME_TYPE, MAX_EXTRA_PARTS_COUNT, PDF_MIME_TYPE} from './constants';\nimport {DocumentType, KYCFile, KYCFileData} from './document.types';\n\nconst isDocumentExtraPartAvailable = (documentType: DocumentType): boolean =>\n AVAILABLE_EXTRA_PARTS_DOCUMENTS.includes(documentType);\n\nconst canAddExtraPart = (documentType: DocumentType, parts: KYCFile[]): boolean =>\n isDocumentExtraPartAvailable(documentType) &&\n parts.every((part: KYCFile) => Boolean(part.data)) &&\n parts.length < MAX_EXTRA_PARTS_COUNT &&\n parts.length > 0;\n\nconst canRemoveExtraPart = (documentType: DocumentType, parts: KYCFile[]): boolean =>\n AVAILABLE_EXTRA_PARTS_DOCUMENTS.includes(documentType) && parts.length > 1;\n\nconst getMimeType = (partData: KYCFileData): string | undefined => partData?.match(/[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/)?.[0];\n\nconst isPDF = (partData: KYCFileData): boolean => {\n const mimeType: string | undefined = getMimeType(partData);\n return mimeType === PDF_MIME_TYPE;\n};\n\nconst isHEIC = (partData: KYCFileData): boolean => {\n const mimeType: string | undefined = getMimeType(partData);\n return mimeType === HEIC_MIME_TYPE;\n};\n\nconst isFileUniqueInDocument = (file: KYCFile, parts: KYCFile[]): boolean =>\n parts.every((part: KYCFile) => part.data !== file?.data);\n\nconst getFileBase64 = async (file: File): Promise<string> => {\n const reader: FileReader = new FileReader();\n\n return new Promise<string>((resolve, reject) => {\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = (error) => reject(error);\n\n reader.readAsDataURL(file);\n });\n};\n\nexport {\n canAddExtraPart,\n canRemoveExtraPart,\n getFileBase64,\n isDocumentExtraPartAvailable,\n isFileUniqueInDocument,\n isHEIC,\n isPDF,\n};\n","import styled from 'styled-components';\nimport {borderRadius, spacing, gray95, white} from '@propellerads/stylevariables';\n\nconst StyledKYCFormItem = styled.div`\n margin-top: ${spacing * 4}px;\n margin-left: ${spacing * 4}px;\n`;\n\nconst StyledKYCFormItemFileTitle = styled.div`\n margin-bottom: ${spacing}px;\n`;\n\nconst StyledKYCFormItemFilePreview = styled.div`\n display: flex;\n align-items: center;\n background-color: ${gray95};\n padding: ${spacing * 2}px;\n border-radius: ${borderRadius}px;\n`;\n\nconst StyledKYCFormItemFilePreviewName = styled.span`\n width: 100%;\n margin-left: ${spacing * 4}px;\n margin-right: ${spacing * 2}px;\n`;\n\nconst StyledKYCFormItemFilePreviewRemove = styled.span`\n cursor: pointer !important;\n margin-right: ${spacing * 2}px;\n`;\n\nconst StyledKYCFormItemFileUploaderContainer = styled.div`\n height: 66px;\n`;\n\nconst StyledKYCFormItemFileExtraPart = styled.div`\n display: flex;\n flex-direction: column;\n margin-top: ${spacing * 4}px;\n margin-left: ${spacing * 4}px;\n`;\n\nconst StyledKYCDocumentPartImgMiniature = styled.img`\n width: auto;\n max-width: 204px;\n height: 50px;\n object-fit: contain;\n border-radius: ${borderRadius}px;\n`;\n\nconst StyledKYCDocumentPartIconMiniature = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 50px;\n height: 50px;\n border-radius: ${borderRadius}px;\n background-color: ${white};\n`;\n\nexport {\n StyledKYCFormItem,\n StyledKYCFormItemFilePreview,\n StyledKYCFormItemFilePreviewName,\n StyledKYCFormItemFilePreviewRemove,\n StyledKYCFormItemFileTitle,\n StyledKYCFormItemFileUploaderContainer,\n StyledKYCFormItemFileExtraPart,\n StyledKYCDocumentPartImgMiniature,\n StyledKYCDocumentPartIconMiniature,\n};\n","import {Color, Delete, Insert, Pdf} from '@propellerads/icon';\nimport ImageUploader, {Direction} from '@propellerads/image-uploader';\nimport TextArea from '@propellerads/textarea';\nimport {ACCEPT_FORMATS, MAX_FILE_SIZE} from '../constants';\nimport KYCErrorLabel from '../KYCErrorLabel';\nimport {isHEIC, isPDF} from '../utils';\nimport {\n StyledKYCDocumentPartIconMiniature,\n StyledKYCDocumentPartImgMiniature,\n StyledKYCFormItem,\n StyledKYCFormItemFileExtraPart,\n StyledKYCFormItemFilePreview,\n StyledKYCFormItemFilePreviewName,\n StyledKYCFormItemFilePreviewRemove,\n StyledKYCFormItemFileTitle,\n StyledKYCFormItemFileUploaderContainer,\n} from './style';\nimport {\n KYCDocumentPartMiniatureProps,\n KYCFormItemFileExtraPartProps,\n KYCFormItemFileProps,\n KYCFormItemTextProps,\n} from './types';\n\nconst KYCDocumentPartMiniature = (props: KYCDocumentPartMiniatureProps) => {\n const {data} = props;\n const isPDFPart: boolean = isPDF(data);\n const isHEICPart: boolean = isHEIC(data);\n\n if (isPDFPart || isHEICPart) {\n return (\n <StyledKYCDocumentPartIconMiniature>\n {isPDFPart && <Pdf color={Color.Gray} hoverColor={Color.Gray} />}\n {isHEICPart && <Insert color={Color.Gray} hoverColor={Color.Gray} />}\n </StyledKYCDocumentPartIconMiniature>\n );\n }\n\n return <StyledKYCDocumentPartImgMiniature src={data} />;\n};\n\nconst KYCFormItemFileExtraPart = (props: KYCFormItemFileExtraPartProps) => {\n const {elementId, title, uploaderLabels, onFileAdd} = props;\n const handleDrop = (files: File[]) => {\n const [file] = files;\n\n if (file) {\n onFileAdd(file);\n }\n };\n\n return (\n <StyledKYCFormItemFileExtraPart id={elementId}>\n {title && <StyledKYCFormItemFileTitle>{title}</StyledKYCFormItemFileTitle>}\n\n <StyledKYCFormItemFileUploaderContainer>\n <ImageUploader\n title={uploaderLabels.title}\n action={uploaderLabels.action}\n maxSize={MAX_FILE_SIZE}\n acceptFormats={ACCEPT_FORMATS}\n elementId={`${elementId}_uploader`}\n direction={Direction.Row}\n onDrop={handleDrop}\n />\n </StyledKYCFormItemFileUploaderContainer>\n </StyledKYCFormItemFileExtraPart>\n );\n};\n\nconst KYCFormItemFile = (props: KYCFormItemFileProps) => {\n const {name, title, data, error, elementId, uploaderLabels, onFileChange, onFileRemove} = props;\n const handleDrop = (files: File[]) => {\n const [file] = files;\n\n if (file) {\n onFileChange(file);\n }\n };\n\n return (\n <StyledKYCFormItem id={elementId}>\n {title && <StyledKYCFormItemFileTitle>{title}</StyledKYCFormItemFileTitle>}\n\n {data ? (\n <StyledKYCFormItemFilePreview>\n <KYCDocumentPartMiniature data={data} />\n <StyledKYCFormItemFilePreviewName>{name}</StyledKYCFormItemFilePreviewName>\n <StyledKYCFormItemFilePreviewRemove onClick={onFileRemove}>\n <Delete color={Color.Blue} hoverColor={Color.Blue} />\n </StyledKYCFormItemFilePreviewRemove>\n </StyledKYCFormItemFilePreview>\n ) : (\n <StyledKYCFormItemFileUploaderContainer>\n <ImageUploader\n title={uploaderLabels.title}\n action={uploaderLabels.action}\n maxSize={MAX_FILE_SIZE}\n acceptFormats={ACCEPT_FORMATS}\n elementId={`${elementId}_uploader`}\n direction={Direction.Row}\n onDrop={handleDrop}\n />\n </StyledKYCFormItemFileUploaderContainer>\n )}\n\n {error && <KYCErrorLabel label={error} isDocumentPartError />}\n </StyledKYCFormItem>\n );\n};\n\nconst KYCFormItemText = (props: KYCFormItemTextProps) => {\n const {onFeedbackChange, value = ''} = props;\n\n const handleChange = (newValue: string) => onFeedbackChange(newValue);\n\n return (\n <StyledKYCFormItem>\n <TextArea\n onChange={handleChange}\n onBlur={handleChange}\n value={value}\n errors={[]}\n name=\"kyc-client-comments\"\n elementId=\"kyc-feedback-textarea\"\n />\n </StyledKYCFormItem>\n );\n};\n\nexport default {\n KYCFormItemFileExtraPart,\n KYCFormItemFile,\n KYCFormItemText,\n};\n","import styled from 'styled-components';\nimport {fontNormal, fontSmall, spacing, gray50, black} from '@propellerads/stylevariables';\n\nconst StyledKYCFormItem = styled.div`\n margin-top: ${spacing * 6}px;\n`;\n\nconst StyledKYCFormItemTitle = styled.div`\n font-size: ${fontNormal}px;\n font-weight: bold;\n color: ${black};\n margin-bottom: ${spacing}px;\n`;\n\nconst StyledKYCFormItemDescription = styled.div`\n font-size: ${fontSmall}px;\n color: ${gray50};\n margin-left: ${spacing * 4}px;\n`;\n\nexport {StyledKYCFormItem, StyledKYCFormItemTitle, StyledKYCFormItemDescription};\n","import {useState} from 'react';\nimport {KYCDocument, KYCFile, KYCFileData, PartType} from '../document.types';\nimport KYCDocumentParts from '../KYCDocumentParts';\nimport {PartLabels, PartsLabels} from '../labels.types';\nimport {canAddExtraPart, getFileBase64, isDocumentExtraPartAvailable, isFileUniqueInDocument} from '../utils';\nimport {StyledKYCFormItem, StyledKYCFormItemDescription, StyledKYCFormItemTitle} from './style';\nimport {KYCFormItemProps} from './types';\n\nconst getErrorKey = (documentIndex: number, partIndex: number) => `[${documentIndex}].parts[${partIndex}].data`;\n\nconst KYCFormItem = (props: KYCFormItemProps) => {\n const {type, index, uploaderLabels, documentLabels, elementId, parts, errors, onDocumentChange} = props;\n const [localErrors, setLocalErrors] = useState<Map<string, string>>(new Map<string, string>());\n\n const isAddExtraPartAvailable: boolean = canAddExtraPart(type, parts);\n const documentLabelsParts: PartsLabels | undefined = documentLabels?.parts;\n const firstPart = parts[0];\n const extraPartTitle = firstPart ? documentLabelsParts?.[firstPart.type]?.title : undefined;\n\n const [fileNames, setFileNames] = useState<Map<string, string>>(new Map<string, string>());\n\n const setLocalErrorByPartIndex = (partIndex: number) => {\n const newLocalErrors = new Map<string, string>(localErrors);\n newLocalErrors.set(getErrorKey(index, partIndex), uploaderLabels.oversizeError);\n setLocalErrors(newLocalErrors);\n };\n\n const deleteLocalErrorByPartIndex = (partIndex: number) => {\n const newLocalErrors = new Map<string, string>(localErrors);\n newLocalErrors.delete(getErrorKey(index, partIndex));\n setLocalErrors(newLocalErrors);\n };\n\n const updateDocumentPart = (part: KYCFile, partIndex: number, data?: KYCFileData) => {\n const newPart: KYCFile = {\n ...part,\n data,\n };\n\n const newParts: KYCFile[] = [...parts];\n newParts.splice(partIndex, 1, newPart);\n\n const newDocument: KYCDocument = {\n type,\n parts: newParts,\n };\n\n onDocumentChange(newDocument);\n };\n\n const onFileChange = async (partIndex: number, file: File) => {\n if (!file) {\n setLocalErrorByPartIndex(partIndex);\n return;\n }\n\n const part = parts[partIndex] ?? parts[0];\n\n if (!part) {\n return;\n }\n\n const data: string = await getFileBase64(file);\n\n updateDocumentPart(part, partIndex, data);\n\n const newFileNames = new Map<string, string>(fileNames);\n newFileNames.set(data, file.name);\n setFileNames(newFileNames);\n\n deleteLocalErrorByPartIndex(partIndex);\n };\n\n const onFileRemove = (partIndex: number) => {\n const part = parts[partIndex];\n\n if (!part) {\n return;\n }\n\n updateDocumentPart(part, partIndex);\n\n const removedPart = parts[partIndex];\n const newFileNames = new Map<string, string>(fileNames);\n\n if (removedPart?.data && isFileUniqueInDocument(removedPart, parts)) {\n newFileNames.delete(removedPart?.data);\n }\n\n setFileNames(newFileNames);\n\n deleteLocalErrorByPartIndex(partIndex);\n };\n\n const getFileName = (key: string | undefined): string | undefined => {\n if (!key) {\n return undefined;\n }\n\n return fileNames.get(key);\n };\n\n const onFeedbackChange = (partIndex: number, data: string) => {\n const part = parts[partIndex] ?? parts[0];\n\n if (!part) {\n return;\n }\n\n updateDocumentPart(part, partIndex, data);\n };\n\n return (\n <StyledKYCFormItem id={elementId}>\n <StyledKYCFormItemTitle>{`${index + 1}. ${documentLabels?.title}`}</StyledKYCFormItemTitle>\n\n {documentLabels?.description && (\n <StyledKYCFormItemDescription>{documentLabels?.description}</StyledKYCFormItemDescription>\n )}\n\n {parts.map((part, partIndex) => {\n let itemKey = `kyc-form_item_file_${part.type}`;\n\n const isExtraPartAvailable: boolean = isDocumentExtraPartAvailable(type);\n const partLabels: PartLabels | undefined = documentLabelsParts?.[part.type];\n const partTitle = isExtraPartAvailable ? undefined : partLabels?.title;\n\n if (isDocumentExtraPartAvailable(type) && part.data) {\n itemKey = `${itemKey}_${part.data?.substr(-32)}`;\n\n if (!isFileUniqueInDocument(part, parts)) {\n itemKey = `${itemKey}_${partIndex}`;\n }\n }\n\n const partError = errors?.[getErrorKey(index, partIndex)];\n const localPartError = localErrors.get(getErrorKey(index, partIndex));\n\n if (part.type === PartType.Feedback) {\n return (\n <KYCDocumentParts.KYCFormItemText\n key={itemKey}\n value={part.data}\n onFeedbackChange={(value) => onFeedbackChange(partIndex, value)}\n />\n );\n }\n\n return (\n <KYCDocumentParts.KYCFormItemFile\n title={partTitle}\n data={part.data}\n type={part.type}\n name={getFileName(part.data)}\n uploaderLabels={uploaderLabels}\n error={localPartError || partError}\n key={itemKey}\n elementId={`${elementId}_part_${part.type}_${partIndex}`}\n onFileChange={(file) => onFileChange(partIndex, file)}\n onFileRemove={() => onFileRemove(partIndex)}\n />\n );\n })}\n\n {isAddExtraPartAvailable && firstPart && (\n <KYCDocumentParts.KYCFormItemFileExtraPart\n elementId={`${elementId}_extra`}\n title={extraPartTitle}\n uploaderLabels={uploaderLabels}\n onFileAdd={(file) => onFileChange(parts.length, file)}\n />\n )}\n </StyledKYCFormItem>\n );\n};\n\nexport default KYCFormItem;\n","import styled from 'styled-components';\nimport {spacing, gray50} from '@propellerads/stylevariables';\n\nconst StyledKYCSucessScreen = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nconst StyledKYCSucessScreenItem = styled.span`\n margin-bottom: ${spacing * 8}px;\n`;\n\nconst StyledKYCSucessScreenSuppport = styled.span`\n color: ${gray50};\n`;\n\nconst StyledKYCFailScreen = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nconst StyledKYCFailScreenItem = styled.span`\n margin-bottom: ${spacing * 6}px;\n`;\n\nexport {\n StyledKYCSucessScreen,\n StyledKYCSucessScreenItem,\n StyledKYCSucessScreenSuppport,\n StyledKYCFailScreen,\n StyledKYCFailScreenItem,\n};\n","import SuccessLabel from '@propellerads/success-label';\nimport {\n ACCEPT_FORMATS,\n AVAILABLE_EXTRA_PARTS_DOCUMENTS,\n MAX_EXTRA_PARTS_COUNT,\n MAX_FILE_SIZE,\n PDF_MIME_TYPE,\n} from '../constants';\nimport KYCErrorLabel from '../KYCErrorLabel';\nimport {\n StyledKYCFailScreen,\n StyledKYCFailScreenItem,\n StyledKYCSucessScreen,\n StyledKYCSucessScreenItem,\n StyledKYCSucessScreenSuppport,\n} from './style';\nimport {KYCFailScreenProps, KYCSuccessScreenProps} from './types';\n\nconst KYCSuccessScreen = (props: KYCSuccessScreenProps) => {\n const {elementId, title, description, support} = props;\n\n return (\n <StyledKYCSucessScreen id={elementId}>\n <StyledKYCSucessScreenItem>\n <SuccessLabel show elementId={`${elementId}_success`}>\n {title}\n </SuccessLabel>\n </StyledKYCSucessScreenItem>\n\n {description && <StyledKYCSucessScreenItem>{description}</StyledKYCSucessScreenItem>}\n\n {support && <StyledKYCSucessScreenSuppport>{support}</StyledKYCSucessScreenSuppport>}\n </StyledKYCSucessScreen>\n );\n};\n\nconst KYCFailScreen = (props: KYCFailScreenProps) => {\n const {elementId, title, support} = props;\n\n return (\n <StyledKYCFailScreen id={elementId}>\n <StyledKYCFailScreenItem>\n <KYCErrorLabel label={title} isDocumentPartError={false} />\n </StyledKYCFailScreenItem>\n\n {support}\n </StyledKYCFailScreen>\n );\n};\n\nexport default {\n KYCSuccessScreen,\n KYCFailScreen,\n};\n\nexport {ACCEPT_FORMATS, AVAILABLE_EXTRA_PARTS_DOCUMENTS, MAX_EXTRA_PARTS_COUNT, MAX_FILE_SIZE, PDF_MIME_TYPE};\n","import styled from 'styled-components';\nimport {fontNormal, spacing} from '@propellerads/stylevariables';\n\nconst StyledKYCForm = styled.div`\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n`;\n\nconst StyledKYCFormTitle = styled.div`\n font-size: ${fontNormal}px;\n`;\n\nconst StyledKYCFormDocuments = styled.div`\n width: 100%;\n margin-bottom: ${spacing * 6}px;\n`;\n\nconst StyledKYCFormButton = styled.div`\n display: flex;\n justify-content: flex-end;\n width: 100%;\n`;\n\nexport {StyledKYCForm, StyledKYCFormTitle, StyledKYCFormDocuments, StyledKYCFormButton};\n","import Button, {ButtonType} from '@propellerads/button';\nimport {useEffect, useState} from 'react';\nimport {\n ACCEPT_FORMATS,\n AVAILABLE_EXTRA_PARTS_DOCUMENTS,\n MAX_EXTRA_PARTS_COUNT,\n MAX_FILE_SIZE,\n OPTIONAL_DOCUMENT_PARTS,\n PDF_MIME_TYPE,\n} from './constants';\nimport {DocumentType, KYCDocument, PartType} from './document.types';\nimport KYCFormItem from './KYCFormItem';\nimport KYCStatusScreen from './KYCStatusScreen';\nimport {StyledKYCForm, StyledKYCFormButton, StyledKYCFormDocuments, StyledKYCFormTitle} from './style';\nimport {KYCFormProps} from './types';\n\nconst KYCForm = (props: KYCFormProps) => {\n const {\n elementId,\n title,\n uploadButtonLabel,\n uploaderLabels,\n documentsLabels,\n documents,\n errors,\n isLoading,\n validator,\n onUploadClick,\n } = props;\n\n const [userDocuments, setUserDocuments] = useState<KYCDocument[]>(documents);\n const [isButtonDisabled, setButtonDisabled] = useState<boolean>(true);\n\n useEffect(() => {\n setUserDocuments(documents);\n }, [documents]);\n\n useEffect(() => {\n const isValid: boolean = validator(userDocuments);\n setButtonDisabled(!isValid);\n }, [userDocuments, validator]);\n\n const onDocumentChange = (index: number, document: KYCDocument) => {\n const newDocuments: KYCDocument[] = [...userDocuments];\n newDocuments.splice(index, 1, document);\n\n setUserDocuments(newDocuments);\n };\n\n return (\n <StyledKYCForm id={elementId}>\n {title && <StyledKYCFormTitle>{title}</StyledKYCFormTitle>}\n\n <StyledKYCFormDocuments>\n {userDocuments.map((document, index) => {\n const key = `kyc-form_item_${document.type}_${index}`;\n\n return (\n <KYCFormItem\n index={index}\n type={document.type}\n parts={document.parts}\n documentLabels={documentsLabels[document.type]}\n uploaderLabels={uploaderLabels}\n errors={errors}\n elementId={`${elementId}_item_${document.type}`}\n key={key}\n onDocumentChange={(doc) => onDocumentChange(index, doc)}\n />\n );\n })}\n </StyledKYCFormDocuments>\n <StyledKYCFormButton>\n <Button\n elementId={`${elementId}_button`}\n type={ButtonType.Primary}\n isDisabled={isButtonDisabled}\n isLoading={isLoading || false}\n onClick={() => onUploadClick(userDocuments)}\n >\n {uploadButtonLabel}\n </Button>\n </StyledKYCFormButton>\n </StyledKYCForm>\n );\n};\n\nKYCForm.SuccessScreen = KYCStatusScreen.KYCSuccessScreen;\nKYCForm.FailScreen = KYCStatusScreen.KYCFailScreen;\n\nexport default KYCForm;\n\nexport {\n ACCEPT_FORMATS,\n AVAILABLE_EXTRA_PARTS_DOCUMENTS,\n DocumentType,\n MAX_EXTRA_PARTS_COUNT,\n MAX_FILE_SIZE,\n OPTIONAL_DOCUMENT_PARTS,\n PartType,\n PDF_MIME_TYPE,\n};\n"],"names":["DocumentType","PartType","MAX_FILE_SIZE","MAX_EXTRA_PARTS_COUNT","PDF_MIME_TYPE","HEIC_MIME_TYPE","ACCEPT_FORMATS","AVAILABLE_EXTRA_PARTS_DOCUMENTS","OPTIONAL_DOCUMENT_PARTS","StyledKYCErrorLabel","styled","errorColor","spacing","StyledKYCErrorLabelIcon","fontSmall","white","StyledKYCErrorLabelText","KYCErrorLabel","props","jsxs","jsx","Close","Color","Size","isDocumentExtraPartAvailable","documentType","canAddExtraPart","parts","part","getMimeType","partData","isPDF","isHEIC","isFileUniqueInDocument","file","getFileBase64","reader","resolve","reject","error","StyledKYCFormItem","StyledKYCFormItemFileTitle","StyledKYCFormItemFilePreview","gray95","borderRadius","StyledKYCFormItemFilePreviewName","StyledKYCFormItemFilePreviewRemove","StyledKYCFormItemFileUploaderContainer","StyledKYCFormItemFileExtraPart","StyledKYCDocumentPartImgMiniature","StyledKYCDocumentPartIconMiniature","KYCDocumentPartMiniature","data","isPDFPart","isHEICPart","Pdf","Insert","KYCFormItemFileExtraPart","elementId","title","uploaderLabels","onFileAdd","handleDrop","files","ImageUploader","Direction","KYCFormItemFile","name","onFileChange","onFileRemove","Delete","KYCFormItemText","onFeedbackChange","value","handleChange","newValue","TextArea","KYCDocumentParts","StyledKYCFormItemTitle","fontNormal","black","StyledKYCFormItemDescription","gray50","getErrorKey","documentIndex","partIndex","KYCFormItem","type","index","documentLabels","errors","onDocumentChange","localErrors","setLocalErrors","useState","isAddExtraPartAvailable","documentLabelsParts","firstPart","extraPartTitle","fileNames","setFileNames","setLocalErrorByPartIndex","newLocalErrors","deleteLocalErrorByPartIndex","updateDocumentPart","newPart","newParts","newFileNames","removedPart","getFileName","key","itemKey","isExtraPartAvailable","partLabels","partTitle","partError","localPartError","StyledKYCSucessScreen","StyledKYCSucessScreenItem","StyledKYCSucessScreenSuppport","StyledKYCFailScreen","StyledKYCFailScreenItem","KYCSuccessScreen","description","support","SuccessLabel","KYCFailScreen","KYCStatusScreen","StyledKYCForm","StyledKYCFormTitle","StyledKYCFormDocuments","StyledKYCFormButton","KYCForm","uploadButtonLabel","documentsLabels","documents","isLoading","validator","onUploadClick","userDocuments","setUserDocuments","isButtonDisabled","setButtonDisabled","useEffect","isValid","document","newDocuments","doc","Button","ButtonType"],"mappings":";;;;;;;;;AAAO,MAAMA,IAAe;AAAA,EAC1B,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,MAAM;AAAA,EACN,qBAA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,EAAA,CACH;AAAA,sBACCqB,IAAA,EACC,UAAA,gBAAA/G;AAAA,MAACgI;AAAA,MAAA;AAAA,QACC,WAAW,GAAG1F,CAAS;AAAA,QACvB,MAAM2F,GAAW;AAAA,QACjB,YAAYR;AAAA,QACZ,WAAWL,KAAa;AAAA,QACxB,SAAS,MAAME,EAAcC,CAAa;AAAA,QAEzC,UAAAN;AAAA,MAAA;AAAA,IAAA,EACH,CACF;AAAA,EAAA,GACF;AAEJ;AAEAD,GAAQ,gBAAgBL,GAAgB;AACxCK,GAAQ,aAAaL,GAAgB;"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/document.types.ts","../src/constants.ts","../src/KYCErrorLabel/style.tsx","../src/KYCErrorLabel/index.tsx","../src/utils.ts","../src/KYCDocumentParts/style.tsx","../src/KYCDocumentParts/index.tsx","../src/KYCFormItem/style.tsx","../src/KYCFormItem/index.tsx","../src/KYCStatusScreen/style.tsx","../src/KYCStatusScreen/index.tsx","../src/style.tsx","../src/index.tsx"],"sourcesContent":["export const DocumentType = {\n Id: 'id',\n Ub: 'ub',\n IdExtra: 'id_extra',\n Card: 'bank_card',\n PaymentSystemScreen: 'payment_system_screen',\n OnlineBankingStatement: 'online_banking_statement',\n CompanyRegistrationDocument: 'company_registration_document',\n SelfieWithIdCard: 'selfie_with_id_card_or_bank_card',\n PaypalDetailsPage: 'pay_pal_details_page',\n BankWireDetails: 'bank_wire_details',\n TransactionConfirmation: 'transaction_confirmation',\n Other: 'other',\n Feedback: 'feedback',\n} as const;\nexport type DocumentType = (typeof DocumentType)[keyof typeof DocumentType];\n\nexport const PartType = {\n IdFront: 'id_front',\n IdBack: 'id_back',\n Ub: 'ub_item',\n Card: 'card_item',\n PaymentSystemScreen: 'screen_item',\n OnlineBankingStatement: 'obs_item',\n CompanyRegistrationDocument: 'crd_item',\n SelfieWithIdCard: 'selfie_item',\n PaypalDetailsPageImage: 'pay_pal_details_page_image',\n BankWireDetailsPage: 'bank_wire_details_image',\n TransactionConfirmationImage: 'transaction_confirmation_image',\n OtherImage: 'other_image',\n Feedback: 'feedback',\n} as const;\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport type KYCFileData = string | undefined;\n\nexport type KYCFile = {\n type: PartType;\n data?: KYCFileData;\n};\n\nexport type KYCDocument = {\n type: DocumentType;\n parts: KYCFile[];\n};\n","import type {ImageUploaderProps} from '@propellerads/image-uploader';\nimport {DocumentType, PartType} from './document.types';\n\nexport const MAX_FILE_SIZE = 5242880;\n\nexport const MAX_EXTRA_PARTS_COUNT = 3;\n\nexport const PDF_MIME_TYPE = 'application/pdf';\nexport const HEIC_MIME_TYPE = 'image/heic';\nexport const ACCEPT_FORMATS: ImageUploaderProps['acceptFormats'] = {\n 'image/png': ['.png'],\n 'image/jpeg': ['.jpg', '.jpe', '.jpeg'],\n [PDF_MIME_TYPE]: ['.pdf'],\n [HEIC_MIME_TYPE]: ['.heic'],\n};\n\nexport const AVAILABLE_EXTRA_PARTS_DOCUMENTS: DocumentType[] = [\n DocumentType.Card,\n DocumentType.Card,\n DocumentType.PaypalDetailsPage,\n DocumentType.BankWireDetails,\n DocumentType.TransactionConfirmation,\n DocumentType.SelfieWithIdCard,\n DocumentType.PaymentSystemScreen,\n DocumentType.Other,\n];\n\nexport const OPTIONAL_DOCUMENT_PARTS = {\n [DocumentType.Id]: {\n parts: [PartType.IdBack],\n },\n [DocumentType.IdExtra]: {\n parts: [PartType.IdBack],\n },\n};\n","import styled from 'styled-components';\nimport {fontSmall, spacing, white, errorColor} from '@propellerads/stylevariables';\n\nconst StyledKYCErrorLabel = styled.div`\n display: flex;\n align-items: center;\n color: ${errorColor};\n margin-top: ${spacing * 2}px;\n margin-bottom: ${spacing * 4}px;\n`;\n\nconst StyledKYCErrorLabelIcon = styled.span`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n border-radius: 100%;\n background-color: ${errorColor};\n\n &:before {\n font-size: ${fontSmall};\n color: ${white};\n content: '!';\n }\n`;\n\nconst StyledKYCErrorLabelText = styled.span`\n margin-left: ${spacing * 2}px;\n`;\n\nexport {StyledKYCErrorLabel, StyledKYCErrorLabelIcon, StyledKYCErrorLabelText};\n","import {Close, Color, Size} from '@propellerads/icon';\nimport {StyledKYCErrorLabel, StyledKYCErrorLabelIcon, StyledKYCErrorLabelText} from './style';\nimport {KYCErrorLabelProps} from './types';\n\nconst KYCErrorLabel = (props: KYCErrorLabelProps) => (\n <StyledKYCErrorLabel>\n {props.isDocumentPartError ? (\n <StyledKYCErrorLabelIcon />\n ) : (\n <Close color={Color.Error} hoverColor={Color.Error} size={Size.Small} />\n )}\n <StyledKYCErrorLabelText>{props.label}</StyledKYCErrorLabelText>\n </StyledKYCErrorLabel>\n);\n\nexport default KYCErrorLabel;\n","import {AVAILABLE_EXTRA_PARTS_DOCUMENTS, HEIC_MIME_TYPE, MAX_EXTRA_PARTS_COUNT, PDF_MIME_TYPE} from './constants';\nimport {DocumentType, KYCFile, KYCFileData} from './document.types';\n\nconst isDocumentExtraPartAvailable = (documentType: DocumentType): boolean =>\n AVAILABLE_EXTRA_PARTS_DOCUMENTS.includes(documentType);\n\nconst canAddExtraPart = (documentType: DocumentType, parts: KYCFile[]): boolean =>\n isDocumentExtraPartAvailable(documentType) &&\n parts.every((part: KYCFile) => Boolean(part.data)) &&\n parts.length < MAX_EXTRA_PARTS_COUNT &&\n parts.length > 0;\n\nconst canRemoveExtraPart = (documentType: DocumentType, parts: KYCFile[]): boolean =>\n AVAILABLE_EXTRA_PARTS_DOCUMENTS.includes(documentType) && parts.length > 1;\n\nconst getMimeType = (partData: KYCFileData): string | undefined => partData?.match(/[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/)?.[0];\n\nconst isPDF = (partData: KYCFileData): boolean => {\n const mimeType: string | undefined = getMimeType(partData);\n return mimeType === PDF_MIME_TYPE;\n};\n\nconst isHEIC = (partData: KYCFileData): boolean => {\n const mimeType: string | undefined = getMimeType(partData);\n return mimeType === HEIC_MIME_TYPE;\n};\n\nconst isFileUniqueInDocument = (file: KYCFile, parts: KYCFile[]): boolean =>\n parts.every((part: KYCFile) => part.data !== file?.data);\n\nconst getFileBase64 = async (file: File): Promise<string> => {\n const reader: FileReader = new FileReader();\n\n return new Promise<string>((resolve, reject) => {\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = (error) => reject(error);\n\n reader.readAsDataURL(file);\n });\n};\n\nexport {\n canAddExtraPart,\n canRemoveExtraPart,\n getFileBase64,\n isDocumentExtraPartAvailable,\n isFileUniqueInDocument,\n isHEIC,\n isPDF,\n};\n","import styled from 'styled-components';\nimport {borderRadius, spacing, gray95, white} from '@propellerads/stylevariables';\n\nconst StyledKYCFormItem = styled.div`\n margin-top: ${spacing * 4}px;\n margin-left: ${spacing * 4}px;\n`;\n\nconst StyledKYCFormItemFileTitle = styled.div`\n margin-bottom: ${spacing}px;\n`;\n\nconst StyledKYCFormItemFilePreview = styled.div`\n display: flex;\n align-items: center;\n background-color: ${gray95};\n padding: ${spacing * 2}px;\n border-radius: ${borderRadius}px;\n`;\n\nconst StyledKYCFormItemFilePreviewName = styled.span`\n width: 100%;\n margin-left: ${spacing * 4}px;\n margin-right: ${spacing * 2}px;\n`;\n\nconst StyledKYCFormItemFilePreviewRemove = styled.span`\n cursor: pointer !important;\n margin-right: ${spacing * 2}px;\n`;\n\nconst StyledKYCFormItemFileUploaderContainer = styled.div`\n height: 66px;\n`;\n\nconst StyledKYCFormItemFileExtraPart = styled.div`\n display: flex;\n flex-direction: column;\n margin-top: ${spacing * 4}px;\n margin-left: ${spacing * 4}px;\n`;\n\nconst StyledKYCDocumentPartImgMiniature = styled.img`\n width: auto;\n max-width: 204px;\n height: 50px;\n object-fit: contain;\n border-radius: ${borderRadius}px;\n`;\n\nconst StyledKYCDocumentPartIconMiniature = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 50px;\n height: 50px;\n border-radius: ${borderRadius}px;\n background-color: ${white};\n`;\n\nexport {\n StyledKYCFormItem,\n StyledKYCFormItemFilePreview,\n StyledKYCFormItemFilePreviewName,\n StyledKYCFormItemFilePreviewRemove,\n StyledKYCFormItemFileTitle,\n StyledKYCFormItemFileUploaderContainer,\n StyledKYCFormItemFileExtraPart,\n StyledKYCDocumentPartImgMiniature,\n StyledKYCDocumentPartIconMiniature,\n};\n","import {Color, Delete, Insert, Pdf} from '@propellerads/icon';\nimport ImageUploader, {Direction} from '@propellerads/image-uploader';\nimport TextArea from '@propellerads/textarea';\nimport {ACCEPT_FORMATS, MAX_FILE_SIZE} from '../constants';\nimport KYCErrorLabel from '../KYCErrorLabel';\nimport {isHEIC, isPDF} from '../utils';\nimport {\n StyledKYCDocumentPartIconMiniature,\n StyledKYCDocumentPartImgMiniature,\n StyledKYCFormItem,\n StyledKYCFormItemFileExtraPart,\n StyledKYCFormItemFilePreview,\n StyledKYCFormItemFilePreviewName,\n StyledKYCFormItemFilePreviewRemove,\n StyledKYCFormItemFileTitle,\n StyledKYCFormItemFileUploaderContainer,\n} from './style';\nimport {\n KYCDocumentPartMiniatureProps,\n KYCFormItemFileExtraPartProps,\n KYCFormItemFileProps,\n KYCFormItemTextProps,\n} from './types';\n\nconst KYCDocumentPartMiniature = (props: KYCDocumentPartMiniatureProps) => {\n const {data} = props;\n const isPDFPart: boolean = isPDF(data);\n const isHEICPart: boolean = isHEIC(data);\n\n if (isPDFPart || isHEICPart) {\n return (\n <StyledKYCDocumentPartIconMiniature>\n {isPDFPart && <Pdf color={Color.Gray} hoverColor={Color.Gray} />}\n {isHEICPart && <Insert color={Color.Gray} hoverColor={Color.Gray} />}\n </StyledKYCDocumentPartIconMiniature>\n );\n }\n\n return <StyledKYCDocumentPartImgMiniature src={data} />;\n};\n\nconst KYCFormItemFileExtraPart = (props: KYCFormItemFileExtraPartProps) => {\n const {elementId, title, uploaderLabels, onFileAdd} = props;\n const handleDrop = (files: File[]) => {\n const [file] = files;\n\n if (file) {\n onFileAdd(file);\n }\n };\n\n return (\n <StyledKYCFormItemFileExtraPart id={elementId}>\n {title && <StyledKYCFormItemFileTitle>{title}</StyledKYCFormItemFileTitle>}\n\n <StyledKYCFormItemFileUploaderContainer>\n <ImageUploader\n title={uploaderLabels.title}\n action={uploaderLabels.action}\n maxSize={MAX_FILE_SIZE}\n acceptFormats={ACCEPT_FORMATS}\n elementId={`${elementId}_uploader`}\n direction={Direction.Row}\n onDrop={handleDrop}\n />\n </StyledKYCFormItemFileUploaderContainer>\n </StyledKYCFormItemFileExtraPart>\n );\n};\n\nconst KYCFormItemFile = (props: KYCFormItemFileProps) => {\n const {name, title, data, error, elementId, uploaderLabels, onFileChange, onFileRemove} = props;\n const handleDrop = (files: File[]) => {\n const [file] = files;\n\n if (file) {\n onFileChange(file);\n }\n };\n\n return (\n <StyledKYCFormItem id={elementId}>\n {title && <StyledKYCFormItemFileTitle>{title}</StyledKYCFormItemFileTitle>}\n\n {data ? (\n <StyledKYCFormItemFilePreview>\n <KYCDocumentPartMiniature data={data} />\n <StyledKYCFormItemFilePreviewName>{name}</StyledKYCFormItemFilePreviewName>\n <StyledKYCFormItemFilePreviewRemove onClick={onFileRemove}>\n <Delete color={Color.Blue} hoverColor={Color.Blue} />\n </StyledKYCFormItemFilePreviewRemove>\n </StyledKYCFormItemFilePreview>\n ) : (\n <StyledKYCFormItemFileUploaderContainer>\n <ImageUploader\n title={uploaderLabels.title}\n action={uploaderLabels.action}\n maxSize={MAX_FILE_SIZE}\n acceptFormats={ACCEPT_FORMATS}\n elementId={`${elementId}_uploader`}\n direction={Direction.Row}\n onDrop={handleDrop}\n />\n </StyledKYCFormItemFileUploaderContainer>\n )}\n\n {error && <KYCErrorLabel label={error} isDocumentPartError />}\n </StyledKYCFormItem>\n );\n};\n\nconst KYCFormItemText = (props: KYCFormItemTextProps) => {\n const {onFeedbackChange, value = ''} = props;\n\n const handleChange = (newValue: string) => onFeedbackChange(newValue);\n\n return (\n <StyledKYCFormItem>\n <TextArea\n onChange={handleChange}\n onBlur={handleChange}\n value={value}\n errors={[]}\n name=\"kyc-client-comments\"\n elementId=\"kyc-feedback-textarea\"\n />\n </StyledKYCFormItem>\n );\n};\n\nexport default {\n KYCFormItemFileExtraPart,\n KYCFormItemFile,\n KYCFormItemText,\n};\n","import styled from 'styled-components';\nimport {fontNormal, fontSmall, spacing, gray50, black} from '@propellerads/stylevariables';\n\nconst StyledKYCFormItem = styled.div`\n margin-top: ${spacing * 6}px;\n`;\n\nconst StyledKYCFormItemTitle = styled.div`\n font-size: ${fontNormal}px;\n font-weight: bold;\n color: ${black};\n margin-bottom: ${spacing}px;\n`;\n\nconst StyledKYCFormItemDescription = styled.div`\n font-size: ${fontSmall}px;\n color: ${gray50};\n margin-left: ${spacing * 4}px;\n`;\n\nexport {StyledKYCFormItem, StyledKYCFormItemTitle, StyledKYCFormItemDescription};\n","import {useState} from 'react';\nimport {KYCDocument, KYCFile, KYCFileData, PartType} from '../document.types';\nimport KYCDocumentParts from '../KYCDocumentParts';\nimport {PartLabels, PartsLabels} from '../labels.types';\nimport {canAddExtraPart, getFileBase64, isDocumentExtraPartAvailable, isFileUniqueInDocument} from '../utils';\nimport {StyledKYCFormItem, StyledKYCFormItemDescription, StyledKYCFormItemTitle} from './style';\nimport {KYCFormItemProps} from './types';\n\nconst getErrorKey = (documentIndex: number, partIndex: number) => `[${documentIndex}].parts[${partIndex}].data`;\n\nconst KYCFormItem = (props: KYCFormItemProps) => {\n const {type, index, uploaderLabels, documentLabels, elementId, parts, errors, onDocumentChange} = props;\n const [localErrors, setLocalErrors] = useState<Map<string, string>>(new Map<string, string>());\n\n const isAddExtraPartAvailable: boolean = canAddExtraPart(type, parts);\n const documentLabelsParts: PartsLabels | undefined = documentLabels?.parts;\n const firstPart = parts[0];\n const extraPartTitle = firstPart ? documentLabelsParts?.[firstPart.type]?.title : undefined;\n\n const [fileNames, setFileNames] = useState<Map<string, string>>(new Map<string, string>());\n\n const setLocalErrorByPartIndex = (partIndex: number) => {\n const newLocalErrors = new Map<string, string>(localErrors);\n newLocalErrors.set(getErrorKey(index, partIndex), uploaderLabels.oversizeError);\n setLocalErrors(newLocalErrors);\n };\n\n const deleteLocalErrorByPartIndex = (partIndex: number) => {\n const newLocalErrors = new Map<string, string>(localErrors);\n newLocalErrors.delete(getErrorKey(index, partIndex));\n setLocalErrors(newLocalErrors);\n };\n\n const updateDocumentPart = (part: KYCFile, partIndex: number, data?: KYCFileData) => {\n const newPart: KYCFile = {\n ...part,\n data,\n };\n\n const newParts: KYCFile[] = [...parts];\n newParts.splice(partIndex, 1, newPart);\n\n const newDocument: KYCDocument = {\n type,\n parts: newParts,\n };\n\n onDocumentChange(newDocument);\n };\n\n const onFileChange = async (partIndex: number, file: File) => {\n if (!file) {\n setLocalErrorByPartIndex(partIndex);\n return;\n }\n\n const part = parts[partIndex] ?? parts[0];\n\n if (!part) {\n return;\n }\n\n const data: string = await getFileBase64(file);\n\n updateDocumentPart(part, partIndex, data);\n\n const newFileNames = new Map<string, string>(fileNames);\n newFileNames.set(data, file.name);\n setFileNames(newFileNames);\n\n deleteLocalErrorByPartIndex(partIndex);\n };\n\n const onFileRemove = (partIndex: number) => {\n const part = parts[partIndex];\n\n if (!part) {\n return;\n }\n\n updateDocumentPart(part, partIndex);\n\n const removedPart = parts[partIndex];\n const newFileNames = new Map<string, string>(fileNames);\n\n if (removedPart?.data && isFileUniqueInDocument(removedPart, parts)) {\n newFileNames.delete(removedPart?.data);\n }\n\n setFileNames(newFileNames);\n\n deleteLocalErrorByPartIndex(partIndex);\n };\n\n const getFileName = (key: string | undefined): string | undefined => {\n if (!key) {\n return undefined;\n }\n\n return fileNames.get(key);\n };\n\n const onFeedbackChange = (partIndex: number, data: string) => {\n const part = parts[partIndex] ?? parts[0];\n\n if (!part) {\n return;\n }\n\n updateDocumentPart(part, partIndex, data);\n };\n\n return (\n <StyledKYCFormItem id={elementId}>\n <StyledKYCFormItemTitle>{`${index + 1}. ${documentLabels?.title}`}</StyledKYCFormItemTitle>\n\n {documentLabels?.description && (\n <StyledKYCFormItemDescription>{documentLabels?.description}</StyledKYCFormItemDescription>\n )}\n\n {parts.map((part, partIndex) => {\n let itemKey = `kyc-form_item_file_${part.type}`;\n\n const isExtraPartAvailable: boolean = isDocumentExtraPartAvailable(type);\n const partLabels: PartLabels | undefined = documentLabelsParts?.[part.type];\n const partTitle = isExtraPartAvailable ? undefined : partLabels?.title;\n\n if (isDocumentExtraPartAvailable(type) && part.data) {\n itemKey = `${itemKey}_${part.data?.substr(-32)}`;\n\n if (!isFileUniqueInDocument(part, parts)) {\n itemKey = `${itemKey}_${partIndex}`;\n }\n }\n\n const partError = errors?.[getErrorKey(index, partIndex)];\n const localPartError = localErrors.get(getErrorKey(index, partIndex));\n\n if (part.type === PartType.Feedback) {\n return (\n <KYCDocumentParts.KYCFormItemText\n key={itemKey}\n value={part.data}\n onFeedbackChange={(value) => onFeedbackChange(partIndex, value)}\n />\n );\n }\n\n return (\n <KYCDocumentParts.KYCFormItemFile\n title={partTitle}\n data={part.data}\n type={part.type}\n name={getFileName(part.data)}\n uploaderLabels={uploaderLabels}\n error={localPartError || partError}\n key={itemKey}\n elementId={`${elementId}_part_${part.type}_${partIndex}`}\n onFileChange={(file) => onFileChange(partIndex, file)}\n onFileRemove={() => onFileRemove(partIndex)}\n />\n );\n })}\n\n {isAddExtraPartAvailable && firstPart && (\n <KYCDocumentParts.KYCFormItemFileExtraPart\n elementId={`${elementId}_extra`}\n title={extraPartTitle}\n uploaderLabels={uploaderLabels}\n onFileAdd={(file) => onFileChange(parts.length, file)}\n />\n )}\n </StyledKYCFormItem>\n );\n};\n\nexport default KYCFormItem;\n","import styled from 'styled-components';\nimport {spacing, gray50} from '@propellerads/stylevariables';\n\nconst StyledKYCSucessScreen = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nconst StyledKYCSucessScreenItem = styled.span`\n margin-bottom: ${spacing * 8}px;\n`;\n\nconst StyledKYCSucessScreenSuppport = styled.span`\n color: ${gray50};\n`;\n\nconst StyledKYCFailScreen = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nconst StyledKYCFailScreenItem = styled.span`\n margin-bottom: ${spacing * 6}px;\n`;\n\nexport {\n StyledKYCSucessScreen,\n StyledKYCSucessScreenItem,\n StyledKYCSucessScreenSuppport,\n StyledKYCFailScreen,\n StyledKYCFailScreenItem,\n};\n","import SuccessLabel from '@propellerads/success-label';\nimport {\n ACCEPT_FORMATS,\n AVAILABLE_EXTRA_PARTS_DOCUMENTS,\n MAX_EXTRA_PARTS_COUNT,\n MAX_FILE_SIZE,\n PDF_MIME_TYPE,\n} from '../constants';\nimport KYCErrorLabel from '../KYCErrorLabel';\nimport {\n StyledKYCFailScreen,\n StyledKYCFailScreenItem,\n StyledKYCSucessScreen,\n StyledKYCSucessScreenItem,\n StyledKYCSucessScreenSuppport,\n} from './style';\nimport {KYCFailScreenProps, KYCSuccessScreenProps} from './types';\n\nconst KYCSuccessScreen = (props: KYCSuccessScreenProps) => {\n const {elementId, title, description, support} = props;\n\n return (\n <StyledKYCSucessScreen id={elementId}>\n <StyledKYCSucessScreenItem>\n <SuccessLabel show elementId={`${elementId}_success`}>\n {title}\n </SuccessLabel>\n </StyledKYCSucessScreenItem>\n\n {description && <StyledKYCSucessScreenItem>{description}</StyledKYCSucessScreenItem>}\n\n {support && <StyledKYCSucessScreenSuppport>{support}</StyledKYCSucessScreenSuppport>}\n </StyledKYCSucessScreen>\n );\n};\n\nconst KYCFailScreen = (props: KYCFailScreenProps) => {\n const {elementId, title, support} = props;\n\n return (\n <StyledKYCFailScreen id={elementId}>\n <StyledKYCFailScreenItem>\n <KYCErrorLabel label={title} isDocumentPartError={false} />\n </StyledKYCFailScreenItem>\n\n {support}\n </StyledKYCFailScreen>\n );\n};\n\nexport default {\n KYCSuccessScreen,\n KYCFailScreen,\n};\n\nexport {ACCEPT_FORMATS, AVAILABLE_EXTRA_PARTS_DOCUMENTS, MAX_EXTRA_PARTS_COUNT, MAX_FILE_SIZE, PDF_MIME_TYPE};\n","import styled from 'styled-components';\nimport {fontNormal, spacing} from '@propellerads/stylevariables';\n\nconst StyledKYCForm = styled.div`\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n`;\n\nconst StyledKYCFormTitle = styled.div`\n font-size: ${fontNormal}px;\n`;\n\nconst StyledKYCFormDocuments = styled.div`\n width: 100%;\n margin-bottom: ${spacing * 6}px;\n`;\n\nconst StyledKYCFormButton = styled.div`\n display: flex;\n justify-content: flex-end;\n width: 100%;\n`;\n\nexport {StyledKYCForm, StyledKYCFormTitle, StyledKYCFormDocuments, StyledKYCFormButton};\n","import Button, {ButtonVariant} from '@propellerads/button';\nimport {useEffect, useState} from 'react';\nimport {\n ACCEPT_FORMATS,\n AVAILABLE_EXTRA_PARTS_DOCUMENTS,\n MAX_EXTRA_PARTS_COUNT,\n MAX_FILE_SIZE,\n OPTIONAL_DOCUMENT_PARTS,\n PDF_MIME_TYPE,\n} from './constants';\nimport {DocumentType, KYCDocument, PartType, KYCFile} from './document.types';\nimport KYCFormItem from './KYCFormItem';\nimport KYCStatusScreen from './KYCStatusScreen';\nimport {StyledKYCForm, StyledKYCFormButton, StyledKYCFormDocuments, StyledKYCFormTitle} from './style';\nimport {KYCFormProps} from './types';\n\nconst KYCForm = (props: KYCFormProps) => {\n const {\n elementId,\n title,\n uploadButtonLabel,\n uploaderLabels,\n documentsLabels,\n documents,\n errors,\n isLoading,\n validator,\n onUploadClick,\n } = props;\n\n const [userDocuments, setUserDocuments] = useState<KYCDocument[]>(documents);\n const [isButtonDisabled, setButtonDisabled] = useState<boolean>(true);\n\n useEffect(() => {\n setUserDocuments(documents);\n }, [documents]);\n\n useEffect(() => {\n const isValid: boolean = validator(userDocuments);\n setButtonDisabled(!isValid);\n }, [userDocuments, validator]);\n\n const onDocumentChange = (index: number, document: KYCDocument) => {\n const newDocuments: KYCDocument[] = [...userDocuments];\n newDocuments.splice(index, 1, document);\n\n setUserDocuments(newDocuments);\n };\n\n return (\n <StyledKYCForm id={elementId}>\n {title && <StyledKYCFormTitle>{title}</StyledKYCFormTitle>}\n\n <StyledKYCFormDocuments>\n {userDocuments.map((document, index) => {\n const key = `kyc-form_item_${document.type}_${index}`;\n\n return (\n <KYCFormItem\n index={index}\n type={document.type}\n parts={document.parts}\n documentLabels={documentsLabels[document.type]}\n uploaderLabels={uploaderLabels}\n errors={errors}\n elementId={`${elementId}_item_${document.type}`}\n key={key}\n onDocumentChange={(doc) => onDocumentChange(index, doc)}\n />\n );\n })}\n </StyledKYCFormDocuments>\n <StyledKYCFormButton>\n <Button\n id={`${elementId}_button`}\n variant={ButtonVariant.Primary}\n isDisabled={isButtonDisabled}\n isLoading={isLoading || false}\n onClick={() => onUploadClick(userDocuments)}\n >\n {uploadButtonLabel}\n </Button>\n </StyledKYCFormButton>\n </StyledKYCForm>\n );\n};\n\nKYCForm.SuccessScreen = KYCStatusScreen.KYCSuccessScreen;\nKYCForm.FailScreen = KYCStatusScreen.KYCFailScreen;\n\nexport default KYCForm;\n\nexport {\n ACCEPT_FORMATS,\n AVAILABLE_EXTRA_PARTS_DOCUMENTS,\n DocumentType,\n MAX_EXTRA_PARTS_COUNT,\n MAX_FILE_SIZE,\n OPTIONAL_DOCUMENT_PARTS,\n PartType,\n PDF_MIME_TYPE,\n};\nexport type {KYCDocument, KYCFile};\n"],"mappings":";;;;;;;;;;AAAA,IAAa,IAAe;CAC1B,IAAI;CACJ,IAAI;CACJ,SAAS;CACT,MAAM;CACN,qBAAqB;CACrB,wBAAwB;CACxB,6BAA6B;CAC7B,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CACjB,yBAAyB;CACzB,OAAO;CACP,UAAU;CACX,EAGY,IAAW;CACtB,SAAS;CACT,QAAQ;CACR,IAAI;CACJ,MAAM;CACN,qBAAqB;CACrB,wBAAwB;CACxB,6BAA6B;CAC7B,kBAAkB;CAClB,wBAAwB;CACxB,qBAAqB;CACrB,8BAA8B;CAC9B,YAAY;CACZ,UAAU;CACX,EC5BY,IAAgB,SAEhB,KAAwB,GAExB,IAAgB,mB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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@propellerads/kyc-form",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"url": "https://github.com/propellerads/ui-components/issues"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "tsc && vite build && rollup -c rollup.dts.config.mjs"
|
|
22
|
+
"build": "tsc && vite build && bunx rollup -c rollup.dts.config.mjs"
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://github.com/propellerads/ui-components#readme",
|
|
25
25
|
"private": false,
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@propellerads/button": "^
|
|
28
|
-
"@propellerads/icon": "^
|
|
27
|
+
"@propellerads/button": "^10.0.0",
|
|
28
|
+
"@propellerads/icon": "^8.0.0",
|
|
29
29
|
"@propellerads/image-uploader": "^4.0.0",
|
|
30
30
|
"@propellerads/stylevariables": "^2.0.2",
|
|
31
|
-
"@propellerads/success-label": "4.0.
|
|
32
|
-
"@propellerads/textarea": "^5.0.
|
|
31
|
+
"@propellerads/success-label": "^4.0.1",
|
|
32
|
+
"@propellerads/textarea": "^5.0.3"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/react": "^19.2.14",
|
|
40
|
-
"@vitejs/plugin-react": "^
|
|
41
|
-
"rollup": "^4.
|
|
42
|
-
"rollup-plugin-dts": "^6.
|
|
43
|
-
"typescript": "^
|
|
44
|
-
"vite": "^
|
|
40
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
41
|
+
"rollup": "^4.60.3",
|
|
42
|
+
"rollup-plugin-dts": "^6.4.1",
|
|
43
|
+
"typescript": "^6.0.3",
|
|
44
|
+
"vite": "^8.0.10"
|
|
45
45
|
}
|
|
46
46
|
}
|