@sikka/hawa 0.49.7-next → 0.49.9-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.d.mts +1 -0
- package/dist/blocks/auth/index.d.ts +1 -0
- package/dist/blocks/auth/index.js +102 -96
- package/dist/blocks/auth/index.mjs +102 -96
- package/dist/blocks/index.d.mts +1 -0
- package/dist/blocks/index.d.ts +1 -0
- package/dist/blocks/index.js +102 -96
- package/dist/blocks/index.mjs +102 -96
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +102 -96
- package/dist/index.mjs +102 -96
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -10539,8 +10539,15 @@ var RegisterForm = ({
|
|
10539
10539
|
continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
|
10540
10540
|
continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
|
10541
10541
|
};
|
10542
|
-
const methods = (0, import_react_hook_form2.useForm)();
|
10543
10542
|
let fieldSchemas = {};
|
10543
|
+
let remainingFieldsSchema = z2.object({
|
10544
|
+
refCode: z2.string().optional(),
|
10545
|
+
reference: z2.string().optional(),
|
10546
|
+
terms_accepted: showTermsOption ? z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
10547
|
+
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
10548
|
+
}) : z2.boolean().optional(),
|
10549
|
+
newsletter_accepted: z2.boolean().optional()
|
10550
|
+
});
|
10544
10551
|
const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
|
10545
10552
|
if (hasPhoneType && selectedRegisterType.value === "phone") {
|
10546
10553
|
registerFields = ["phone"];
|
@@ -10595,13 +10602,7 @@ var RegisterForm = ({
|
|
10595
10602
|
return isPhoneValid;
|
10596
10603
|
},
|
10597
10604
|
{ message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
|
10598
|
-
)
|
10599
|
-
refCode: z2.string().optional(),
|
10600
|
-
reference: z2.string().optional(),
|
10601
|
-
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
10602
|
-
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
10603
|
-
}),
|
10604
|
-
newsletter_accepted: z2.boolean().optional()
|
10605
|
+
)
|
10605
10606
|
});
|
10606
10607
|
} else {
|
10607
10608
|
formSchema = z2.object({
|
@@ -10619,21 +10620,24 @@ var RegisterForm = ({
|
|
10619
10620
|
message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
|
10620
10621
|
}).refine((value) => value !== "", {
|
10621
10622
|
message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
|
10622
|
-
})
|
10623
|
-
refCode: z2.string().optional(),
|
10624
|
-
reference: z2.string().optional(),
|
10625
|
-
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
10626
|
-
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
10627
|
-
}),
|
10628
|
-
newsletter_accepted: z2.boolean().optional()
|
10623
|
+
})
|
10629
10624
|
}).refine((data) => data.password === data.confirm_password, {
|
10630
10625
|
message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
|
10631
10626
|
path: ["confirm_password"]
|
10632
10627
|
});
|
10633
10628
|
}
|
10634
|
-
|
10635
|
-
|
10629
|
+
let finalSchema = z2.intersection(formSchema, remainingFieldsSchema);
|
10630
|
+
const methods = (0, import_react_hook_form2.useForm)({
|
10631
|
+
resolver: (0, import_zod2.zodResolver)(finalSchema)
|
10636
10632
|
});
|
10633
|
+
const onSubmit = (data) => {
|
10634
|
+
console.log("Form submitted with data:", data);
|
10635
|
+
if (props.onRegister) {
|
10636
|
+
props.onRegister(data);
|
10637
|
+
} else {
|
10638
|
+
console.log("onRegister prop is missing");
|
10639
|
+
}
|
10640
|
+
};
|
10637
10641
|
return /* @__PURE__ */ import_react69.default.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ import_react69.default.createElement(
|
10638
10642
|
Card,
|
10639
10643
|
{
|
@@ -10673,13 +10677,7 @@ var RegisterForm = ({
|
|
10673
10677
|
{
|
10674
10678
|
id: "register_form",
|
10675
10679
|
noValidate: true,
|
10676
|
-
onSubmit: handleSubmit(
|
10677
|
-
if (props.onRegister) {
|
10678
|
-
return props.onRegister(e);
|
10679
|
-
} else {
|
10680
|
-
console.log("Form is submitted but onRegister prop is missing");
|
10681
|
-
}
|
10682
|
-
}),
|
10680
|
+
onSubmit: methods.handleSubmit(onSubmit),
|
10683
10681
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
10684
10682
|
},
|
10685
10683
|
/* @__PURE__ */ import_react69.default.createElement(
|
@@ -10716,7 +10714,7 @@ var RegisterForm = ({
|
|
10716
10714
|
import_react_hook_form2.Controller,
|
10717
10715
|
{
|
10718
10716
|
key: i,
|
10719
|
-
control,
|
10717
|
+
control: methods.control,
|
10720
10718
|
name: "fullName",
|
10721
10719
|
render: ({ field }) => {
|
10722
10720
|
var _a2, _b2, _c2;
|
@@ -10726,7 +10724,7 @@ var RegisterForm = ({
|
|
10726
10724
|
width: "full",
|
10727
10725
|
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
10728
10726
|
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
10729
|
-
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
10727
|
+
helperText: (_c2 = methods.formState.errors.fullName) == null ? void 0 : _c2.message,
|
10730
10728
|
...field
|
10731
10729
|
}
|
10732
10730
|
);
|
@@ -10739,7 +10737,7 @@ var RegisterForm = ({
|
|
10739
10737
|
import_react_hook_form2.Controller,
|
10740
10738
|
{
|
10741
10739
|
key: i,
|
10742
|
-
control,
|
10740
|
+
control: methods.control,
|
10743
10741
|
name: "email",
|
10744
10742
|
render: ({ field }) => {
|
10745
10743
|
var _a2, _b2, _c2;
|
@@ -10753,7 +10751,7 @@ var RegisterForm = ({
|
|
10753
10751
|
width: "full",
|
10754
10752
|
autoComplete: "email",
|
10755
10753
|
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
10756
|
-
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
10754
|
+
helperText: (_b2 = methods.formState.errors.email) == null ? void 0 : _b2.message,
|
10757
10755
|
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
10758
10756
|
...field,
|
10759
10757
|
onChange: (e) => {
|
@@ -10770,7 +10768,7 @@ var RegisterForm = ({
|
|
10770
10768
|
import_react_hook_form2.Controller,
|
10771
10769
|
{
|
10772
10770
|
key: i,
|
10773
|
-
control,
|
10771
|
+
control: methods.control,
|
10774
10772
|
name: "username",
|
10775
10773
|
render: ({ field }) => {
|
10776
10774
|
var _a2, _b2, _c2, _d2, _e2;
|
@@ -10783,7 +10781,7 @@ var RegisterForm = ({
|
|
10783
10781
|
labelProps: ((_b2 = props.usernameOptions) == null ? void 0 : _b2.label) ? {
|
10784
10782
|
...(_c2 = props.usernameOptions) == null ? void 0 : _c2.label
|
10785
10783
|
} : void 0,
|
10786
|
-
helperText: (_d2 = formState.errors.username) == null ? void 0 : _d2.message,
|
10784
|
+
helperText: (_d2 = methods.formState.errors.username) == null ? void 0 : _d2.message,
|
10787
10785
|
placeholder: (_e2 = texts == null ? void 0 : texts.username) == null ? void 0 : _e2.placeholder,
|
10788
10786
|
...field
|
10789
10787
|
}
|
@@ -10796,7 +10794,7 @@ var RegisterForm = ({
|
|
10796
10794
|
/* @__PURE__ */ import_react69.default.createElement(
|
10797
10795
|
import_react_hook_form2.Controller,
|
10798
10796
|
{
|
10799
|
-
control,
|
10797
|
+
control: methods.control,
|
10800
10798
|
name: "password",
|
10801
10799
|
render: ({ field }) => {
|
10802
10800
|
var _a2, _b2, _c2;
|
@@ -10808,7 +10806,7 @@ var RegisterForm = ({
|
|
10808
10806
|
autoComplete: "new-password",
|
10809
10807
|
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
10810
10808
|
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
10811
|
-
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
10809
|
+
helperText: (_c2 = methods.formState.errors.password) == null ? void 0 : _c2.message,
|
10812
10810
|
endIcon: /* @__PURE__ */ import_react69.default.createElement(
|
10813
10811
|
"div",
|
10814
10812
|
{
|
@@ -10827,7 +10825,7 @@ var RegisterForm = ({
|
|
10827
10825
|
/* @__PURE__ */ import_react69.default.createElement(
|
10828
10826
|
import_react_hook_form2.Controller,
|
10829
10827
|
{
|
10830
|
-
control,
|
10828
|
+
control: methods.control,
|
10831
10829
|
name: "confirm_password",
|
10832
10830
|
render: ({ field }) => {
|
10833
10831
|
var _a2, _b2, _c2;
|
@@ -10839,7 +10837,7 @@ var RegisterForm = ({
|
|
10839
10837
|
autoComplete: "new-password",
|
10840
10838
|
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
10841
10839
|
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
10842
|
-
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
10840
|
+
helperText: (_c2 = methods.formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
10843
10841
|
endIcon: /* @__PURE__ */ import_react69.default.createElement(
|
10844
10842
|
"div",
|
10845
10843
|
{
|
@@ -10859,7 +10857,7 @@ var RegisterForm = ({
|
|
10859
10857
|
props.showRefCode && /* @__PURE__ */ import_react69.default.createElement(
|
10860
10858
|
import_react_hook_form2.Controller,
|
10861
10859
|
{
|
10862
|
-
control,
|
10860
|
+
control: methods.control,
|
10863
10861
|
name: "refCode",
|
10864
10862
|
render: ({ field }) => {
|
10865
10863
|
var _a2;
|
@@ -10869,7 +10867,7 @@ var RegisterForm = ({
|
|
10869
10867
|
width: "full",
|
10870
10868
|
label: texts == null ? void 0 : texts.refCode,
|
10871
10869
|
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
10872
|
-
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
10870
|
+
helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
|
10873
10871
|
...field
|
10874
10872
|
}
|
10875
10873
|
);
|
@@ -10879,7 +10877,7 @@ var RegisterForm = ({
|
|
10879
10877
|
props.showUserSource && /* @__PURE__ */ import_react69.default.createElement(
|
10880
10878
|
import_react_hook_form2.Controller,
|
10881
10879
|
{
|
10882
|
-
control,
|
10880
|
+
control: methods.control,
|
10883
10881
|
name: "reference",
|
10884
10882
|
render: ({ field }) => {
|
10885
10883
|
var _a2, _b2;
|
@@ -10913,7 +10911,7 @@ var RegisterForm = ({
|
|
10913
10911
|
/* @__PURE__ */ import_react69.default.createElement(
|
10914
10912
|
import_react_hook_form2.Controller,
|
10915
10913
|
{
|
10916
|
-
control,
|
10914
|
+
control: methods.control,
|
10917
10915
|
name: "phone",
|
10918
10916
|
render: ({ field }) => {
|
10919
10917
|
var _a2, _b2;
|
@@ -10921,7 +10919,7 @@ var RegisterForm = ({
|
|
10921
10919
|
PhoneInput,
|
10922
10920
|
{
|
10923
10921
|
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
10924
|
-
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
10922
|
+
helperText: (_b2 = methods.formState.errors.phone) == null ? void 0 : _b2.message,
|
10925
10923
|
preferredCountry: { label: "+966" },
|
10926
10924
|
...props.phoneInputProps,
|
10927
10925
|
handleChange: (e) => {
|
@@ -10941,7 +10939,7 @@ var RegisterForm = ({
|
|
10941
10939
|
props.showRefCode && /* @__PURE__ */ import_react69.default.createElement(
|
10942
10940
|
import_react_hook_form2.Controller,
|
10943
10941
|
{
|
10944
|
-
control,
|
10942
|
+
control: methods.control,
|
10945
10943
|
name: "refCode",
|
10946
10944
|
render: ({ field }) => {
|
10947
10945
|
var _a2;
|
@@ -10951,7 +10949,7 @@ var RegisterForm = ({
|
|
10951
10949
|
width: "full",
|
10952
10950
|
label: texts == null ? void 0 : texts.refCode,
|
10953
10951
|
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
10954
|
-
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
10952
|
+
helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
|
10955
10953
|
...field
|
10956
10954
|
}
|
10957
10955
|
);
|
@@ -10961,7 +10959,7 @@ var RegisterForm = ({
|
|
10961
10959
|
props.showUserSource && /* @__PURE__ */ import_react69.default.createElement(
|
10962
10960
|
import_react_hook_form2.Controller,
|
10963
10961
|
{
|
10964
|
-
control,
|
10962
|
+
control: methods.control,
|
10965
10963
|
name: "reference",
|
10966
10964
|
render: ({ field }) => {
|
10967
10965
|
var _a2, _b2;
|
@@ -10985,7 +10983,7 @@ var RegisterForm = ({
|
|
10985
10983
|
showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react69.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react69.default.createElement(
|
10986
10984
|
import_react_hook_form2.Controller,
|
10987
10985
|
{
|
10988
|
-
control,
|
10986
|
+
control: methods.control,
|
10989
10987
|
name: "terms_accepted",
|
10990
10988
|
render: ({ field }) => {
|
10991
10989
|
var _a2, _b2;
|
@@ -10993,7 +10991,7 @@ var RegisterForm = ({
|
|
10993
10991
|
Checkbox,
|
10994
10992
|
{
|
10995
10993
|
id: "terms_accepted",
|
10996
|
-
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
10994
|
+
helperText: (_b2 = (_a2 = methods.formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
10997
10995
|
onCheckedChange: (e) => field.onChange(e),
|
10998
10996
|
label: /* @__PURE__ */ import_react69.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_react69.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react69.default.createElement(
|
10999
10997
|
"span",
|
@@ -11015,7 +11013,7 @@ var RegisterForm = ({
|
|
11015
11013
|
), showNewsletterOption && /* @__PURE__ */ import_react69.default.createElement(
|
11016
11014
|
import_react_hook_form2.Controller,
|
11017
11015
|
{
|
11018
|
-
control,
|
11016
|
+
control: methods.control,
|
11019
11017
|
name: "newsletter_accepted",
|
11020
11018
|
render: ({ field }) => /* @__PURE__ */ import_react69.default.createElement(
|
11021
11019
|
Checkbox,
|
@@ -11321,63 +11319,71 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
11321
11319
|
}
|
11322
11320
|
};
|
11323
11321
|
}, []);
|
11324
|
-
return /* @__PURE__ */ import_react74.default.createElement(
|
11325
|
-
|
11322
|
+
return /* @__PURE__ */ import_react74.default.createElement(
|
11323
|
+
Card,
|
11326
11324
|
{
|
11327
|
-
|
11328
|
-
|
11329
|
-
|
11330
|
-
return props.onConfirm(e);
|
11331
|
-
} else {
|
11332
|
-
console.log("Form is submitted but onConfirm prop is missing");
|
11333
|
-
}
|
11334
|
-
})
|
11325
|
+
className: cn(
|
11326
|
+
props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
|
11327
|
+
)
|
11335
11328
|
},
|
11336
|
-
/* @__PURE__ */ import_react74.default.createElement(
|
11337
|
-
|
11338
|
-
{
|
11339
|
-
control,
|
11340
|
-
name: "otp_code",
|
11341
|
-
render: ({ field }) => {
|
11342
|
-
var _a2;
|
11343
|
-
return /* @__PURE__ */ import_react74.default.createElement(
|
11344
|
-
PinInput,
|
11345
|
-
{
|
11346
|
-
maxLength: codeLength,
|
11347
|
-
helperText: (_a2 = formState.errors.otp_code) == null ? void 0 : _a2.message,
|
11348
|
-
...field
|
11349
|
-
}
|
11350
|
-
);
|
11351
|
-
}
|
11352
|
-
}
|
11353
|
-
),
|
11354
|
-
showResendTimer ? /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ import_react74.default.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ import_react74.default.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ import_react74.default.createElement(
|
11355
|
-
"span",
|
11356
|
-
{
|
11357
|
-
className: "clickable-link",
|
11358
|
-
onClick: () => {
|
11359
|
-
startResendTimer();
|
11360
|
-
props.onResend();
|
11361
|
-
}
|
11362
|
-
},
|
11363
|
-
((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
|
11364
|
-
)),
|
11365
|
-
/* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react74.default.createElement(
|
11366
|
-
Button,
|
11329
|
+
/* @__PURE__ */ import_react74.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ import_react74.default.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-text-muted-foreground hawa-flex hawa-flex-row" }, /* @__PURE__ */ import_react74.default.createElement("span", null, `${(_d = props.texts) == null ? void 0 : _d.weSentCode} ` || `We've sent a code to `, /* @__PURE__ */ import_react74.default.createElement("span", { dir: "ltr" }, props.identifier)))), /* @__PURE__ */ import_react74.default.createElement(
|
11330
|
+
"form",
|
11367
11331
|
{
|
11368
|
-
|
11369
|
-
|
11370
|
-
if (props.
|
11371
|
-
return props.
|
11332
|
+
noValidate: true,
|
11333
|
+
onSubmit: handleSubmit((e) => {
|
11334
|
+
if (props.onConfirm) {
|
11335
|
+
return props.onConfirm(e);
|
11372
11336
|
} else {
|
11373
|
-
console.log("
|
11337
|
+
console.log("Form is submitted but onConfirm prop is missing");
|
11374
11338
|
}
|
11375
|
-
}
|
11376
|
-
variant: "outline"
|
11339
|
+
})
|
11377
11340
|
},
|
11378
|
-
|
11379
|
-
|
11380
|
-
|
11341
|
+
/* @__PURE__ */ import_react74.default.createElement(
|
11342
|
+
import_react_hook_form5.Controller,
|
11343
|
+
{
|
11344
|
+
control,
|
11345
|
+
name: "otp_code",
|
11346
|
+
render: ({ field }) => {
|
11347
|
+
var _a2;
|
11348
|
+
return /* @__PURE__ */ import_react74.default.createElement(
|
11349
|
+
PinInput,
|
11350
|
+
{
|
11351
|
+
maxLength: codeLength,
|
11352
|
+
helperText: (_a2 = formState.errors.otp_code) == null ? void 0 : _a2.message,
|
11353
|
+
...field
|
11354
|
+
}
|
11355
|
+
);
|
11356
|
+
}
|
11357
|
+
}
|
11358
|
+
),
|
11359
|
+
showResendTimer ? /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ import_react74.default.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ import_react74.default.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ import_react74.default.createElement(
|
11360
|
+
"span",
|
11361
|
+
{
|
11362
|
+
className: "clickable-link",
|
11363
|
+
onClick: () => {
|
11364
|
+
startResendTimer();
|
11365
|
+
props.onResend();
|
11366
|
+
}
|
11367
|
+
},
|
11368
|
+
((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
|
11369
|
+
)),
|
11370
|
+
/* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react74.default.createElement(
|
11371
|
+
Button,
|
11372
|
+
{
|
11373
|
+
type: "button",
|
11374
|
+
onClick: () => {
|
11375
|
+
if (props.onCancel) {
|
11376
|
+
return props.onCancel();
|
11377
|
+
} else {
|
11378
|
+
console.log("Cancel button clicked but onCancel prop is missing");
|
11379
|
+
}
|
11380
|
+
},
|
11381
|
+
variant: "outline"
|
11382
|
+
},
|
11383
|
+
((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"
|
11384
|
+
), /* @__PURE__ */ import_react74.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
|
11385
|
+
))
|
11386
|
+
);
|
11381
11387
|
};
|
11382
11388
|
|
11383
11389
|
// blocks/feedback/UserReferralSource.tsx
|