@sikka/hawa 0.49.7-next → 0.49.8-next
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/blocks/auth/index.js +43 -45
- package/dist/blocks/auth/index.mjs +43 -45
- package/dist/blocks/index.js +43 -45
- package/dist/blocks/index.mjs +43 -45
- package/dist/index.js +43 -45
- package/dist/index.mjs +43 -45
- package/package.json +1 -1
@@ -4298,8 +4298,15 @@ var RegisterForm = ({
|
|
4298
4298
|
continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
|
4299
4299
|
continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
|
4300
4300
|
};
|
4301
|
-
const methods = (0, import_react_hook_form2.useForm)();
|
4302
4301
|
let fieldSchemas = {};
|
4302
|
+
let remainingFieldsSchema = z2.object({
|
4303
|
+
refCode: z2.string().optional(),
|
4304
|
+
reference: z2.string().optional(),
|
4305
|
+
terms_accepted: showTermsOption ? z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
4306
|
+
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
4307
|
+
}) : z2.boolean().optional(),
|
4308
|
+
newsletter_accepted: z2.boolean().optional()
|
4309
|
+
});
|
4303
4310
|
const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
|
4304
4311
|
if (hasPhoneType && selectedRegisterType.value === "phone") {
|
4305
4312
|
registerFields = ["phone"];
|
@@ -4354,13 +4361,7 @@ var RegisterForm = ({
|
|
4354
4361
|
return isPhoneValid;
|
4355
4362
|
},
|
4356
4363
|
{ message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
|
4357
|
-
)
|
4358
|
-
refCode: z2.string().optional(),
|
4359
|
-
reference: z2.string().optional(),
|
4360
|
-
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
4361
|
-
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
4362
|
-
}),
|
4363
|
-
newsletter_accepted: z2.boolean().optional()
|
4364
|
+
)
|
4364
4365
|
});
|
4365
4366
|
} else {
|
4366
4367
|
formSchema = z2.object({
|
@@ -4378,21 +4379,24 @@ var RegisterForm = ({
|
|
4378
4379
|
message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
|
4379
4380
|
}).refine((value) => value !== "", {
|
4380
4381
|
message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
|
4381
|
-
})
|
4382
|
-
refCode: z2.string().optional(),
|
4383
|
-
reference: z2.string().optional(),
|
4384
|
-
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
4385
|
-
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
4386
|
-
}),
|
4387
|
-
newsletter_accepted: z2.boolean().optional()
|
4382
|
+
})
|
4388
4383
|
}).refine((data) => data.password === data.confirm_password, {
|
4389
4384
|
message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
|
4390
4385
|
path: ["confirm_password"]
|
4391
4386
|
});
|
4392
4387
|
}
|
4393
|
-
|
4394
|
-
|
4388
|
+
let finalSchema = z2.intersection(formSchema, remainingFieldsSchema);
|
4389
|
+
const methods = (0, import_react_hook_form2.useForm)({
|
4390
|
+
resolver: (0, import_zod2.zodResolver)(finalSchema)
|
4395
4391
|
});
|
4392
|
+
const onSubmit = (data) => {
|
4393
|
+
console.log("Form submitted with data:", data);
|
4394
|
+
if (props.onRegister) {
|
4395
|
+
props.onRegister(data);
|
4396
|
+
} else {
|
4397
|
+
console.log("onRegister prop is missing");
|
4398
|
+
}
|
4399
|
+
};
|
4396
4400
|
return /* @__PURE__ */ import_react37.default.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ import_react37.default.createElement(
|
4397
4401
|
Card,
|
4398
4402
|
{
|
@@ -4432,13 +4436,7 @@ var RegisterForm = ({
|
|
4432
4436
|
{
|
4433
4437
|
id: "register_form",
|
4434
4438
|
noValidate: true,
|
4435
|
-
onSubmit: handleSubmit(
|
4436
|
-
if (props.onRegister) {
|
4437
|
-
return props.onRegister(e);
|
4438
|
-
} else {
|
4439
|
-
console.log("Form is submitted but onRegister prop is missing");
|
4440
|
-
}
|
4441
|
-
}),
|
4439
|
+
onSubmit: methods.handleSubmit(onSubmit),
|
4442
4440
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
4443
4441
|
},
|
4444
4442
|
/* @__PURE__ */ import_react37.default.createElement(
|
@@ -4475,7 +4473,7 @@ var RegisterForm = ({
|
|
4475
4473
|
import_react_hook_form2.Controller,
|
4476
4474
|
{
|
4477
4475
|
key: i,
|
4478
|
-
control,
|
4476
|
+
control: methods.control,
|
4479
4477
|
name: "fullName",
|
4480
4478
|
render: ({ field }) => {
|
4481
4479
|
var _a2, _b2, _c2;
|
@@ -4485,7 +4483,7 @@ var RegisterForm = ({
|
|
4485
4483
|
width: "full",
|
4486
4484
|
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
4487
4485
|
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
4488
|
-
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
4486
|
+
helperText: (_c2 = methods.formState.errors.fullName) == null ? void 0 : _c2.message,
|
4489
4487
|
...field
|
4490
4488
|
}
|
4491
4489
|
);
|
@@ -4498,7 +4496,7 @@ var RegisterForm = ({
|
|
4498
4496
|
import_react_hook_form2.Controller,
|
4499
4497
|
{
|
4500
4498
|
key: i,
|
4501
|
-
control,
|
4499
|
+
control: methods.control,
|
4502
4500
|
name: "email",
|
4503
4501
|
render: ({ field }) => {
|
4504
4502
|
var _a2, _b2, _c2;
|
@@ -4512,7 +4510,7 @@ var RegisterForm = ({
|
|
4512
4510
|
width: "full",
|
4513
4511
|
autoComplete: "email",
|
4514
4512
|
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
4515
|
-
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
4513
|
+
helperText: (_b2 = methods.formState.errors.email) == null ? void 0 : _b2.message,
|
4516
4514
|
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
4517
4515
|
...field,
|
4518
4516
|
onChange: (e) => {
|
@@ -4529,7 +4527,7 @@ var RegisterForm = ({
|
|
4529
4527
|
import_react_hook_form2.Controller,
|
4530
4528
|
{
|
4531
4529
|
key: i,
|
4532
|
-
control,
|
4530
|
+
control: methods.control,
|
4533
4531
|
name: "username",
|
4534
4532
|
render: ({ field }) => {
|
4535
4533
|
var _a2, _b2, _c2, _d2, _e2;
|
@@ -4542,7 +4540,7 @@ var RegisterForm = ({
|
|
4542
4540
|
labelProps: ((_b2 = props.usernameOptions) == null ? void 0 : _b2.label) ? {
|
4543
4541
|
...(_c2 = props.usernameOptions) == null ? void 0 : _c2.label
|
4544
4542
|
} : void 0,
|
4545
|
-
helperText: (_d2 = formState.errors.username) == null ? void 0 : _d2.message,
|
4543
|
+
helperText: (_d2 = methods.formState.errors.username) == null ? void 0 : _d2.message,
|
4546
4544
|
placeholder: (_e2 = texts == null ? void 0 : texts.username) == null ? void 0 : _e2.placeholder,
|
4547
4545
|
...field
|
4548
4546
|
}
|
@@ -4555,7 +4553,7 @@ var RegisterForm = ({
|
|
4555
4553
|
/* @__PURE__ */ import_react37.default.createElement(
|
4556
4554
|
import_react_hook_form2.Controller,
|
4557
4555
|
{
|
4558
|
-
control,
|
4556
|
+
control: methods.control,
|
4559
4557
|
name: "password",
|
4560
4558
|
render: ({ field }) => {
|
4561
4559
|
var _a2, _b2, _c2;
|
@@ -4567,7 +4565,7 @@ var RegisterForm = ({
|
|
4567
4565
|
autoComplete: "new-password",
|
4568
4566
|
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
4569
4567
|
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
4570
|
-
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
4568
|
+
helperText: (_c2 = methods.formState.errors.password) == null ? void 0 : _c2.message,
|
4571
4569
|
endIcon: /* @__PURE__ */ import_react37.default.createElement(
|
4572
4570
|
"div",
|
4573
4571
|
{
|
@@ -4586,7 +4584,7 @@ var RegisterForm = ({
|
|
4586
4584
|
/* @__PURE__ */ import_react37.default.createElement(
|
4587
4585
|
import_react_hook_form2.Controller,
|
4588
4586
|
{
|
4589
|
-
control,
|
4587
|
+
control: methods.control,
|
4590
4588
|
name: "confirm_password",
|
4591
4589
|
render: ({ field }) => {
|
4592
4590
|
var _a2, _b2, _c2;
|
@@ -4598,7 +4596,7 @@ var RegisterForm = ({
|
|
4598
4596
|
autoComplete: "new-password",
|
4599
4597
|
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
4600
4598
|
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
4601
|
-
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
4599
|
+
helperText: (_c2 = methods.formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
4602
4600
|
endIcon: /* @__PURE__ */ import_react37.default.createElement(
|
4603
4601
|
"div",
|
4604
4602
|
{
|
@@ -4618,7 +4616,7 @@ var RegisterForm = ({
|
|
4618
4616
|
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
4619
4617
|
import_react_hook_form2.Controller,
|
4620
4618
|
{
|
4621
|
-
control,
|
4619
|
+
control: methods.control,
|
4622
4620
|
name: "refCode",
|
4623
4621
|
render: ({ field }) => {
|
4624
4622
|
var _a2;
|
@@ -4628,7 +4626,7 @@ var RegisterForm = ({
|
|
4628
4626
|
width: "full",
|
4629
4627
|
label: texts == null ? void 0 : texts.refCode,
|
4630
4628
|
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
4631
|
-
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
4629
|
+
helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
|
4632
4630
|
...field
|
4633
4631
|
}
|
4634
4632
|
);
|
@@ -4638,7 +4636,7 @@ var RegisterForm = ({
|
|
4638
4636
|
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
4639
4637
|
import_react_hook_form2.Controller,
|
4640
4638
|
{
|
4641
|
-
control,
|
4639
|
+
control: methods.control,
|
4642
4640
|
name: "reference",
|
4643
4641
|
render: ({ field }) => {
|
4644
4642
|
var _a2, _b2;
|
@@ -4672,7 +4670,7 @@ var RegisterForm = ({
|
|
4672
4670
|
/* @__PURE__ */ import_react37.default.createElement(
|
4673
4671
|
import_react_hook_form2.Controller,
|
4674
4672
|
{
|
4675
|
-
control,
|
4673
|
+
control: methods.control,
|
4676
4674
|
name: "phone",
|
4677
4675
|
render: ({ field }) => {
|
4678
4676
|
var _a2, _b2;
|
@@ -4680,7 +4678,7 @@ var RegisterForm = ({
|
|
4680
4678
|
PhoneInput,
|
4681
4679
|
{
|
4682
4680
|
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
4683
|
-
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
4681
|
+
helperText: (_b2 = methods.formState.errors.phone) == null ? void 0 : _b2.message,
|
4684
4682
|
preferredCountry: { label: "+966" },
|
4685
4683
|
...props.phoneInputProps,
|
4686
4684
|
handleChange: (e) => {
|
@@ -4700,7 +4698,7 @@ var RegisterForm = ({
|
|
4700
4698
|
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
4701
4699
|
import_react_hook_form2.Controller,
|
4702
4700
|
{
|
4703
|
-
control,
|
4701
|
+
control: methods.control,
|
4704
4702
|
name: "refCode",
|
4705
4703
|
render: ({ field }) => {
|
4706
4704
|
var _a2;
|
@@ -4710,7 +4708,7 @@ var RegisterForm = ({
|
|
4710
4708
|
width: "full",
|
4711
4709
|
label: texts == null ? void 0 : texts.refCode,
|
4712
4710
|
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
4713
|
-
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
4711
|
+
helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
|
4714
4712
|
...field
|
4715
4713
|
}
|
4716
4714
|
);
|
@@ -4720,7 +4718,7 @@ var RegisterForm = ({
|
|
4720
4718
|
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
4721
4719
|
import_react_hook_form2.Controller,
|
4722
4720
|
{
|
4723
|
-
control,
|
4721
|
+
control: methods.control,
|
4724
4722
|
name: "reference",
|
4725
4723
|
render: ({ field }) => {
|
4726
4724
|
var _a2, _b2;
|
@@ -4744,7 +4742,7 @@ var RegisterForm = ({
|
|
4744
4742
|
showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react37.default.createElement(
|
4745
4743
|
import_react_hook_form2.Controller,
|
4746
4744
|
{
|
4747
|
-
control,
|
4745
|
+
control: methods.control,
|
4748
4746
|
name: "terms_accepted",
|
4749
4747
|
render: ({ field }) => {
|
4750
4748
|
var _a2, _b2;
|
@@ -4752,7 +4750,7 @@ var RegisterForm = ({
|
|
4752
4750
|
Checkbox,
|
4753
4751
|
{
|
4754
4752
|
id: "terms_accepted",
|
4755
|
-
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
4753
|
+
helperText: (_b2 = (_a2 = methods.formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
4756
4754
|
onCheckedChange: (e) => field.onChange(e),
|
4757
4755
|
label: /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ import_react37.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react37.default.createElement(
|
4758
4756
|
"span",
|
@@ -4774,7 +4772,7 @@ var RegisterForm = ({
|
|
4774
4772
|
), showNewsletterOption && /* @__PURE__ */ import_react37.default.createElement(
|
4775
4773
|
import_react_hook_form2.Controller,
|
4776
4774
|
{
|
4777
|
-
control,
|
4775
|
+
control: methods.control,
|
4778
4776
|
name: "newsletter_accepted",
|
4779
4777
|
render: ({ field }) => /* @__PURE__ */ import_react37.default.createElement(
|
4780
4778
|
Checkbox,
|
@@ -2925,8 +2925,15 @@ var RegisterForm = ({
|
|
2925
2925
|
continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
|
2926
2926
|
continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
|
2927
2927
|
};
|
2928
|
-
const methods = useForm2();
|
2929
2928
|
let fieldSchemas = {};
|
2929
|
+
let remainingFieldsSchema = z2.object({
|
2930
|
+
refCode: z2.string().optional(),
|
2931
|
+
reference: z2.string().optional(),
|
2932
|
+
terms_accepted: showTermsOption ? z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
2933
|
+
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
2934
|
+
}) : z2.boolean().optional(),
|
2935
|
+
newsletter_accepted: z2.boolean().optional()
|
2936
|
+
});
|
2930
2937
|
const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
|
2931
2938
|
if (hasPhoneType && selectedRegisterType.value === "phone") {
|
2932
2939
|
registerFields = ["phone"];
|
@@ -2981,13 +2988,7 @@ var RegisterForm = ({
|
|
2981
2988
|
return isPhoneValid;
|
2982
2989
|
},
|
2983
2990
|
{ message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
|
2984
|
-
)
|
2985
|
-
refCode: z2.string().optional(),
|
2986
|
-
reference: z2.string().optional(),
|
2987
|
-
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
2988
|
-
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
2989
|
-
}),
|
2990
|
-
newsletter_accepted: z2.boolean().optional()
|
2991
|
+
)
|
2991
2992
|
});
|
2992
2993
|
} else {
|
2993
2994
|
formSchema = z2.object({
|
@@ -3005,21 +3006,24 @@ var RegisterForm = ({
|
|
3005
3006
|
message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
|
3006
3007
|
}).refine((value) => value !== "", {
|
3007
3008
|
message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
|
3008
|
-
})
|
3009
|
-
refCode: z2.string().optional(),
|
3010
|
-
reference: z2.string().optional(),
|
3011
|
-
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
3012
|
-
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
3013
|
-
}),
|
3014
|
-
newsletter_accepted: z2.boolean().optional()
|
3009
|
+
})
|
3015
3010
|
}).refine((data) => data.password === data.confirm_password, {
|
3016
3011
|
message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
|
3017
3012
|
path: ["confirm_password"]
|
3018
3013
|
});
|
3019
3014
|
}
|
3020
|
-
|
3021
|
-
|
3015
|
+
let finalSchema = z2.intersection(formSchema, remainingFieldsSchema);
|
3016
|
+
const methods = useForm2({
|
3017
|
+
resolver: zodResolver2(finalSchema)
|
3022
3018
|
});
|
3019
|
+
const onSubmit = (data) => {
|
3020
|
+
console.log("Form submitted with data:", data);
|
3021
|
+
if (props.onRegister) {
|
3022
|
+
props.onRegister(data);
|
3023
|
+
} else {
|
3024
|
+
console.log("onRegister prop is missing");
|
3025
|
+
}
|
3026
|
+
};
|
3023
3027
|
return /* @__PURE__ */ React7.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ React7.createElement(
|
3024
3028
|
Card,
|
3025
3029
|
{
|
@@ -3059,13 +3063,7 @@ var RegisterForm = ({
|
|
3059
3063
|
{
|
3060
3064
|
id: "register_form",
|
3061
3065
|
noValidate: true,
|
3062
|
-
onSubmit: handleSubmit(
|
3063
|
-
if (props.onRegister) {
|
3064
|
-
return props.onRegister(e);
|
3065
|
-
} else {
|
3066
|
-
console.log("Form is submitted but onRegister prop is missing");
|
3067
|
-
}
|
3068
|
-
}),
|
3066
|
+
onSubmit: methods.handleSubmit(onSubmit),
|
3069
3067
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
3070
3068
|
},
|
3071
3069
|
/* @__PURE__ */ React7.createElement(
|
@@ -3102,7 +3100,7 @@ var RegisterForm = ({
|
|
3102
3100
|
Controller2,
|
3103
3101
|
{
|
3104
3102
|
key: i,
|
3105
|
-
control,
|
3103
|
+
control: methods.control,
|
3106
3104
|
name: "fullName",
|
3107
3105
|
render: ({ field }) => {
|
3108
3106
|
var _a2, _b2, _c2;
|
@@ -3112,7 +3110,7 @@ var RegisterForm = ({
|
|
3112
3110
|
width: "full",
|
3113
3111
|
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
3114
3112
|
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
3115
|
-
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
3113
|
+
helperText: (_c2 = methods.formState.errors.fullName) == null ? void 0 : _c2.message,
|
3116
3114
|
...field
|
3117
3115
|
}
|
3118
3116
|
);
|
@@ -3125,7 +3123,7 @@ var RegisterForm = ({
|
|
3125
3123
|
Controller2,
|
3126
3124
|
{
|
3127
3125
|
key: i,
|
3128
|
-
control,
|
3126
|
+
control: methods.control,
|
3129
3127
|
name: "email",
|
3130
3128
|
render: ({ field }) => {
|
3131
3129
|
var _a2, _b2, _c2;
|
@@ -3139,7 +3137,7 @@ var RegisterForm = ({
|
|
3139
3137
|
width: "full",
|
3140
3138
|
autoComplete: "email",
|
3141
3139
|
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
3142
|
-
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
3140
|
+
helperText: (_b2 = methods.formState.errors.email) == null ? void 0 : _b2.message,
|
3143
3141
|
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
3144
3142
|
...field,
|
3145
3143
|
onChange: (e) => {
|
@@ -3156,7 +3154,7 @@ var RegisterForm = ({
|
|
3156
3154
|
Controller2,
|
3157
3155
|
{
|
3158
3156
|
key: i,
|
3159
|
-
control,
|
3157
|
+
control: methods.control,
|
3160
3158
|
name: "username",
|
3161
3159
|
render: ({ field }) => {
|
3162
3160
|
var _a2, _b2, _c2, _d2, _e2;
|
@@ -3169,7 +3167,7 @@ var RegisterForm = ({
|
|
3169
3167
|
labelProps: ((_b2 = props.usernameOptions) == null ? void 0 : _b2.label) ? {
|
3170
3168
|
...(_c2 = props.usernameOptions) == null ? void 0 : _c2.label
|
3171
3169
|
} : void 0,
|
3172
|
-
helperText: (_d2 = formState.errors.username) == null ? void 0 : _d2.message,
|
3170
|
+
helperText: (_d2 = methods.formState.errors.username) == null ? void 0 : _d2.message,
|
3173
3171
|
placeholder: (_e2 = texts == null ? void 0 : texts.username) == null ? void 0 : _e2.placeholder,
|
3174
3172
|
...field
|
3175
3173
|
}
|
@@ -3182,7 +3180,7 @@ var RegisterForm = ({
|
|
3182
3180
|
/* @__PURE__ */ React7.createElement(
|
3183
3181
|
Controller2,
|
3184
3182
|
{
|
3185
|
-
control,
|
3183
|
+
control: methods.control,
|
3186
3184
|
name: "password",
|
3187
3185
|
render: ({ field }) => {
|
3188
3186
|
var _a2, _b2, _c2;
|
@@ -3194,7 +3192,7 @@ var RegisterForm = ({
|
|
3194
3192
|
autoComplete: "new-password",
|
3195
3193
|
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
3196
3194
|
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
3197
|
-
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
3195
|
+
helperText: (_c2 = methods.formState.errors.password) == null ? void 0 : _c2.message,
|
3198
3196
|
endIcon: /* @__PURE__ */ React7.createElement(
|
3199
3197
|
"div",
|
3200
3198
|
{
|
@@ -3213,7 +3211,7 @@ var RegisterForm = ({
|
|
3213
3211
|
/* @__PURE__ */ React7.createElement(
|
3214
3212
|
Controller2,
|
3215
3213
|
{
|
3216
|
-
control,
|
3214
|
+
control: methods.control,
|
3217
3215
|
name: "confirm_password",
|
3218
3216
|
render: ({ field }) => {
|
3219
3217
|
var _a2, _b2, _c2;
|
@@ -3225,7 +3223,7 @@ var RegisterForm = ({
|
|
3225
3223
|
autoComplete: "new-password",
|
3226
3224
|
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
3227
3225
|
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
3228
|
-
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
3226
|
+
helperText: (_c2 = methods.formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
3229
3227
|
endIcon: /* @__PURE__ */ React7.createElement(
|
3230
3228
|
"div",
|
3231
3229
|
{
|
@@ -3245,7 +3243,7 @@ var RegisterForm = ({
|
|
3245
3243
|
props.showRefCode && /* @__PURE__ */ React7.createElement(
|
3246
3244
|
Controller2,
|
3247
3245
|
{
|
3248
|
-
control,
|
3246
|
+
control: methods.control,
|
3249
3247
|
name: "refCode",
|
3250
3248
|
render: ({ field }) => {
|
3251
3249
|
var _a2;
|
@@ -3255,7 +3253,7 @@ var RegisterForm = ({
|
|
3255
3253
|
width: "full",
|
3256
3254
|
label: texts == null ? void 0 : texts.refCode,
|
3257
3255
|
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
3258
|
-
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
3256
|
+
helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
|
3259
3257
|
...field
|
3260
3258
|
}
|
3261
3259
|
);
|
@@ -3265,7 +3263,7 @@ var RegisterForm = ({
|
|
3265
3263
|
props.showUserSource && /* @__PURE__ */ React7.createElement(
|
3266
3264
|
Controller2,
|
3267
3265
|
{
|
3268
|
-
control,
|
3266
|
+
control: methods.control,
|
3269
3267
|
name: "reference",
|
3270
3268
|
render: ({ field }) => {
|
3271
3269
|
var _a2, _b2;
|
@@ -3299,7 +3297,7 @@ var RegisterForm = ({
|
|
3299
3297
|
/* @__PURE__ */ React7.createElement(
|
3300
3298
|
Controller2,
|
3301
3299
|
{
|
3302
|
-
control,
|
3300
|
+
control: methods.control,
|
3303
3301
|
name: "phone",
|
3304
3302
|
render: ({ field }) => {
|
3305
3303
|
var _a2, _b2;
|
@@ -3307,7 +3305,7 @@ var RegisterForm = ({
|
|
3307
3305
|
PhoneInput,
|
3308
3306
|
{
|
3309
3307
|
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
3310
|
-
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
3308
|
+
helperText: (_b2 = methods.formState.errors.phone) == null ? void 0 : _b2.message,
|
3311
3309
|
preferredCountry: { label: "+966" },
|
3312
3310
|
...props.phoneInputProps,
|
3313
3311
|
handleChange: (e) => {
|
@@ -3327,7 +3325,7 @@ var RegisterForm = ({
|
|
3327
3325
|
props.showRefCode && /* @__PURE__ */ React7.createElement(
|
3328
3326
|
Controller2,
|
3329
3327
|
{
|
3330
|
-
control,
|
3328
|
+
control: methods.control,
|
3331
3329
|
name: "refCode",
|
3332
3330
|
render: ({ field }) => {
|
3333
3331
|
var _a2;
|
@@ -3337,7 +3335,7 @@ var RegisterForm = ({
|
|
3337
3335
|
width: "full",
|
3338
3336
|
label: texts == null ? void 0 : texts.refCode,
|
3339
3337
|
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
3340
|
-
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
3338
|
+
helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
|
3341
3339
|
...field
|
3342
3340
|
}
|
3343
3341
|
);
|
@@ -3347,7 +3345,7 @@ var RegisterForm = ({
|
|
3347
3345
|
props.showUserSource && /* @__PURE__ */ React7.createElement(
|
3348
3346
|
Controller2,
|
3349
3347
|
{
|
3350
|
-
control,
|
3348
|
+
control: methods.control,
|
3351
3349
|
name: "reference",
|
3352
3350
|
render: ({ field }) => {
|
3353
3351
|
var _a2, _b2;
|
@@ -3371,7 +3369,7 @@ var RegisterForm = ({
|
|
3371
3369
|
showTermsOption || showNewsletterOption ? /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React7.createElement(
|
3372
3370
|
Controller2,
|
3373
3371
|
{
|
3374
|
-
control,
|
3372
|
+
control: methods.control,
|
3375
3373
|
name: "terms_accepted",
|
3376
3374
|
render: ({ field }) => {
|
3377
3375
|
var _a2, _b2;
|
@@ -3379,7 +3377,7 @@ var RegisterForm = ({
|
|
3379
3377
|
Checkbox,
|
3380
3378
|
{
|
3381
3379
|
id: "terms_accepted",
|
3382
|
-
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
3380
|
+
helperText: (_b2 = (_a2 = methods.formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
3383
3381
|
onCheckedChange: (e) => field.onChange(e),
|
3384
3382
|
label: /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ React7.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React7.createElement(
|
3385
3383
|
"span",
|
@@ -3401,7 +3399,7 @@ var RegisterForm = ({
|
|
3401
3399
|
), showNewsletterOption && /* @__PURE__ */ React7.createElement(
|
3402
3400
|
Controller2,
|
3403
3401
|
{
|
3404
|
-
control,
|
3402
|
+
control: methods.control,
|
3405
3403
|
name: "newsletter_accepted",
|
3406
3404
|
render: ({ field }) => /* @__PURE__ */ React7.createElement(
|
3407
3405
|
Checkbox,
|