@sikka/hawa 0.48.0-next → 0.48.1-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 +338 -325
- package/dist/blocks/auth/index.mjs +338 -325
- package/dist/blocks/index.d.mts +1 -0
- package/dist/blocks/index.d.ts +1 -0
- package/dist/blocks/index.js +338 -325
- package/dist/blocks/index.mjs +338 -325
- package/dist/index.css +0 -4
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +338 -325
- package/dist/index.mjs +338 -325
- package/package.json +1 -1
package/dist/blocks/index.mjs
CHANGED
@@ -624,385 +624,398 @@ var RegisterForm = ({
|
|
624
624
|
headless: registerTypes ? registerTypes.length <= 1 : true,
|
625
625
|
noPadding: props.cardless
|
626
626
|
},
|
627
|
-
/* @__PURE__ */ React3.createElement(
|
628
|
-
|
627
|
+
/* @__PURE__ */ React3.createElement(
|
628
|
+
"div",
|
629
629
|
{
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
630
|
+
className: cn(registerTypes && registerTypes.length > 1 ? "hawa-mt-6 hawa-mb-0" : "")
|
631
|
+
},
|
632
|
+
props.showError && /* @__PURE__ */ React3.createElement(
|
633
|
+
Alert,
|
634
|
+
{
|
635
|
+
direction: props.direction,
|
636
|
+
title: props.errorTitle,
|
637
|
+
text: props.errorText,
|
638
|
+
severity: "error",
|
639
|
+
onAlertClosed: () => {
|
640
|
+
if (props.onErrorDismissed) {
|
641
|
+
props.onErrorDismissed();
|
642
|
+
}
|
637
643
|
}
|
638
644
|
}
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
{
|
643
|
-
noValidate: true,
|
644
|
-
onSubmit: handleSubmit((e) => {
|
645
|
-
if (props.onRegister) {
|
646
|
-
return props.onRegister(e);
|
647
|
-
} else {
|
648
|
-
console.log("Form is submitted but onRegister prop is missing");
|
649
|
-
}
|
650
|
-
}),
|
651
|
-
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
652
|
-
},
|
653
|
-
/* @__PURE__ */ React3.createElement(
|
654
|
-
Tabs,
|
645
|
+
),
|
646
|
+
/* @__PURE__ */ React3.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React3.createElement(
|
647
|
+
"form",
|
655
648
|
{
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
649
|
+
noValidate: true,
|
650
|
+
onSubmit: handleSubmit((e) => {
|
651
|
+
if (props.onRegister) {
|
652
|
+
return props.onRegister(e);
|
653
|
+
} else {
|
654
|
+
console.log("Form is submitted but onRegister prop is missing");
|
662
655
|
}
|
663
|
-
)
|
656
|
+
}),
|
657
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
664
658
|
},
|
665
|
-
registerTypes && registerTypes.length > 1 && /* @__PURE__ */ React3.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-my-4 hawa-mt-6" }, /* @__PURE__ */ React3.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ React3.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
|
666
659
|
/* @__PURE__ */ React3.createElement(
|
667
|
-
|
660
|
+
Tabs,
|
668
661
|
{
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
Controller2,
|
680
|
-
{
|
681
|
-
key: i,
|
682
|
-
control,
|
683
|
-
name: "fullName",
|
684
|
-
render: ({ field }) => {
|
685
|
-
var _a2, _b2, _c2;
|
686
|
-
return /* @__PURE__ */ React3.createElement(
|
687
|
-
Input,
|
688
|
-
{
|
689
|
-
width: "full",
|
690
|
-
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
691
|
-
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
692
|
-
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
693
|
-
...field
|
694
|
-
}
|
695
|
-
);
|
696
|
-
}
|
697
|
-
}
|
698
|
-
);
|
699
|
-
}
|
700
|
-
if (fld === "email") {
|
701
|
-
return /* @__PURE__ */ React3.createElement(
|
702
|
-
Controller2,
|
703
|
-
{
|
704
|
-
key: i,
|
705
|
-
control,
|
706
|
-
name: "email",
|
707
|
-
render: ({ field }) => {
|
708
|
-
var _a2, _b2, _c2;
|
709
|
-
return /* @__PURE__ */ React3.createElement(
|
710
|
-
Input,
|
711
|
-
{
|
712
|
-
dir: "ltr",
|
713
|
-
inputProps: {
|
714
|
-
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
715
|
-
},
|
716
|
-
width: "full",
|
717
|
-
autoComplete: "email",
|
718
|
-
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
719
|
-
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
720
|
-
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
721
|
-
...field,
|
722
|
-
onChange: (e) => {
|
723
|
-
field.onChange(e.target.value.toLowerCase().trim());
|
724
|
-
}
|
725
|
-
}
|
726
|
-
);
|
727
|
-
}
|
728
|
-
}
|
729
|
-
);
|
730
|
-
}
|
731
|
-
if (fld === "username") {
|
732
|
-
return /* @__PURE__ */ React3.createElement(
|
733
|
-
Controller2,
|
734
|
-
{
|
735
|
-
key: i,
|
736
|
-
control,
|
737
|
-
name: "username",
|
738
|
-
render: ({ field }) => {
|
739
|
-
var _a2, _b2, _c2, _d2;
|
740
|
-
return /* @__PURE__ */ React3.createElement(
|
741
|
-
Input,
|
742
|
-
{
|
743
|
-
width: "full",
|
744
|
-
autoComplete: "username",
|
745
|
-
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
746
|
-
labelProps: {
|
747
|
-
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
748
|
-
},
|
749
|
-
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
750
|
-
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
751
|
-
...field
|
752
|
-
}
|
753
|
-
);
|
754
|
-
}
|
662
|
+
dir: props.direction,
|
663
|
+
value: selectedRegisterType.value,
|
664
|
+
onValueChange: (e) => {
|
665
|
+
if (props.onRegisterTypeChange) {
|
666
|
+
props.onRegisterTypeChange(e);
|
667
|
+
}
|
668
|
+
setSelectedRegisterType(
|
669
|
+
(registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
|
670
|
+
label: "Password",
|
671
|
+
value: "password"
|
755
672
|
}
|
756
673
|
);
|
757
674
|
}
|
758
|
-
}
|
675
|
+
},
|
676
|
+
registerTypes && registerTypes.length > 1 && /* @__PURE__ */ React3.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-mb-4" }, /* @__PURE__ */ React3.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ React3.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
|
759
677
|
/* @__PURE__ */ React3.createElement(
|
760
|
-
|
678
|
+
TabsContent,
|
761
679
|
{
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
680
|
+
value: "password",
|
681
|
+
className: cn(
|
682
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
683
|
+
selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
|
684
|
+
),
|
685
|
+
dir: props.direction
|
686
|
+
},
|
687
|
+
/* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
|
688
|
+
if (fld === "fullname") {
|
766
689
|
return /* @__PURE__ */ React3.createElement(
|
767
|
-
|
690
|
+
Controller2,
|
768
691
|
{
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
692
|
+
key: i,
|
693
|
+
control,
|
694
|
+
name: "fullName",
|
695
|
+
render: ({ field }) => {
|
696
|
+
var _a2, _b2, _c2;
|
697
|
+
return /* @__PURE__ */ React3.createElement(
|
698
|
+
Input,
|
699
|
+
{
|
700
|
+
width: "full",
|
701
|
+
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
702
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
703
|
+
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
704
|
+
...field
|
705
|
+
}
|
706
|
+
);
|
707
|
+
}
|
785
708
|
}
|
786
709
|
);
|
787
710
|
}
|
788
|
-
|
789
|
-
),
|
790
|
-
/* @__PURE__ */ React3.createElement(
|
791
|
-
Controller2,
|
792
|
-
{
|
793
|
-
control,
|
794
|
-
name: "confirm_password",
|
795
|
-
render: ({ field }) => {
|
796
|
-
var _a2, _b2, _c2;
|
711
|
+
if (fld === "email") {
|
797
712
|
return /* @__PURE__ */ React3.createElement(
|
798
|
-
|
713
|
+
Controller2,
|
799
714
|
{
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
715
|
+
key: i,
|
716
|
+
control,
|
717
|
+
name: "email",
|
718
|
+
render: ({ field }) => {
|
719
|
+
var _a2, _b2, _c2;
|
720
|
+
return /* @__PURE__ */ React3.createElement(
|
721
|
+
Input,
|
722
|
+
{
|
723
|
+
dir: "ltr",
|
724
|
+
inputProps: {
|
725
|
+
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
726
|
+
},
|
727
|
+
width: "full",
|
728
|
+
autoComplete: "email",
|
729
|
+
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
730
|
+
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
731
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
732
|
+
...field,
|
733
|
+
onChange: (e) => {
|
734
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
735
|
+
}
|
736
|
+
}
|
737
|
+
);
|
738
|
+
}
|
816
739
|
}
|
817
740
|
);
|
818
741
|
}
|
819
|
-
|
820
|
-
),
|
821
|
-
props.additionalInputs,
|
822
|
-
props.showRefCode && /* @__PURE__ */ React3.createElement(
|
823
|
-
Controller2,
|
824
|
-
{
|
825
|
-
control,
|
826
|
-
name: "refCode",
|
827
|
-
render: ({ field }) => {
|
828
|
-
var _a2;
|
742
|
+
if (fld === "username") {
|
829
743
|
return /* @__PURE__ */ React3.createElement(
|
830
|
-
|
744
|
+
Controller2,
|
831
745
|
{
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
746
|
+
key: i,
|
747
|
+
control,
|
748
|
+
name: "username",
|
749
|
+
render: ({ field }) => {
|
750
|
+
var _a2, _b2, _c2, _d2;
|
751
|
+
return /* @__PURE__ */ React3.createElement(
|
752
|
+
Input,
|
753
|
+
{
|
754
|
+
width: "full",
|
755
|
+
autoComplete: "username",
|
756
|
+
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
757
|
+
labelProps: {
|
758
|
+
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
759
|
+
},
|
760
|
+
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
761
|
+
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
762
|
+
...field
|
763
|
+
}
|
764
|
+
);
|
765
|
+
}
|
837
766
|
}
|
838
767
|
);
|
839
768
|
}
|
840
|
-
}
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
769
|
+
})),
|
770
|
+
/* @__PURE__ */ React3.createElement(
|
771
|
+
Controller2,
|
772
|
+
{
|
773
|
+
control,
|
774
|
+
name: "password",
|
775
|
+
render: ({ field }) => {
|
776
|
+
var _a2, _b2, _c2;
|
777
|
+
return /* @__PURE__ */ React3.createElement(
|
778
|
+
Input,
|
779
|
+
{
|
780
|
+
width: "full",
|
781
|
+
type: passwordVisible ? "text" : "password",
|
782
|
+
autoComplete: "new-password",
|
783
|
+
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
784
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
785
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
786
|
+
endIcon: /* @__PURE__ */ React3.createElement(
|
787
|
+
"div",
|
788
|
+
{
|
789
|
+
className: "hawa-cursor-pointer",
|
790
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
791
|
+
},
|
792
|
+
passwordVisible ? /* @__PURE__ */ React3.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React3.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
793
|
+
" "
|
794
|
+
),
|
795
|
+
...field
|
796
|
+
}
|
797
|
+
);
|
798
|
+
}
|
862
799
|
}
|
863
|
-
}
|
864
|
-
)
|
865
|
-
),
|
866
|
-
/* @__PURE__ */ React3.createElement(
|
867
|
-
TabsContent,
|
868
|
-
{
|
869
|
-
value: "phone",
|
870
|
-
className: cn(
|
871
|
-
"hawa-flex hawa-flex-col hawa-gap-4",
|
872
|
-
selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
|
873
800
|
),
|
874
|
-
|
875
|
-
|
801
|
+
/* @__PURE__ */ React3.createElement(
|
802
|
+
Controller2,
|
803
|
+
{
|
804
|
+
control,
|
805
|
+
name: "confirm_password",
|
806
|
+
render: ({ field }) => {
|
807
|
+
var _a2, _b2, _c2;
|
808
|
+
return /* @__PURE__ */ React3.createElement(
|
809
|
+
Input,
|
810
|
+
{
|
811
|
+
width: "full",
|
812
|
+
type: passwordVisible ? "text" : "password",
|
813
|
+
autoComplete: "new-password",
|
814
|
+
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
815
|
+
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
816
|
+
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
817
|
+
endIcon: /* @__PURE__ */ React3.createElement(
|
818
|
+
"div",
|
819
|
+
{
|
820
|
+
className: "hawa-cursor-pointer",
|
821
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
822
|
+
},
|
823
|
+
passwordVisible ? /* @__PURE__ */ React3.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React3.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
824
|
+
" "
|
825
|
+
),
|
826
|
+
...field
|
827
|
+
}
|
828
|
+
);
|
829
|
+
}
|
830
|
+
}
|
831
|
+
),
|
832
|
+
props.additionalInputs,
|
833
|
+
props.showRefCode && /* @__PURE__ */ React3.createElement(
|
834
|
+
Controller2,
|
835
|
+
{
|
836
|
+
control,
|
837
|
+
name: "refCode",
|
838
|
+
render: ({ field }) => {
|
839
|
+
var _a2;
|
840
|
+
return /* @__PURE__ */ React3.createElement(
|
841
|
+
Input,
|
842
|
+
{
|
843
|
+
width: "full",
|
844
|
+
label: texts == null ? void 0 : texts.refCode,
|
845
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
846
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
847
|
+
...field
|
848
|
+
}
|
849
|
+
);
|
850
|
+
}
|
851
|
+
}
|
852
|
+
),
|
853
|
+
props.showUserSource && /* @__PURE__ */ React3.createElement(
|
854
|
+
Controller2,
|
855
|
+
{
|
856
|
+
control,
|
857
|
+
name: "reference",
|
858
|
+
render: ({ field }) => {
|
859
|
+
var _a2, _b2;
|
860
|
+
return /* @__PURE__ */ React3.createElement(
|
861
|
+
Select,
|
862
|
+
{
|
863
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
864
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
865
|
+
isCreatable: false,
|
866
|
+
isMulti: false,
|
867
|
+
isSearchable: false,
|
868
|
+
isClearable: false,
|
869
|
+
options: props.userReferenceOptions || [],
|
870
|
+
onChange: (e) => field.onChange(e)
|
871
|
+
}
|
872
|
+
);
|
873
|
+
}
|
874
|
+
}
|
875
|
+
)
|
876
|
+
),
|
876
877
|
/* @__PURE__ */ React3.createElement(
|
877
|
-
|
878
|
+
TabsContent,
|
878
879
|
{
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
880
|
+
value: "phone",
|
881
|
+
className: cn(
|
882
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
883
|
+
selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
|
884
|
+
),
|
885
|
+
dir: props.direction
|
886
|
+
},
|
887
|
+
/* @__PURE__ */ React3.createElement(
|
888
|
+
Controller2,
|
889
|
+
{
|
890
|
+
control,
|
891
|
+
name: "phone",
|
892
|
+
render: ({ field }) => {
|
893
|
+
var _a2, _b2;
|
894
|
+
return /* @__PURE__ */ React3.createElement(
|
895
|
+
PhoneInput,
|
896
|
+
{
|
897
|
+
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
898
|
+
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
899
|
+
preferredCountry: { label: "+966" },
|
900
|
+
...props.phoneInputProps,
|
901
|
+
handleChange: (e) => {
|
902
|
+
if (isValidPhoneNumber2(e) && isPossiblePhoneNumber2(e) && validatePhoneNumberLength2(e) === void 0) {
|
903
|
+
let parsed = parsePhoneNumber2(e);
|
904
|
+
field.onChange(parsed.number);
|
905
|
+
} else {
|
906
|
+
field.onChange(e);
|
907
|
+
}
|
896
908
|
}
|
897
909
|
}
|
898
|
-
|
899
|
-
|
910
|
+
);
|
911
|
+
}
|
900
912
|
}
|
901
|
-
|
913
|
+
),
|
914
|
+
props.additionalInputs,
|
915
|
+
props.showRefCode && /* @__PURE__ */ React3.createElement(
|
916
|
+
Controller2,
|
917
|
+
{
|
918
|
+
control,
|
919
|
+
name: "refCode",
|
920
|
+
render: ({ field }) => {
|
921
|
+
var _a2;
|
922
|
+
return /* @__PURE__ */ React3.createElement(
|
923
|
+
Input,
|
924
|
+
{
|
925
|
+
width: "full",
|
926
|
+
label: texts == null ? void 0 : texts.refCode,
|
927
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
928
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
929
|
+
...field
|
930
|
+
}
|
931
|
+
);
|
932
|
+
}
|
933
|
+
}
|
934
|
+
),
|
935
|
+
props.showUserSource && /* @__PURE__ */ React3.createElement(
|
936
|
+
Controller2,
|
937
|
+
{
|
938
|
+
control,
|
939
|
+
name: "reference",
|
940
|
+
render: ({ field }) => {
|
941
|
+
var _a2, _b2;
|
942
|
+
return /* @__PURE__ */ React3.createElement(
|
943
|
+
Select,
|
944
|
+
{
|
945
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
946
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
947
|
+
isCreatable: false,
|
948
|
+
isMulti: false,
|
949
|
+
isSearchable: false,
|
950
|
+
isClearable: false,
|
951
|
+
options: props.userReferenceOptions || [],
|
952
|
+
onChange: (e) => field.onChange(e)
|
953
|
+
}
|
954
|
+
);
|
955
|
+
}
|
956
|
+
}
|
957
|
+
)
|
902
958
|
),
|
903
|
-
|
904
|
-
props.showRefCode && /* @__PURE__ */ React3.createElement(
|
959
|
+
showTermsOption || showNewsletterOption ? /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React3.createElement(
|
905
960
|
Controller2,
|
906
961
|
{
|
907
962
|
control,
|
908
|
-
name: "
|
963
|
+
name: "terms_accepted",
|
909
964
|
render: ({ field }) => {
|
910
|
-
var _a2;
|
965
|
+
var _a2, _b2;
|
911
966
|
return /* @__PURE__ */ React3.createElement(
|
912
|
-
|
967
|
+
Checkbox,
|
913
968
|
{
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
969
|
+
id: "terms_accepted",
|
970
|
+
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
971
|
+
onCheckedChange: (e) => field.onChange(e),
|
972
|
+
label: /* @__PURE__ */ React3.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__ */ React3.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React3.createElement(
|
973
|
+
"span",
|
974
|
+
{
|
975
|
+
onClick: (e) => {
|
976
|
+
e.preventDefault();
|
977
|
+
if (props.onRouteToTOS) {
|
978
|
+
props.onRouteToTOS();
|
979
|
+
}
|
980
|
+
},
|
981
|
+
className: "clickable-link"
|
982
|
+
},
|
983
|
+
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
984
|
+
)))
|
919
985
|
}
|
920
986
|
);
|
921
987
|
}
|
922
988
|
}
|
923
|
-
),
|
924
|
-
props.showUserSource && /* @__PURE__ */ React3.createElement(
|
989
|
+
), showNewsletterOption && /* @__PURE__ */ React3.createElement(
|
925
990
|
Controller2,
|
926
991
|
{
|
927
992
|
control,
|
928
|
-
name: "
|
929
|
-
render: ({ field }) =>
|
930
|
-
var _a2, _b2;
|
931
|
-
return /* @__PURE__ */ React3.createElement(
|
932
|
-
Select,
|
933
|
-
{
|
934
|
-
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
935
|
-
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
936
|
-
isCreatable: false,
|
937
|
-
isMulti: false,
|
938
|
-
isSearchable: false,
|
939
|
-
isClearable: false,
|
940
|
-
options: props.userReferenceOptions || [],
|
941
|
-
onChange: (e) => field.onChange(e)
|
942
|
-
}
|
943
|
-
);
|
944
|
-
}
|
945
|
-
}
|
946
|
-
)
|
947
|
-
),
|
948
|
-
showTermsOption || showNewsletterOption ? /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React3.createElement(
|
949
|
-
Controller2,
|
950
|
-
{
|
951
|
-
control,
|
952
|
-
name: "terms_accepted",
|
953
|
-
render: ({ field }) => {
|
954
|
-
var _a2, _b2;
|
955
|
-
return /* @__PURE__ */ React3.createElement(
|
993
|
+
name: "newsletter_accepted",
|
994
|
+
render: ({ field }) => /* @__PURE__ */ React3.createElement(
|
956
995
|
Checkbox,
|
957
996
|
{
|
958
|
-
id: "
|
959
|
-
|
960
|
-
onCheckedChange:
|
961
|
-
label: /* @__PURE__ */ React3.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__ */ React3.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React3.createElement(
|
962
|
-
"span",
|
963
|
-
{
|
964
|
-
onClick: (e) => {
|
965
|
-
e.preventDefault();
|
966
|
-
if (props.onRouteToTOS) {
|
967
|
-
props.onRouteToTOS();
|
968
|
-
}
|
969
|
-
},
|
970
|
-
className: "clickable-link"
|
971
|
-
},
|
972
|
-
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
973
|
-
)))
|
997
|
+
id: "newsletter_accepted",
|
998
|
+
label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
|
999
|
+
onCheckedChange: field.onChange
|
974
1000
|
}
|
975
|
-
)
|
1001
|
+
)
|
976
1002
|
}
|
977
|
-
|
978
|
-
),
|
979
|
-
|
1003
|
+
)) : null
|
1004
|
+
),
|
1005
|
+
/* @__PURE__ */ React3.createElement(
|
1006
|
+
Button,
|
980
1007
|
{
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
)) : null
|
993
|
-
),
|
994
|
-
/* @__PURE__ */ React3.createElement(
|
995
|
-
Button,
|
996
|
-
{
|
997
|
-
className: "hawa-w-full",
|
998
|
-
type: "submit",
|
999
|
-
isLoading: props.isLoading,
|
1000
|
-
disabled: props.isLoading
|
1001
|
-
},
|
1002
|
-
(texts == null ? void 0 : texts.registerText) || "Register"
|
1003
|
-
),
|
1004
|
-
props.additionalButtons
|
1005
|
-
)), props.onRouteToLogin && /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ React3.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ React3.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))
|
1008
|
+
className: "hawa-w-full",
|
1009
|
+
type: "submit",
|
1010
|
+
isLoading: props.isLoading,
|
1011
|
+
disabled: props.isLoading
|
1012
|
+
},
|
1013
|
+
(texts == null ? void 0 : texts.registerText) || "Register"
|
1014
|
+
),
|
1015
|
+
props.additionalButtons
|
1016
|
+
)),
|
1017
|
+
props.onRouteToLogin && /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ React3.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ React3.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login"))
|
1018
|
+
)
|
1006
1019
|
),
|
1007
1020
|
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React3.createElement(
|
1008
1021
|
CardFooter,
|