@techlabi/kycrazy-ui-kit 0.38.0 → 0.40.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,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.40.0
4
+
5
+ ### Fixes
6
+
7
+ - fix infinite loading in KYC
8
+
9
+ ## 0.39.0
10
+
11
+ ### Fixes
12
+
13
+ - fix issues with Passport in KYC and KYB
14
+
3
15
  ## 0.38.0
4
16
 
5
17
  ### Features
package/README.md CHANGED
@@ -45,12 +45,9 @@ function App() {
45
45
  apiKey="ak_test_0987654321zyxwvutsrqponmlkjihgfedcba"
46
46
  apiEndpoint="http://localhost:8080"
47
47
  isKYB={true}
48
- onComplete={(token: string, data: KYCRequestData | KYBRequestData) => {
49
-
50
- }}
51
- onDoneClick={() => {
52
-
53
- }}
48
+ onComplete={(token: string, data: KYCRequestData | KYBRequestData) => {}}
49
+ onDoneClick={() => {}}
50
+ userEmail={user.email}
54
51
  />
55
52
  </div>
56
53
  );
package/dist/index.es.js CHANGED
@@ -29553,23 +29553,29 @@ const xD = {
29553
29553
  "id-back",
29554
29554
  "verify"
29555
29555
  ], [g]), w = () => g.hide_name_step ? g.hide_document_selection_step ? "id-front" : "document-selection" : "name", _ = async () => {
29556
- if ((g.hide_name_step || !!s) && d && h && v) {
29557
- const N = {
29556
+ if ((g.hide_name_step || !!s) && d && h && (!(c !== "passport") || v)) {
29557
+ const O = {
29558
29558
  full_name: s,
29559
29559
  email: o,
29560
29560
  selfie_photo: d,
29561
29561
  id_photo: h,
29562
29562
  id_photo_back: v
29563
- }, O = await y.mutateAsync({
29564
- apiEndpoint: n,
29565
- apiKey: t,
29566
- data: N
29567
- });
29568
- e(O.data.token, N), x({
29569
- title: "KYC Complete",
29570
- description: "Identity verification completed successfully"
29571
- }), u(""), f(null), m(null), p(null), i("done");
29572
- }
29563
+ };
29564
+ try {
29565
+ const I = await y.mutateAsync({ apiEndpoint: n, apiKey: t, data: O });
29566
+ e(I.data.token, O), x({
29567
+ title: "KYC Complete",
29568
+ description: "Identity verification completed successfully."
29569
+ }), u(""), f(null), m(null), p(null), i("done");
29570
+ } catch {
29571
+ x({
29572
+ title: "Submission failed",
29573
+ description: "There was an error submitting your verification. Please try again.",
29574
+ variant: "destructive"
29575
+ });
29576
+ }
29577
+ } else
29578
+ console.warn("Missing data for KYC", { fullName: s, selfiePhoto: d, idCardFront: h, idCardBack: v, selectedDocumentType: c });
29573
29579
  }, E = () => /* @__PURE__ */ C(Gt, { children: a !== "landing" && /* @__PURE__ */ C("div", { className: "flex justify-center", children: /* @__PURE__ */ C("div", { className: "flex space-x-2", children: b.map((S, N) => /* @__PURE__ */ C(
29574
29580
  "div",
29575
29581
  {
@@ -29690,7 +29696,7 @@ async function CD({
29690
29696
  data: e
29691
29697
  }) {
29692
29698
  const r = new FormData();
29693
- r.append("full_name", e.full_name), r.append("email", e.email), r.append("selfie_photo", e.selfie_photo, e.selfie_photo.name), r.append("id_photo", e.id_photo, e.id_photo.name), r.append("id_photo_back", e.id_photo_back, e.id_photo_back.name);
29699
+ r.append("full_name", e.full_name), r.append("email", e.email), e.selfie_photo && r.append("selfie_photo", e.selfie_photo, e.selfie_photo.name), e.id_photo && r.append("id_photo", e.id_photo, e.id_photo.name), e.id_photo_back && r.append("id_photo_back", e.id_photo_back, e.id_photo_back.name);
29694
29700
  const o = await fetch(`${n}/api/kyc`, {
29695
29701
  method: "POST",
29696
29702
  headers: {