@opexa/portal-components 0.0.535 → 0.0.537
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/SignIn/NameAndPasswordSignIn.js +1 -1
- package/dist/components/SignIn/SignInMethod.d.ts +1 -1
- package/dist/components/SignIn/SignInMethod.js +2 -0
- package/dist/components/SignIn/useSignIn.d.ts +2 -0
- package/dist/components/SignIn/useSignIn.js +5 -1
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/useSelfieImageField.js +2 -2
- package/dist/components/SignUp/SignUpNameAndPassword/SignUpNameAndPasswordForm.js +8 -4
- package/dist/components/shared/SelfieImageField/useSelfieImageField.js +2 -2
- package/package.json +1 -1
|
@@ -140,7 +140,7 @@ export function NameAndPasswordSignIn() {
|
|
|
140
140
|
secretAnswer: data.secretAnswer,
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
}), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.name, children: [_jsx(Field.Label, { children: "Name" }), _jsx(Field.Input, { placeholder: "Enter your
|
|
143
|
+
}), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.name, children: [_jsx(Field.Label, { children: "Name" }), _jsx(Field.Input, { placeholder: "Enter your Username", ...form.register('name', {
|
|
144
144
|
onChange() {
|
|
145
145
|
signInMutation.reset();
|
|
146
146
|
form.setValue('secretAnswer', '');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function SignInMethod(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function SignInMethod(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -12,6 +12,8 @@ const METHOD_LABEL_MAP = {
|
|
|
12
12
|
};
|
|
13
13
|
export function SignInMethod() {
|
|
14
14
|
const context = useSignInContext();
|
|
15
|
+
if (context.types.length <= 1)
|
|
16
|
+
return null;
|
|
15
17
|
return (_jsxs(SegmentGroup.Root, { value: context.type, onValueChange: (details) => {
|
|
16
18
|
context.setStep(1);
|
|
17
19
|
context.setType(z.enum(METHODS).parse(details.value));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type SignInStep = 1 | 2 | (number & {});
|
|
2
2
|
export type SignInType = 'NAME_AND_PASSWORD' | 'MOBILE_NUMBER';
|
|
3
3
|
export interface UseSignInProps {
|
|
4
|
+
types?: SignInType[];
|
|
4
5
|
defaultType?: SignInType;
|
|
5
6
|
}
|
|
6
7
|
export interface UseSignInReturn {
|
|
@@ -8,5 +9,6 @@ export interface UseSignInReturn {
|
|
|
8
9
|
setStep: (step: SignInStep) => void;
|
|
9
10
|
type: SignInType;
|
|
10
11
|
setType: (type: SignInType) => void;
|
|
12
|
+
types: SignInType[];
|
|
11
13
|
}
|
|
12
14
|
export declare function useSignIn(props?: UseSignInProps): UseSignInReturn;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
export function useSignIn(props) {
|
|
3
|
+
const types = !props?.types?.length
|
|
4
|
+
? ['MOBILE_NUMBER', 'NAME_AND_PASSWORD']
|
|
5
|
+
: props.types;
|
|
3
6
|
const [step, setStep] = useState(1);
|
|
4
|
-
const [type, setType] = useState(props?.defaultType ??
|
|
7
|
+
const [type, setType] = useState(props?.defaultType ?? types[0]);
|
|
5
8
|
return {
|
|
6
9
|
step,
|
|
7
10
|
setStep,
|
|
8
11
|
type,
|
|
9
12
|
setType,
|
|
13
|
+
types,
|
|
10
14
|
};
|
|
11
15
|
}
|
|
@@ -117,7 +117,7 @@ async function getImageFaceDetector() {
|
|
|
117
117
|
}
|
|
118
118
|
const detector = await FaceDetector.createFromOptions(__vision__, {
|
|
119
119
|
runningMode: 'IMAGE',
|
|
120
|
-
minDetectionConfidence: 0.
|
|
120
|
+
minDetectionConfidence: 0.5,
|
|
121
121
|
baseOptions: {
|
|
122
122
|
delegate: 'GPU',
|
|
123
123
|
modelAssetPath: 'https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite',
|
|
@@ -135,7 +135,7 @@ async function getVideoFaceDetector() {
|
|
|
135
135
|
}
|
|
136
136
|
const detector = await FaceDetector.createFromOptions(__vision__, {
|
|
137
137
|
runningMode: 'VIDEO',
|
|
138
|
-
minDetectionConfidence: 0.
|
|
138
|
+
minDetectionConfidence: 0.5,
|
|
139
139
|
baseOptions: {
|
|
140
140
|
delegate: 'GPU',
|
|
141
141
|
modelAssetPath: 'https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite',
|
|
@@ -20,6 +20,8 @@ import { CheckIcon } from '../../../icons/CheckIcon.js';
|
|
|
20
20
|
import { ChevronDownIcon } from '../../../icons/ChevronDownIcon.js';
|
|
21
21
|
import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
|
|
22
22
|
import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
|
|
23
|
+
import { EyeIcon } from '../../../icons/EyeIcon.js';
|
|
24
|
+
import { EyeOffIcon } from '../../../icons/EyeOffIcon.js';
|
|
23
25
|
import { HelpCircleIcon } from '../../../icons/HelpCircleIcon.js';
|
|
24
26
|
import pagcorLogo from '../../../images/pagcor-round-icon.png';
|
|
25
27
|
import responsibleGamingLogo from '../../../images/responsible-gaming-gold.png';
|
|
@@ -28,6 +30,7 @@ import { Button } from '../../../ui/Button/index.js';
|
|
|
28
30
|
import { Checkbox } from '../../../ui/Checkbox/index.js';
|
|
29
31
|
import { DatePicker } from '../../../ui/DatePicker/index.js';
|
|
30
32
|
import { Field } from '../../../ui/Field/index.js';
|
|
33
|
+
import { PasswordInput } from '../../../ui/PasswordInput/index.js';
|
|
31
34
|
import { Select } from '../../../ui/Select/index.js';
|
|
32
35
|
import { Tooltip } from '../../../ui/Tooltip/index.js';
|
|
33
36
|
import { createPoll } from '../../../utils/createPoll.js';
|
|
@@ -54,13 +57,14 @@ export function SignUpNameAndPasswordForm() {
|
|
|
54
57
|
name: z
|
|
55
58
|
.string()
|
|
56
59
|
.trim()
|
|
57
|
-
.
|
|
58
|
-
.
|
|
60
|
+
.regex(/^[0-9a-z]*$/, 'Name must be alphanumeric')
|
|
61
|
+
.min(6, 'Name must be 6 or more characters')
|
|
62
|
+
.max(20, 'Name must not be more that 20 characters'),
|
|
59
63
|
password: z
|
|
60
64
|
.string()
|
|
61
65
|
.trim()
|
|
62
66
|
.min(8, 'Password must be 8 or more characters')
|
|
63
|
-
.max(
|
|
67
|
+
.max(32, 'Password must not be more that 32 characters'),
|
|
64
68
|
termsAccepted: z.boolean().superRefine((v, ctx) => {
|
|
65
69
|
if (!v) {
|
|
66
70
|
ctx.addIssue({
|
|
@@ -168,7 +172,7 @@ export function SignUpNameAndPasswordForm() {
|
|
|
168
172
|
description: error instanceof Error ? error.message : 'Something went wrong',
|
|
169
173
|
});
|
|
170
174
|
}
|
|
171
|
-
}), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.name, className: "mt-xl", children: [_jsx(Field.Label, { children: "Name" }), _jsx(Field.Input, { placeholder: "Enter your
|
|
175
|
+
}), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.name, className: "mt-xl", children: [_jsx(Field.Label, { children: "Name" }), _jsx(Field.Input, { placeholder: "Enter your Username", ...form.register('name') }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.password, className: "mt-xl", children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.firstName, className: "mt-xl", children: [_jsx(Field.Label, { children: "First Name" }), _jsx(Field.Input, { placeholder: "Enter your first name", ...form.register('firstName') }), _jsx(Field.ErrorText, { children: form.formState.errors.firstName?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.lastName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Last Name" }), _jsx(Field.Input, { placeholder: "Enter your last name", ...form.register('lastName') }), _jsx(Field.ErrorText, { children: form.formState.errors.lastName?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.birthDay, className: "mt-xl", children: [_jsx(DateOfBirthField, { value: form.watch('birthDay'), onChange: (value) => {
|
|
172
176
|
if (!value)
|
|
173
177
|
return;
|
|
174
178
|
form.setValue('birthDay', value, {
|
|
@@ -147,7 +147,7 @@ async function getImageFaceDetector() {
|
|
|
147
147
|
}
|
|
148
148
|
const detector = await FaceDetector.createFromOptions(__vision__, {
|
|
149
149
|
runningMode: 'IMAGE',
|
|
150
|
-
minDetectionConfidence: 0.
|
|
150
|
+
minDetectionConfidence: 0.5,
|
|
151
151
|
baseOptions: {
|
|
152
152
|
delegate: 'GPU',
|
|
153
153
|
modelAssetPath: 'https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite',
|
|
@@ -165,7 +165,7 @@ async function getVideoFaceDetector() {
|
|
|
165
165
|
}
|
|
166
166
|
const detector = await FaceDetector.createFromOptions(__vision__, {
|
|
167
167
|
runningMode: 'VIDEO',
|
|
168
|
-
minDetectionConfidence: 0.
|
|
168
|
+
minDetectionConfidence: 0.5,
|
|
169
169
|
baseOptions: {
|
|
170
170
|
delegate: 'GPU',
|
|
171
171
|
modelAssetPath: 'https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite',
|