@opexa/portal-components 0.0.38 → 0.0.40
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/dist/components/AccountVerification/AccountVerification.js +5 -32
- package/dist/components/AccountVerification/AccountVerificationContext.d.ts +14 -0
- package/dist/components/AccountVerification/AccountVerificationContext.js +27 -0
- package/dist/components/AccountVerification/VerificationCapture.d.ts +1 -1
- package/dist/components/AccountVerification/VerificationCapture.js +16 -45
- package/dist/components/AccountVerification/VerificationComplete.d.ts +1 -0
- package/dist/components/AccountVerification/VerificationComplete.js +9 -0
- package/dist/components/AccountVerification/VerificationDetails.d.ts +1 -0
- package/dist/components/AccountVerification/VerificationDetails.js +38 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +196 -196
- package/dist/ui/Combobox/combobox.recipe.d.ts +14 -14
- package/dist/ui/DatePicker/DatePicker.d.ts +192 -192
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +8 -8
- package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +55 -55
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +6 -6
|
@@ -1,37 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { useMemberVerificationQuery, useProfileCompletionQuery, } from '../../client/hooks/index.js';
|
|
6
|
-
import { AlertCircleIcon, CheckVerified02Icon, CreditCard02Icon, FaceIdIcon, FileCheck02Icon, FileSearch02Icon, FileX02Icon, Globe05Icon, } from '../../icons/index.js';
|
|
7
|
-
import { Button } from '../../ui/index.js';
|
|
3
|
+
import { AccountVerificationContext, useAccountVerification, } from './AccountVerificationContext.js';
|
|
8
4
|
import { VerificationCapture } from './VerificationCapture.js';
|
|
5
|
+
import { VerificationComplete } from './VerificationComplete.js';
|
|
6
|
+
import { VerificationDetails } from './VerificationDetails.js';
|
|
9
7
|
export function AccountVerification(props) {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const verificationQuery = useMemberVerificationQuery();
|
|
13
|
-
const verification = verificationQuery.data;
|
|
14
|
-
const empty = verification == null;
|
|
15
|
-
const pending = verification?.status === 'PENDING';
|
|
16
|
-
const success = verification?.status === 'VERIFIED' || verification?.status === 'APPROVED';
|
|
17
|
-
const failed = verification?.status === 'REJECTED' ||
|
|
18
|
-
verification?.status === 'UNVERIFIED';
|
|
19
|
-
if (1) {
|
|
20
|
-
return (_jsx("div", { className: props.className, children: _jsx(VerificationCapture, {}) }));
|
|
21
|
-
}
|
|
22
|
-
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verify your identity" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Complete personal verification to unlock all features and enhance account security." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountVerification
|
|
23
|
-
? 'text-text-success-primary'
|
|
24
|
-
: 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs border-border-secondary bg-bg-primary-alt mt-5 rounded-xl border", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(Globe05Icon, {}), "Proof of address"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), _jsx("div", { className: "border-border-secondary border-t px-4 py-3", children: _jsx(Button, { size: "sm", children: "Verify Now" }) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
|
|
25
|
-
}
|
|
26
|
-
function VerificationNotSubmitted() {
|
|
27
|
-
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(AlertCircleIcon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("p", { className: "text-text-tertiary-600 mt-2 text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
|
|
28
|
-
}
|
|
29
|
-
function VerificationInProgress() {
|
|
30
|
-
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileSearch02Icon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Under review" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
|
|
31
|
-
}
|
|
32
|
-
function VerificationSuccess() {
|
|
33
|
-
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-success-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-success-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileCheck02Icon, { className: "text-text-success-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Verification successful" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "Your account has been successfully verified. You now have full access to all features and improved account security." })] }));
|
|
34
|
-
}
|
|
35
|
-
function VerificationFailed() {
|
|
36
|
-
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-error-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-error-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileX02Icon, { className: "text-text-error-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Verification failed" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "There was an issue with the verification process. Please try again or contact support for assistance." })] }));
|
|
8
|
+
const context = useAccountVerification();
|
|
9
|
+
return (_jsx(AccountVerificationContext, { value: context, children: _jsxs("div", { className: props.className, children: [_jsx(VerificationCapture, {}), _jsx(VerificationDetails, {}), _jsx(VerificationComplete, {})] }) }));
|
|
37
10
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Step = 1 | 2 | 3 | (number & {});
|
|
2
|
+
interface UseAccountVerificationReturn {
|
|
3
|
+
step: Step;
|
|
4
|
+
setStep: (step: Step) => void;
|
|
5
|
+
started: boolean;
|
|
6
|
+
setStarted: (started: boolean) => void;
|
|
7
|
+
completed: boolean;
|
|
8
|
+
setCompleted: (completed: boolean) => void;
|
|
9
|
+
reset: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function useAccountVerification(): UseAccountVerificationReturn;
|
|
12
|
+
export declare const AccountVerificationContext: import("react").Context<UseAccountVerificationReturn | null>;
|
|
13
|
+
export declare function useAccountVerificationContext(): UseAccountVerificationReturn;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createContext, useContext, useState } from 'react';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
export function useAccountVerification() {
|
|
4
|
+
const [step, setStep] = useState(1);
|
|
5
|
+
const [started, setStarted] = useState(false);
|
|
6
|
+
const [completed, setCompleted] = useState(false);
|
|
7
|
+
function reset() {
|
|
8
|
+
setStep(1);
|
|
9
|
+
setStarted(false);
|
|
10
|
+
setCompleted(false);
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
step,
|
|
14
|
+
setStep,
|
|
15
|
+
started,
|
|
16
|
+
setStarted,
|
|
17
|
+
completed,
|
|
18
|
+
setCompleted,
|
|
19
|
+
reset,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export const AccountVerificationContext = createContext(null);
|
|
23
|
+
export function useAccountVerificationContext() {
|
|
24
|
+
const context = useContext(AccountVerificationContext);
|
|
25
|
+
invariant(context);
|
|
26
|
+
return context;
|
|
27
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function VerificationCapture(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function VerificationCapture(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,57 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { clamp, noop } from 'lodash-es';
|
|
2
|
+
import { noop } from 'lodash-es';
|
|
4
3
|
import Image from 'next/image';
|
|
5
|
-
import {
|
|
6
|
-
import invariant from 'tiny-invariant';
|
|
7
|
-
import { toaster } from '../../client/utils/index.js';
|
|
8
|
-
import { ArrowLeftIcon, CheckCircleIcon, CheckIcon, XIcon } from '../../icons/index.js';
|
|
4
|
+
import { ArrowLeftIcon, CheckIcon, XIcon } from '../../icons/index.js';
|
|
9
5
|
import uploadId from '../../images/capture-id-banner.png';
|
|
10
6
|
import selfie from '../../images/capture-selfie-banner.png';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
const [step, setStep_] = useState(1);
|
|
14
|
-
function setStep(step) {
|
|
15
|
-
setStep_(step);
|
|
16
|
-
if (step === 4) {
|
|
17
|
-
toaster.success({
|
|
18
|
-
title: 'Submission Successful',
|
|
19
|
-
description: 'Your documents have been submitted successfully. They’re now under review, and you’ll receive a notification as soon as your account is verified.',
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
step,
|
|
25
|
-
setStep,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
const VerificationCaptureContext = createContext(null);
|
|
29
|
-
function useVerificationCaptureContext() {
|
|
30
|
-
const context = useContext(VerificationCaptureContext);
|
|
31
|
-
invariant(context);
|
|
32
|
-
return context;
|
|
33
|
-
}
|
|
7
|
+
import { Button, Checkbox, Field, Progress } from '../../ui/index.js';
|
|
8
|
+
import { useAccountVerificationContext } from './AccountVerificationContext.js';
|
|
34
9
|
export function VerificationCapture() {
|
|
35
|
-
const context =
|
|
36
|
-
|
|
10
|
+
const context = useAccountVerificationContext();
|
|
11
|
+
if (!context.started)
|
|
12
|
+
return null;
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "grid grid-cols-4 items-center", children: [_jsxs("button", { className: "text-text-tertiary-600 flex gap-sm text-sm font-semibold", disabled: context.step <= 1, onClick: () => context.setStep(context.step - 1), children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] }), _jsxs("div", { className: "col-span-2 flex justify-center gap-2", children: [_jsx(Progress.Root, { value: context.step >= 2 ? 100 : context.step >= 1 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { value: context.completed ? 100 : context.step >= 3 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) })] })] }), context.step === 1 && _jsx(Step1, {}), context.step === 2 && _jsx(Step2, {}), context.step === 3 && _jsx(Step3, {})] }));
|
|
37
14
|
}
|
|
38
15
|
function Step1() {
|
|
39
|
-
const context =
|
|
40
|
-
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Prepare to upload your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: uploadId, alt: "", className: "h-auto w-full", width:
|
|
16
|
+
const context = useAccountVerificationContext();
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Prepare to upload your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: uploadId, alt: "", className: "h-auto w-full", width: 600, height: 352 }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Upload front side of your ID"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "Don't edit image of your ID"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(2), children: "Continue" }) })] })] }));
|
|
41
18
|
}
|
|
42
19
|
function Step2() {
|
|
43
|
-
const context =
|
|
44
|
-
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Take a selfie holding your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: selfie, alt: "", className: "h-auto w-full", width:
|
|
20
|
+
const context = useAccountVerificationContext();
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Take a selfie holding your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: selfie, alt: "", className: "h-auto w-full", width: 600, height: 352 }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Face and ID must be clearly visible"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "No hats, sunglasses, or masks"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(3), children: "Continue" }) })] })] }));
|
|
45
22
|
}
|
|
46
23
|
function Step3() {
|
|
47
|
-
const context =
|
|
48
|
-
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Enter your basic and work-related information" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Permanent address" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Current address" }), _jsx(Field.Input, {})] }), _jsxs(Checkbox.Root, { className: "mt-sm", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Same as permanent address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nature of work" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, {})] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () =>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const context = useVerificationCaptureContext();
|
|
52
|
-
return (_jsx(AlertDialog.Root, { open: context.step === 4, onOpenChange: (details) => {
|
|
53
|
-
if (!details.open) {
|
|
54
|
-
context.setStep(1);
|
|
55
|
-
}
|
|
56
|
-
}, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "bg-bg-overlay/75 backdrop-blur-sm" }), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { className: "mx-auto w-[21.438rem] p-xl", children: [_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(CheckCircleIcon, {}) }), _jsx(AlertDialog.Title, { className: "mt-3 text-center", children: "Submission Successful" }), _jsx(AlertDialog.Description, { className: "text-text-tertiary-600 text-center", children: "Your documents have been submitted successfully. They\u2019re now under review, and you\u2019ll receive a notification as soon as your account is verified." }), _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { className: "mt-3xl", onClick: () => api.setOpen(false), children: "Ok" })) })] }) })] }) }));
|
|
24
|
+
const context = useAccountVerificationContext();
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Enter your basic and work-related information" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Permanent address" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Current address" }), _jsx(Field.Input, {})] }), _jsxs(Checkbox.Root, { className: "mt-sm", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Same as permanent address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nature of work" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, {})] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => {
|
|
26
|
+
context.setCompleted(true);
|
|
27
|
+
}, children: "Continue" }) })] })] }));
|
|
57
28
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function VerificationComplete(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Portal } from '@ark-ui/react';
|
|
3
|
+
import { CheckCircleIcon } from '../../icons/index.js';
|
|
4
|
+
import { AlertDialog, Button } from '../../ui/index.js';
|
|
5
|
+
import { useAccountVerificationContext } from './AccountVerificationContext.js';
|
|
6
|
+
export function VerificationComplete() {
|
|
7
|
+
const context = useAccountVerificationContext();
|
|
8
|
+
return (_jsx(AlertDialog.Root, { open: context.completed, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "bg-bg-overlay/75 backdrop-blur-sm" }), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { className: "mx-auto w-[21.438rem] p-xl", children: [_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(CheckCircleIcon, {}) }), _jsx(AlertDialog.Title, { className: "mt-3 text-center", children: "Submission Successful" }), _jsx(AlertDialog.Description, { className: "text-text-tertiary-600 text-center", children: "Your documents have been submitted successfully. They\u2019re now under review, and you\u2019ll receive a notification as soon as your account is verified." }), _jsx(Button, { className: "mt-3xl", onClick: () => context.reset(), children: "Ok" })] }) })] }) }));
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function VerificationDetails(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ark } from '@ark-ui/react';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useMemberVerificationQuery, useProfileCompletionQuery, } from '../../client/hooks/index.js';
|
|
5
|
+
import { AlertCircleIcon, CheckVerified02Icon, CreditCard02Icon, FaceIdIcon, FileCheck02Icon, FileSearch02Icon, FileX02Icon, Globe05Icon, } from '../../icons/index.js';
|
|
6
|
+
import { Button } from '../../ui/index.js';
|
|
7
|
+
import { useAccountVerificationContext } from './AccountVerificationContext.js';
|
|
8
|
+
export function VerificationDetails() {
|
|
9
|
+
const context = useAccountVerificationContext();
|
|
10
|
+
const profileCompletionQuery = useProfileCompletionQuery();
|
|
11
|
+
const profileCompletion = profileCompletionQuery.data;
|
|
12
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
13
|
+
const verification = verificationQuery.data;
|
|
14
|
+
const empty = verification == null;
|
|
15
|
+
const pending = verification?.status === 'PENDING';
|
|
16
|
+
const success = verification?.status === 'VERIFIED' || verification?.status === 'APPROVED';
|
|
17
|
+
const failed = verification?.status === 'REJECTED' ||
|
|
18
|
+
verification?.status === 'UNVERIFIED';
|
|
19
|
+
if (context.started)
|
|
20
|
+
return null;
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verify your identity" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Complete personal verification to unlock all features and enhance account security." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountVerification
|
|
22
|
+
? 'text-text-success-primary'
|
|
23
|
+
: 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs border-border-secondary bg-bg-primary-alt mt-5 rounded-xl border", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(Globe05Icon, {}), "Proof of address"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), _jsx("div", { className: "border-border-secondary border-t px-4 py-3", children: _jsx(Button, { size: "sm", onClick: () => {
|
|
24
|
+
context.setStarted(true);
|
|
25
|
+
}, children: "Verify Now" }) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
|
|
26
|
+
}
|
|
27
|
+
function VerificationNotSubmitted() {
|
|
28
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(AlertCircleIcon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("p", { className: "text-text-tertiary-600 mt-2 text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
|
|
29
|
+
}
|
|
30
|
+
function VerificationInProgress() {
|
|
31
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileSearch02Icon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Under review" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
|
|
32
|
+
}
|
|
33
|
+
function VerificationSuccess() {
|
|
34
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-success-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-success-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileCheck02Icon, { className: "text-text-success-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Verification successful" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "Your account has been successfully verified. You now have full access to all features and improved account security." })] }));
|
|
35
|
+
}
|
|
36
|
+
function VerificationFailed() {
|
|
37
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 rounded-xl border p-xl", children: [_jsx("div", { className: "border-text-error-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-error-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileX02Icon, { className: "text-text-error-primary size-5" }) }) }), _jsx("h2", { className: "text-text-secondary-700 mt-2 text-sm font-semibold", children: "Verification failed" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "There was an issue with the verification process. Please try again or contact support for assistance." })] }));
|
|
38
|
+
}
|